Пример #1
0
import os
import ctypes
import PyTango

from taurus.core import TaurusEventType, TaurusSWDevState, TaurusDevState

from sardana.sardanautils import is_pure_str, is_non_str_seq
from sardana.spock import genutils
from sardana.util.parser import ParamParser
from sardana.spock.inputhandler import SpockInputHandler, InputHandler
from sardana import sardanacustomsettings

CHANGE_EVTS = TaurusEventType.Change, TaurusEventType.Periodic

if genutils.get_gui_mode() == 'qt':
    from sardana.taurus.qt.qtcore.tango.sardana.macroserver import QDoor, QMacroServer
    BaseDoor = QDoor
    BaseMacroServer = QMacroServer
    BaseGUIViewer = object
else:
    from sardana.taurus.core.tango.sardana.macroserver import BaseDoor, BaseMacroServer
    BaseGUIViewer = object

RUNNING_STATE = TaurusDevState.Ready


class GUIViewer(BaseGUIViewer):
    def __init__(self, door=None):
        BaseGUIViewer.__init__(self)
        self._door = door
Пример #2
0
import os
import ctypes
import PyTango

from taurus.core import TaurusEventType, TaurusSWDevState

from sardana.sardanautils import is_pure_str, is_non_str_seq
from sardana.spock import genutils
from sardana.spock.inputhandler import SpockInputHandler, InputHandler
from sardana import sardanacustomsettings

CHANGE_EVTS = TaurusEventType.Change, TaurusEventType.Periodic


if genutils.get_gui_mode() == 'qt':
    from sardana.taurus.qt.qtcore.tango.sardana.macroserver import QDoor, QMacroServer
    BaseDoor = QDoor
    BaseMacroServer = QMacroServer
    BaseGUIViewer = object
else:
    from sardana.taurus.core.tango.sardana.macroserver import BaseDoor, BaseMacroServer
    BaseGUIViewer = object

try:
    RUNNING_STATE = TaurusSWDevState.Running
except RuntimeError:
    # TODO: For Taurus 4 compatibility
    from taurus.core import TaurusDevState
    RUNNING_STATE = TaurusDevState.Ready