Пример #1
0
 def on_client_connected(self):
     with waitCursor():
         missed_devices = []
         for d in ('def1', 'polcol', 'man', 'med'):
             self.client.eval('%s.pollParam()', None)
             params = self.client.getDeviceParams(d)
             for p, v in params.items():
                 self._update_key('%s/%s' % (d, p), v)
         for d in ('ra5', 'ra6', 'ra7', 'ta5', 'ta6', 'ta7', 'rd5', 'rd6',
                   'rd7', 'rg5', 'rg6', 'rg7', 'rd5_cad', 'rd6_cad',
                   'rd7_cad', 'lsa', 'lsd1', 'lsd2', 'lad', 'lpsd', 'kf',
                   'def1', 'def2', 'slit2.width'):
             try:
                 self.log.debug('poll: %s', d)
                 self.client.eval("session.getDevice('%s').poll()" % d)
                 val = self.client.getDeviceValue('%s' % d)
                 self._update_key('%s/value' % d, val)
                 self.log.debug('%s/%s', d, val)
             except (NicosError, NameError):
                 missed_devices += [d]
     if not missed_devices:
         self.recalculate()
         for w in (self.kf, self.LSA, self.LSD1, self.LSD1, self.gamma1,
                   self.gamma2, self.LAD, self.bA, self.bD, self.bS):
             w.textChanged.connect(self.recalculate)
     else:
         QMessageBox.warning(
             self.parent().parent(), 'Error',
             'The following devices are not available:<br>'
             "'%s'" % ', '.join(missed_devices))
         self.setDisabled(True)
Пример #2
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)
Пример #3
0
 def showData(self):
     idx = self.fileList.currentRow()
     if idx == -1:
         return
     with waitCursor():
         data = self.getDataFromItem(self.fileList.item(idx))
         data = self._showHistogram(data)
     LiveDataPanel._show(self, data)
Пример #4
0
    def initUi(self):
        with waitCursor():
            loadUi(self,
                   findResource('nicos_mlz/toftof/gui/resolutionpanel.ui'))

            valid = QDoubleValidator()

            for f in (self.E_neutron, self.Q0_min, self.Q0_max, self.dE_max,
                      self.dE_el):
                f.setValidator(valid)
                f.setReadOnly(True)

            self.plot1 = DynamicRangePlot(self.drPlot)
            self.plot2 = ElasticResolutionPlot(self.erPlot)
            self.plot3 = ResolutionPlot(self.rPlot)
Пример #5
0
 def on_client_connected(self):
     with waitCursor():
         missed_devices = []
         for d in ('chSpeed', 'chRatio', 'chWL', 'chST'):
             try:
                 self.client.eval('%s.pollParam()', None)
                 params = self.client.getDeviceParams(d)
                 for p, v in params.items():
                     self._update_key('%s/%s' % (d, p), v)
             except (NicosError, NameError):
                 missed_devices += [d]
     if not missed_devices:
         self.recalculate()
     else:
         QMessageBox.warning(self.parent().parent(), 'Error',
                             'The following devices are not available:<br>'
                             "'%s'" % ', '.join(missed_devices))
         self.buttonBox.removeButton(
             self.buttonBox.button(QDialogButtonBox.Apply))