class ExposeCmd(CustomedCmd): def __init__(self, controlPanel): CustomedCmd.__init__(self, controlPanel=controlPanel, buttonLabel='EXPOSE') self.exptime = DoubleSpinBoxGB('Exptime', 1, 10000, 1) self.comboShut = ComboBox() self.comboShut.addItems(['', 'blue', 'red']) self.addWidget(self.exptime, 0, 1) self.addWidget(self.comboShut, 0, 2) def buildCmd(self): cmdStr = '%s shutters expose exptime=%.1f %s' % ( self.controlPanel.actorName, self.exptime.getValue(), self.comboShut.currentText()) return cmdStr
class MoveCmd(CustomedCmd): limits = dict(penta=(-450, 450), detector=(0, 12)) def __init__(self, controlPanel, stage): CustomedCmd.__init__(self, controlPanel, buttonLabel='MOVE') self.stage = stage l_bound, u_bound = MoveCmd.limits[stage] self.combo = ComboBox() self.combo.addItems(['abs', 'rel']) self.distSpinbox = DoubleSpinBoxGB('Dist', l_bound, u_bound, 3) self.addWidget(self.combo, 0, 1) self.addWidget(self.distSpinbox, 0, 2) def buildCmd(self): reference = '' if self.combo.currentText( ) == 'rel' else self.combo.currentText() cmdStr = 'sac move %s=%.2f %s' % ( self.stage, self.distSpinbox.getValue(), reference) return cmdStr
class TempLoopCmd(CustomedCmd): def __init__(self, controlPanel): CustomedCmd.__init__(self, controlPanel, buttonLabel='SET Temperature', safetyCheck=True) self.value = DoubleSpinBoxGB('setpoint(K)', 50, 250, 2) self.addWidget(self.value, 0, 1) def buildCmd(self): return f'{self.controlPanel.actorName} {self.controlPanel.controllerName} on setpoint=%g' % self.value.getValue( )
def __init__(self, controlPanel): CustomedCmd.__init__(self, controlPanel, buttonLabel='MOVE') self.distSpinbox = DoubleSpinBoxGB('Relative(mm)', *self.limits) self.addWidget(self.distSpinbox, 0, 1)