Ejemplo n.º 1
0
    def setupUi(self, Form):
        Form.setObjectName("QRangeSlider")
        Form.resize(300, 30)
        Form.setStyleSheet(DEFAULT_CSS)
        self.gridLayout = QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self._splitter = QSplitter(Form)
        self._splitter.setMinimumSize(QSize(0, 0))
        self._splitter.setMaximumSize(QSize(16777215, 16777215))
        self._splitter.setOrientation(Qt.Horizontal)
        self._splitter.setObjectName("splitter")
        self._head = QGroupBox(self._splitter)
        self._head.setTitle("")
        self._head.setObjectName("Head")
        self._handle = QGroupBox(self._splitter)
        self._handle.setTitle("")
        self._handle.setObjectName("Span")
        self._tail = QGroupBox(self._splitter)
        self._tail.setTitle("")
        self._tail.setObjectName("Tail")
        self.gridLayout.addWidget(self._splitter, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QMetaObject.connectSlotsByName(Form)
Ejemplo n.º 2
0
 def __init__(self,
              parent,
              types,
              curvalue,
              client,
              allow_enter=False,
              valinfo=None):
     QWidget.__init__(self, parent)
     layout = self._layout = QGridLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     self._widgets = []
     if valinfo is not None:
         for i, info in enumerate(valinfo):
             layout.addWidget(QLabel(info.name), 0, i)
     for i, (typ, val) in enumerate(zip(types, curvalue)):
         widget = create(self,
                         typ,
                         val,
                         client=client,
                         allow_enter=allow_enter)
         self._widgets.append(widget)
         widget.valueModified.connect(self.valueModified)
         if allow_enter:
             widget.valueChosen.connect(
                 lambda val: self.valueChosen.emit(self.getValue()))
         layout.addWidget(widget, 1, i)
     self.setLayout(layout)
Ejemplo n.º 3
0
class PGAIWidget(QWidget):
    """Widget to rotate the measurement cells and space cell."""

    maxrot = 95

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.gridLayout = QGridLayout(self)
        self.widget = GLWidget(self)
        self.gridLayout.addWidget(self.widget, 0, 0, 1, 1)

        self.verticalScrollBar = QScrollBar(self)
        self.verticalScrollBar.setOrientation(Qt.Vertical)
        self.verticalScrollBar.setMinimum(-self.maxrot)
        self.verticalScrollBar.setMaximum(self.maxrot)
        self.verticalScrollBar.setValue(0)

        self.gridLayout.addWidget(self.verticalScrollBar, 0, 1, 1, 1)

        self.horizontalScrollBar = QScrollBar(self)
        self.horizontalScrollBar.setOrientation(Qt.Horizontal)
        self.horizontalScrollBar.setMinimum(-self.maxrot)
        self.horizontalScrollBar.setMaximum(self.maxrot)

        self.gridLayout.addWidget(self.horizontalScrollBar, 1, 0, 1, 1)
        self.verticalScrollBar.valueChanged.connect(self.widget.rotateX)
        self.horizontalScrollBar.valueChanged.connect(self.widget.rotateY)
        self.horizontalScrollBar.setValue(20)
Ejemplo n.º 4
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.gridLayout = QGridLayout(self)
        self.widget = GLWidget(self)
        self.gridLayout.addWidget(self.widget, 0, 0, 1, 1)

        self.verticalScrollBar = QScrollBar(self)
        self.verticalScrollBar.setOrientation(Qt.Vertical)
        self.verticalScrollBar.setMinimum(-self.maxrot)
        self.verticalScrollBar.setMaximum(self.maxrot)
        self.verticalScrollBar.setValue(0)

        self.gridLayout.addWidget(self.verticalScrollBar, 0, 1, 1, 1)

        self.horizontalScrollBar = QScrollBar(self)
        self.horizontalScrollBar.setOrientation(Qt.Horizontal)
        self.horizontalScrollBar.setMinimum(-self.maxrot)
        self.horizontalScrollBar.setMaximum(self.maxrot)

        self.gridLayout.addWidget(self.horizontalScrollBar, 1, 0, 1, 1)
        self.verticalScrollBar.valueChanged.connect(self.widget.rotateX)
        self.horizontalScrollBar.valueChanged.connect(self.widget.rotateY)
        self.horizontalScrollBar.setValue(20)
Ejemplo n.º 5
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/pgaa/gui/panels/pgaaposition.ui'))

        self.motorslide = DevSlider(client, 'sc', 1, 16, parent=self)
        self.motorslide.setParent(self.MotorGroup)
        self.motorslide.setOrientation(Qt.Horizontal)
        self.motorslide.setGeometry(10, 60, 221, 22)
        self.motorval = MotorValue(client, self)
        self.motorval.setParent(self.MotorGroup)
        self.motorval.setGeometry(10, 30, 221, 23)
        self.press = VacuumView(client, self)
        self.PressureLayout.addWidget(self.press)

        self.shutterled = Led('shutter', 'open', 'closed', client)
        self.shutterled.resize(51, 31)
        gl = QGridLayout()
        gl.addWidget(self.shutterled, 0, 0)
        self.BeamBox.setLayout(gl)

        self.pushmover = PushSlider(client, 'push', parent=self)
        self.pushmover.setParent(self.MotorGroup)
        self.pushmover.setOrientation(Qt.Vertical)
        self.pushmover.setGeometry(240, 25, 22, 51)

        self.ellcol = ElCol(client)
        gl = QGridLayout()
        self.ellcol.resize(51, 32)
        gl.addWidget(self.ellcol, 0, 0)
        self.EllColGroup.setLayout(gl)

        self.attenuatorLed1 = Led('att1',
                                  'in',
                                  'out',
                                  client,
                                  colorActive='blue',
                                  colorInactive='yellow')
        self.AttLayout.addWidget(self.attenuatorLed1)
        self.attenuatorLed2 = Led('att2',
                                  'in',
                                  'out',
                                  client,
                                  colorActive='blue',
                                  colorInactive='yellow')
        self.AttLayout.addWidget(self.attenuatorLed2)
        self.attenuatorLed3 = Led('att3',
                                  'in',
                                  'out',
                                  client,
                                  colorActive='blue',
                                  colorInactive='yellow')
        self.AttLayout.addWidget(self.attenuatorLed3)

        self.filenum = FileNum(client)
        self.filenum.setMaximumWidth(70)
        self.CountLayout.addWidget(self.filenum)

        self.active_table = TableWidget(
            QueueSource(client, self, startwidg=self.startQ),
            QueueSource.column_order, self)
        self.active_table.setSelectionMode(QAbstractItemView.SingleSelection)
        self.active_table.handle_drop = self.active_table.source.insert_new
        self.active_table.rearrange = self.active_table.source.rearrange
        self.active_table.keypress = self.active_table.source.keypress
        self.active_table.horizontalHeader().hide()
        self.queueLayout.addWidget(self.active_table)

        self.log_table = TableWidget(LogSource(client, self), Log.column_order,
                                     self)
        self.log_table.setAcceptDrops(False)
        self.log_table.setSelectionMode(QAbstractItemView.SingleSelection)
        self.logLayout.addWidget(self.log_table)

        self.pattern_table = TableWidget(Template(client, self),
                                         Row.column_order, self)
        self.pattern_table.setAcceptDrops(False)
        self.pattern_table.keypress = self.pattern_table.source.keypress
        self.templateLayout.addWidget(self.pattern_table)

        self.tracker = ProgressTracker(client, self, self.Name, self.Comment,
                                       self.finish, self.suffixView,
                                       self.stopBy, self.atAfter)

        self.setAcceptDrops(True)

        if client.isconnected:
            self.on_client_connected()
        self.queue_data = None
        client.status.connect(self.on_status)
Ejemplo n.º 6
0
 def _queryDetails(self):
     dlg = QDialog(self)
     dlg.setWindowTitle('Login details for ticket tracker required')
     layout = QGridLayout()
     layout.addWidget(QLabel('Please enter details for the ticket tracker. '
                             'You can contact the instrument control group '
                             'for help.', dlg))
     layout.addWidget(QLabel('Instrument name:', dlg))
     instrBox = QLineEdit(self.instrument, dlg)
     instrBox.setEnabled(self.instrument != 'none')
     layout.addWidget(instrBox)
     noinstrBox = QCheckBox('No instrument', dlg)
     noinstrBox.setChecked(self.instrument == 'none')
     noinstrBox.toggled.connect(lambda c: instrBox.setEnabled(not c))
     layout.addWidget(noinstrBox)
     layout.addWidget(QLabel('Username:'******'Password:'******'Login successful.  Your API key has been stored '
                       'for further reports.')
         settings = QSettings('nicos', 'secrets')
         settings.beginGroup('Redmine')
         if noinstrBox.isChecked():
             self.instrument = 'none'
         else:
             self.instrument = instrBox.text()
         self.apikey = apikey
         self.username = userBox.text()
         settings.setValue('instrument', self.instrument)
         settings.setValue('apikey', self.apikey)
         settings.setValue('username', self.username)
         if not self.instrument or not self.apikey:
             return False
         self.titleLabel.setText(
             'Submit a ticket for instrument "%s" (as user %s)'
             % (self.instrument, self.username))
         return True