forked from ImSwitch/ImSwitch
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/openUC2/ImSwitch
- Loading branch information
Showing
12 changed files
with
172 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
imswitch/imcontrol/controller/PickUC2BoardConfigController.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from .basecontrollers import ImConWidgetController | ||
|
||
|
||
class PickUC2BoardConfigController(ImConWidgetController): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
def setUC2BoardConfig(self, setupList): | ||
self._widget.setC2BoardConfig(setupList) | ||
|
||
def getSelectedC2BoardConfig(self): | ||
return self._widget.getSelectedC2BoardConfig() | ||
|
||
def setSelectedC2BoardConfig(self, UC2BoardConfig): | ||
self._widget.setSelectedC2BoardConfig(UC2BoardConfig) | ||
|
||
|
||
# Copyright (C) 2020-2021 ImSwitch developers | ||
# This file is part of ImSwitch. | ||
# | ||
# ImSwitch is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ImSwitch is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from qtpy import QtCore, QtWidgets | ||
|
||
|
||
class PickUC2BoardConfigDialog(QtWidgets.QDialog): | ||
""" Dialog for picking the setup to use for imcontrol. """ | ||
|
||
def __init__(self, parent=None, *args, **kwargs): | ||
super().__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint, | ||
*args, **kwargs) | ||
self.setWindowTitle('Select pin configuration for the board') | ||
|
||
self.informationLabel = QtWidgets.QLabel( | ||
'Select the configuration file for your UC2 Board setup:' | ||
) | ||
self.configPicker = QtWidgets.QComboBox() | ||
|
||
self.buttons = QtWidgets.QDialogButtonBox( | ||
QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, | ||
QtCore.Qt.Horizontal, | ||
self | ||
) | ||
self.buttons.accepted.connect(self.accept) | ||
self.buttons.rejected.connect(self.reject) | ||
|
||
layout = QtWidgets.QVBoxLayout() | ||
layout.addWidget(self.informationLabel) | ||
layout.addWidget(self.configPicker) | ||
layout.addWidget(self.buttons) | ||
self.setLayout(layout) | ||
|
||
def setUC2BoardConfig(self, configList): | ||
self.configPicker.clear() | ||
for config in configList: | ||
self.configPicker.addItem(config) | ||
|
||
def getSelectedConfig(self): | ||
return self.configPicker.currentText() | ||
|
||
def setSelectedConfig(self, config): | ||
index = self.configPicker.findText(config) | ||
if index > -1: | ||
self.configPicker.setCurrentIndex(index) | ||
|
||
|
||
# Copyright (C) 2020-2021 ImSwitch developers | ||
# This file is part of ImSwitch. | ||
# | ||
# ImSwitch is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ImSwitch is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from .ImConMainView import ImConMainView | ||
from .PickSetupDialog import PickSetupDialog | ||
from .PickUC2BoardConfigDialog import PickUC2BoardConfigDialog | ||
from .SLMDisplay import SLMDisplay | ||
from .SIMDisplay import SIMDisplay | ||
from .guitools import ViewSetupInfo |