本文整理汇总了Python中taurus.qt.qtgui.container.TaurusWidget类的典型用法代码示例。如果您正苦于以下问题:Python TaurusWidget类的具体用法?Python TaurusWidget怎么用?Python TaurusWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaurusWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode)
self.setLayout(Qt.QVBoxLayout())
self._splitter = Qt.QSplitter()
self._splitter.setOrientation(Qt.Qt.Vertical)
self.layout().addWidget(self._splitter)
self._frame = TaurusWidget(self)
self._frame.setLayout(Qt.QGridLayout())
self._scrollArea = TaurusScrollArea(self)
self._scrollArea.setWidget(self._frame)
self._scrollArea.setWidgetResizable(True)
self._splitter.addWidget(self._scrollArea)
self._outputTE = Qt.QTextEdit()
self._outputTE.setReadOnly(True)
self._splitter.addWidget(self._outputTE)
#self._splitter.moveSplitter(self._splitter.getRange(0)[-1], 0)
self._cmdWidgets = []
self._paramWidgets = []
self._viewFilters = []
self._defaultParameters = []
self._sortKey = lambda x: x.cmd_name
self._operatorViewFilter = lambda x: x.disp_level == PyTango.DispLevel.OPERATOR
# self.setLayout(Qt.QGridLayout())
self.modelChanged.connect(self._updateCommandWidgets)
示例2: __init__
def __init__(self, parent=None, selectables=None, buttonsPos=None, designMode=None):
TaurusWidget.__init__(self, parent)
if selectables is None:
selectables = [taurus.core.taurusbasetypes.TaurusElementType.Attribute, taurus.core.taurusbasetypes.TaurusElementType.Member,
taurus.core.taurusbasetypes.TaurusElementType.Device]
self._selectables = selectables
# tree
self._deviceTree = TaurusDbTreeWidget(
perspective=taurus.core.taurusbasetypes.TaurusElementType.Device)
self._deviceTree.getQModel().setSelectables(self._selectables)
self._deviceTree.setUseParentModel(True)
# toolbar
self._toolbar = Qt.QToolBar("TangoSelector toolbar")
self._toolbar.setIconSize(Qt.QSize(16, 16))
self._toolbar.setFloatable(False)
self._addSelectedAction = self._toolbar.addAction(
Qt.QIcon.fromTheme("list-add"), "Add selected", self.onAddSelected)
# defines the layout
self.setButtonsPos(buttonsPos)
self._deviceTree.recheckTaurusParent() # NOT WORKING????
# @todo: This is Workaround because UseSetParentModel is giving trouble again!
self.modelChanged.connect(self._deviceTree.setModel)
示例3: setModel
def setModel(self, model):
'''
reimplemented from :class:`TaurusWidget`. A door device name is
expected as the model
'''
TaurusWidget.setModel(self, model)
if self.door is not None:
self.disconnect(self.door, Qt.SIGNAL('macroStatusUpdated'), self._statusUpdated)
self.disconnect(self.door, Qt.SIGNAL('resultUpdated'), self._resultUpdated)
# disable management of Door Tango States
self.door.getAttribute('State').removeListener(self.door_state_listener)
self.disconnect(self.door_state_listener, Qt.SIGNAL('doorStateChanged'), self._doorStateChanged)
self.door_state_listener = None
try: self.door = taurus.Device(model)
except: return
self.connect(self.door, Qt.SIGNAL('macroStatusUpdated'), self._statusUpdated)
self.connect(self.door, Qt.SIGNAL('resultUpdated'), self._resultUpdated)
# Manage Door Tango States
self.door_state_listener = DoorStateListener()
self.connect(self.door_state_listener, Qt.SIGNAL('doorStateChanged'), self._doorStateChanged)
self.door.getAttribute('State').addListener(self.door_state_listener)
示例4: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent=parent, designMode=designMode)
self._xAttr = None
self._yAttr = None
self._arrayEditor = ArrayEditor()
self.fromFileBT = Qt.QPushButton('Read From File')
self.toFileBT = Qt.QPushButton('Write To File')
self.fromAttrBT = Qt.QPushButton('Read From Device')
self.toAttrBT = Qt.QPushButton('Write To Device')
self.fromAttrBT.setEnabled(False)
self.toAttrBT.setEnabled(False)
layout = Qt.QGridLayout(self)
layout.addWidget(self._arrayEditor, 0, 0, 1, 4)
layout.addWidget(self.fromFileBT, 1, 0)
layout.addWidget(self.toFileBT, 1, 1)
layout.addWidget(self.fromAttrBT, 1, 2)
layout.addWidget(self.toAttrBT, 1, 3)
self.fromFileBT.clicked[()].connect(self.onFromFile)
self.toFileBT.clicked[()].connect(self.onToFile)
self.fromAttrBT.clicked[()].connect(self.onFromAttr)
self.toAttrBT.clicked[()].connect(self.onToAttr)
示例5: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode=designMode)
self.loadUi(filename="computeu.ui")
self.connect(self._ui.ComputeButton, Qt.SIGNAL(
"clicked()"), self.compute_u)
示例6: setModel
def setModel(self, model):
oldModelObj = self.getModelObj()
if oldModelObj is not None:
self.disconnect(oldModelObj, Qt.SIGNAL("macrosUpdated"), self.macroComboBox.onMacrosUpdated)
TaurusWidget.setModel(self, model)
newModelObj = self.getModelObj()
self.connect(newModelObj, Qt.SIGNAL("macrosUpdated"), self.macroComboBox.onMacrosUpdated)
示例7: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode=designMode)
self.loadUi(filename="reflectionseditor.ui")
self._ui.ApplyButton.clicked.connect(self.apply)
self._ui.ClearButton.clicked.connect(self.clear)
示例8: setModel
def setModel(self, model):
oldModelObj = self.getModelObj()
if oldModelObj is not None:
oldModelObj.macrosUpdated.disconnect(
self.macroComboBox.onMacrosUpdated)
TaurusWidget.setModel(self, model)
newModelObj = self.getModelObj()
newModelObj.macrosUpdated.connect(self.macroComboBox.onMacrosUpdated)
示例9: setModel
def setModel(self, model):
'''This implementation propagates the model to the read and write widgets.
You may reimplement it to do things like passing different models to each.
'''
if self.readWidget is not None:
self.readWidget.setModel(model)
if self.writeWidget is not None:
self.writeWidget.setModel(model)
TaurusWidget.setModel(self, model)
示例10: setModel
def setModel(self, model):
oldModelObj = self.getModelObj()
if oldModelObj is not None:
# TODO: check if macrosUpdated signal exists
oldModelObj.macrosUpdated.disconnect(
self.macroComboBox.onMacrosUpdated)
TaurusWidget.setModel(self, model)
newModelObj = self.getModelObj()
newModelObj.macrosUpdated.connect(
self.macroComboBox.onMacrosUpdated)
示例11: applyConfig
def applyConfig(self, configdict, **kwargs):
"""extending :meth:`TaurusBaseWidget.applyConfig` to restore the splitter config
:param configdict: (dict)
.. seealso:: :meth:`TaurusBaseWidget.applyConfig`, :meth:`createConfig`
"""
# first do the basic stuff...
TaurusWidget.applyConfig(self, configdict, **kwargs)
# restore the splitter config
self._splitter.restoreState(
Qt.QByteArray(configdict['splitter/state']))
示例12: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode=designMode)
self.loadUi(filename="hklscan.ui")
self._ui.hklStartScanButton.clicked.connect(self.start_hklscan)
self._ui.hklStopScanButton.clicked.connect(self.stop_hklscan)
self._ui.hklDisplayAnglesButton.clicked.connect(self.display_angles)
self._ui.MacroServerConnectionButton.clicked.connect(
self.open_macroserver_connection_panel)
# Create a global SharedDataManager
Qt.qApp.SDM = SharedDataManager(self)
示例13: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode=designMode)
self.loadUi(filename="ubmatrix.ui")
self._ui.UpdateButton.clicked.connect(self.update_values)
self._ui.ComputeUButton.clicked.connect(self.compute_ub)
self._ui.ReflectionsListButton.clicked.connect(
self.reflections_list_window)
self._ui.EditReflectionsButton.clicked.connect(
self.edit_reflections_window)
self._ui.AffineButton.clicked.connect(self.affine)
self._ui.AddCrystalButton.clicked.connect(self.add_select_crystal)
示例14: __init__
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent, designMode)
self.loadUi()
self.door = None
self.door_state_listener = None
self.macro_name = ''
self.macro_args = []
self.macro_id = None
self.running_macro = None
self.ui.progress.setValue(0)
self.ui.button.setCheckable(True)
self.ui.button.clicked.connect(self._onButtonClicked)
示例15: __init__
def __init__(self, *args, **kwargs):
TaurusWidget.__init__(self, *args)
fileModel = kwargs.get("fileModel", None)
if fileModel is None:
fileModel = HDF5Widget.FileModel()
self.__fileModel = fileModel
self.treeWidget = HDF5Widget.HDF5Widget(self.__fileModel)
self.treeWidget.setSizePolicy(Qt.QSizePolicy(Qt.QSizePolicy.Expanding, Qt.QSizePolicy.Expanding))
# self.infoWidget = HDF5Info.HDF5InfoWidget()
self.__previewStack = Qt.QStackedWidget()
self.__currentPreview = None
# layout
self.__splitter = Qt.QSplitter()
self.__splitter.setOrientation(Qt.Qt.Vertical)
self.__splitter.addWidget(self.treeWidget)
# self.__splitter.addWidget(self.infoWidget)
self.__splitter.addWidget(self.__previewStack)
self.setLayout(Qt.QVBoxLayout())
self.layout().addWidget(self.__splitter)
# Actions
self.setContextMenuPolicy(Qt.Qt.ActionsContextMenu)
self.openFileAction = Qt.QAction(Qt.QIcon.fromTheme("document-open"), "Open Data File...", self)
self.togglePreviewAction = Qt.QAction(Qt.QIcon("actions:view.svg"), "Show/Hide preview", self)
self.togglePreviewAction.setCheckable(True)
self.togglePreviewAction.setChecked(True)
self.addActions([self.openFileAction, self.togglePreviewAction])
# Toolbar
self._toolbar = Qt.QToolBar("NeXus browser toolbar")
self._toolbar.setIconSize(Qt.QSize(16, 16))
self._toolbar.setFloatable(False)
self._toolbar.addActions([self.openFileAction, self.togglePreviewAction])
self.layout().setMenuBar(self._toolbar)
# connections
self.__fileModel.sigFileAppended.connect(self.treeWidget.fileAppended)
self.treeWidget.sigHDF5WidgetSignal.connect(self.onHDF5WidgetSignal)
self.openFileAction.triggered[()].connect(self.openFile)
self.togglePreviewAction.toggled.connect(self.__previewStack.setVisible)
# configuration
self.registerConfigProperty(
self.togglePreviewAction.isChecked, self.togglePreviewAction.setChecked, "showPreview"
)