예제 #1
0
    def __init__(self, parent, client, options):
        LokiPanelBase.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_ess/loki/gui/ui_files/sampleconf.ui'))
        self.sampleGroup.setEnabled(False)
        self.frame.setLayout(QVBoxLayout())

        self.sample_frame = QFrame(self)
        loadUi(
            self.sample_frame,
            findResource('nicos_ess/loki/gui/ui_files/sampleconf_summary.ui'))

        layout = self.frame.layout()
        layout.addWidget(self.sample_frame)
        self.sample_frame.hide()

        self.sample_frame.posTbl.setEnabled(False)

        for box in self.sample_frame.findChildren(QLineEdit):
            box.setEnabled(False)

        menu = QMenu(self)
        menu.addAction(self.actionEmpty)
        menu.addAction(self.actionGenerate)
        self.createBtn.setMenu(menu)

        self.configs = []
        self.holder_info = options.get('holder_info', [])
        self.instrument = options.get('instrument', 'loki')
        self.unapplied_changes = False
        self.applyBtn.setEnabled(False)
        self.initialise_connection_status_listeners()
예제 #2
0
 def __init__(self, parent, client):
     Cmdlet.__init__(self, parent, client,
                     findResource('nicos_mlz/poli/gui/centerpeak.ui'))
     self.multiList.entryAdded.connect(self.on_entryAdded)
     self.multiList.uifile = findResource(
         'nicos_mlz/poli/gui/centerpeak_one.ui')
     self.steps.valueChanged.connect(self.changed)
     self.stepsize.textChanged.connect(self.changed)
     self.func.currentIndexChanged.connect(self.changed)
     self.seconds.textChanged.connect(self.changed)
     self.rounds.valueChanged.connect(self.changed)
     self.contBox.toggled.connect(self.changed)
예제 #3
0
 def __init__(self, parent, client):
     Cmdlet.__init__(self, parent, client,
                     findResource('nicos_mlz/poli/gui/refinematrix.ui'))
     self._boxes = [
         self.aBox, self.bBox, self.cBox, self.aaBox, self.bbBox,
         self.ccBox, self.lamBox, self.dgBox, self.dnBox
     ]
     for box in self._boxes:
         box.editTextChanged.connect(self.changed)
     res = client.eval(
         'session.experiment.sample.cell.cellparams(), '
         'session.instrument.wavelength, '
         'session.instrument._attached_gamma.offset, '
         'session.instrument._attached_nu.offset', None)
     if res:
         params, lamda, dgamma, dnu = res
     self.aBox.addItem('%.4f' % params[0])
     self.bBox.addItem('%.4f' % params[1])
     self.cBox.addItem('%.4f' % params[2])
     self.aaBox.addItem('%.4f' % params[3])
     self.bbBox.addItem('%.4f' % params[4])
     self.ccBox.addItem('%.4f' % params[5])
     self.lamBox.addItem('%.4f' % lamda)
     self.dgBox.addItem('%.4f' % dgamma)
     self.dnBox.addItem('%.4f' % dnu)
     for box in (self.bBox, self.cBox):
         box.addItem('= a')
     for box in (self.bbBox, self.ccBox):
         box.addItem('= alpha')
     for box in self._boxes:
         box.addItem('free')
     self.acceptBox.toggled.connect(self.changed)
예제 #4
0
 def __init__(self, parent, client, **settings):
     QMainWindow.__init__(self, parent)
     DlgUtils.__init__(self, 'Instrument config')
     loadUi(self, findResource('nicos_mlz/kws1/gui/instrconfig.ui'))
     self.setWindowTitle('Reconfigure Instrument')
     self.client = client
     self.client.connected.connect(self.on_client_connected)
     self.client.disconnected.connect(self.on_client_disconnected)
     self._parts = settings['parts']
     self._widgets = []
     for (i, part) in enumerate(self._parts):
         label = QLabel(part + ':', self)
         bgrp = QButtonGroup(self)
         rbtn = QRadioButton('real', self)
         vbtn = QRadioButton('virtual', self)
         bgrp.addButton(rbtn)
         bgrp.addButton(vbtn)
         self.grid.addWidget(label, i, 0)
         self.grid.addWidget(rbtn, i, 1)
         self.grid.addWidget(vbtn, i, 2)
         self._widgets.append((label, bgrp, rbtn, vbtn))
     self.resize(self.sizeHint())
     if self.client.isconnected:
         self._update()
     else:
         self.frame.setDisabled(True)
예제 #5
0
    def on_addDevBtn_clicked(self):
        devlist = self.client.getDeviceList(
            'nicos.core.device.Moveable',
            special_clause='d.valuetype is float')
        devlist = [
            item for item in devlist
            if item.startswith(('sam_', 'hexapod_')) or '_sam_' in item
        ]
        dlg = dialogFromUi(
            self, findResource('nicos_mlz/kws1/gui/sampleconf_adddev.ui'))
        dlg.widget = None

        def callback(index):
            devname = devlist[index]
            if dlg.widget:
                dlg.widget.deleteLater()
                dlg.valueFrame.layout().takeAt(0)
            dlg.widget = typedvalue.DeviceValueEdit(dlg, dev=devname)
            dlg.widget.setClient(self.client)
            dlg.valueFrame.layout().insertWidget(0, dlg.widget)

        dlg.devBox.currentIndexChanged.connect(callback)
        dlg.devBox.addItems(devlist)
        if not dlg.exec_():
            return
        self._addRow(dlg.devBox.currentText(), str(dlg.widget.getValue()))
예제 #6
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/kws1/gui/sampleconf.ui'))
        self.sampleGroup.setEnabled(False)
        self.frame.setLayout(QVBoxLayout())

        menu = QMenu(self)
        menu.addAction(self.actionCopyAperture)
        menu.addAction(self.actionCopyDetOffset)
        menu.addAction(self.actionCopyThickness)
        menu.addAction(self.actionCopyTimeFactor)
        menu.addSeparator()
        menu.addAction(self.actionCopyAll)
        self.copyBtn.setMenu(menu)

        menu = QMenu(self)
        menu.addAction(self.actionEmpty)
        menu.addAction(self.actionGenerate)
        self.createBtn.setMenu(menu)

        self.configs = []
        self.dirty = False
        self.filename = None
        self.holder_info = options.get('holder_info', [])
        self.instrument = options.get('instrument', 'kws1')
예제 #7
0
    def __init__(self, parent, client, instrument, configs, config=None):
        QDialog.__init__(self, parent)
        self.instrument = instrument
        self.configs = configs
        self.client = client
        self.setWindowTitle('Sample configuration')
        layout = QVBoxLayout()
        self.frm = QFrame(self)
        loadUi(self.frm,
               findResource('nicos_ess/loki/gui/ui_files/sampleconf_one.ui'))
        self.frm.addDevBtn.clicked.connect(self.on_addDevBtn_clicked)
        self.frm.delDevBtn.clicked.connect(self.on_delDevBtn_clicked)
        self.frm.readDevsBtn.clicked.connect(self.on_readDevsBtn_clicked)
        box = QDialogButtonBox(self)
        box.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        box.accepted.connect(self.maybeAccept)
        box.rejected.connect(self.reject)
        layout.addWidget(self.frm)
        layout.addWidget(box)
        self.setLayout(layout)
        self.frm.thickBox.setValidator(DoubleValidator(self))
        if config is not None:
            configToFrame(self.frm, config)

        # Apply local customisations to the stylesheet
        self.setStyleSheet(ConfigEditDialog_QSS)

        if not config:
            self.frm.whatLbl.setText('New sample configuration')
예제 #8
0
파일: exp_panel.py 프로젝트: ess-dmsc/nicos
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self,
               findResource('nicos_ess/gui/panels/ui_files/exp_panel.ui'))

        self.old_proposal_settings = ProposalSettings()
        self.new_proposal_settings = deepcopy(self.old_proposal_settings)

        self.samples_model = SamplesModel()
        self.samples_model.data_updated.connect(self.on_samples_changed)
        self.sampleTable.setModel(self.samples_model)
        self.sampleTable.horizontalHeader().setSectionResizeMode(
            QHeaderView.Interactive)

        self.applyWarningLabel.setStyleSheet('color: red')
        self.applyWarningLabel.setVisible(False)
        self.discardButton.setVisible(False)

        self._text_controls = (self.expTitle, self.users, self.localContacts,
                               self.proposalNum, self.proposalQuery)

        self.hide_samples = options.get('hide_sample', False)
        if self.hide_samples:
            self._hide_sample_info()

        self.initialise_connection_status_listeners()
예제 #9
0
 def on_readDevsBtn_clicked(self):
     dlg = dialogFromUi(self, findResource(
         'nicos_mlz/kws1/gui/sampleconf_readpos.ui'))
     if self.instrument == 'kws1':
         dlg.kws3Box.hide()
     elif self.instrument == 'kws2':
         dlg.kws3Box.hide()
         dlg.hexaBox.hide()
     elif self.instrument == 'kws3':
         dlg.rotBox.hide()
         dlg.transBox.hide()
         dlg.hexaBox.hide()
         dlg.kws3Box.setChecked(True)
     if not dlg.exec_():
         return
     if dlg.rotBox.isChecked():
         self._addRow('sam_rot', self._readDev('sam_rot'))
     if dlg.transBox.isChecked():
         self._addRow('sam_trans_x', self._readDev('sam_trans_x'))
         self._addRow('sam_trans_y', self._readDev('sam_trans_y'))
     if dlg.hexaBox.isChecked():
         for axis in ('dt', 'tx', 'ty', 'tz', 'rx', 'ry', 'rz'):
             self._addRow('hexapod_' + axis,
                          self._readDev('hexapod_' + axis))
     if dlg.kws3Box.isChecked():
         self._addRow('sam_x', self._readDev('sam_x'))
         self._addRow('sam_y', self._readDev('sam_y'))
예제 #10
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/kws1/gui/protocol.ui'))

        self.firstEdit.setShadowText('default: all')
        self.lastEdit.setShadowText('default: all')
        self.fontBox.setValue(self.outText.font().pointSize())
예제 #11
0
    def __init__(self, parent, client, options):
        LokiPanelBase.__init__(self, parent, client, options)
        self.parent = parent
        self.options = options
        loadUi(self, findResource('nicos_ess/loki/gui/ui_files/exp_config.ui'))

        self.holder_info = options.get('holder_info', [])
        self.instrument = options.get('instrument', 'loki')
        self.initialise_connection_status_listeners()
        self.initialise_markups()

        self.envComboBox.addItems([_changer for _changer in SAMPLE_CHANGERS])
        # Start with a "no item", ie, empty selection.
        self.envComboBox.setCurrentIndex(-1)

        self.descriptionGroupBox.setVisible(False)
        self.settingsGroupBox.setVisible(False)

        self.envComboBox.activated.connect(self._activate_environment_settings)

        # Listen to changes in Aperture and Detector Offset values
        self.listen_instrument_settings()

        # Disable apply buttons in both settings until an action taken by the
        # user.
        self.sampleSetApply.setEnabled(False)
        self.instSetApply.setEnabled(False)
예제 #12
0
    def initUi(self):
        with waitCursor():
            loadUi(self, findResource('nicos_mlz/puma/gui/polarisation.ui'))

        valid = QDoubleValidator()

        for f in (self.kf, self.alpha0, self.eta, self.gamma1, self.gamma2,
                  self.bA, self.dA, self.LSA, self.LSD1, self.LSD2, self.LPSD,
                  self.LAD, self.R, self.L, self.d, self.bS, self.psdwidth,
                  self.bD, self.theta05, self.theta06, self.theta07, self.x05,
                  self.x06, self.x07, self.y05, self.y06, self.y07, self.ta5,
                  self.ta6, self.ta7, self.rd5, self.rd6, self.rd7, self.rg5,
                  self.rg6, self.rg7, self.PSDintUp, self.PSDintDown,
                  self.IgesUp, self.IgesDown, self.fractionUp,
                  self.fractionDown, self.I5Up, self.I5Down, self.I6Up,
                  self.I6Down, self.I7Up, self.I7Down, self.ratioUp,
                  self.ratioDown, self.Dplus, self.Dminus, self.x05_cur,
                  self.x06_cur, self.x07_cur, self.ta5_cur, self.ta6_cur,
                  self.ta7_cur, self.rd5_cur, self.rd6_cur, self.rd7_cur,
                  self.rg5_cur, self.rg6_cur, self.rg7_cur, self.theta05_cur,
                  self.theta06_cur, self.theta07_cur):
            f.setValidator(valid)
            f.setReadOnly(True)

        for b in (self.buttonRecall, self.buttonOK, self.buttonCancel,
                  self.buttonOptimize, self.label_187, self.label_18,
                  self.label_20, self.label_21, self.x05, self.x06, self.x07,
                  self.x05_cur, self.x06_cur, self.x07_cur, self.progress):
            b.hide()

        self.plot1 = IntensityPlot('up', self.plotWidget1)
        self.plot2 = IntensityPlot('down', self.plotWidget2)
        self.plot3 = TransmissionPlot('up', self.plotWidget3)
        self.plot4 = TransmissionPlot('down', self.plotWidget4)
예제 #13
0
    def on_addDevBtn_clicked(self):
        dev_list = self.client.getDeviceList('nicos.core.device.Moveable',
                                             only_explicit=False)
        # Only get the sample changer related motors
        dev_list = [
            item for item in dev_list
            if item.startswith('sc_') and 'motor' in item
        ]
        dlg = dialogFromUi(
            self,
            findResource('nicos_ess/loki/gui/ui_files/sampleconf_adddev.ui'))
        dlg.widget = None

        def callback(index):
            dev_name = dev_list[index]
            if dlg.widget:
                dlg.widget.deleteLater()
                dlg.valueFrame.layout().takeAt(0)
            dlg.widget = typedvalue.DeviceValueEdit(dlg, dev=dev_name)
            dlg.widget.setClient(self.client)
            dlg.valueFrame.layout().insertWidget(0, dlg.widget)

        dlg.devBox.currentIndexChanged.connect(callback)
        dlg.devBox.addItems(dev_list)
        if not dlg.exec_():
            return
        if dlg.widget is not None:
            self._addRow(dlg.devBox.currentText(), str(dlg.widget.getValue()))
예제 #14
0
    def __init__(self, parent, client, options):
        LokiPanelBase.__init__(self, parent, client, options)
        loadUi(
            self,
            findResource('nicos_ess/loki/gui/ui_files/loki_scriptbuilder.ui'))

        self.window = parent
        self.duration_options = ['Mevents', 'seconds', 'frames']

        self.permanent_columns = {
            'position': 'Position',
            'sample': 'Sample',
            'thickness': 'Thickness\n(mm)',
            'trans_duration': 'TRANS Duration',
            'sans_duration': 'SANS Duration'
        }

        self.optional_columns = {
            'temperature': ('Temperature', self.chkShowTempColumn),
            'pre-command': ('Pre-command', self.chkShowPreCommand),
            'post-command': ('Post-command', self.chkShowPostCommand)
        }
        # Set up trans order combo-box
        self.comboTransOrder.addItems(self._available_trans_options.keys())

        self.columns_in_order = list(self.permanent_columns.keys())
        self.columns_in_order.extend(self.optional_columns.keys())
        self.last_save_location = None
        self._init_table_panel()
        self._init_right_click_context_menu()
예제 #15
0
 def __init__(self, parent, client, instrument, configs, config=None):
     QDialog.__init__(self, parent)
     self.instrument = instrument
     self.configs = configs
     self.client = client
     self.setWindowTitle('Sample configuration')
     layout = QVBoxLayout()
     self.frm = QFrame(self)
     loadUi(self.frm, findResource('nicos_mlz/kws1/gui/sampleconf_one.ui'))
     self.frm.addDevBtn.clicked.connect(self.on_addDevBtn_clicked)
     self.frm.delDevBtn.clicked.connect(self.on_delDevBtn_clicked)
     self.frm.readDevsBtn.clicked.connect(self.on_readDevsBtn_clicked)
     self.frm.readApBtn.clicked.connect(self.on_readApBtn_clicked)
     box = QDialogButtonBox(self)
     box.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
     box.accepted.connect(self.maybeAccept)
     box.rejected.connect(self.reject)
     layout.addWidget(self.frm)
     layout.addWidget(box)
     self.setLayout(layout)
     for box in [self.frm.offsetBox, self.frm.thickBox, self.frm.factorBox,
                 self.frm.apXBox, self.frm.apYBox, self.frm.apWBox,
                 self.frm.apHBox]:
         box.setValidator(DoubleValidator(self))
     if config is not None:
         configToFrame(self.frm, config)
예제 #16
0
    def fromfile(cls, filename):
        ndim = 254
        ndet = 80
        sizes = (ndet, ndim)
        corrData = DataParser.ReadCorrectionFile(
            findResource(cls.correctionfile))
        with open(filename, 'r', encoding='utf-8') as f:
            if not f.readline().startswith('QMesyDAQ CARESS Histogram File'):
                raise NicosError('File is not a CARESS histogram file.')
            for line in f:
                if line.startswith('Resosteps'):
                    resosteps = int(line.split()[1])
                elif line.startswith('2Theta start'):
                    startpos = float(line.split()[2])
                elif line.startswith('Comment'):
                    for p in line.replace(' = ', '=').replace(' x ',
                                                              'x').split()[1:]:
                        k, v = p.split('=')
                        if k == 'detsampledist':
                            detsampledist = float(v)
            thetaRaw = DataParser.ThetaInitial(startpos, resosteps, ndet)
            thetaCorr = DataParser.ThetaModified(thetaRaw, corrData, resosteps,
                                                 ndet)

        data = DataParser.CaressFormat(filename, sizes[1], sizes[0])[-1]
        return np.sum(DataParser.RingStraight(
            thetaCorr, thetaRaw,
            DataParser.VertCalibIntensCorr(data, corrData, resosteps, ndet,
                                           ndim), resosteps, ndet, ndim,
            detsampledist),
                      axis=1)
예제 #17
0
    def __init__(self, measmode, wavelength, header_labels, current_table,
                 client, parent):
        QDialog.__init__(self, parent)
        loadUi(self, findResource('nicos_mlz/gui/tunewavetablepreviewdlg.ui'))

        self._client = client
        self._measmode = measmode
        self._wavelength = float(wavelength)
        self._header_labels = header_labels
        self._current_table = current_table
        self._shown_table = None

        self._history = {}  # {datetime: table}

        self.measmodeLabel.setText(measmode)
        self.wavelengthLabel.setText(wavelength)
        self.timeline = TimelineWidget()
        self.horizontalLayout.insertWidget(0, self.timeline)

        self.tableWidget.setColumnCount(len(self._header_labels))
        self.tableWidget.setHorizontalHeaderLabels(self._header_labels)

        self.fromDateTimeEdit.setDateTime(
            QDateTime.currentDateTime().addMonths(-1))
        self.toDateTimeEdit.setDateTime(QDateTime.currentDateTime())

        self.fromDateTimeEdit.dateTimeChanged.connect(self.update_timeline)
        self.toDateTimeEdit.dateTimeChanged.connect(self.update_timeline)
        self.timeline.timepointSelected.connect(self.update_table)
        self.diffNoneRadioButton.toggled.connect(self.update_table)
        self.diffCurrentRadioButton.toggled.connect(self.update_table)
        self.diffPreviousRadioButton.toggled.connect(self.update_table)

        self.update_timeline()
예제 #18
0
class IFFSamplePanel(GenericSamplePanel):
    """Provides the sample ID required for the IFF sample database."""

    panelName = 'IFF sample setup'
    uiName = findResource('nicos_jcns/gui/setup_iffsample.ui')

    def getEditBoxes(self):
        return [self.samplenameEdit, self.sampleidEdit]
예제 #19
0
    def initUi(self):
        loadUi(self, findResource('nicos_mlz/refsans/gui/resolutionpanel.ui'))

        valid = QDoubleValidator()

        for f in (self.chSpeed, self.phase2, self.phase3, self.phase4,
                  self.phase5, self.phase6):
            f.setValidator(valid)
            f.setReadOnly(True)
예제 #20
0
 def __init__(self, parent):
     QDialog.__init__(self, parent)
     loadUi(self, findResource('nicos_ess/loki/gui/ui_files/rtconfig.ui'))
     self.progBox.setValidator(DoubleValidator(self))
     self.chanBox.valueChanged.connect(self._update_time)
     self.intervalBox.valueChanged.connect(self._update_time)
     self.intervalUnitBox.currentIndexChanged.connect(self._update_time)
     self.linBtn.toggled.connect(self._update_time)
     self.progBtn.toggled.connect(self._update_time)
     self.progBox.textChanged.connect(self._update_time)
예제 #21
0
 def __init__(self, parent, client, options, frame):
     LokiPanelBase.__init__(self, parent, client, options)
     self.client = client
     self.frame = frame
     loadUi(self.frame, findResource('nicos_ess/loki/gui/'
                                     'ui_files/sample_changers/'
                                     'thermo_cell_holder_settings.ui'))
     self.initialise_validators()
     self.frame.cartridgeSettings.clicked.connect(
         self._active_holder_position_settings)
예제 #22
0
    def __init__(self, parent, client, devs):
        self.client = client
        self.devs = devs
        QWidget.__init__(self, parent)
        loadUi(self, findResource('nicos_mlz/kws1/gui/devices_one.ui'))

        self.table.setColumnCount(len(devs))
        self.table.setHorizontalHeaderLabels(devs)
        self._edit = None
        self._rows = []
예제 #23
0
    def __init__(self, parent, _client, **_kwds):
        QMainWindow.__init__(self, parent)
        DlgUtils.__init__(self, 'Hexapod')

        # set during actions that will call signal handlers
        self.recursive = False

        loadUi(self, findResource('nicos_mlz/kws1/gui/tools/hexapod.ui'))

        for but in (self.butStart, self.butSetWorkspace, self.butSetFrame,
                    self.butSaveVel):
            but.setEnabled(False)

        self.axes = {}
        self.axeslist = []

        try:
            self._controller = PyTango.DeviceProxy(TANGO_DEV_BASE +
                                                   'controller')
            # make sure the server is running and create remaining proxies
            try:
                self._controller.State()
            except AttributeError:
                raise Exception('server appears to be not running')
            for axis in AXES:
                self.axes[axis] = PyTango.DeviceProxy(TANGO_DEV_BASE + axis)
                self.axeslist.append(self.axes[axis])
        except Exception as err:
            self.showError('could not connect to tango server: %s' % err)
            self.deleteLater()
            return

        self.on_cbsWorkspace_activated(0)
        self.on_cbsFrame_activated(self.cbsFrame.currentText())

        tx_speed = self.query_attr(self.axes['tx'], 'speed')
        self.inpVelTrans.setValue(tx_speed)
        self.lblVelTrans.setText(self.inpVelTrans.text())
        self.inpVelRot.setValue(self.query_attr(self.axes['rx'], 'speed'))
        self.lblVelRot.setText(self.inpVelRot.text())
        self.inpVelOmega.setValue(self.query_attr(self.axes['omega'], 'speed'))
        self.lblVelOmega.setText(self.inpVelOmega.text())

        # ramp time = speed / acceleration
        self.inpRampUp.setValue(tx_speed /
                                self.query_attr(self.axes['tx'], 'accel'))
        self.lblRampUp.setText(self.inpRampUp.text())
        self.inpRampDown.setValue(tx_speed /
                                  self.query_attr(self.axes['tx'], 'decel'))
        self.lblRampDown.setText(self.inpRampDown.text())

        self.updTimer = QTimer()
        self.updTimer.timeout.connect(self.updateTimer)
        self.updTimer.start(1000)
예제 #24
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/pgaa/gui/panels/tomography.ui'))

        self.current_status = None
        self.run_color = QColor('#ffdddd')
        self.idle_color = parent.user_color

        client.connected.connect(self.on_client_connected)
        client.message.connect(self.on_client_message)
        client.status.connect(self.on_client_initstatus)
        client.mode.connect(self.on_client_mode)
예제 #25
0
파일: generic.py 프로젝트: umithardal/nicos
 def __init__(self, parent, client, options):
     Panel.__init__(self, parent, client, options)
     self._error_window = None
     if 'uifile' not in options:
         raise ConfigurationError('GenericPanels require at least an'
                                  ' `uifile` option.')
     loadUi(self, findResource(options['uifile']))
     if options.get('showmsg'):
         self.client.message.connect(self.on_client_message)
     if client.isconnected:
         self.on_client_connected()
     client.connected.connect(self.on_client_connected)
예제 #26
0
 def __init__(self, parent, client):
     Cmdlet.__init__(self, parent, client,
                     findResource('nicos_mlz/dns/gui/cmdlets/slit_scan.ui'))
     for box in self.slits + ['open_at_begin']:
         getattr(self, 'cB_' + box).stateChanged.connect(self.changed)
     for rb in ['RB_sample', 'RB_polarizer']:
         getattr(self, rb).toggled.connect(self._slitTypeChanged)
     for dsb in self.slits:
         for field in ['from', 'stepsize', 'number_of_steps']:
             dsb_obj = getattr(self, 'dSB_{}_{}'.format(dsb, field))
             dsb_obj.valueChanged.connect(self._calcEnd)
     self._slitTypeChanged()
예제 #27
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/toftof/gui/safety.ui'))

        self.table.horizontalHeader().restoreState(self._headerstate)
        self.clear()

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)
        client.disconnected.connect(self.on_client_disconnected)
        client.cache.connect(self.on_client_cache)
예제 #28
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/gui/plcpanel.ui'))
        self._curdev = None
        self._changed_pars = {}
        self._in_reread = False

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.device.connect(self.on_client_device)

        self.controlBox.setEnabled(False)
예제 #29
0
 def __init__(self, parent, client):
     Cmdlet.__init__(self, parent, client,
                     findResource('nicos_mlz/maria/gui/kscan.ui'))
     self.device.addItems(self._getDeviceList('hasattr(d, "speed")'))
     self.on_device_change(self.device.currentText())
     self.device.currentIndexChanged[str].connect(self.on_device_change)
     self.start.setValidator(DoubleValidator(self))
     self.step.setValidator(DoubleValidator(self))
     self.speed.setValidator(DoubleValidator(self))
     self.start.textChanged.connect(self.on_range_change)
     self.step.textChanged.connect(self.on_range_change)
     self.speed.textChanged.connect(self.on_range_change)
     self.numpoints.valueChanged.connect(self.on_range_change)
예제 #30
0
파일: live.py 프로젝트: umithardal/nicos
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/mira/gui/live.ui'))

        self._format = None
        self._runtime = 0
        self._no_direct_display = False
        self._range_active = False

        self.statusBar = QStatusBar(self)
        policy = self.statusBar.sizePolicy()
        policy.setVerticalPolicy(QSizePolicy.Fixed)
        self.statusBar.setSizePolicy(policy)
        self.statusBar.setSizeGripEnabled(False)
        self.layout().addWidget(self.statusBar)

        if CascadeWidget:
            self.widget = CascadeWidget(self)
            self.widget.setContextMenuPolicy(Qt.CustomContextMenu)
            self.widgetLayout.addWidget(self.widget)
        else:
            raise RuntimeError('The Cascade live widget is not available')

        self.rangeFrom = QDoubleSpinBox(self)
        self.rangeTo = QDoubleSpinBox(self)
        for ctrl in [self.rangeFrom, self.rangeTo]:
            ctrl.setRange(0, 100000000)
            ctrl.setEnabled(False)
            ctrl.setMaximumWidth(90)
            ctrl.setSizePolicy(
                QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
            ctrl.valueChanged.connect(self.on_rangeChanged)

        self.liveitem = QListWidgetItem('<Live>', self.fileList)
        self.liveitem.setData(32, '')
        self.liveitem.setData(33, '')

        self.splitter.setSizes([20, 80])
        self.splitter.restoreState(self.splitterstate)

        client.livedata.connect(self.on_client_livedata)
        client.liveparams.connect(self.on_client_liveparams)
        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)

        self.actionLogScale.toggled.connect(self.widget.SetLog10)
        self.actionSelectChannels.triggered.connect(self.widget.showSumDlg)
        self.widget.customContextMenuRequested.connect(
            self.on_widget_customContextMenuRequested)