def setModel(self, model): TaurusWidget.setModel(self, model) if model: m = self.getModelObj() self.down_command = getattr(m, self._down_command) self.up_command = getattr(m, self._up_command) self.state = m.getAttribute("State") self.state.addListener(self.handle_state_event) else: if self.state: self.state.removeListener(self.handle_state_event)
def setModel(self, circuit): print "MagnetListPanel setModel", circuit TaurusWidget.setModel(self, circuit) db = PyTango.Database() if circuit: magnets = db.get_device_property(circuit, "MagnetProxies")["MagnetProxies"] if "SQF" in magnets[0]: self.table.setModel(magnets, ["State", "TemperatureInterlock", "shuntResistance"]) else: self.table.setModel(magnets, ["State", "TemperatureInterlock"]) else: self.table.setModel(None)
class Ui_CameraSettingsDialog(object): def setupUi(self, CameraSettingsDialog): CameraSettingsDialog.setObjectName(_fromUtf8("CameraSettingsDialog")) CameraSettingsDialog.resize(271, 162) self.verticalLayout = QtGui.QVBoxLayout(CameraSettingsDialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.taurusWidget = TaurusWidget(CameraSettingsDialog) self.taurusWidget.setObjectName(_fromUtf8("taurusWidget")) self.gridLayout = QtGui.QGridLayout(self.taurusWidget) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.label_3 = QtGui.QLabel(self.taurusWidget) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1) self.imageTypeComboBox = TaurusValueComboBox(self.taurusWidget) self.imageTypeComboBox.setObjectName(_fromUtf8("imageTypeComboBox")) self.gridLayout.addWidget(self.imageTypeComboBox, 0, 1, 1, 1) self.label_4 = QtGui.QLabel(self.taurusWidget) self.label_4.setObjectName(_fromUtf8("label_4")) self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) self.triggerModeComboBox = TaurusValueComboBox(self.taurusWidget) self.triggerModeComboBox.setObjectName( _fromUtf8("triggerModeComboBox")) self.gridLayout.addWidget(self.triggerModeComboBox, 1, 1, 1, 1) self.label_5 = QtGui.QLabel(self.taurusWidget) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) self.expTimeLineEdit = MAXLineEdit(self.taurusWidget) self.expTimeLineEdit.setModel(_fromUtf8("")) self.expTimeLineEdit.setUseParentModel(False) self.expTimeLineEdit.setObjectName(_fromUtf8("expTimeLineEdit")) self.gridLayout.addWidget(self.expTimeLineEdit, 2, 1, 1, 1) self.label_6 = QtGui.QLabel(self.taurusWidget) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1) self.gainLineEdit = MAXLineEdit(self.taurusWidget) self.gainLineEdit.setObjectName(_fromUtf8("gainLineEdit")) self.gridLayout.addWidget(self.gainLineEdit, 3, 1, 1, 1) self.verticalLayout.addWidget(self.taurusWidget) self.retranslateUi(CameraSettingsDialog) QtCore.QMetaObject.connectSlotsByName(CameraSettingsDialog) def retranslateUi(self, CameraSettingsDialog): CameraSettingsDialog.setWindowTitle( _translate("CameraSettingsDialog", "Camera Settings", None)) self.label_3.setText( _translate("CameraSettingsDialog", "Image Type", None)) self.label_4.setText( _translate("CameraSettingsDialog", "Trigger Mode", None)) self.label_5.setText( _translate("CameraSettingsDialog", "Exposure (ms)", None)) self.label_6.setText( _translate("CameraSettingsDialog", "Gain (dB)", None))
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._setup_ui() self._throttle_timer = QtCore.QTimer() self._throttle_timer.setInterval(200) self._throttle_timer.setSingleShot(True) self.connect(self._throttle_timer, QtCore.SIGNAL("timeout()"), self._writeValue) self._value = None self._acc_value = 0 # accumulate fast wheel events self._last_wheel = 0 # time of last wheel event
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret['module'] = 'liberabrillianceplusmini' ret['group'] = 'Taurus Display' ret['container'] = ':/designer/frame.png' ret['container'] = False return ret
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret['module'] = 'widgets.facadaadjustments' ret['group'] = 'Taurus Containers' ret['container'] = ':/designer/frame.png' ret['container'] = False return ret
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret['module'] = 'loops' ret['group'] = 'RF_FDL_DLLRF' ret['container'] = ':/designer/frame.png' ret['container'] = False return ret
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret["module"] = "diagnostics" ret["group"] = "RF_FDL_DLLRF" ret["container"] = ":/designer/frame.png" ret["container"] = False return ret
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)
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret['module'] = 'liberasinglepassemini' ret['group'] = 'Taurus Display' ret['container'] = ':/designer/frame.png' ret['container'] = False return ret
def getQtDesignerPluginInfo(cls): ret = TaurusWidget.getQtDesignerPluginInfo() ret['module'] = 'maxvaluebar' ret['group'] = 'MAX-lab Taurus Widgets' ret['container'] = ':/designer/frame.png' ret['container'] = False return ret
def setModel(self, device): print self.__class__.__name__, "setModel", device TaurusWidget.setModel(self, device) self.device_and_state.setModel(device) if device: self.form.setModel(["%s/%s" % (device, attribute) for attribute in self.attrs]) db = PyTango.Database() magnet = db.get_device_property(device, "MagnetProxies")["MagnetProxies"][0] magnet_type = PyTango.Database().get_device_property(magnet, "Type")["Type"][0] self.magnet_type_label.setText("Magnet type: <b>%s</b>" % magnet_type) attrname = "%s/%s" % (device, "MainFieldComponent") self.valuebar.setModel(attrname) attr = Attribute(attrname) self.current_label.setText("%s [%s]" % (attr.label, attr.unit)) self.status_area.setModel(device) else: self.form.setModel(None) self.valuebar.setModel(None) self.status_area.setModel(None)
def setModel(self, attrs): if not attrs: for att, col in zip(self.attributes, self._columns): att and att.removeListener(col.event_received) else: try: TaurusWidget.setModel(self, attrs[0].rsplit("/", 1)[0]) self.attributes = [Attribute(a) for a in attrs] self.table.setColumnCount(len(attrs)) fmt = "%s [%s]" labels = [] for a in self.attributes: config = a.getConfig() label = fmt % (config.getLabel(), config.getUnit()) labels.append(label) self.table.setHorizontalHeaderLabels(labels) header = self.table.horizontalHeader() header.setResizeMode(QtGui.QHeaderView.Stretch) # Check if there are any columns at all row_lengths = [len(a.read().value) for a in self.attributes if a.read().quality == PyTango.AttrQuality.ATTR_VALID] if not any(row_lengths): return None self.table.setRowCount(max(row_lengths)) self._values = {} self._config = {} self._columns = [] for i, att in enumerate(self.attributes): # JFF: this is a workaround for a behavior in Taurus. Just # adding a new listener to each attribute does not work, the # previous ones get removed for some reason. col = AttributeColumn(self, i) self._columns.append(col) # keep reference to prevent GC att.addListener(col.event_received) except PyTango.DevFailed: pass
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._ui = Ui_LiberaSinglePassEMini() self._ui.setupUi(self) self._ui.taurusCurveDialog = myTaurusCurveDialog(self) self._ui.taurusCurveDialog.setObjectName("taurusCurveDialog") self._ui.gridLayout.addWidget(self._ui.taurusCurveDialog, 0, 0, 1, 1) self.l_plot = self._ui.taurusCurveDialog.get_active_plot() self.sym = QwtSymbol(QwtSymbol.Ellipse, QtGui.QBrush(QtCore.Qt.blue), QtGui.QPen(QtCore.Qt.blue), QtCore.QSize(10, 10)) self.sym_old = QwtSymbol(QwtSymbol.Ellipse, QtGui.QBrush(QtCore.Qt.gray), QtGui.QPen(QtCore.Qt.gray), QtCore.QSize(4, 4)) self.l_plot.set_axis_limits('left', -0.003, 0.003) self.l_plot.set_axis_title('left', "Y") self.l_plot.set_axis_unit('left', "mm") self.l_plot.set_axis_limits('bottom', -0.003, 0.003) self.l_plot.set_axis_title('bottom', "X") self.l_plot.set_axis_unit('bottom', "mm") self.x = 0 self.y = 0 self.list_mark = [] self.trigger.connect(self.update_plot)
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._ui = Ui_Loops() self._ui.setupUi(self)
def setModel(self, model): TaurusWidget.setModel(self, model) self.updateConfig() conf = Configuration("%s?configuration" % self.model) conf.addListener(lambda *args: self.conf_trigger.emit())
def __init__(self, parent=None, down_command=None, up_command=None, state=None): TaurusWidget.__init__(self, parent) self._down_command = down_command self._up_command = up_command self._state = state self._setup_ui()
def __init__(self, userwidget, parent=None): self.userwidget = userwidget TaurusWidget.__init__(self, parent) self._setup_ui() self.oldvalue = {}
def __init__(self, parent=None): TaurusWidget.__init__(self, parent) vbox = QtGui.QVBox(layout=self) self.lineedit = MAXLineEdit(parent=vbox)
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._ui = Ui_facadeAdjustments() self._ui.setupUi(self)
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._ui = Ui_timeAndDecimation() self._ui.setupUi(self)
def __init__(self, parent=None): TaurusWidget.__init__(self, parent) self._setup_ui()
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._ui = Ui_FastDataLoggerDLLRF() self._ui.setupUi(self)