Beispiel #1
0
    def _setup_ui(self):
        vbox = QtGui.QVBoxLayout(self)
        self.setLayout(vbox)

        grid = QtGui.QGridLayout()
        self.form = MAXForm(withButtons=False)

        grid.addWidget(self.form, 0, 0, 2, 1)
        # rescale taurus form methode
        self.form.scrollArea.sizeHint = self.scaleSize
        self.status_label = StatusArea()
        grid.addWidget(self.status_label, 0, 1, 1, 1)

        commandbox = QtGui.QVBoxLayout(self)
        self.start_button = TaurusCommandButton(command="StartCycle")
        self.start_button.setUseParentModel(True)
        self.stop_button = TaurusCommandButton(command="StopCycle")
        self.stop_button.setUseParentModel(True)
        commandbox.addWidget(self.start_button)
        commandbox.addWidget(self.stop_button)
        grid.addLayout(commandbox, 1, 1, 1, 1)

        vbox.addLayout(grid)

        self.trend = TaurusTrend()
        vbox.addWidget(self.trend, stretch=1)
        self.trend_trigger.connect(self.set_trend_paused)

        self.cyclingState = None
Beispiel #2
0
def hack_circuitpanel(widget, ps_model):
    """ add trigger buttons from PS to the circuit panel (BinpPowerSupplyPanel case) """
    circuit = widget.circuit_widget
    h_box = QtGui.QHBoxLayout(circuit)
    circuit.enable_trigger_button = TaurusCommandButton(
        command="EnableTrigger")
    circuit.disable_trigger_button = TaurusCommandButton(
        command="DisableTrigger")
    circuit.enable_trigger_button.setModel(ps_model)
    circuit.disable_trigger_button.setModel(ps_model)
    h_box.addWidget(circuit.enable_trigger_button)
    h_box.addWidget(circuit.disable_trigger_button)
    circuit.vbox.insertLayout(1, h_box)
Beispiel #3
0
    def _updateCommandWidgets(self, *args):
        '''
        Inserts command buttons and parameter widgets in the layout, according to
        the commands from the model
        '''
        #self.debug('In TaurusCommandsForm._updateCommandWidgets())')
        dev = self.getModelObj()
        if dev is None or dev.state != TaurusDevState.Ready:
            self.debug('Cannot connect to device')
            self._clearFrame()
            return
        commands = sorted(dev.command_list_query(), key=self._sortKey)

        for f in self.getViewFilters():
            commands = filter(f, commands)

        self._clearFrame()

        layout = self._frame.layout()

        for row, c in enumerate(commands):
            self.debug('Adding button for command %s' % c.cmd_name)
            button = TaurusCommandButton(command=c.cmd_name, text=c.cmd_name)
            layout.addWidget(button, row, 0)
            button.setUseParentModel(True)
            self._cmdWidgets.append(button)
            button.commandExecuted.connect(self._onCommandExecuted)

            if c.in_type != PyTango.CmdArgType.DevVoid:
                self.debug('Adding arguments for command %s' % c.cmd_name)
                pwidget = ParameterCB()
                if c.cmd_name.lower() in self._defaultParameters:
                    for par in self._defaultParameters.get(c.cmd_name.lower(), []):
                        pwidget.addItem(par)
                    #pwidget.setEditable( (self._defaultParameters[c.cmd_name.lower()] or [''])[0] == '' )
                    if (self._defaultParameters[c.cmd_name.lower()] or [''])[0] == '':
                        pwidget.setEditable(True)
                    else:
                        pwidget.setEditable(False)
                        button.setParameters(self._defaultParameters[
                                             c.cmd_name.lower()][0])
                pwidget.editTextChanged.connect(button.setParameters)
                pwidget.currentIndexChanged.connect(button.setParameters)
                pwidget.activated.connect(button.setFocus)
                button.commandExecuted.connect(pwidget.rememberCurrentText)
                layout.addWidget(pwidget, row, 1)
                self._paramWidgets.append(pwidget)
    def __init__(self, *args):
        TaurusWidget.__init__(self, *args)
        self.setLayout(QtGui.QHBoxLayout())
        self.layout().setMargin(0)

        self.moveInButton = TaurusCommandButton(self)
        self.moveInButton.setUseParentModel(True)
        self.moveInButton.setCommand('MoveIn')
        self.moveInButton.setCustomText('Move In')

        self.moveOutButton = TaurusCommandButton(self)
        self.moveOutButton.setUseParentModel(True)
        self.moveOutButton.setCommand('MoveOut')
        self.moveOutButton.setCustomText('Move Out')

        self.layout().addWidget(self.moveInButton)
        self.layout().addWidget(self.moveOutButton)
    def setupUi(self, MainWindow,devices):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))

        self.devices = devices
        self.tangoDevices = list() # list of tango-devices

        self.nMaxRows = 10 # maximal number of rows in mainWidget
        self.nMinRowsForDecrSize = 3 # минимальное число строк для изменения размера

        self.deviceNameLabel = list()
        self.statusLed = list()
        self.voltageValueSpinBox = list()
        self.setVoltageButton = list()
        self.measLCD = list()
        self.checkActiveBox = list()

        self.timer = list() # список таймеров
        self.timerVal = timerval # timer interval

        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))

        self.reconnectButton = TaurusCommandButton(self.centralwidget)
        self.reconnectButton.setObjectName(_fromUtf8("reconnectButton"))
        self.reconnectButton.clicked.connect(self.reconnectCommand)


        self.settingsButton = QtGui.QPushButton(self.centralwidget)
        # self.settingsButton.setObjectName(_fromUtf8("settingsButton"))
        self.settingsButton.clicked.connect(self.showSettDialog)

        # timer init
        for i in range(0,len(self.devices)):
            self.timer.append(MyTimer()) # установка таймера для проверки актуального заряда конденсаторов
            self.timer[i].iter = i
            self.setWidgetView(i) # установка параметров виджетов
            self.setSignalHandler(i) # установка обработчиков
        # clicked connect
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.layouts(MainWindow)  # установка компоновки

        self.centerOnScreen(MainWindow)
        self.initTangoDevices() # tango devices
        if MDEBUG:
            print("Number of TanDev: " + str(self.tangoDevices))

        self.widgetSizes(MainWindow) # установка размеров виджетов
Beispiel #6
0
    def _updateCommandWidgets(self, *args):
        '''
        Inserts command buttons and parameter widgets in the layout, according to
        the commands from the model
        '''

        dev = self.getModelObj()
        if dev is None:
            self._clearFrame()
            return

        try:
            commands = sorted(dev.command_list_query(), key=self._sortKey)
        except Exception as e:
            self.warning('Problem querying commands from %s. Reason: %s',
                         dev, e)
            self._clearFrame()
            return

        for f in self.getViewFilters():
            commands = list(filter(f, commands))

        self._clearFrame()

        layout = self._frame.layout()

        model = self.getFullModelName()

        for row, c in enumerate(commands):
            self.debug('Adding button for command %s' % c.cmd_name)
            button = TaurusCommandButton(command=c.cmd_name, text=c.cmd_name)
            layout.addWidget(button, row, 0)
            button.setModel(model)
            self._cmdWidgets.append(button)
            button.commandExecuted.connect(self._onCommandExecuted)
            
            import taurus.core.tango.util.tango_taurus as tango_taurus
            in_type = tango_taurus.FROM_TANGO_TO_TAURUS_TYPE[c.in_type]

            if in_type is not None:
                self.debug('Adding arguments for command %s' % c.cmd_name)
                pwidget = ParameterCB()
                if c.cmd_name.lower() in self._defaultParameters:
                    for par in self._defaultParameters.get(c.cmd_name.lower(), []):
                        pwidget.addItem(par)
                    #pwidget.setEditable( (self._defaultParameters[c.cmd_name.lower()] or [''])[0] == '' )
                    if (self._defaultParameters[c.cmd_name.lower()] or [''])[0] == '':
                        pwidget.setEditable(True)
                    else:
                        pwidget.setEditable(False)
                        button.setParameters(self._defaultParameters[
                                             c.cmd_name.lower()][0])
                pwidget.editTextChanged.connect(button.setParameters)
                pwidget.currentIndexChanged['QString'].connect(button.setParameters)
                pwidget.activated.connect(button.setFocus)
                button.commandExecuted.connect(pwidget.rememberCurrentText)
                layout.addWidget(pwidget, row, 1)
                self._paramWidgets.append(pwidget)
    def _updateCommandWidgets(self, *args):
        '''
        Inserts command buttons and parameter widgets in the layout, according to
        the commands from the model
        '''
        #self.debug('In TaurusCommandsForm._updateCommandWidgets())')
        dev = self.getModelObj()
        if dev is None or dev.state != TaurusDevState.Ready:
            self.debug('Cannot connect to device')
            self._clearFrame()
            return
        commands = sorted(dev.command_list_query(), key=self._sortKey)

        for f in self.getViewFilters():
            commands = filter(f, commands)

        self._clearFrame()

        layout = self._frame.layout()

        for row, c in enumerate(commands):
            self.debug('Adding button for command %s' % c.cmd_name)
            button = TaurusCommandButton(command=c.cmd_name, text=c.cmd_name)
            layout.addWidget(button, row, 0)
            button.setUseParentModel(True)
            self._cmdWidgets.append(button)
            self.connect(button, Qt.SIGNAL('commandExecuted'),
                         self._onCommandExecuted)

            if c.in_type != PyTango.CmdArgType.DevVoid:
                self.debug('Adding arguments for command %s' % c.cmd_name)
                pwidget = ParameterCB()
                if c.cmd_name.lower() in self._defaultParameters:
                    for par in self._defaultParameters.get(
                            c.cmd_name.lower(), []):
                        pwidget.addItem(par)
                    #pwidget.setEditable( (self._defaultParameters[c.cmd_name.lower()] or [''])[0] == '' )
                    if (self._defaultParameters[c.cmd_name.lower()]
                            or [''])[0] == '':
                        pwidget.setEditable(True)
                    else:
                        pwidget.setEditable(False)
                        button.setParameters(
                            self._defaultParameters[c.cmd_name.lower()][0])
                self.connect(pwidget,
                             Qt.SIGNAL('editTextChanged (const QString&)'),
                             button.setParameters)
                self.connect(pwidget,
                             Qt.SIGNAL('currentIndexChanged (const QString&)'),
                             button.setParameters)
                self.connect(pwidget, Qt.SIGNAL('activated (int)'),
                             button.setFocus)
                self.connect(button, Qt.SIGNAL('commandExecuted'),
                             pwidget.rememberCurrentText)
                layout.addWidget(pwidget, row, 1)
                self._paramWidgets.append(pwidget)
Beispiel #8
0
    def _setup_ui(self):
        print('-----------voici ')
        hbox = QtGui.QHBoxLayout(self)
        self.setLayout(hbox)
        form_vbox = QtGui.QVBoxLayout(self)

        # devicename label
        hbox2 = QtGui.QVBoxLayout(self)
        self.device_and_state = DevnameAndState(self)
        hbox2.addWidget(self.device_and_state, stretch=2)

        # commands
        commandbox = QtGui.QHBoxLayout(self)
        self.start_button = TaurusCommandButton(command="On")
        self.start_button.setUseParentModel(True)
        self.stop_button = TaurusCommandButton(command="Off")
        self.stop_button.setUseParentModel(True)
        self.init_button = TaurusCommandButton(command="Init")
        self.init_button.setUseParentModel(True)
        commandbox.addWidget(self.start_button)
        commandbox.addWidget(self.stop_button)
        commandbox.addWidget(self.init_button)
        hbox2.addLayout(commandbox, stretch=1)
        form_vbox.addLayout(hbox2)

        # attributes
        self.form = MAXForm(withButtons=False)

        form_vbox.addLayout(commandbox)
        form_vbox.addWidget(self.form, stretch=1)
        self.status_area = StatusArea()
        form_vbox.addWidget(self.status_area)
        hbox.addLayout(form_vbox)

        # value bar
        self.valuebar = MAXValueBar(self)
        slider_vbox = QtGui.QVBoxLayout(self)
        slider_vbox.setContentsMargins(10, 10, 10, 10)
        hbox.addLayout(slider_vbox)
        self.current_label = TaurusLabel()
        self.current_label.setAlignment(QtCore.Qt.AlignCenter)
        slider_vbox.addWidget(self.valuebar, 1)
        slider_vbox.addWidget(self.current_label)
class MyDialog(QtGui.QWidget):
    def __init__(self):
        QtGui.QWidget.__init__(self)
        uic.loadUi(
            os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         "gridComboboxSelection_pyQt_layout.ui"), self)
        self.contenu = QtGui.QWidget()
        self.gridLayout = QtGui.QGridLayout()
        # Taille des collonnes
        self.gridLayout.setColumnMinimumWidth(0, 100)
        self.gridLayout.setColumnMinimumWidth(1, 70)
        self.gridLayout.setColumnMinimumWidth(2, 70)
        self.gridLayout.setColumnMinimumWidth(3, 70)
        # self.gridLayout.setColumnMinimumWidth(4, 60)
        self.gridLayout.setColumnMinimumWidth(5, 60)
        # self.gridLayout.setColumnMinimumWidth(6, 80)
        self.gridLayout.setColumnMinimumWidth(7, 80)
        self.contenu.setLayout(self.gridLayout)
        self.readFileAlim()
        self.getFilterZones()
        self.comboBoxType.currentIndexChanged.connect(self.updateTable)
        self.comboBoxType.clear()
        self.comboBoxType.insertItems(0, self.getFilterTypes())
        self.comboBoxZone.currentIndexChanged.connect(self.updateTable)
        self.comboBoxZone.clear()
        self.comboBoxZone.insertItems(0, self.getFilterZones())
        self.selectButton.clicked.connect(self.selectAll)
        self.startButton.clicked.connect(self.startAll)
        self.stopButton.clicked.connect(self.stopAll)
        # self.updateList()
        # self.updateTable()

    def updateTable(self):
        global checkList
        checkList = []
        # filtre venant du choix du combobox
        # Recherche dans le dictionnaire
        if filterTypes.has_key(str(self.comboBoxType.currentText())):
            value_filterTypes = filterTypes.get(
                str(self.comboBoxType.currentText()))
        else:
            value_filterTypes = 'All'

        if filterZones.has_key(str(self.comboBoxZone.currentText())):
            value_filterZones = filterZones.get(
                str(self.comboBoxZone.currentText()))
        else:
            value_filterZones = 'All'

        # nettoyage de la zone a ecrire
        self.clearLayout(self.gridLayout)
        # Header du tableau a ecrire après chaque .clear
        #self.tableWidget.setHorizontalHeaderLabels(['Names','Current','Voltage'])
        # If "All" is used, no filter is applied
        # cette methode n'existe pas : il faut trouver un equivalent
        # self.tableWidget.insertItems(0,[text for text in items if text_filter in text + "All"])
        k = -1
        #self.gridLayout.addWidget(self.styledPanel(),k,0,1,8)
        for device in DeviceList:
            if value_filterTypes in device + "All":
                if value_filterZones in device + "All":
                    # test line
                    k += 1
                    self.gridLayout.addWidget(self.Hline(), k, 0, 1, 8)
                    k += 1
                    self.gridLayout.setRowMinimumHeight(k, 40)
                    # Bouton ouverture device
                    self.buttonDevice = QtGui.QPushButton()
                    self.buttonDevice.setText(device)
                    self.buttonDevice.clicked.connect(AfficheDevice(device))
                    self.gridLayout.addWidget(self.buttonDevice, k, 0)
                    # Afficheur courant
                    self.afficheurCurrent = TaurusLabel()
                    self.afficheurCurrent.setModel(device + '/double_scalar')
                    self.gridLayout.addWidget(self.afficheurCurrent, k, 1)
                    # Afficheur tension
                    self.afficheurVoltage = TaurusLabel()
                    self.afficheurVoltage.setModel(device + '/float_scalar')
                    self.gridLayout.addWidget(self.afficheurVoltage, k, 2)
                    # Lecture consigne courant
                    self.afficheurCurrentSP = TaurusLabel()
                    self.afficheurCurrentSP.setModel(device + '/ampli')
                    self.gridLayout.addWidget(self.afficheurCurrentSP, k, 3)
                    # Ecriture consigne courant
                    self.writeCurrentSP = TaurusWheelEdit()
                    self.writeCurrentSP.setModel(device + '/ampli')
                    self.gridLayout.addWidget(self.writeCurrentSP, k, 4)
                    # Afficheur etat
                    self.afficheurState = TaurusLabel()
                    self.afficheurState.setModel(device + '/State')
                    self.gridLayout.addWidget(self.afficheurState, k, 5)
                    # CheckBox de selection
                    self.buttonSelect = QtGui.QCheckBox(device, self)
                    self.gridLayout.addWidget(self.buttonSelect, k, 6)
                    checkList.append(self.buttonSelect)
                    # Bouton commande Taurus
                    self.commandButtonSwitch = TaurusCommandButton(
                        command='SwitchStates', text='Switch State')
                    self.commandButtonSwitch.setModel(device)
                    self.gridLayout.addWidget(self.commandButtonSwitch, k, 7)

        self.scrollArea.setWidget(self.contenu)

    def readFileAlim(self):
        # Read Device name in file
        # List of Device name
        global DeviceList
        DeviceList = []
        with open("alim.txt") as f:
            for line in f:
                DeviceList.append(line.strip())

    def getDeviceAttributes(self):
        for device in DeviceList:
            device.readAttributes()
        self.updateTable()

    def clearLayout(self, layout):
        print layout.count()
        while layout.count():
            child = layout.takeAt(0)
            if child.widget() is not None:
                child.widget().deleteLater()
            elif child.layout() is not None:
                clearLayout(child.layout())

    def getFilterTypes(self):
        # Dictionnaire du filtre
        global filterTypes
        filterTypes = {
            "Dipole": "DP",
            "Quadripole": "QP",
            "Sextupole": "SP",
            "Steerer": "STR",
            "Coil": "COL"
        }
        #return les clefs du filtre
        return map(str, filterTypes.keys() + ['All'])

    def getFilterZones(self):
        # Dictionnaire du filtre
        global filterZones
        filterZones = {
            "Linac": "LI",
            "Transfert line": "TL",
            "Extraction line": "EL",
            "Ring C1": "RI-C1",
            "Ring-C2": "RI-C2"
        }
        #return les clefs du filtre
        return map(str, filterZones.keys() + ['All'])

    def selectAll(self):
        for check in checkList:
            check.setCheckState(True)

    def startAll(self):
        for check in checkList:
            if check.checkState():
                print(check.text())

    def stopAll(self):
        for check in checkList:
            if check.checkState():
                print(check.text())

    def Hline(self):
        line = QFrame()
        line.setFrameShape(QFrame.HLine)
        line.setFrameShadow(QFrame.Sunken)
        return line

    def Vline(self):
        line = QFrame()
        line.setFrameShape(QFrame.VLine)
        line.setFrameShadow(QFrame.Sunken)
        return line

    def styledPanel(self):
        line = QFrame()
        line.setFrameShape(QFrame.StyledPanel)
        line.setFrameShadow(QFrame.Sunken)
        return line
    def updateTable(self):
        global checkList
        checkList = []
        # filtre venant du choix du combobox
        # Recherche dans le dictionnaire
        if filterTypes.has_key(str(self.comboBoxType.currentText())):
            value_filterTypes = filterTypes.get(
                str(self.comboBoxType.currentText()))
        else:
            value_filterTypes = 'All'

        if filterZones.has_key(str(self.comboBoxZone.currentText())):
            value_filterZones = filterZones.get(
                str(self.comboBoxZone.currentText()))
        else:
            value_filterZones = 'All'

        # nettoyage de la zone a ecrire
        self.clearLayout(self.gridLayout)
        # Header du tableau a ecrire après chaque .clear
        #self.tableWidget.setHorizontalHeaderLabels(['Names','Current','Voltage'])
        # If "All" is used, no filter is applied
        # cette methode n'existe pas : il faut trouver un equivalent
        # self.tableWidget.insertItems(0,[text for text in items if text_filter in text + "All"])
        k = -1
        #self.gridLayout.addWidget(self.styledPanel(),k,0,1,8)
        for device in DeviceList:
            if value_filterTypes in device + "All":
                if value_filterZones in device + "All":
                    # test line
                    k += 1
                    self.gridLayout.addWidget(self.Hline(), k, 0, 1, 8)
                    k += 1
                    self.gridLayout.setRowMinimumHeight(k, 40)
                    # Bouton ouverture device
                    self.buttonDevice = QtGui.QPushButton()
                    self.buttonDevice.setText(device)
                    self.buttonDevice.clicked.connect(AfficheDevice(device))
                    self.gridLayout.addWidget(self.buttonDevice, k, 0)
                    # Afficheur courant
                    self.afficheurCurrent = TaurusLabel()
                    self.afficheurCurrent.setModel(device + '/double_scalar')
                    self.gridLayout.addWidget(self.afficheurCurrent, k, 1)
                    # Afficheur tension
                    self.afficheurVoltage = TaurusLabel()
                    self.afficheurVoltage.setModel(device + '/float_scalar')
                    self.gridLayout.addWidget(self.afficheurVoltage, k, 2)
                    # Lecture consigne courant
                    self.afficheurCurrentSP = TaurusLabel()
                    self.afficheurCurrentSP.setModel(device + '/ampli')
                    self.gridLayout.addWidget(self.afficheurCurrentSP, k, 3)
                    # Ecriture consigne courant
                    self.writeCurrentSP = TaurusWheelEdit()
                    self.writeCurrentSP.setModel(device + '/ampli')
                    self.gridLayout.addWidget(self.writeCurrentSP, k, 4)
                    # Afficheur etat
                    self.afficheurState = TaurusLabel()
                    self.afficheurState.setModel(device + '/State')
                    self.gridLayout.addWidget(self.afficheurState, k, 5)
                    # CheckBox de selection
                    self.buttonSelect = QtGui.QCheckBox(device, self)
                    self.gridLayout.addWidget(self.buttonSelect, k, 6)
                    checkList.append(self.buttonSelect)
                    # Bouton commande Taurus
                    self.commandButtonSwitch = TaurusCommandButton(
                        command='SwitchStates', text='Switch State')
                    self.commandButtonSwitch.setModel(device)
                    self.gridLayout.addWidget(self.commandButtonSwitch, k, 7)

        self.scrollArea.setWidget(self.contenu)
Beispiel #11
0
        def create_layout(self, macro_name):
            p_names, d_values = self.getMacroInfo(macro_name)
            # Create TOP layout
            self.w_arg = Qt.QWidget()
            self.w_arg.setLayout(Qt.QGridLayout())
            col = 0
            self.w_arg.layout().addWidget(Qt.QLabel('macro name'), 0, col)
            self.w_macro_name = Qt.QLineEdit()
            self.w_arg.layout().addWidget(self.w_macro_name, 1, col)

            _argEditors = []
            for name in p_names:
                col += 1
                self.w_arg.layout().addWidget(Qt.QLabel(name), 0, col)
                self.argEdit = Qt.QLineEdit()
                self.w_arg.layout().addWidget(self.argEdit, 1, col)
                _argEditors.append(self.argEdit)

            for e, v in zip(_argEditors, d_values):
                if v is None:
                    continue
                e.setText(str(v))

            # Create bottom layout
            self.mb = MacroButton()
            self.mb.setModel(door_name)
            self.w_bottom = Qt.QWidget()
            self.w_bottom.setLayout(Qt.QGridLayout())
            self.w_bottom.layout().addWidget(self.mb, 0, 0, 2, 7)
            self.w_bottom.layout().addWidget(Qt.QLabel('Result:'), 2, 0)

            self.result_label = Qt.QLabel()
            self.w_bottom.layout().addWidget(self.result_label, 2, 1, 1, 5)

            self.show_progress = Qt.QCheckBox('Progress')
            self.show_progress.setChecked(True)
            self.w_bottom.layout().addWidget(self.show_progress, 3, 0)

            mb_abort = TaurusCommandButton(
                command='StopMacro', icon=':/actions/media_playback_stop.svg')
            mb_abort.setModel(door_name)
            self.w_bottom.layout().addWidget(mb_abort, 3, 1)

            # Toggle progressbar
            self.show_progress.stateChanged.connect(self.toggle_progress)
            # connect the argument editors
            for i, editor in enumerate(_argEditors):
                slot = functools.partial(self.mb.updateMacroArgument, i)
                editor.textChanged.connect(slot)

            self.setLayout(Qt.QVBoxLayout())
            self.layout().addWidget(self.w_arg)
            self.layout().addWidget(self.w_bottom)

            # Update possible macro result
            self.mb.resultUpdated.connect(self.update_result)

            self.w_macro_name.textEdited.connect(self.update_macro_name)
            self.w_macro_name.editingFinished.connect(self.update_layout)
            self.w_macro_name.textChanged.connect(self.mb.setMacroName)
            self.w_macro_name.textChanged.connect(self.mb.setButtonText)

            # Since everything is now connected, the parameters will be updated
            self.w_macro_name.setText(macro_name)
Beispiel #12
0
def test_timeout(qtbot, taurus_test_ds):
    """Check that the timeout property works"""
    w = TaurusCommandButton(command='Sleep')
    qtbot.addWidget(w)

    try:
        w.setModel(taurus_test_ds)

        # set the parameter for the sleep command to 0.2 seconds
        w.setParameters([.2])

        # Create a callback to check the result of the execution
        def _check_result(res):
            return res == .2

        # Check that the button emits commandExecuted when timeout > exec time
        w.setTimeout(10)
        assert w.getTimeout() == 10
        with qtbot.waitSignal(w.commandExecuted,
                              check_params_cb=_check_result):
            qtbot.mouseClick(w, Qt.Qt.LeftButton)

        # Check that, if timeout < exec time, commandExecuted is NOT emited
        # and CommunicationFailed is raised
        w.setTimeout(.1)
        assert w.getTimeout() == .1
        with pytest.raises(CommunicationFailed):
            with qtbot.assertNotEmitted(w.commandExecuted):
                # call _onClicked instead of emulating a click to bypass
                # the @ProtectTaurusMessageBox protection of onClicked()
                w._onClicked()
    finally:
        # just in case this helps avoiding problems at exit
        w.setModel(None)
Beispiel #13
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(501, 414)
        self.gridLayout_2 = QtGui.QGridLayout(Form)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.taurusLabel = TaurusLabel(self.groupBox)
        self.taurusLabel.setObjectName(_fromUtf8("taurusLabel"))
        self.gridLayout.addWidget(self.taurusLabel, 0, 0, 1, 1)
        self.taurusLabel_2 = TaurusLabel(self.groupBox)
        self.taurusLabel_2.setObjectName(_fromUtf8("taurusLabel_2"))
        self.gridLayout.addWidget(self.taurusLabel_2, 0, 2, 1, 1)
        self.taurusLed_2 = TaurusLed(self.groupBox)
        self.taurusLed_2.setObjectName(_fromUtf8("taurusLed_2"))
        self.gridLayout.addWidget(self.taurusLed_2, 0, 3, 1, 1)
        self.taurusLabel_3 = TaurusLabel(self.groupBox)
        self.taurusLabel_3.setObjectName(_fromUtf8("taurusLabel_3"))
        self.gridLayout.addWidget(self.taurusLabel_3, 1, 0, 1, 1)
        self.taurusLabel_4 = TaurusLabel(self.groupBox)
        self.taurusLabel_4.setObjectName(_fromUtf8("taurusLabel_4"))
        self.gridLayout.addWidget(self.taurusLabel_4, 1, 2, 1, 1)
        self.taurusLed_3 = TaurusLed(self.groupBox)
        self.taurusLed_3.setObjectName(_fromUtf8("taurusLed_3"))
        self.gridLayout.addWidget(self.taurusLed_3, 1, 3, 1, 1)
        self.taurusLabel_5 = TaurusLabel(self.groupBox)
        self.taurusLabel_5.setObjectName(_fromUtf8("taurusLabel_5"))
        self.gridLayout.addWidget(self.taurusLabel_5, 2, 0, 1, 1)
        self.taurusLabel_6 = TaurusLabel(self.groupBox)
        self.taurusLabel_6.setObjectName(_fromUtf8("taurusLabel_6"))
        self.gridLayout.addWidget(self.taurusLabel_6, 2, 2, 1, 1)
        self.taurusLed_4 = TaurusLed(self.groupBox)
        self.taurusLed_4.setObjectName(_fromUtf8("taurusLed_4"))
        self.gridLayout.addWidget(self.taurusLed_4, 2, 3, 1, 1)
        self.taurusLabel_7 = TaurusLabel(self.groupBox)
        self.taurusLabel_7.setObjectName(_fromUtf8("taurusLabel_7"))
        self.gridLayout.addWidget(self.taurusLabel_7, 3, 0, 1, 1)
        self.taurusLabel_8 = TaurusLabel(self.groupBox)
        self.taurusLabel_8.setObjectName(_fromUtf8("taurusLabel_8"))
        self.gridLayout.addWidget(self.taurusLabel_8, 3, 2, 1, 1)
        self.taurusLed_5 = TaurusLed(self.groupBox)
        self.taurusLed_5.setObjectName(_fromUtf8("taurusLed_5"))
        self.gridLayout.addWidget(self.taurusLed_5, 3, 3, 1, 1)
        self.taurusLabel_9 = TaurusLabel(self.groupBox)
        self.taurusLabel_9.setObjectName(_fromUtf8("taurusLabel_9"))
        self.gridLayout.addWidget(self.taurusLabel_9, 4, 0, 1, 1)
        self.taurusLabel_10 = TaurusLabel(self.groupBox)
        self.taurusLabel_10.setObjectName(_fromUtf8("taurusLabel_10"))
        self.gridLayout.addWidget(self.taurusLabel_10, 4, 2, 1, 1)
        self.taurusLed_6 = TaurusLed(self.groupBox)
        self.taurusLed_6.setObjectName(_fromUtf8("taurusLed_6"))
        self.gridLayout.addWidget(self.taurusLed_6, 4, 3, 1, 1)
        self.taurusLabel_11 = TaurusLabel(self.groupBox)
        self.taurusLabel_11.setObjectName(_fromUtf8("taurusLabel_11"))
        self.gridLayout.addWidget(self.taurusLabel_11, 5, 0, 1, 1)
        self.taurusLabel_12 = TaurusLabel(self.groupBox)
        self.taurusLabel_12.setObjectName(_fromUtf8("taurusLabel_12"))
        self.gridLayout.addWidget(self.taurusLabel_12, 5, 2, 1, 1)
        self.taurusLed_7 = TaurusLed(self.groupBox)
        self.taurusLed_7.setObjectName(_fromUtf8("taurusLed_7"))
        self.gridLayout.addWidget(self.taurusLed_7, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox, 0, 2, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.taurusLabel_13 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_13.setObjectName(_fromUtf8("taurusLabel_13"))
        self.gridLayout_3.addWidget(self.taurusLabel_13, 0, 0, 1, 1)
        self.taurusLabel_14 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_14.setObjectName(_fromUtf8("taurusLabel_14"))
        self.gridLayout_3.addWidget(self.taurusLabel_14, 0, 2, 1, 1)
        self.taurusLed_8 = TaurusLed(self.groupBox_2)
        self.taurusLed_8.setObjectName(_fromUtf8("taurusLed_8"))
        self.gridLayout_3.addWidget(self.taurusLed_8, 0, 3, 1, 1)
        self.taurusLabel_15 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_15.setObjectName(_fromUtf8("taurusLabel_15"))
        self.gridLayout_3.addWidget(self.taurusLabel_15, 1, 0, 1, 1)
        self.taurusLabel_16 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_16.setObjectName(_fromUtf8("taurusLabel_16"))
        self.gridLayout_3.addWidget(self.taurusLabel_16, 1, 2, 1, 1)
        self.taurusLed_9 = TaurusLed(self.groupBox_2)
        self.taurusLed_9.setObjectName(_fromUtf8("taurusLed_9"))
        self.gridLayout_3.addWidget(self.taurusLed_9, 1, 3, 1, 1)
        self.taurusLabel_17 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_17.setObjectName(_fromUtf8("taurusLabel_17"))
        self.gridLayout_3.addWidget(self.taurusLabel_17, 2, 0, 1, 1)
        self.taurusLabel_18 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_18.setObjectName(_fromUtf8("taurusLabel_18"))
        self.gridLayout_3.addWidget(self.taurusLabel_18, 2, 2, 1, 1)
        self.taurusLed_10 = TaurusLed(self.groupBox_2)
        self.taurusLed_10.setObjectName(_fromUtf8("taurusLed_10"))
        self.gridLayout_3.addWidget(self.taurusLed_10, 2, 3, 1, 1)
        self.taurusLabel_19 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_19.setObjectName(_fromUtf8("taurusLabel_19"))
        self.gridLayout_3.addWidget(self.taurusLabel_19, 3, 0, 1, 1)
        self.taurusLabel_20 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_20.setObjectName(_fromUtf8("taurusLabel_20"))
        self.gridLayout_3.addWidget(self.taurusLabel_20, 3, 2, 1, 1)
        self.taurusLed_11 = TaurusLed(self.groupBox_2)
        self.taurusLed_11.setObjectName(_fromUtf8("taurusLed_11"))
        self.gridLayout_3.addWidget(self.taurusLed_11, 3, 3, 1, 1)
        self.taurusLabel_21 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_21.setObjectName(_fromUtf8("taurusLabel_21"))
        self.gridLayout_3.addWidget(self.taurusLabel_21, 4, 0, 1, 1)
        self.taurusLabel_22 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_22.setObjectName(_fromUtf8("taurusLabel_22"))
        self.gridLayout_3.addWidget(self.taurusLabel_22, 4, 2, 1, 1)
        self.taurusLed_12 = TaurusLed(self.groupBox_2)
        self.taurusLed_12.setObjectName(_fromUtf8("taurusLed_12"))
        self.gridLayout_3.addWidget(self.taurusLed_12, 4, 3, 1, 1)
        self.taurusLabel_23 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_23.setObjectName(_fromUtf8("taurusLabel_23"))
        self.gridLayout_3.addWidget(self.taurusLabel_23, 5, 0, 1, 1)
        self.taurusLabel_24 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_24.setObjectName(_fromUtf8("taurusLabel_24"))
        self.gridLayout_3.addWidget(self.taurusLabel_24, 5, 2, 1, 1)
        self.taurusLed_13 = TaurusLed(self.groupBox_2)
        self.taurusLed_13.setObjectName(_fromUtf8("taurusLed_13"))
        self.gridLayout_3.addWidget(self.taurusLed_13, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox_2, 0, 3, 1, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.taurusLabel_26 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_26.setObjectName(_fromUtf8("taurusLabel_26"))
        self.gridLayout_5.addWidget(self.taurusLabel_26, 0, 0, 1, 3)
        self.taurusLed_14 = TaurusLed(self.groupBox_4)
        self.taurusLed_14.setObjectName(_fromUtf8("taurusLed_14"))
        self.gridLayout_5.addWidget(self.taurusLed_14, 1, 0, 1, 1)
        self.taurusLabel_29 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_29.setObjectName(_fromUtf8("taurusLabel_29"))
        self.gridLayout_5.addWidget(self.taurusLabel_29, 2, 0, 1, 1)
        self.taurusLabel_30 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_30.setObjectName(_fromUtf8("taurusLabel_30"))
        self.gridLayout_5.addWidget(self.taurusLabel_30, 2, 1, 1, 1)
        self.taurusValueLineEdit_2 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_2.setObjectName(
            _fromUtf8("taurusValueLineEdit_2"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_2, 2, 2, 1, 1)
        self.taurusLabel_33 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_33.setObjectName(_fromUtf8("taurusLabel_33"))
        self.gridLayout_5.addWidget(self.taurusLabel_33, 3, 0, 1, 1)
        self.taurusLabel_34 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_34.setObjectName(_fromUtf8("taurusLabel_34"))
        self.gridLayout_5.addWidget(self.taurusLabel_34, 3, 1, 1, 1)
        self.taurusValueLineEdit_4 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_4.setObjectName(
            _fromUtf8("taurusValueLineEdit_4"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_4, 3, 2, 1, 1)
        self.taurusLabel_37 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_37.setObjectName(_fromUtf8("taurusLabel_37"))
        self.gridLayout_5.addWidget(self.taurusLabel_37, 4, 0, 1, 1)
        self.taurusLabel_38 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_38.setObjectName(_fromUtf8("taurusLabel_38"))
        self.gridLayout_5.addWidget(self.taurusLabel_38, 4, 1, 1, 1)
        self.taurusValueLineEdit_6 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_6.setObjectName(
            _fromUtf8("taurusValueLineEdit_6"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_6, 4, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.taurusCommandButton_2 = TaurusCommandButton(self.groupBox_4)
        self.taurusCommandButton_2.setObjectName(
            _fromUtf8("taurusCommandButton_2"))
        self.horizontalLayout_2.addWidget(self.taurusCommandButton_2)
        self.cfgMg2 = QtGui.QToolButton(self.groupBox_4)
        self.cfgMg2.setObjectName(_fromUtf8("cfgMg2"))
        self.horizontalLayout_2.addWidget(self.cfgMg2)
        self.horizontalLayout_2.setStretch(0, 1)
        self.gridLayout_5.addLayout(self.horizontalLayout_2, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_4, 1, 3, 1, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.taurusLabel_25 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_25.setObjectName(_fromUtf8("taurusLabel_25"))
        self.gridLayout_4.addWidget(self.taurusLabel_25, 0, 0, 1, 3)
        self.taurusLabel_27 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_27.setObjectName(_fromUtf8("taurusLabel_27"))
        self.gridLayout_4.addWidget(self.taurusLabel_27, 2, 1, 1, 1)
        self.taurusLabel_28 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_28.setObjectName(_fromUtf8("taurusLabel_28"))
        self.gridLayout_4.addWidget(self.taurusLabel_28, 2, 0, 1, 1)
        self.taurusValueLineEdit = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit.setObjectName(
            _fromUtf8("taurusValueLineEdit"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit, 2, 2, 1, 1)
        self.taurusLed = TaurusLed(self.groupBox_3)
        self.taurusLed.setObjectName(_fromUtf8("taurusLed"))
        self.gridLayout_4.addWidget(self.taurusLed, 1, 0, 1, 1)
        self.taurusLabel_31 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_31.setObjectName(_fromUtf8("taurusLabel_31"))
        self.gridLayout_4.addWidget(self.taurusLabel_31, 3, 0, 1, 1)
        self.taurusLabel_32 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_32.setObjectName(_fromUtf8("taurusLabel_32"))
        self.gridLayout_4.addWidget(self.taurusLabel_32, 3, 1, 1, 1)
        self.taurusValueLineEdit_3 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_3.setObjectName(
            _fromUtf8("taurusValueLineEdit_3"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_3, 3, 2, 1, 1)
        self.taurusLabel_35 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_35.setObjectName(_fromUtf8("taurusLabel_35"))
        self.gridLayout_4.addWidget(self.taurusLabel_35, 4, 0, 1, 1)
        self.taurusLabel_36 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_36.setObjectName(_fromUtf8("taurusLabel_36"))
        self.gridLayout_4.addWidget(self.taurusLabel_36, 4, 1, 1, 1)
        self.taurusValueLineEdit_5 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_5.setObjectName(
            _fromUtf8("taurusValueLineEdit_5"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_5, 4, 2, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.taurusCommandButton = TaurusCommandButton(self.groupBox_3)
        self.taurusCommandButton.setObjectName(
            _fromUtf8("taurusCommandButton"))
        self.horizontalLayout_3.addWidget(self.taurusCommandButton)
        self.cfgMg1 = QtGui.QToolButton(self.groupBox_3)
        self.cfgMg1.setObjectName(_fromUtf8("cfgMg1"))
        self.horizontalLayout_3.addWidget(self.cfgMg1)
        self.gridLayout_4.addLayout(self.horizontalLayout_3, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_3, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
 def populateButtons(self):
     """
     Create taurus commandbuttons for everything in modelcommand
     """
     for modelcommand in self._modelcommands:
         button = TaurusCommandButton(self.frame)
         button.setCommand(modelcommand['command'])
         if 'model' in modelcommand:
             button.setModel(modelcommand['model'])
         else:
             button.setUseParentModel(True)
         if 'customtext' in modelcommand:
             button.setCustomText(modelcommand['customtext'])
         if 'dangermessage' in modelcommand:
             button.setDangerMessage(modelcommand['dangermessage'])
         if 'parameters' in modelcommand:
             button.setParameters(modelcommand['parameters'])
         if 'timeout' in modelcommand:
             button.setTimeout(modelcommand['timeout'])
         self.connect(button,
                      Qt.SIGNAL('commandExecuted'),
                      self.onCommandExectued)
         # Make button expand vertically
         button.setSizePolicy(QtGui.QSizePolicy.Minimum,
                              QtGui.QSizePolicy.Expanding)
         self.frame.layout().addWidget(button)
         self._buttons.append(button)
Beispiel #15
0
    mb = MacroButton()

    mb.setModel(door_name)

    w.layout().addWidget(mb, 2, 0, 2, 7)

    w.layout().addWidget(Qt.QLabel('Result:'), 4, 0)

    result_label = Qt.QLabel()
    w.layout().addWidget(result_label, 4, 1, 1, 5)

    show_progress = Qt.QCheckBox('Progress')
    show_progress.setChecked(True)
    w.layout().addWidget(show_progress, 5, 0)

    mb_abort = TaurusCommandButton(command='StopMacro',
                                   icon=':/actions/media_playback_stop.svg')
    mb_abort.setModel(door_name)

    w.layout().addWidget(mb_abort, 5, 1)

    # Change macro name
    Qt.QObject.connect(macro_name, Qt.SIGNAL('textChanged(QString)'),
                       mb.setMacroName)
    Qt.QObject.connect(macro_name, Qt.SIGNAL('textChanged(QString)'),
                       mb.setButtonText)

    # connect the argument editors
    signals = [(e, 'textChanged(QString)') for e in _argEditors]
    mb.connectArgEditors(signals)

    def update_result(result):
Beispiel #16
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(501, 414)
        self.gridLayout_2 = QtGui.QGridLayout(Form)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.taurusLabel = TaurusLabel(self.groupBox)
        self.taurusLabel.setObjectName(_fromUtf8("taurusLabel"))
        self.gridLayout.addWidget(self.taurusLabel, 0, 0, 1, 1)
        self.taurusLabel_2 = TaurusLabel(self.groupBox)
        self.taurusLabel_2.setObjectName(_fromUtf8("taurusLabel_2"))
        self.gridLayout.addWidget(self.taurusLabel_2, 0, 2, 1, 1)
        self.taurusLed_2 = TaurusLed(self.groupBox)
        self.taurusLed_2.setObjectName(_fromUtf8("taurusLed_2"))
        self.gridLayout.addWidget(self.taurusLed_2, 0, 3, 1, 1)
        self.taurusLabel_3 = TaurusLabel(self.groupBox)
        self.taurusLabel_3.setObjectName(_fromUtf8("taurusLabel_3"))
        self.gridLayout.addWidget(self.taurusLabel_3, 1, 0, 1, 1)
        self.taurusLabel_4 = TaurusLabel(self.groupBox)
        self.taurusLabel_4.setObjectName(_fromUtf8("taurusLabel_4"))
        self.gridLayout.addWidget(self.taurusLabel_4, 1, 2, 1, 1)
        self.taurusLed_3 = TaurusLed(self.groupBox)
        self.taurusLed_3.setObjectName(_fromUtf8("taurusLed_3"))
        self.gridLayout.addWidget(self.taurusLed_3, 1, 3, 1, 1)
        self.taurusLabel_5 = TaurusLabel(self.groupBox)
        self.taurusLabel_5.setObjectName(_fromUtf8("taurusLabel_5"))
        self.gridLayout.addWidget(self.taurusLabel_5, 2, 0, 1, 1)
        self.taurusLabel_6 = TaurusLabel(self.groupBox)
        self.taurusLabel_6.setObjectName(_fromUtf8("taurusLabel_6"))
        self.gridLayout.addWidget(self.taurusLabel_6, 2, 2, 1, 1)
        self.taurusLed_4 = TaurusLed(self.groupBox)
        self.taurusLed_4.setObjectName(_fromUtf8("taurusLed_4"))
        self.gridLayout.addWidget(self.taurusLed_4, 2, 3, 1, 1)
        self.taurusLabel_7 = TaurusLabel(self.groupBox)
        self.taurusLabel_7.setObjectName(_fromUtf8("taurusLabel_7"))
        self.gridLayout.addWidget(self.taurusLabel_7, 3, 0, 1, 1)
        self.taurusLabel_8 = TaurusLabel(self.groupBox)
        self.taurusLabel_8.setObjectName(_fromUtf8("taurusLabel_8"))
        self.gridLayout.addWidget(self.taurusLabel_8, 3, 2, 1, 1)
        self.taurusLed_5 = TaurusLed(self.groupBox)
        self.taurusLed_5.setObjectName(_fromUtf8("taurusLed_5"))
        self.gridLayout.addWidget(self.taurusLed_5, 3, 3, 1, 1)
        self.taurusLabel_9 = TaurusLabel(self.groupBox)
        self.taurusLabel_9.setObjectName(_fromUtf8("taurusLabel_9"))
        self.gridLayout.addWidget(self.taurusLabel_9, 4, 0, 1, 1)
        self.taurusLabel_10 = TaurusLabel(self.groupBox)
        self.taurusLabel_10.setObjectName(_fromUtf8("taurusLabel_10"))
        self.gridLayout.addWidget(self.taurusLabel_10, 4, 2, 1, 1)
        self.taurusLed_6 = TaurusLed(self.groupBox)
        self.taurusLed_6.setObjectName(_fromUtf8("taurusLed_6"))
        self.gridLayout.addWidget(self.taurusLed_6, 4, 3, 1, 1)
        self.taurusLabel_11 = TaurusLabel(self.groupBox)
        self.taurusLabel_11.setObjectName(_fromUtf8("taurusLabel_11"))
        self.gridLayout.addWidget(self.taurusLabel_11, 5, 0, 1, 1)
        self.taurusLabel_12 = TaurusLabel(self.groupBox)
        self.taurusLabel_12.setObjectName(_fromUtf8("taurusLabel_12"))
        self.gridLayout.addWidget(self.taurusLabel_12, 5, 2, 1, 1)
        self.taurusLed_7 = TaurusLed(self.groupBox)
        self.taurusLed_7.setObjectName(_fromUtf8("taurusLed_7"))
        self.gridLayout.addWidget(self.taurusLed_7, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox, 0, 2, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.taurusLabel_13 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_13.setObjectName(_fromUtf8("taurusLabel_13"))
        self.gridLayout_3.addWidget(self.taurusLabel_13, 0, 0, 1, 1)
        self.taurusLabel_14 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_14.setObjectName(_fromUtf8("taurusLabel_14"))
        self.gridLayout_3.addWidget(self.taurusLabel_14, 0, 2, 1, 1)
        self.taurusLed_8 = TaurusLed(self.groupBox_2)
        self.taurusLed_8.setObjectName(_fromUtf8("taurusLed_8"))
        self.gridLayout_3.addWidget(self.taurusLed_8, 0, 3, 1, 1)
        self.taurusLabel_15 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_15.setObjectName(_fromUtf8("taurusLabel_15"))
        self.gridLayout_3.addWidget(self.taurusLabel_15, 1, 0, 1, 1)
        self.taurusLabel_16 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_16.setObjectName(_fromUtf8("taurusLabel_16"))
        self.gridLayout_3.addWidget(self.taurusLabel_16, 1, 2, 1, 1)
        self.taurusLed_9 = TaurusLed(self.groupBox_2)
        self.taurusLed_9.setObjectName(_fromUtf8("taurusLed_9"))
        self.gridLayout_3.addWidget(self.taurusLed_9, 1, 3, 1, 1)
        self.taurusLabel_17 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_17.setObjectName(_fromUtf8("taurusLabel_17"))
        self.gridLayout_3.addWidget(self.taurusLabel_17, 2, 0, 1, 1)
        self.taurusLabel_18 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_18.setObjectName(_fromUtf8("taurusLabel_18"))
        self.gridLayout_3.addWidget(self.taurusLabel_18, 2, 2, 1, 1)
        self.taurusLed_10 = TaurusLed(self.groupBox_2)
        self.taurusLed_10.setObjectName(_fromUtf8("taurusLed_10"))
        self.gridLayout_3.addWidget(self.taurusLed_10, 2, 3, 1, 1)
        self.taurusLabel_19 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_19.setObjectName(_fromUtf8("taurusLabel_19"))
        self.gridLayout_3.addWidget(self.taurusLabel_19, 3, 0, 1, 1)
        self.taurusLabel_20 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_20.setObjectName(_fromUtf8("taurusLabel_20"))
        self.gridLayout_3.addWidget(self.taurusLabel_20, 3, 2, 1, 1)
        self.taurusLed_11 = TaurusLed(self.groupBox_2)
        self.taurusLed_11.setObjectName(_fromUtf8("taurusLed_11"))
        self.gridLayout_3.addWidget(self.taurusLed_11, 3, 3, 1, 1)
        self.taurusLabel_21 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_21.setObjectName(_fromUtf8("taurusLabel_21"))
        self.gridLayout_3.addWidget(self.taurusLabel_21, 4, 0, 1, 1)
        self.taurusLabel_22 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_22.setObjectName(_fromUtf8("taurusLabel_22"))
        self.gridLayout_3.addWidget(self.taurusLabel_22, 4, 2, 1, 1)
        self.taurusLed_12 = TaurusLed(self.groupBox_2)
        self.taurusLed_12.setObjectName(_fromUtf8("taurusLed_12"))
        self.gridLayout_3.addWidget(self.taurusLed_12, 4, 3, 1, 1)
        self.taurusLabel_23 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_23.setObjectName(_fromUtf8("taurusLabel_23"))
        self.gridLayout_3.addWidget(self.taurusLabel_23, 5, 0, 1, 1)
        self.taurusLabel_24 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_24.setObjectName(_fromUtf8("taurusLabel_24"))
        self.gridLayout_3.addWidget(self.taurusLabel_24, 5, 2, 1, 1)
        self.taurusLed_13 = TaurusLed(self.groupBox_2)
        self.taurusLed_13.setObjectName(_fromUtf8("taurusLed_13"))
        self.gridLayout_3.addWidget(self.taurusLed_13, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox_2, 0, 3, 1, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.taurusLabel_26 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_26.setObjectName(_fromUtf8("taurusLabel_26"))
        self.gridLayout_5.addWidget(self.taurusLabel_26, 0, 0, 1, 3)
        self.taurusLed_14 = TaurusLed(self.groupBox_4)
        self.taurusLed_14.setObjectName(_fromUtf8("taurusLed_14"))
        self.gridLayout_5.addWidget(self.taurusLed_14, 1, 0, 1, 1)
        self.taurusLabel_29 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_29.setObjectName(_fromUtf8("taurusLabel_29"))
        self.gridLayout_5.addWidget(self.taurusLabel_29, 2, 0, 1, 1)
        self.taurusLabel_30 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_30.setObjectName(_fromUtf8("taurusLabel_30"))
        self.gridLayout_5.addWidget(self.taurusLabel_30, 2, 1, 1, 1)
        self.taurusValueLineEdit_2 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_2.setObjectName(
            _fromUtf8("taurusValueLineEdit_2"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_2, 2, 2, 1, 1)
        self.taurusLabel_33 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_33.setObjectName(_fromUtf8("taurusLabel_33"))
        self.gridLayout_5.addWidget(self.taurusLabel_33, 3, 0, 1, 1)
        self.taurusLabel_34 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_34.setObjectName(_fromUtf8("taurusLabel_34"))
        self.gridLayout_5.addWidget(self.taurusLabel_34, 3, 1, 1, 1)
        self.taurusValueLineEdit_4 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_4.setObjectName(
            _fromUtf8("taurusValueLineEdit_4"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_4, 3, 2, 1, 1)
        self.taurusLabel_37 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_37.setObjectName(_fromUtf8("taurusLabel_37"))
        self.gridLayout_5.addWidget(self.taurusLabel_37, 4, 0, 1, 1)
        self.taurusLabel_38 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_38.setObjectName(_fromUtf8("taurusLabel_38"))
        self.gridLayout_5.addWidget(self.taurusLabel_38, 4, 1, 1, 1)
        self.taurusValueLineEdit_6 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_6.setObjectName(
            _fromUtf8("taurusValueLineEdit_6"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_6, 4, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.taurusCommandButton_2 = TaurusCommandButton(self.groupBox_4)
        self.taurusCommandButton_2.setObjectName(
            _fromUtf8("taurusCommandButton_2"))
        self.horizontalLayout_2.addWidget(self.taurusCommandButton_2)
        self.cfgMg2 = QtGui.QToolButton(self.groupBox_4)
        self.cfgMg2.setObjectName(_fromUtf8("cfgMg2"))
        self.horizontalLayout_2.addWidget(self.cfgMg2)
        self.horizontalLayout_2.setStretch(0, 1)
        self.gridLayout_5.addLayout(self.horizontalLayout_2, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_4, 1, 3, 1, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.taurusLabel_25 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_25.setObjectName(_fromUtf8("taurusLabel_25"))
        self.gridLayout_4.addWidget(self.taurusLabel_25, 0, 0, 1, 3)
        self.taurusLabel_27 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_27.setObjectName(_fromUtf8("taurusLabel_27"))
        self.gridLayout_4.addWidget(self.taurusLabel_27, 2, 1, 1, 1)
        self.taurusLabel_28 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_28.setObjectName(_fromUtf8("taurusLabel_28"))
        self.gridLayout_4.addWidget(self.taurusLabel_28, 2, 0, 1, 1)
        self.taurusValueLineEdit = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit.setObjectName(
            _fromUtf8("taurusValueLineEdit"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit, 2, 2, 1, 1)
        self.taurusLed = TaurusLed(self.groupBox_3)
        self.taurusLed.setObjectName(_fromUtf8("taurusLed"))
        self.gridLayout_4.addWidget(self.taurusLed, 1, 0, 1, 1)
        self.taurusLabel_31 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_31.setObjectName(_fromUtf8("taurusLabel_31"))
        self.gridLayout_4.addWidget(self.taurusLabel_31, 3, 0, 1, 1)
        self.taurusLabel_32 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_32.setObjectName(_fromUtf8("taurusLabel_32"))
        self.gridLayout_4.addWidget(self.taurusLabel_32, 3, 1, 1, 1)
        self.taurusValueLineEdit_3 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_3.setObjectName(
            _fromUtf8("taurusValueLineEdit_3"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_3, 3, 2, 1, 1)
        self.taurusLabel_35 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_35.setObjectName(_fromUtf8("taurusLabel_35"))
        self.gridLayout_4.addWidget(self.taurusLabel_35, 4, 0, 1, 1)
        self.taurusLabel_36 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_36.setObjectName(_fromUtf8("taurusLabel_36"))
        self.gridLayout_4.addWidget(self.taurusLabel_36, 4, 1, 1, 1)
        self.taurusValueLineEdit_5 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_5.setObjectName(
            _fromUtf8("taurusValueLineEdit_5"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_5, 4, 2, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.taurusCommandButton = TaurusCommandButton(self.groupBox_3)
        self.taurusCommandButton.setObjectName(
            _fromUtf8("taurusCommandButton"))
        self.horizontalLayout_3.addWidget(self.taurusCommandButton)
        self.cfgMg1 = QtGui.QToolButton(self.groupBox_3)
        self.cfgMg1.setObjectName(_fromUtf8("cfgMg1"))
        self.horizontalLayout_3.addWidget(self.cfgMg1)
        self.gridLayout_4.addLayout(self.horizontalLayout_3, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_3, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(
            QtGui.QApplication.translate("Form", "Form", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.groupBox.setTitle(
            QtGui.QApplication.translate("Form", "CTs of CTRL1", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/1/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_2.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/1/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_2.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/1/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_3.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/2/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_3.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_4.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/2/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_3.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/2/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_5.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/3/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_5.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_6.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/3/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_4.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/3/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_7.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/4/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_7.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_8.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/4/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_5.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/4/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_9.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/5/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_9.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_10.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/5/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_6.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/5/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_11.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl1/6/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_11.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_12.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/6/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_7.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl1/6/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.groupBox_2.setTitle(
            QtGui.QApplication.translate("Form", "CTs of CTRL2", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_13.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/1/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_13.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_14.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/1/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_8.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/1/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_15.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/2/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_15.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_16.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/2/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_9.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/2/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_17.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/3/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_17.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_18.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/3/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_10.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/3/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_19.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/4/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_19.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_20.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/4/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_11.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/4/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_21.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/5/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_21.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_22.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/5/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_12.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/5/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_23.setModel(
            QtGui.QApplication.translate(
                "Form", "expchan/dummyctctrl2/6/value?configuration=dev_alias",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_23.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_24.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/6/value", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_13.setModel(
            QtGui.QApplication.translate("Form",
                                         "expchan/dummyctctrl2/6/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.groupBox_4.setTitle(
            QtGui.QApplication.translate("Form", "MG2", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_26.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg2/elementlist",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_26.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_14.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg2/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_29.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg2/integrationtime?configuration=label",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_29.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_30.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg2/integrationtime", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_2.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg2/integrationtime", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_33.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg2/monitorcount?configuration=label", None,
                QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_33.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_34.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg2/monitorcount",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_4.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg2/monitorcount",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_37.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg2/acquisitionmode?configuration=label",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_37.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_38.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg2/acquisitionmode", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_6.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg2/acquisitionmode", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton_2.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg2", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton_2.setCommand(
            QtGui.QApplication.translate("Form", "start", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.cfgMg2.setText(
            QtGui.QApplication.translate("Form", "...", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.groupBox_3.setTitle(
            QtGui.QApplication.translate("Form", "MG1", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_25.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg1/elementlist",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_25.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_27.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg1/integrationtime", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_28.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg1/integrationtime?configuration=label",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_28.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg1/integrationtime", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLed.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg1/state", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_31.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg1/monitorcount?configuration=label", None,
                QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_31.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_32.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg1/monitorcount",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_3.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg1/monitorcount",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_35.setModel(
            QtGui.QApplication.translate(
                "Form", "mntgrp/v3/mg1/acquisitionmode?configuration=label",
                None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_35.setBgRole(
            QtGui.QApplication.translate("Form", "none", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_36.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg1/acquisitionmode", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_5.setModel(
            QtGui.QApplication.translate("Form",
                                         "mntgrp/v3/mg1/acquisitionmode", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton.setModel(
            QtGui.QApplication.translate("Form", "mntgrp/v3/mg1", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton.setCommand(
            QtGui.QApplication.translate("Form", "start", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.cfgMg1.setText(
            QtGui.QApplication.translate("Form", "...", None,
                                         QtGui.QApplication.UnicodeUTF8))
Beispiel #17
0
class CyclePanel(TaurusWidget):
    "Panel for controlling the cycling functionality"

    trend_trigger = QtCore.pyqtSignal(bool)

    attrs = [
        "CyclingTimePlateau", "CyclingIterations", "CyclingSteps",
        "CyclingRampTime", "NominalSetPoint"
    ]
    scale_factor = 1.1

    def __init__(self, parent=None):
        TaurusWidget.__init__(self, parent)
        self._setup_ui()
        print('CyclePanel juste avant setmodel')

    #    self.setModel('sys/tg_test/1')

    def scaleSize(self):
        size = self.form.scrollArea.widget().frameSize()
        return QtCore.QSize(size.width(), size.height() * self.scale_factor)

    def _setup_ui(self):
        vbox = QtGui.QVBoxLayout(self)
        self.setLayout(vbox)

        grid = QtGui.QGridLayout()
        self.form = MAXForm(withButtons=False)

        grid.addWidget(self.form, 0, 0, 2, 1)
        # rescale taurus form methode
        self.form.scrollArea.sizeHint = self.scaleSize
        self.status_label = StatusArea()
        grid.addWidget(self.status_label, 0, 1, 1, 1)

        commandbox = QtGui.QVBoxLayout(self)
        self.start_button = TaurusCommandButton(command="StartCycle")
        self.start_button.setUseParentModel(True)
        self.stop_button = TaurusCommandButton(command="StopCycle")
        self.stop_button.setUseParentModel(True)
        commandbox.addWidget(self.start_button)
        commandbox.addWidget(self.stop_button)
        grid.addLayout(commandbox, 1, 1, 1, 1)

        vbox.addLayout(grid)

        self.trend = TaurusTrend()
        vbox.addWidget(self.trend, stretch=1)
        self.trend_trigger.connect(self.set_trend_paused)

        self.cyclingState = None

    def setModel(self, device):
        print self.__class__.__name__, "setModel", device
        TaurusWidget.setModel(self, device)
        # self.state_button.setModel(device)
        if device:
            self.form.setModel(
                ["%s/%s" % (device, attribute) for attribute in self.attrs])

            self.status_label.setModel("%s/cyclingStatus" % device)

            ps = str(PyTango.Database().get_device_property(
                device, "PowerSupplyProxy")["PowerSupplyProxy"][0])

            self.trend.setPaused()
            self.trend.setModel(["%s/Current" % ps])
            self.trend.setForcedReadingPeriod(0.2)
            self.trend.showLegend(True)

            # let's pause the trend when not cycling
            self.cyclingState = self.getModelObj().getAttribute("cyclingState")
            self.cyclingState.addListener(self.handle_cycling_state)
        else:
            if self.cyclingState:
                self.cyclingState.removeListener(self.handle_cycling_state)
            self.trend.setModel(None)
            self.status_label.setModel(None)

    def handle_cycling_state(self, evt_src, evt_type, evt_value):
        if evt_type in [
                PyTango.EventType.CHANGE_EVENT,
                PyTango.EventType.PERIODIC_EVENT
        ]:
            self.trend_trigger.emit(evt_value.value)

    def set_trend_paused(self, value):
        self.trend.setForcedReadingPeriod(0.2 if value else -1)
        self.trend.setPaused(not value)
Beispiel #18
0
        def create_layout(self, macro_name):
            p_names, d_values = self.getMacroInfo(macro_name)
            # Create TOP layout
            self.w_arg = Qt.QWidget()
            self.w_arg.setLayout(Qt.QGridLayout())
            col = 0
            self.w_arg.layout().addWidget(Qt.QLabel('macro name'), 0, col)
            self.w_macro_name = Qt.QLineEdit()
            self.w_arg.layout().addWidget(self.w_macro_name, 1, col)

            _argEditors = []
            for name in p_names:
                col += 1
                self.w_arg.layout().addWidget(Qt.QLabel(name), 0, col)
                self.argEdit = Qt.QLineEdit()
                self.w_arg.layout().addWidget(self.argEdit, 1, col)
                _argEditors.append(self.argEdit)

            for e, v in zip(_argEditors, d_values):
                e.setText(v)

            # Create bottom layout
            self.mb = MacroButton()
            self.mb.setModel(door_name)
            self.w_bottom = Qt.QWidget()
            self.w_bottom.setLayout(Qt.QGridLayout())
            self.w_bottom.layout().addWidget(self.mb, 0, 0, 2, 7)
            self.w_bottom.layout().addWidget(Qt.QLabel('Result:'), 2, 0)

            self.result_label = Qt.QLabel()
            self.w_bottom.layout().addWidget(self.result_label, 2, 1, 1, 5)

            self.show_progress = Qt.QCheckBox('Progress')
            self.show_progress.setChecked(True)
            self.w_bottom.layout().addWidget(self.show_progress, 3, 0)

            mb_abort = TaurusCommandButton(command='StopMacro',
                                           icon=':/actions/media_playback_stop.svg')
            mb_abort.setModel(door_name)
            self.w_bottom.layout().addWidget(mb_abort, 3, 1)

            # Toggle progressbar
            self.show_progress.stateChanged.connect(self.toggle_progress)
            # connect the argument editors
            # signals = [(e, 'textChanged(QString)') for e in _argEditors]
            signals = [getattr(e, 'textChanged') for e in _argEditors]
            self.mb.connectArgEditors(signals)

            self.setLayout(Qt.QVBoxLayout())
            self.layout().addWidget(self.w_arg)
            self.layout().addWidget(self.w_bottom)

            # Update possible macro result
            self.mb.resultUpdated.connect(self.update_result)

            self.w_macro_name.textEdited.connect(self.update_macro_name)
            self.w_macro_name.editingFinished.connect(self.update_layout)
            self.w_macro_name.textChanged.connect(self.mb.setMacroName)
            self.w_macro_name.textChanged.connect(self.mb.setButtonText)

            # Since everything is now connected, the parameters will be updated
            self.w_macro_name.setText(macro_name)
Beispiel #19
0
    mb = MacroButton()

    mb.setModel(door_name)

    w.layout().addWidget(mb, 2, 0, 2, 7)

    w.layout().addWidget(Qt.QLabel('Result:'), 4, 0)

    result_label = Qt.QLabel()
    w.layout().addWidget(result_label, 4, 1, 1, 5)

    show_progress = Qt.QCheckBox('Progress')
    show_progress.setChecked(True)
    w.layout().addWidget(show_progress, 5, 0)

    mb_abort = TaurusCommandButton(command = 'StopMacro',
                                   icon=':/actions/media_playback_stop.svg')
    mb_abort.setModel(door_name)

    w.layout().addWidget(mb_abort, 5, 1)

    # Change macro name
    Qt.QObject.connect(macro_name, Qt.SIGNAL('textChanged(QString)'), mb.setMacroName)
    Qt.QObject.connect(macro_name, Qt.SIGNAL('textChanged(QString)'), mb.setButtonText)
    
    # connect the argument editors
    signals = [(e, 'textChanged(QString)') for e in _argEditors]
    mb.connectArgEditors(signals)

    def update_result(result):
        result_label.setText(str(result))
Beispiel #20
0
class Ui_Form(object):

    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(501, 414)
        self.gridLayout_2 = QtGui.QGridLayout(Form)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.taurusLabel = TaurusLabel(self.groupBox)
        self.taurusLabel.setObjectName(_fromUtf8("taurusLabel"))
        self.gridLayout.addWidget(self.taurusLabel, 0, 0, 1, 1)
        self.taurusLabel_2 = TaurusLabel(self.groupBox)
        self.taurusLabel_2.setObjectName(_fromUtf8("taurusLabel_2"))
        self.gridLayout.addWidget(self.taurusLabel_2, 0, 2, 1, 1)
        self.taurusLed_2 = TaurusLed(self.groupBox)
        self.taurusLed_2.setObjectName(_fromUtf8("taurusLed_2"))
        self.gridLayout.addWidget(self.taurusLed_2, 0, 3, 1, 1)
        self.taurusLabel_3 = TaurusLabel(self.groupBox)
        self.taurusLabel_3.setObjectName(_fromUtf8("taurusLabel_3"))
        self.gridLayout.addWidget(self.taurusLabel_3, 1, 0, 1, 1)
        self.taurusLabel_4 = TaurusLabel(self.groupBox)
        self.taurusLabel_4.setObjectName(_fromUtf8("taurusLabel_4"))
        self.gridLayout.addWidget(self.taurusLabel_4, 1, 2, 1, 1)
        self.taurusLed_3 = TaurusLed(self.groupBox)
        self.taurusLed_3.setObjectName(_fromUtf8("taurusLed_3"))
        self.gridLayout.addWidget(self.taurusLed_3, 1, 3, 1, 1)
        self.taurusLabel_5 = TaurusLabel(self.groupBox)
        self.taurusLabel_5.setObjectName(_fromUtf8("taurusLabel_5"))
        self.gridLayout.addWidget(self.taurusLabel_5, 2, 0, 1, 1)
        self.taurusLabel_6 = TaurusLabel(self.groupBox)
        self.taurusLabel_6.setObjectName(_fromUtf8("taurusLabel_6"))
        self.gridLayout.addWidget(self.taurusLabel_6, 2, 2, 1, 1)
        self.taurusLed_4 = TaurusLed(self.groupBox)
        self.taurusLed_4.setObjectName(_fromUtf8("taurusLed_4"))
        self.gridLayout.addWidget(self.taurusLed_4, 2, 3, 1, 1)
        self.taurusLabel_7 = TaurusLabel(self.groupBox)
        self.taurusLabel_7.setObjectName(_fromUtf8("taurusLabel_7"))
        self.gridLayout.addWidget(self.taurusLabel_7, 3, 0, 1, 1)
        self.taurusLabel_8 = TaurusLabel(self.groupBox)
        self.taurusLabel_8.setObjectName(_fromUtf8("taurusLabel_8"))
        self.gridLayout.addWidget(self.taurusLabel_8, 3, 2, 1, 1)
        self.taurusLed_5 = TaurusLed(self.groupBox)
        self.taurusLed_5.setObjectName(_fromUtf8("taurusLed_5"))
        self.gridLayout.addWidget(self.taurusLed_5, 3, 3, 1, 1)
        self.taurusLabel_9 = TaurusLabel(self.groupBox)
        self.taurusLabel_9.setObjectName(_fromUtf8("taurusLabel_9"))
        self.gridLayout.addWidget(self.taurusLabel_9, 4, 0, 1, 1)
        self.taurusLabel_10 = TaurusLabel(self.groupBox)
        self.taurusLabel_10.setObjectName(_fromUtf8("taurusLabel_10"))
        self.gridLayout.addWidget(self.taurusLabel_10, 4, 2, 1, 1)
        self.taurusLed_6 = TaurusLed(self.groupBox)
        self.taurusLed_6.setObjectName(_fromUtf8("taurusLed_6"))
        self.gridLayout.addWidget(self.taurusLed_6, 4, 3, 1, 1)
        self.taurusLabel_11 = TaurusLabel(self.groupBox)
        self.taurusLabel_11.setObjectName(_fromUtf8("taurusLabel_11"))
        self.gridLayout.addWidget(self.taurusLabel_11, 5, 0, 1, 1)
        self.taurusLabel_12 = TaurusLabel(self.groupBox)
        self.taurusLabel_12.setObjectName(_fromUtf8("taurusLabel_12"))
        self.gridLayout.addWidget(self.taurusLabel_12, 5, 2, 1, 1)
        self.taurusLed_7 = TaurusLed(self.groupBox)
        self.taurusLed_7.setObjectName(_fromUtf8("taurusLed_7"))
        self.gridLayout.addWidget(self.taurusLed_7, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox, 0, 2, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.taurusLabel_13 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_13.setObjectName(_fromUtf8("taurusLabel_13"))
        self.gridLayout_3.addWidget(self.taurusLabel_13, 0, 0, 1, 1)
        self.taurusLabel_14 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_14.setObjectName(_fromUtf8("taurusLabel_14"))
        self.gridLayout_3.addWidget(self.taurusLabel_14, 0, 2, 1, 1)
        self.taurusLed_8 = TaurusLed(self.groupBox_2)
        self.taurusLed_8.setObjectName(_fromUtf8("taurusLed_8"))
        self.gridLayout_3.addWidget(self.taurusLed_8, 0, 3, 1, 1)
        self.taurusLabel_15 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_15.setObjectName(_fromUtf8("taurusLabel_15"))
        self.gridLayout_3.addWidget(self.taurusLabel_15, 1, 0, 1, 1)
        self.taurusLabel_16 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_16.setObjectName(_fromUtf8("taurusLabel_16"))
        self.gridLayout_3.addWidget(self.taurusLabel_16, 1, 2, 1, 1)
        self.taurusLed_9 = TaurusLed(self.groupBox_2)
        self.taurusLed_9.setObjectName(_fromUtf8("taurusLed_9"))
        self.gridLayout_3.addWidget(self.taurusLed_9, 1, 3, 1, 1)
        self.taurusLabel_17 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_17.setObjectName(_fromUtf8("taurusLabel_17"))
        self.gridLayout_3.addWidget(self.taurusLabel_17, 2, 0, 1, 1)
        self.taurusLabel_18 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_18.setObjectName(_fromUtf8("taurusLabel_18"))
        self.gridLayout_3.addWidget(self.taurusLabel_18, 2, 2, 1, 1)
        self.taurusLed_10 = TaurusLed(self.groupBox_2)
        self.taurusLed_10.setObjectName(_fromUtf8("taurusLed_10"))
        self.gridLayout_3.addWidget(self.taurusLed_10, 2, 3, 1, 1)
        self.taurusLabel_19 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_19.setObjectName(_fromUtf8("taurusLabel_19"))
        self.gridLayout_3.addWidget(self.taurusLabel_19, 3, 0, 1, 1)
        self.taurusLabel_20 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_20.setObjectName(_fromUtf8("taurusLabel_20"))
        self.gridLayout_3.addWidget(self.taurusLabel_20, 3, 2, 1, 1)
        self.taurusLed_11 = TaurusLed(self.groupBox_2)
        self.taurusLed_11.setObjectName(_fromUtf8("taurusLed_11"))
        self.gridLayout_3.addWidget(self.taurusLed_11, 3, 3, 1, 1)
        self.taurusLabel_21 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_21.setObjectName(_fromUtf8("taurusLabel_21"))
        self.gridLayout_3.addWidget(self.taurusLabel_21, 4, 0, 1, 1)
        self.taurusLabel_22 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_22.setObjectName(_fromUtf8("taurusLabel_22"))
        self.gridLayout_3.addWidget(self.taurusLabel_22, 4, 2, 1, 1)
        self.taurusLed_12 = TaurusLed(self.groupBox_2)
        self.taurusLed_12.setObjectName(_fromUtf8("taurusLed_12"))
        self.gridLayout_3.addWidget(self.taurusLed_12, 4, 3, 1, 1)
        self.taurusLabel_23 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_23.setObjectName(_fromUtf8("taurusLabel_23"))
        self.gridLayout_3.addWidget(self.taurusLabel_23, 5, 0, 1, 1)
        self.taurusLabel_24 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_24.setObjectName(_fromUtf8("taurusLabel_24"))
        self.gridLayout_3.addWidget(self.taurusLabel_24, 5, 2, 1, 1)
        self.taurusLed_13 = TaurusLed(self.groupBox_2)
        self.taurusLed_13.setObjectName(_fromUtf8("taurusLed_13"))
        self.gridLayout_3.addWidget(self.taurusLed_13, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox_2, 0, 3, 1, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.taurusLabel_26 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_26.setObjectName(_fromUtf8("taurusLabel_26"))
        self.gridLayout_5.addWidget(self.taurusLabel_26, 0, 0, 1, 3)
        self.taurusLed_14 = TaurusLed(self.groupBox_4)
        self.taurusLed_14.setObjectName(_fromUtf8("taurusLed_14"))
        self.gridLayout_5.addWidget(self.taurusLed_14, 1, 0, 1, 1)
        self.taurusLabel_29 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_29.setObjectName(_fromUtf8("taurusLabel_29"))
        self.gridLayout_5.addWidget(self.taurusLabel_29, 2, 0, 1, 1)
        self.taurusLabel_30 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_30.setObjectName(_fromUtf8("taurusLabel_30"))
        self.gridLayout_5.addWidget(self.taurusLabel_30, 2, 1, 1, 1)
        self.taurusValueLineEdit_2 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_2.setObjectName(
            _fromUtf8("taurusValueLineEdit_2"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_2, 2, 2, 1, 1)
        self.taurusLabel_33 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_33.setObjectName(_fromUtf8("taurusLabel_33"))
        self.gridLayout_5.addWidget(self.taurusLabel_33, 3, 0, 1, 1)
        self.taurusLabel_34 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_34.setObjectName(_fromUtf8("taurusLabel_34"))
        self.gridLayout_5.addWidget(self.taurusLabel_34, 3, 1, 1, 1)
        self.taurusValueLineEdit_4 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_4.setObjectName(
            _fromUtf8("taurusValueLineEdit_4"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_4, 3, 2, 1, 1)
        self.taurusLabel_37 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_37.setObjectName(_fromUtf8("taurusLabel_37"))
        self.gridLayout_5.addWidget(self.taurusLabel_37, 4, 0, 1, 1)
        self.taurusLabel_38 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_38.setObjectName(_fromUtf8("taurusLabel_38"))
        self.gridLayout_5.addWidget(self.taurusLabel_38, 4, 1, 1, 1)
        self.taurusValueLineEdit_6 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_6.setObjectName(
            _fromUtf8("taurusValueLineEdit_6"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_6, 4, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.taurusCommandButton_2 = TaurusCommandButton(self.groupBox_4)
        self.taurusCommandButton_2.setObjectName(
            _fromUtf8("taurusCommandButton_2"))
        self.horizontalLayout_2.addWidget(self.taurusCommandButton_2)
        self.cfgMg2 = QtGui.QToolButton(self.groupBox_4)
        self.cfgMg2.setObjectName(_fromUtf8("cfgMg2"))
        self.horizontalLayout_2.addWidget(self.cfgMg2)
        self.horizontalLayout_2.setStretch(0, 1)
        self.gridLayout_5.addLayout(self.horizontalLayout_2, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_4, 1, 3, 1, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.taurusLabel_25 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_25.setObjectName(_fromUtf8("taurusLabel_25"))
        self.gridLayout_4.addWidget(self.taurusLabel_25, 0, 0, 1, 3)
        self.taurusLabel_27 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_27.setObjectName(_fromUtf8("taurusLabel_27"))
        self.gridLayout_4.addWidget(self.taurusLabel_27, 2, 1, 1, 1)
        self.taurusLabel_28 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_28.setObjectName(_fromUtf8("taurusLabel_28"))
        self.gridLayout_4.addWidget(self.taurusLabel_28, 2, 0, 1, 1)
        self.taurusValueLineEdit = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit.setObjectName(
            _fromUtf8("taurusValueLineEdit"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit, 2, 2, 1, 1)
        self.taurusLed = TaurusLed(self.groupBox_3)
        self.taurusLed.setObjectName(_fromUtf8("taurusLed"))
        self.gridLayout_4.addWidget(self.taurusLed, 1, 0, 1, 1)
        self.taurusLabel_31 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_31.setObjectName(_fromUtf8("taurusLabel_31"))
        self.gridLayout_4.addWidget(self.taurusLabel_31, 3, 0, 1, 1)
        self.taurusLabel_32 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_32.setObjectName(_fromUtf8("taurusLabel_32"))
        self.gridLayout_4.addWidget(self.taurusLabel_32, 3, 1, 1, 1)
        self.taurusValueLineEdit_3 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_3.setObjectName(
            _fromUtf8("taurusValueLineEdit_3"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_3, 3, 2, 1, 1)
        self.taurusLabel_35 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_35.setObjectName(_fromUtf8("taurusLabel_35"))
        self.gridLayout_4.addWidget(self.taurusLabel_35, 4, 0, 1, 1)
        self.taurusLabel_36 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_36.setObjectName(_fromUtf8("taurusLabel_36"))
        self.gridLayout_4.addWidget(self.taurusLabel_36, 4, 1, 1, 1)
        self.taurusValueLineEdit_5 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_5.setObjectName(
            _fromUtf8("taurusValueLineEdit_5"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_5, 4, 2, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.taurusCommandButton = TaurusCommandButton(self.groupBox_3)
        self.taurusCommandButton.setObjectName(
            _fromUtf8("taurusCommandButton"))
        self.horizontalLayout_3.addWidget(self.taurusCommandButton)
        self.cfgMg1 = QtGui.QToolButton(self.groupBox_3)
        self.cfgMg1.setObjectName(_fromUtf8("cfgMg1"))
        self.horizontalLayout_3.addWidget(self.cfgMg1)
        self.gridLayout_4.addLayout(self.horizontalLayout_3, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_3, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(QtGui.QApplication.translate(
            "Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox.setTitle(QtGui.QApplication.translate(
            "Form", "CTs of CTRL1", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/1/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_2.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/1/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_2.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/1/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_3.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/2/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_3.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_4.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/2/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_3.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/2/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_5.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/3/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_5.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_6.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/3/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_4.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/3/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_7.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/4/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_7.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_8.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/4/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_5.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/4/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_9.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/5/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_9.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_10.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/5/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_6.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/5/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_11.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/6/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_11.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_12.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/6/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_7.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl1/6/state", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_2.setTitle(QtGui.QApplication.translate(
            "Form", "CTs of CTRL2", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_13.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/1/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_13.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_14.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/1/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_8.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/1/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_15.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/2/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_15.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_16.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/2/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_9.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/2/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_17.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/3/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_17.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_18.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/3/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_10.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/3/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_19.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/4/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_19.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_20.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/4/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_11.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/4/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_21.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/5/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_21.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_22.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/5/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_12.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/5/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_23.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/6/value?configuration=dev_alias", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_23.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_24.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/6/value", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_13.setModel(QtGui.QApplication.translate(
            "Form", "expchan/dummyctctrl2/6/state", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_4.setTitle(QtGui.QApplication.translate(
            "Form", "MG2", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_26.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/elementlist", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_26.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed_14.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_29.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/integrationtime?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_29.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_30.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/integrationtime", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_2.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/integrationtime", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_33.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/monitorcount?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_33.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_34.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/monitorcount", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_4.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/monitorcount", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_37.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/acquisitionmode?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_37.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_38.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/acquisitionmode", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_6.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2/acquisitionmode", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton_2.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg2", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton_2.setCommand(QtGui.QApplication.translate(
            "Form", "start", None, QtGui.QApplication.UnicodeUTF8))
        self.cfgMg2.setText(QtGui.QApplication.translate(
            "Form", "...", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_3.setTitle(QtGui.QApplication.translate(
            "Form", "MG1", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_25.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/elementlist", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_25.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_27.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/integrationtime", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_28.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/integrationtime?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_28.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/integrationtime", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLed.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/state", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_31.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/monitorcount?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_31.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_32.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/monitorcount", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_3.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/monitorcount", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_35.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/acquisitionmode?configuration=label", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_35.setBgRole(QtGui.QApplication.translate(
            "Form", "none", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusLabel_36.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/acquisitionmode", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusValueLineEdit_5.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1/acquisitionmode", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton.setModel(QtGui.QApplication.translate(
            "Form", "mntgrp/v3/mg1", None, QtGui.QApplication.UnicodeUTF8))
        self.taurusCommandButton.setCommand(QtGui.QApplication.translate(
            "Form", "start", None, QtGui.QApplication.UnicodeUTF8))
        self.cfgMg1.setText(QtGui.QApplication.translate(
            "Form", "...", None, QtGui.QApplication.UnicodeUTF8))
Beispiel #21
0
class PowerSupplyPanel(TaurusWidget):
    "Allows directly controlling the power supply connected to the circuit"
    attrs = ["long_scalar", "double_scalar", "float_scalar"]

    #   attrs = ["Current", "Voltage", "Resistance"]

    def __init__(self, parent=None):
        print('ddddddddddddddddd')
        TaurusWidget.__init__(self, parent)
        self._setup_ui()
        print('juste avant setmodel')
        self.setModel('sys/tg_test/1')

    def _setup_ui(self):
        print('-----------voici ')
        hbox = QtGui.QHBoxLayout(self)
        self.setLayout(hbox)
        form_vbox = QtGui.QVBoxLayout(self)

        # devicename label
        hbox2 = QtGui.QVBoxLayout(self)
        self.device_and_state = DevnameAndState(self)
        hbox2.addWidget(self.device_and_state, stretch=2)

        # commands
        commandbox = QtGui.QHBoxLayout(self)
        self.start_button = TaurusCommandButton(command="On")
        self.start_button.setUseParentModel(True)
        self.stop_button = TaurusCommandButton(command="Off")
        self.stop_button.setUseParentModel(True)
        self.init_button = TaurusCommandButton(command="Init")
        self.init_button.setUseParentModel(True)
        commandbox.addWidget(self.start_button)
        commandbox.addWidget(self.stop_button)
        commandbox.addWidget(self.init_button)
        hbox2.addLayout(commandbox, stretch=1)
        form_vbox.addLayout(hbox2)

        # attributes
        self.form = MAXForm(withButtons=False)

        form_vbox.addLayout(commandbox)
        form_vbox.addWidget(self.form, stretch=1)
        self.status_area = StatusArea()
        form_vbox.addWidget(self.status_area)
        hbox.addLayout(form_vbox)

        # value bar
        self.valuebar = MAXValueBar(self)
        slider_vbox = QtGui.QVBoxLayout(self)
        slider_vbox.setContentsMargins(10, 10, 10, 10)
        hbox.addLayout(slider_vbox)
        self.current_label = TaurusLabel()
        self.current_label.setAlignment(QtCore.Qt.AlignCenter)
        slider_vbox.addWidget(self.valuebar, 1)
        slider_vbox.addWidget(self.current_label)

    def setModel(self, device):
        print self.__class__.__name__, "setModel", device
        TaurusWidget.setModel(self, device)
        self.device_and_state.setModel(device)
        self.status_area.setModel(device)
        if device:
            self.form.setModel(
                ["%s/%s" % (device, attribute) for attribute in self.attrs])
            attrname = "%s/%s" % (device, "Current")

            self.valuebar.setModel(attrname)
            # self.state_button.setModel(device)
            attr = Attribute(attrname)
            self.current_label.setText("%s [%s]" % (attr.label, attr.unit))
        else:
            self.form.setModel(None)
            self.valuebar.setModel(None)
Beispiel #22
0
        def create_layout(self, macro_name):
            p_names, d_values = self.getMacroInfo(macro_name)
            # Create TOP layout
            self.w_arg = Qt.QWidget()
            self.w_arg.setLayout(Qt.QGridLayout())
            col = 0
            self.w_arg.layout().addWidget(Qt.QLabel('macro name'), 0, col)
            self.w_macro_name = Qt.QLineEdit()
            self.w_arg.layout().addWidget(self.w_macro_name, 1, col)

            _argEditors = []
            for name in p_names:
                col += 1
                self.w_arg.layout().addWidget(Qt.QLabel(name), 0, col)
                self.argEdit = Qt.QLineEdit()
                self.w_arg.layout().addWidget(self.argEdit, 1, col)
                _argEditors.append(self.argEdit)

            for e, v in zip(_argEditors, d_values):
                e.setText(v)

            # Create bottom layout
            self.mb = MacroButton()
            self.mb.setModel(door_name)
            self.w_bottom = Qt.QWidget()
            self.w_bottom.setLayout(Qt.QGridLayout())
            self.w_bottom.layout().addWidget(self.mb, 0, 0, 2, 7)
            self.w_bottom.layout().addWidget(Qt.QLabel('Result:'), 2, 0)

            self.result_label = Qt.QLabel()
            self.w_bottom.layout().addWidget(self.result_label, 2, 1, 1, 5)

            self.show_progress = Qt.QCheckBox('Progress')
            self.show_progress.setChecked(True)
            self.w_bottom.layout().addWidget(self.show_progress, 3, 0)

            mb_abort = TaurusCommandButton(command='StopMacro',
                                           icon=':/actions/media_playback_stop.svg')
            mb_abort.setModel(door_name)
            self.w_bottom.layout().addWidget(mb_abort, 3, 1)

            # Toggle progressbar
            Qt.QObject.connect(self.show_progress, Qt.SIGNAL(
                'stateChanged(int)'), self.toggle_progress)
            # connect the argument editors
            signals = [(e, 'textChanged(QString)') for e in _argEditors]
            self.mb.connectArgEditors(signals)

            self.setLayout(Qt.QVBoxLayout())
            self.layout().addWidget(self.w_arg)
            self.layout().addWidget(self.w_bottom)

            # Update possible macro result
            Qt.QObject.connect(self.mb, Qt.SIGNAL(
                'resultUpdated'), self.update_result)

            Qt.QObject.connect(self.w_macro_name, Qt.SIGNAL(
                'textEdited(QString)'), self.update_macro_name)
            Qt.QObject.connect(self.w_macro_name, Qt.SIGNAL(
                'editingFinished()'), self.update_layout)
            Qt.QObject.connect(self.w_macro_name, Qt.SIGNAL(
                'textChanged(QString)'), self.mb.setMacroName)
            Qt.QObject.connect(self.w_macro_name, Qt.SIGNAL(
                'textChanged(QString)'), self.mb.setButtonText)

            # Since everything is now connected, the parameters will be updated
            self.w_macro_name.setText(macro_name)
Beispiel #23
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(501, 414)
        self.gridLayout_2 = QtGui.QGridLayout(Form)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.taurusLabel = TaurusLabel(self.groupBox)
        self.taurusLabel.setObjectName(_fromUtf8("taurusLabel"))
        self.gridLayout.addWidget(self.taurusLabel, 0, 0, 1, 1)
        self.taurusLabel_2 = TaurusLabel(self.groupBox)
        self.taurusLabel_2.setObjectName(_fromUtf8("taurusLabel_2"))
        self.gridLayout.addWidget(self.taurusLabel_2, 0, 2, 1, 1)
        self.taurusLed_2 = TaurusLed(self.groupBox)
        self.taurusLed_2.setObjectName(_fromUtf8("taurusLed_2"))
        self.gridLayout.addWidget(self.taurusLed_2, 0, 3, 1, 1)
        self.taurusLabel_3 = TaurusLabel(self.groupBox)
        self.taurusLabel_3.setObjectName(_fromUtf8("taurusLabel_3"))
        self.gridLayout.addWidget(self.taurusLabel_3, 1, 0, 1, 1)
        self.taurusLabel_4 = TaurusLabel(self.groupBox)
        self.taurusLabel_4.setObjectName(_fromUtf8("taurusLabel_4"))
        self.gridLayout.addWidget(self.taurusLabel_4, 1, 2, 1, 1)
        self.taurusLed_3 = TaurusLed(self.groupBox)
        self.taurusLed_3.setObjectName(_fromUtf8("taurusLed_3"))
        self.gridLayout.addWidget(self.taurusLed_3, 1, 3, 1, 1)
        self.taurusLabel_5 = TaurusLabel(self.groupBox)
        self.taurusLabel_5.setObjectName(_fromUtf8("taurusLabel_5"))
        self.gridLayout.addWidget(self.taurusLabel_5, 2, 0, 1, 1)
        self.taurusLabel_6 = TaurusLabel(self.groupBox)
        self.taurusLabel_6.setObjectName(_fromUtf8("taurusLabel_6"))
        self.gridLayout.addWidget(self.taurusLabel_6, 2, 2, 1, 1)
        self.taurusLed_4 = TaurusLed(self.groupBox)
        self.taurusLed_4.setObjectName(_fromUtf8("taurusLed_4"))
        self.gridLayout.addWidget(self.taurusLed_4, 2, 3, 1, 1)
        self.taurusLabel_7 = TaurusLabel(self.groupBox)
        self.taurusLabel_7.setObjectName(_fromUtf8("taurusLabel_7"))
        self.gridLayout.addWidget(self.taurusLabel_7, 3, 0, 1, 1)
        self.taurusLabel_8 = TaurusLabel(self.groupBox)
        self.taurusLabel_8.setObjectName(_fromUtf8("taurusLabel_8"))
        self.gridLayout.addWidget(self.taurusLabel_8, 3, 2, 1, 1)
        self.taurusLed_5 = TaurusLed(self.groupBox)
        self.taurusLed_5.setObjectName(_fromUtf8("taurusLed_5"))
        self.gridLayout.addWidget(self.taurusLed_5, 3, 3, 1, 1)
        self.taurusLabel_9 = TaurusLabel(self.groupBox)
        self.taurusLabel_9.setObjectName(_fromUtf8("taurusLabel_9"))
        self.gridLayout.addWidget(self.taurusLabel_9, 4, 0, 1, 1)
        self.taurusLabel_10 = TaurusLabel(self.groupBox)
        self.taurusLabel_10.setObjectName(_fromUtf8("taurusLabel_10"))
        self.gridLayout.addWidget(self.taurusLabel_10, 4, 2, 1, 1)
        self.taurusLed_6 = TaurusLed(self.groupBox)
        self.taurusLed_6.setObjectName(_fromUtf8("taurusLed_6"))
        self.gridLayout.addWidget(self.taurusLed_6, 4, 3, 1, 1)
        self.taurusLabel_11 = TaurusLabel(self.groupBox)
        self.taurusLabel_11.setObjectName(_fromUtf8("taurusLabel_11"))
        self.gridLayout.addWidget(self.taurusLabel_11, 5, 0, 1, 1)
        self.taurusLabel_12 = TaurusLabel(self.groupBox)
        self.taurusLabel_12.setObjectName(_fromUtf8("taurusLabel_12"))
        self.gridLayout.addWidget(self.taurusLabel_12, 5, 2, 1, 1)
        self.taurusLed_7 = TaurusLed(self.groupBox)
        self.taurusLed_7.setObjectName(_fromUtf8("taurusLed_7"))
        self.gridLayout.addWidget(self.taurusLed_7, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox, 0, 2, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.taurusLabel_13 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_13.setObjectName(_fromUtf8("taurusLabel_13"))
        self.gridLayout_3.addWidget(self.taurusLabel_13, 0, 0, 1, 1)
        self.taurusLabel_14 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_14.setObjectName(_fromUtf8("taurusLabel_14"))
        self.gridLayout_3.addWidget(self.taurusLabel_14, 0, 2, 1, 1)
        self.taurusLed_8 = TaurusLed(self.groupBox_2)
        self.taurusLed_8.setObjectName(_fromUtf8("taurusLed_8"))
        self.gridLayout_3.addWidget(self.taurusLed_8, 0, 3, 1, 1)
        self.taurusLabel_15 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_15.setObjectName(_fromUtf8("taurusLabel_15"))
        self.gridLayout_3.addWidget(self.taurusLabel_15, 1, 0, 1, 1)
        self.taurusLabel_16 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_16.setObjectName(_fromUtf8("taurusLabel_16"))
        self.gridLayout_3.addWidget(self.taurusLabel_16, 1, 2, 1, 1)
        self.taurusLed_9 = TaurusLed(self.groupBox_2)
        self.taurusLed_9.setObjectName(_fromUtf8("taurusLed_9"))
        self.gridLayout_3.addWidget(self.taurusLed_9, 1, 3, 1, 1)
        self.taurusLabel_17 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_17.setObjectName(_fromUtf8("taurusLabel_17"))
        self.gridLayout_3.addWidget(self.taurusLabel_17, 2, 0, 1, 1)
        self.taurusLabel_18 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_18.setObjectName(_fromUtf8("taurusLabel_18"))
        self.gridLayout_3.addWidget(self.taurusLabel_18, 2, 2, 1, 1)
        self.taurusLed_10 = TaurusLed(self.groupBox_2)
        self.taurusLed_10.setObjectName(_fromUtf8("taurusLed_10"))
        self.gridLayout_3.addWidget(self.taurusLed_10, 2, 3, 1, 1)
        self.taurusLabel_19 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_19.setObjectName(_fromUtf8("taurusLabel_19"))
        self.gridLayout_3.addWidget(self.taurusLabel_19, 3, 0, 1, 1)
        self.taurusLabel_20 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_20.setObjectName(_fromUtf8("taurusLabel_20"))
        self.gridLayout_3.addWidget(self.taurusLabel_20, 3, 2, 1, 1)
        self.taurusLed_11 = TaurusLed(self.groupBox_2)
        self.taurusLed_11.setObjectName(_fromUtf8("taurusLed_11"))
        self.gridLayout_3.addWidget(self.taurusLed_11, 3, 3, 1, 1)
        self.taurusLabel_21 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_21.setObjectName(_fromUtf8("taurusLabel_21"))
        self.gridLayout_3.addWidget(self.taurusLabel_21, 4, 0, 1, 1)
        self.taurusLabel_22 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_22.setObjectName(_fromUtf8("taurusLabel_22"))
        self.gridLayout_3.addWidget(self.taurusLabel_22, 4, 2, 1, 1)
        self.taurusLed_12 = TaurusLed(self.groupBox_2)
        self.taurusLed_12.setObjectName(_fromUtf8("taurusLed_12"))
        self.gridLayout_3.addWidget(self.taurusLed_12, 4, 3, 1, 1)
        self.taurusLabel_23 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_23.setObjectName(_fromUtf8("taurusLabel_23"))
        self.gridLayout_3.addWidget(self.taurusLabel_23, 5, 0, 1, 1)
        self.taurusLabel_24 = TaurusLabel(self.groupBox_2)
        self.taurusLabel_24.setObjectName(_fromUtf8("taurusLabel_24"))
        self.gridLayout_3.addWidget(self.taurusLabel_24, 5, 2, 1, 1)
        self.taurusLed_13 = TaurusLed(self.groupBox_2)
        self.taurusLed_13.setObjectName(_fromUtf8("taurusLed_13"))
        self.gridLayout_3.addWidget(self.taurusLed_13, 5, 3, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox_2, 0, 3, 1, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.taurusLabel_26 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_26.setObjectName(_fromUtf8("taurusLabel_26"))
        self.gridLayout_5.addWidget(self.taurusLabel_26, 0, 0, 1, 3)
        self.taurusLed_14 = TaurusLed(self.groupBox_4)
        self.taurusLed_14.setObjectName(_fromUtf8("taurusLed_14"))
        self.gridLayout_5.addWidget(self.taurusLed_14, 1, 0, 1, 1)
        self.taurusLabel_29 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_29.setObjectName(_fromUtf8("taurusLabel_29"))
        self.gridLayout_5.addWidget(self.taurusLabel_29, 2, 0, 1, 1)
        self.taurusLabel_30 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_30.setObjectName(_fromUtf8("taurusLabel_30"))
        self.gridLayout_5.addWidget(self.taurusLabel_30, 2, 1, 1, 1)
        self.taurusValueLineEdit_2 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_2.setObjectName(
            _fromUtf8("taurusValueLineEdit_2"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_2, 2, 2, 1, 1)
        self.taurusLabel_33 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_33.setObjectName(_fromUtf8("taurusLabel_33"))
        self.gridLayout_5.addWidget(self.taurusLabel_33, 3, 0, 1, 1)
        self.taurusLabel_34 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_34.setObjectName(_fromUtf8("taurusLabel_34"))
        self.gridLayout_5.addWidget(self.taurusLabel_34, 3, 1, 1, 1)
        self.taurusValueLineEdit_4 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_4.setObjectName(
            _fromUtf8("taurusValueLineEdit_4"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_4, 3, 2, 1, 1)
        self.taurusLabel_37 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_37.setObjectName(_fromUtf8("taurusLabel_37"))
        self.gridLayout_5.addWidget(self.taurusLabel_37, 4, 0, 1, 1)
        self.taurusLabel_38 = TaurusLabel(self.groupBox_4)
        self.taurusLabel_38.setObjectName(_fromUtf8("taurusLabel_38"))
        self.gridLayout_5.addWidget(self.taurusLabel_38, 4, 1, 1, 1)
        self.taurusValueLineEdit_6 = TaurusValueLineEdit(self.groupBox_4)
        self.taurusValueLineEdit_6.setObjectName(
            _fromUtf8("taurusValueLineEdit_6"))
        self.gridLayout_5.addWidget(self.taurusValueLineEdit_6, 4, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.taurusCommandButton_2 = TaurusCommandButton(self.groupBox_4)
        self.taurusCommandButton_2.setObjectName(
            _fromUtf8("taurusCommandButton_2"))
        self.horizontalLayout_2.addWidget(self.taurusCommandButton_2)
        self.cfgMg2 = QtGui.QToolButton(self.groupBox_4)
        self.cfgMg2.setObjectName(_fromUtf8("cfgMg2"))
        self.horizontalLayout_2.addWidget(self.cfgMg2)
        self.horizontalLayout_2.setStretch(0, 1)
        self.gridLayout_5.addLayout(self.horizontalLayout_2, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_4, 1, 3, 1, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.taurusLabel_25 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_25.setObjectName(_fromUtf8("taurusLabel_25"))
        self.gridLayout_4.addWidget(self.taurusLabel_25, 0, 0, 1, 3)
        self.taurusLabel_27 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_27.setObjectName(_fromUtf8("taurusLabel_27"))
        self.gridLayout_4.addWidget(self.taurusLabel_27, 2, 1, 1, 1)
        self.taurusLabel_28 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_28.setObjectName(_fromUtf8("taurusLabel_28"))
        self.gridLayout_4.addWidget(self.taurusLabel_28, 2, 0, 1, 1)
        self.taurusValueLineEdit = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit.setObjectName(
            _fromUtf8("taurusValueLineEdit"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit, 2, 2, 1, 1)
        self.taurusLed = TaurusLed(self.groupBox_3)
        self.taurusLed.setObjectName(_fromUtf8("taurusLed"))
        self.gridLayout_4.addWidget(self.taurusLed, 1, 0, 1, 1)
        self.taurusLabel_31 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_31.setObjectName(_fromUtf8("taurusLabel_31"))
        self.gridLayout_4.addWidget(self.taurusLabel_31, 3, 0, 1, 1)
        self.taurusLabel_32 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_32.setObjectName(_fromUtf8("taurusLabel_32"))
        self.gridLayout_4.addWidget(self.taurusLabel_32, 3, 1, 1, 1)
        self.taurusValueLineEdit_3 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_3.setObjectName(
            _fromUtf8("taurusValueLineEdit_3"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_3, 3, 2, 1, 1)
        self.taurusLabel_35 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_35.setObjectName(_fromUtf8("taurusLabel_35"))
        self.gridLayout_4.addWidget(self.taurusLabel_35, 4, 0, 1, 1)
        self.taurusLabel_36 = TaurusLabel(self.groupBox_3)
        self.taurusLabel_36.setObjectName(_fromUtf8("taurusLabel_36"))
        self.gridLayout_4.addWidget(self.taurusLabel_36, 4, 1, 1, 1)
        self.taurusValueLineEdit_5 = TaurusValueLineEdit(self.groupBox_3)
        self.taurusValueLineEdit_5.setObjectName(
            _fromUtf8("taurusValueLineEdit_5"))
        self.gridLayout_4.addWidget(self.taurusValueLineEdit_5, 4, 2, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.taurusCommandButton = TaurusCommandButton(self.groupBox_3)
        self.taurusCommandButton.setObjectName(
            _fromUtf8("taurusCommandButton"))
        self.horizontalLayout_3.addWidget(self.taurusCommandButton)
        self.cfgMg1 = QtGui.QToolButton(self.groupBox_3)
        self.cfgMg1.setObjectName(_fromUtf8("cfgMg1"))
        self.horizontalLayout_3.addWidget(self.cfgMg1)
        self.gridLayout_4.addLayout(self.horizontalLayout_3, 1, 1, 1, 2)
        self.gridLayout_2.addWidget(self.groupBox_3, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Beispiel #24
0
class BinpPowerSupplyPanel(TaurusWidget):
    "Allows directly controlling the BINP power supply connected to the circuit"
    attrs = ["Voltage"]

    def __init__(self, parent=None):
        TaurusWidget.__init__(self, parent)
        self._setup_ui()

    def _setup_ui(self):
        hbox = QtGui.QHBoxLayout(self)
        self.setLayout(hbox)
        form_vbox = QtGui.QVBoxLayout(self)

        # devicename label
        hbox2 = QtGui.QVBoxLayout(self)
        self.device_and_state = DevnameAndState(self)
        hbox2.addWidget(self.device_and_state, stretch=2)

        # commands
        commandbox = QtGui.QHBoxLayout(self)
        self.start_button = TaurusCommandButton(command="Start")
        self.start_button.setUseParentModel(True)
        self.stop_button = TaurusCommandButton(command="Stop")
        self.stop_button.setUseParentModel(True)
        self.init_button = TaurusCommandButton(command="Init")
        self.init_button.setUseParentModel(True)
        self.on_button = TaurusCommandButton(command="On")
        self.on_button.setUseParentModel(True)
        self.off_button = TaurusCommandButton(command="Off")
        self.off_button.setUseParentModel(True)
        self.enable_trigger_button = TaurusCommandButton(
            command="EnableTrigger")
        self.enable_trigger_button.setUseParentModel(True)
        self.disable_trigger_button = TaurusCommandButton(
            command="DisableTrigger")
        self.disable_trigger_button.setUseParentModel(True)
        self.reset_button = TaurusCommandButton(command="Reset")
        self.reset_button.setUseParentModel(True)
        commandbox.addWidget(self.start_button)
        commandbox.addWidget(self.stop_button)
        commandbox.addWidget(self.init_button)
        commandbox.addWidget(self.on_button)
        commandbox.addWidget(self.off_button)
        commandbox.addWidget(self.enable_trigger_button)
        commandbox.addWidget(self.disable_trigger_button)
        commandbox.addWidget(self.reset_button)
        hbox2.addLayout(commandbox, stretch=1)
        form_vbox.addLayout(hbox2)

        # attributes
        self.form = MAXForm(withButtons=False)

        form_vbox.addLayout(commandbox)
        form_vbox.addWidget(self.form, stretch=1)
        self.status_area = StatusArea()
        form_vbox.addWidget(self.status_area)
        hbox.addLayout(form_vbox)

        # value bar
        self.valuebar = MAXValueBar(self)
        slider_vbox = QtGui.QVBoxLayout(self)
        slider_vbox.setContentsMargins(10, 10, 10, 10)
        hbox.addLayout(slider_vbox)
        self.current_label = TaurusLabel()
        self.current_label.setAlignment(QtCore.Qt.AlignCenter)
        slider_vbox.addWidget(self.valuebar, 1)
        slider_vbox.addWidget(self.current_label)

    def setModel(self, device):
        print self.__class__.__name__, "setModel", device
        TaurusWidget.setModel(self, device)
        self.device_and_state.setModel(device)
        self.status_area.setModel(device)
        if device:
            self.form.setModel(
                ["%s/%s" % (device, attribute) for attribute in self.attrs])
            attrname = "%s/%s" % (device, "Voltage")
            self.valuebar.setModel(attrname)
            # self.state_button.setModel(device)
            attr = Attribute(attrname)
            self.current_label.setText("%s [%s]" % (attr.label, attr.unit))
        else:
            self.form.setModel(None)
            self.valuebar.setModel(None)
class Ui_MainWindow(QtGui.QMainWindow):
    def setupUi(self, MainWindow,devices):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))

        self.devices = devices
        self.tangoDevices = list() # list of tango-devices

        self.nMaxRows = 10 # maximal number of rows in mainWidget
        self.nMinRowsForDecrSize = 3 # минимальное число строк для изменения размера

        self.deviceNameLabel = list()
        self.statusLed = list()
        self.voltageValueSpinBox = list()
        self.setVoltageButton = list()
        self.measLCD = list()
        self.checkActiveBox = list()

        self.timer = list() # список таймеров
        self.timerVal = timerval # timer interval

        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))

        self.reconnectButton = TaurusCommandButton(self.centralwidget)
        self.reconnectButton.setObjectName(_fromUtf8("reconnectButton"))
        self.reconnectButton.clicked.connect(self.reconnectCommand)


        self.settingsButton = QtGui.QPushButton(self.centralwidget)
        # self.settingsButton.setObjectName(_fromUtf8("settingsButton"))
        self.settingsButton.clicked.connect(self.showSettDialog)

        # timer init
        for i in range(0,len(self.devices)):
            self.timer.append(MyTimer()) # установка таймера для проверки актуального заряда конденсаторов
            self.timer[i].iter = i
            self.setWidgetView(i) # установка параметров виджетов
            self.setSignalHandler(i) # установка обработчиков
        # clicked connect
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.layouts(MainWindow)  # установка компоновки

        self.centerOnScreen(MainWindow)
        self.initTangoDevices() # tango devices
        if MDEBUG:
            print("Number of TanDev: " + str(self.tangoDevices))

        self.widgetSizes(MainWindow) # установка размеров виджетов

    def init_val(self,i):
        try:
            self.checkADCoutput(i)
            state = self.tangoDevices[i].command_inout('State')
            if state == PyTango.DevState.RUNNING:
                self.checkActiveBox[i].setChecked(True)
            if state == PyTango.DevState.DISABLE:
                self.checkActiveBox[i].setEnabled(False)
            if self.timer[i].isActive() == False:
                self.timer[i].setInterval(self.timerVal)
                self.timer[i].start()
        except PyTango.DevFailed as exc:
            self.exceptionDialog(i,exc)

    # def timerset(self,i):

    def widgetSizes(self,MainWindow):
        # установка размера виджетов в зависимости от количества
        if len(self.devices) > self.nMinRowsForDecrSize: # минимальное число строк для изменения размера
            horSizeBlock = 600
            if len(self.devices) > self.nMaxRows:
                vertWinSize = 50 + len(self.devices)*50/2
            else:
                vertWinSize = 50 + len(self.devices)*50
            horWinSize = horSizeBlock + (len(self.devices)//11)*horSizeBlock
            MainWindow.setFixedSize(horWinSize,vertWinSize)
            for i in range(0,len(self.devices)):
                self.checkActiveBox[i].setFixedWidth(120)
                self.statusLed[i].setFixedSize(30,30)
                self.voltageValueSpinBox[i].setFixedWidth(70)
        else:
            horWinSize = 900
            vertWinSize = 80 + len(self.devices)*80
            for i in range(0,len(self.devices)):
                self.measLCD[i].setFixedHeight(70)
                self.voltageValueSpinBox[i].setFixedHeight(70)
                self.statusLed[i].setFixedSize(40,40)
                font = self.voltageValueSpinBox[i].font()
                font.setPointSize(20)
                self.voltageValueSpinBox[i].setFont(font)

                labelFont = self.deviceNameLabel[i].font()
                labelFont.setPointSize(10)
                self.deviceNameLabel[i].setFont(labelFont)
                self.checkActiveBox[i].setFixedHeight(50)
                self.voltageValueSpinBox[i].setFixedWidth(150)
            MainWindow.setFixedSize(horWinSize,vertWinSize)

    def layouts(self,MainWindow):
        # установка layouts в зависимости от количества девайсов
        if len(self.devices) < self.nMaxRows + 1:
            mainLayout = QtGui.QVBoxLayout()
        if len(self.devices) > self.nMaxRows:
            mainLayout = QtGui.QGridLayout()
        # testLayout = QtGui.QHBoxLayout() # ???

        htopLayout=list()

        for i in range(0,len(self.devices)):
            htopLayout.append(QtGui.QHBoxLayout())
            htopLayout[i].addWidget(self.statusLed[i])
            htopLayout[i].addWidget(self.deviceNameLabel[i])
            # htopLayout[i].addStretch(1)
            htopLayout[i].addWidget(self.measLCD[i])
            # htopLayout[i].addWidget(self.voltageLabel[i])
            htopLayout[i].addWidget(self.voltageValueSpinBox[i])
            htopLayout[i].addWidget(self.setVoltageButton[i])
            htopLayout[i].addWidget(self.checkActiveBox[i])
            # htopLayout[i].addStretch(1)


        hbottomLayout = QtGui.QHBoxLayout()
        hbottomLayout.addStretch(1)
        hbottomLayout.addWidget(self.settingsButton )
        hbottomLayout.addWidget(self.reconnectButton)

        j = k = 0
        for i in range(0,len(self.devices)):
            if len(self.devices) < self.nMaxRows + 1:
                mainLayout.addLayout(htopLayout[i])
                # self.voltageValueSpinBox[i].setFixedWidth(70)
            if len(self.devices) > self.nMaxRows:
                mainLayout.addLayout(htopLayout[i],j,k)
                # self.voltageValueSpinBox[i].setFixedWidth(70)
                k = k + 1
                if k >= 2:
                    j = j + 1
                    k = 0

        if (k != 0):
            j = j + 1

        if len(self.devices) < self.nMaxRows + 1:
            mainLayout.addLayout(hbottomLayout)
        if len(self.devices) > self.nMaxRows:
            mainLayout.addLayout(hbottomLayout,j,0,1,2)

        centralWidget = MainWindow.centralWidget()
        centralWidget.setLayout(mainLayout)

    def setWidgetView(self,i):
        # установка вида для виджетов
        self.statusLed.append(MyTaurusLed(self))
        self.statusLed[i].iter = i
        self.statusLed[i].setModel(str(self.devices[i]) + "/State")
        self.statusLed[i].setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        # self.statusLed[i].setAutoTooltip(False) # ??? Всплывающая подсказка

        self.voltageValueSpinBox.append(QtGui.QSpinBox())
        self.voltageValueSpinBox[i].setMinimum(50)
        self.voltageValueSpinBox[i].setMaximum(500)
        self.voltageValueSpinBox[i].setValue(50)

        self.setVoltageButton.append(MyQPushButton())
        self.setVoltageButton[i].setText("set Voltage")
        self.setVoltageButton[i].iter = i

        self.measLCD.append(TaurusLCD())
        self.measLCD[i].setEnabled(True)
        self.measLCD[i].setDigitCount(3)
        # self.measLCD[i].setBgRole('state')
        # self.measLCD[i].setFgRole('state')
        palette = self.measLCD[i].palette()
        palette.setColor(palette.WindowText, QtGui.QColor("green"))
        # palette.setColor(palette.Background, QtGui.QColor("black"))
        palette.setColor(palette.Light, QtGui.QColor("orange"))
        palette.setColor(palette.Dark, QtGui.QColor("magenta"))
        self.measLCD[i].setPalette(palette)
        self.measLCD[i].setSegmentStyle(TaurusLCD.Flat)

        self.deviceNameLabel.append(QtGui.QLabel())
        textLabel = "<font color = black>"
        textLabel += QtCore.QString(self.devices[i])
        textLabel += "<\font>"

        self.deviceNameLabel[i].setText(textLabel)
        self.deviceNameLabel[i].setFixedWidth(200)
        # self.deviceNameLabel[i].setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))

        self.checkActiveBox.append(MyQCheckBox())
        self.checkActiveBox[i].setText("Charging")
        self.checkActiveBox[i].iter = i
        self.checkActiveBox[i].setChecked(False)

    def setSignalHandler(self,i):
        # установка обработчиков для событий
        # self.reconnectButton.clicked.connect(self.reconnectCommand)
        # события клика по кнопке установки напряжения
        self.connect(self.setVoltageButton[i],QtCore.SIGNAL("clicked(int)"),self.setVoltageAttr)
        # события изменения для бокса активного состояния
        self.connect(self.checkActiveBox[i], QtCore.SIGNAL("stateChanged(int,int)"),self.chargingOnOffCommand)
        # события таймера
        self.connect(self.timer[i],QtCore.SIGNAL("timeout(int)"),self.checkADCoutput)
        # события клика по лампочке состояния
        self.connect(self.statusLed[i],QtCore.SIGNAL("clicked(int)"),self.statusLedInfo)

    def statusLedInfo(self,i):
        if MDEBUG:
            print("StatusLedInfo: " + str(i))
        cd = deviceInfoDialog(self.tangoDevices[i],self)
        cd.show()

    def checkADCoutput(self,i):
        if MDEBUG:
            print("check ADC: " + str(i))
        try:
            self.tangoDevices[i].command_inout("CheckPSState") # таймеры выставлены в девайсах
            result = self.tangoDevices[i].command_inout("CheckAdcOutput")
            if (result != 65535):
                self.measLCD[i].setProperty("intValue", result)
                isActive = self.tangoDevices[i].read_attribute("isActive")
                if MDEBUG:
                    print (str(self.tangoDevices[i].state()))
                    print("Result: " + str(result))
                if (self.tangoDevices[i].state()!= PyTango.DevState.RUNNING): #??? Выключение checkActiveBox
                    if (self.checkActiveBox[i].isChecked()):                  #??? если активный, при полной зарадке
                        self.checkActiveBox[i].setChecked(False)              #??? конденсатора
                        # self.timer[i].stop() # ??? timer
                        if MDEBUG:
                            print("charging OFF. Completed")
                if (self.tangoDevices[i].state()== PyTango.DevState.RUNNING): #??? Выключение checkActiveBox
                    if (self.checkActiveBox[i].isChecked()==False):                  #??? если активный, при полной зарадке
                        self.checkActiveBox[i].setChecked(True)              #??? конденсатора
                        # self.timer[i].stop() # ??? timer
                        if MDEBUG:
                            print("State Running. setChecked(True)")
                if (self.tangoDevices[i].state()== PyTango.DevState.DISABLE):

                    self.checkActiveBox[i].setEnabled(False)
                    self.checkActiveBox[i].setChecked(isActive.value)
                elif (self.tangoDevices[i].state()!= PyTango.DevState.OFF or self.tangoDevices[i].state()!= PyTango.DevState.FAULT):
                    if (self.checkActiveBox[i].isEnabled() == False):
                        self.checkActiveBox[i].setEnabled(True)
                    self.checkActiveBox[i].setChecked(isActive.value)
                else:
                    if (self.checkActiveBox[i].isEnabled() == True):
                        self.checkActiveBox[i].setEnabled(False)
                    self.checkActiveBox[i].setChecked(isActive.value)




            else:
                self.setEnabledVoltageEdit(i,False)
                if (self.checkActiveBox[i].isChecked()):
                    self.checkActiveBox[i].setChecked(False)
                self.timer[i].stop()
                if MDEBUG:
                    print("timer STOP")
        except PyTango.DevFailed as exc:
            self.exceptionDialog(i,exc)

    def chargingOnOffCommand(self,i,state):
        # включить/выключить режим заряда
        if MDEBUG:
            print("ChargingOnOff : " + str(i) + " " + str(state))
        try:
            if (self.checkActiveBox[i].isChecked()):
                self.tangoDevices[i].command_inout("ChargingOff")
                # ??? нужна ли проверка бита активного состояния перед setChecked
                self.checkActiveBox[i].setChecked(False)
                if self.timer[i].isActive() == False: # ??? timer
                    self.timer[i].setInterval(self.timerVal)
                    self.timer[i].start()
                if MDEBUG:
                    print("charging off")
            else:
                self.tangoDevices[i].command_inout("ChargingOn")
                # ??? нужна ли проверка бита активного состояния перед setChecked
                self.checkActiveBox[i].setChecked(True)
                if self.timer[i].isActive() == False:
                    self.timer[i].setInterval(self.timerVal)
                    self.timer[i].start()
                if MDEBUG:
                    print("charging on")
                    print("TIMERVAL CHARGON: " + str(self.timerVal))
        except PyTango.DevFailed as exc:
            self.exceptionDialog(i,exc)

    def setVoltageAttr(self,i):
        try:
            voltage = self.voltageValueSpinBox[i].value()
            self.tangoDevices[i].write_attribute("Voltage", voltage)
            state = self.tangoDevices[i].command_inout('State')
            # если тумблер не на внешнем управлении и если
            # если не включён заряд, включить
            if (self.checkActiveBox[i].isChecked() == False and state != PyTango.DevState.DISABLE):
                self.tangoDevices[i].command_inout("ChargingOn")
                self.checkActiveBox[i].setChecked(True)
            if self.timer[i].isActive() == False:
                if MDEBUG:
                    print("TIMERVAL SETVOLT: " + str(self.timerVal))
                self.timer[i].setInterval(self.timerVal)
                self.timer[i].start()
            if(self.setVoltageButton[i].isDown()==True):
                if MDEBUG:
                    print("isDown")
                self.setVoltageButton[i].setDown(False)
            if MDEBUG:
                print("voltage charging on")
        except PyTango.DevFailed as exc:
            self.exceptionDialog(i,exc)

    def reconnectCommand(self):
        for i in range(0,len(self.tangoDevices)):
            if self.tangoDevices[i] != False and (self.tangoDevices[i].state() == PyTango.DevState.FAULT or self.tangoDevices[i].state() == PyTango.DevState.OFF):
                self.tangoDevices[i].command_inout("Init")

                if MDEBUG:
                    print("reInit")
            self.checkStatus(self.tangoDevices[i],i)
            if MDEBUG:
                print("checkStatus")

    def initTangoDevices(self):
        if len(self.devices) < 1:
            print("Devices less than 1")
            return
        # print "Number of devices: " + str(len(self.devices)) # for debug
    
        for i in range(0,len(self.devices)):
            try:
                # print("Device: -> " + self.devices[i])
                if MDEBUG:
                    print("initTangoDevices: " + str(self.devices[i]))
                deviceTan = PyTango.DeviceProxy(self.devices[i])
                self.checkStatus(deviceTan,i)
                self.tangoDevices.append(deviceTan)
                if MDEBUG:
                    print("Registered devices: " + str(deviceTan))


                volt = deviceTan.get_attribute_config("Voltage")
                # volt = deviceTan.get_attribute_list()
                # volt = deviceTan.read_attribute("Voltage")
                # volt = deviceTan.attribute_list_query()
                # volt = deviceTan.state()

                self.voltageValueSpinBox[i].setMaximum(int(volt.max_value))
                self.voltageValueSpinBox[i].setMinimum(int(volt.min_value))
                self.voltageValueSpinBox[i].setSuffix("V")
                # self.voltageValueSpinBox[i].setFixedWidth(70)
                if (int(volt.max_value)>10000):
                    self.measLCD[i].setDigitCount(5)
                    self.voltageValueSpinBox[i].setSingleStep(1000)
                else:
                    self.voltageValueSpinBox[i].setSingleStep(10)
                if MDEBUG:
                    print(volt.min_value)
                    print(volt.max_value)

                self.init_val(i)

            except PyTango.DevFailed as exc:
                self.statusLed[i].setLedColor("red")
                self.statusLed[i].setToolTip(str(exc)) # ??? test
                # self.voltageValueSpinBox[i].setEnabled(False)
                # self.setVoltageButton[i].setEnabled(False)
                self.setEnabledVoltageEdit(i,False)
                self.tangoDevices.append(False)
                
    def checkStatus(self,deviceTan,i):
        if deviceTan.state() == PyTango.DevState.OFF:
            if MDEBUG:
                self.setEnabledVoltageEdit(i,True) # ??? test
                self.statusLed[i].setToolTip("TESTOFF") # ??? test
                print("TESTOFF is True now")
            else:
                self.setEnabledVoltageEdit(i,False)
        elif deviceTan.state() == PyTango.DevState.FAULT:
            if MDEBUG:
                self.setEnabledVoltageEdit(i,True)
                self.statusLed[i].setToolTip("TESTFAULT") # ??? test
                print("TESTFAULT is True now")
            else:
                self.setEnabledVoltageEdit(i,False)
        elif deviceTan.state() == PyTango.DevState.ON:
            self.setEnabledVoltageEdit(i,True)
            if MDEBUG:
                self.statusLed[i].setToolTip("TESTON") # ??? test
                print("TESTON")

        elif deviceTan.state() == PyTango.DevState.DISABLE:
            self.voltageValueSpinBox[i].setEnabled(False)
            self.setVoltageButton[i].setEnabled(True)
            self.voltageValueSpinBox[i].setEnabled(True)
            if MDEBUG:
                self.statusLed[i].setToolTip("TESTDISABLE") # ??? test
                print("TESTDISABLE")
        elif deviceTan.state() == PyTango.DevState.RUNNING:
            self.setEnabledVoltageEdit(i,True)
            if MDEBUG:
                self.statusLed[i].setToolTip("TESTRUNNING") # ??? test
                print("TESTRUNNING")

    def showSettDialog(self):
        dial = SettingsDialog(self.timerVal,self)
        dial.show()
        self.settingsButton.setEnabled(False)
        if dial.exec_():
            ntime = dial.getValue()
            self.timerVal = ntime*1000
            for i in range(0,len(self.tangoDevices)):
                if self.tangoDevices[i] != False:
                    if (self.tangoDevices[i].state() == PyTango.DevState.ON
                        or self.tangoDevices[i].state() == PyTango.DevState.RUNNING)\
                            or self.tangoDevices[i].state() == PyTango.DevState.DISABLE:
                        if self.timer[i].isActive() == True:
                            self.timer[i].stop()
                            self.timer[i].setInterval(self.timerVal)
                            self.timer[i].start()
                        else:
                            self.timer[i].setInterval(self.timerVal)
                            self.timer[i].start()
            # self.settingsButton.setEnabled(False)
            time.sleep(3) # for
            self.settingsButton.setEnabled(True)
            if MDEBUG:
                print("EXEC DIAL" + str(ntime))
        else:
            self.settingsButton.setEnabled(True)
            if MDEBUG:
                print("ELSE DIAL")

    def setEnabledVoltageEdit(self,iter,isEnabled):
        self.voltageValueSpinBox[iter].setEnabled(isEnabled)
        self.setVoltageButton[iter].setEnabled(isEnabled)
        self.checkActiveBox[iter].setEnabled(isEnabled)

    def centerOnScreen(self,MainWindow):
        resolution = QtGui.QDesktopWidget().screenGeometry()
        MainWindow.move((resolution.width() / 2) - (self.frameSize().width() / 2),
                  (resolution.height() / 2) - (self.frameSize().height() / 2))

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))

        # for i in range(0,len(self.devices)):
        #     self.statusLed[i].setLedColor(_translate("MainWindow", "green", None))
            # self.measLCD[i].setText(_translate("MainWindow", " 99.99", None))

        self.reconnectButton.setText(_translate("MainWindow", "Reconnect", None))
        self.settingsButton.setText(_translate("MainWindow","Settings",None))


    def exceptionDialog(self,i, exc):
        lenExc = len(tuple(exc))
        if MDEBUG:
            print("setVoltage exception")
        if self.timer[i].isActive() == True:
            self.timer[i].stop()
        self.setEnabledVoltageEdit(i,False)
        mes = QtCore.QString("<b>Exceptions:</b><br><br>")
        for k in range(0,lenExc):
            mes = mes + QtCore.QString("Exception"+str(k)+"<br>")
            mes = mes + QtCore.QString("<b>Reason</b>: " + str(exc.args[k].reason) + "<br>")
            mes = mes + QtCore.QString("<b>Description</b>: " + str(exc.args[k].desc) + "<br>")
            mes = mes + QtCore.QString("<b>Origin</b>: " + str(exc.args[k].origin) + "<br>")
            mes = mes + QtCore.QString("<br>")

        error = QtGui.QMessageBox(QtGui.QMessageBox.Critical,"Error",mes,buttons = QtGui.QMessageBox.Ok)
        error.exec_()


    def tempConsoleOut(self,i):
        # val = self.voltageValueSpinBox[i].value()
        # print i
        print "sds" + str(i)