Esempio n. 1
0
def test():
    import sys
    from sardana.taurus.core.tango.sardana.macroserver import registerExtensions
    registerExtensions()
    app = Qt.QApplication(sys.argv)
    taurusMacroDescriptionView = TaurusMacroDescriptionViewer(designMode=1)
    if len(sys.argv) != 2:
        taurusMacroDescriptionView.setModel("macroserver/zreszela/1")
    else:
        taurusMacroDescriptionView.setModel(sys.argv[1])
    taurusMacroDescriptionView.onMacroChanged("mv")
    taurusMacroDescriptionView.show()
    sys.exit(app.exec_())
Esempio n. 2
0
def test():
    import sys
    from sardana.taurus.core.tango.sardana.macroserver import registerExtensions
    registerExtensions()
    app = Qt.QApplication(sys.argv)
    taurusMacroDescriptionView = TaurusMacroDescriptionViewer(designMode=1)
    if len(sys.argv) != 2:
        taurusMacroDescriptionView.setModel("macroserver/zreszela/1")
    else:
        taurusMacroDescriptionView.setModel(sys.argv[1])
    taurusMacroDescriptionView.onMacroChanged("mv")
    taurusMacroDescriptionView.show()
    sys.exit(app.exec_())
Esempio n. 3
0
    def __init__(self, parent=None, designMode=False):
        TaurusWidget.__init__(self, parent, designMode=designMode)

        self.loadUi(filename="selectsignal.ui")

        self.signalComboBox = SignalComboBox(self)
        self.signalComboBox.setGeometry(QtCore.QRect(70, 50, 161, 27))
        self.signalComboBox.setObjectName("SignalcomboBox")

        self.connect(self.signalComboBox, Qt.SIGNAL(
            "currentIndexChanged(QString)"), self.onSignalChanged)

        self.doorName = None
        self.door_device = None
        
        registerExtensions()
Esempio n. 4
0
    def __init__(self, parent=None, designMode=False):
        TaurusWidget.__init__(self, parent=None, designMode=designMode)

        self.loadUi(filename="selectsignal.ui")

        self.signalComboBox = SignalComboBox(self)
        self.signalComboBox.setGeometry(QtCore.QRect(70, 50, 161, 27))
        self.signalComboBox.setObjectName("SignalcomboBox")

        self.signalComboBox.currentIndexChanged['QString'].connect(
            self.onSignalChanged)

        self.doorName = None
        self.door_device = None

        registerExtensions()
Esempio n. 5
0
from taurus.qt.qtgui.application import TaurusApplication
import taurus

try:
    import sardana.taurus.core.tango.sardana.macroserver as sms
except:
    try:
        import taurus.core.tango.sardana.macroserver as sms
    except:
        print "demoDoor.py: failed to import macroserver.py"
        sys.exit(255)

import pyqtgraph as pg
import numpy as np

sms.registerExtensions()


class demoDoor(sms.BaseDoor):
    def __init__(self, name, **kw):

        self.initDone = False

        self.app = QtGui.QApplication.instance()
        if self.app is None:
            #app = QtGui.QApplication(sys.argv)
            self.app = TaurusApplication([])

        pg.setConfigOption('background', 'w')
        pg.setConfigOption('foreground', 'k')
        self.win = pg.GraphicsWindow(title="A Graphics Window")
Esempio n. 6
0
# macro wrapper where we programmatically attach hook
class MyMacroWrapper(Macro):
    def run(self):
        self.output("In MyMacroWrapper")
        my_macro, _ = self.createMacro("MyMacro")
        my_macro.hooks = [(self.my_hook2, ["my-hook-place"])]
        self.runMacro(my_macro)

    def my_hook2(self):
        self.output("In my_hook2")


if __name__ == "__main__":
    import sys
    import lxml
    import taurus
    from sardana.taurus.core.tango.sardana.macroserver import registerExtensions
    registerExtensions()
    if len(sys.argv) < 2:
        print "Usage: python generalHooks <door name>"
        sys.exit(1)
    door_name = sys.argv[1]
    door = taurus.Device(door_name)
    door.runMacro("senv GeneralHooks [('MyHook1' ['my-hook-place'])]",
                  synch=True)
    #     door.runMacro("senv GeneralHooks {'my-hook-place':'MyHook1'}",
    #                   synch=True)
    xml = lxml.etree.fromstring(XML)
    door.runMacro(xml, synch=True)
    door.runMacro("MyMacroWrapper", synch=True)
Esempio n. 7
0
# macro wrapper where we programmatically attach hook
class MyMacroWrapper(Macro):

    def run(self):
        self.output("In MyMacroWrapper")
        my_macro, _ = self.createMacro("MyMacro")
        my_macro.hooks = [(self.my_hook2, ["my-hook-place"])]
        self.runMacro(my_macro)

    def my_hook2(self):
        self.output("In my_hook2")

if __name__ == "__main__":
    import sys
    import lxml
    import taurus
    from sardana.taurus.core.tango.sardana.macroserver import registerExtensions
    registerExtensions()
    if len(sys.argv) < 2:
        print "Usage: python generalHooks <door name>"
        sys.exit(1)
    door_name = sys.argv[1]
    door = taurus.Device(door_name)
    door.runMacro("senv GeneralHooks [('MyHook1' ['my-hook-place'])]",
                  synch=True)
#     door.runMacro("senv GeneralHooks {'my-hook-place':'MyHook1'}",
#                   synch=True)
    xml = lxml.etree.fromstring(XML)
    door.runMacro(xml, synch=True)
    door.runMacro("MyMacroWrapper", synch=True)