def __init__(self, *args, **kwargs):
        """
        Accepts same args and kwargs as PlotDataItem, plus:
        :param xModel: (str) Taurus model name for abscissas values.
                       Default=None
        :param yModel: (str) Taurus model name for ordinate values.
                       Default=None
        :param colors: (generator) An infinite generator of QColor objects
        """
        xModel = kwargs.pop("xModel", None)
        yModel = kwargs.pop("yModel", None)
        colors = kwargs.pop("colors", LoopList(CURVE_COLORS))
        if "pen" not in kwargs:
            kwargs["pen"] = next(colors)
        PlotDataItem.__init__(self, *args, **kwargs)
        TaurusBaseComponent.__init__(self, "TaurusBaseComponent")
        self._x = None
        self._y = None
        self.xModel = None
        if xModel is not None:
            self.setXModel(xModel)
        if yModel is not None:
            self.setModel(yModel)

        self.registerConfigProperty(self.getOpts, self.setOpts, "opts")
        self.setModelInConfig(True)
        self.registerConfigProperty(
            self.getXModelName, self.setXModel, "XModel"
        )
Esempio n. 2
0
    def __init__(self, param=None, buffersize=512, stackMode='datetime'):
        """
        :param param: param to be passed to XYImageItem constructor
        :param buffersize: (int) size of the stack
        :param stackMode: (str) can be 'datetime', 'timedelta' or 'event'
        """
        XYImageItem.__init__(self,
                             numpy.arange(2),
                             numpy.arange(2),
                             numpy.zeros((2, 2)),
                             param=param)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)
        self.maxBufferSize = buffersize
        self._yValues = None
        self._xBuffer = None
        self._zBuffer = None
        self.stackMode = stackMode
        self.set_interpolation(INTERP_NEAREST)
        self.__timeOffset = None

        # Config properties
        self.registerConfigProperty(self.get_lut_range, self.set_lut_range,
                                    'lut_range')
        self.registerConfigProperty(self._get_interpolation_cfg,
                                    self._set_interpolation_cfg,
                                    'interpolation')
        self.registerConfigProperty(self.get_color_map_name,
                                    self.set_color_map, 'color_map')
Esempio n. 3
0
    def __init__(self, plot=None, parent=None):
        Qt.QObject.__init__(self, parent)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self._group_mode = self.XAxis

        self.plot = plot or MultiPlotWidget()
    def __init__(self, *args, **kwargs):
        _ = kwargs.pop("xModel", None)
        yModel = kwargs.pop("yModel", None)
        colors = kwargs.pop("colors", None)
        if colors is None:
            colors = LoopList(CURVE_COLORS)
        name = kwargs.pop("name", None)
        PlotDataItem.__init__(self, x=[], y=[], name=name)
        TaurusBaseComponent.__init__(self, "TaurusBaseComponent")
        self._UImodifiable = False
        self._maxBufferSize = 65536  # (=2**16, i.e., 64K events))
        self._xBuffer = None
        self._yBuffer = None
        self._curveColors = colors
        self._args = args
        self._kwargs = kwargs
        self._curves = []
        self._timer = Qt.QTimer()
        self._timer.timeout.connect(self._forceRead)
        self._legend = None

        # register config properties
        self.setModelInConfig(True)
        self.registerConfigProperty(
            self._getCurvesOpts, self._setCurvesOpts, "opts"
        )
        # TODO: store forceReadPeriod config
        # TODO: store _maxBufferSize config
        if yModel is not None:
            self.setModel(yModel)
Esempio n. 5
0
    def __init__(self, parent=None):
        Qt.QObject.__init__(self, parent)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self.__panels = {}

        self._trends1d = {}
        self._trends2d = {}
Esempio n. 6
0
    def __init__(self, parent=None):
        Qt.QObject.__init__(self, parent)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self.__panels = {}

        self._trends1d = {}
        self._trends2d = {}
 def __init__(self, xmodel=None, id=None):
     Qt.QObject.__init__(self)
     TaurusBaseComponent.__init__(self, self.__class__.__name__)
     self._attrnamevalidator = ATTRNAMEVALIDATOR
     self.id = id
     self.sev = SafeEvaluator()
     self._referencedQAttrs = []
     self.value = None
     self._setExtendedModel(xmodel)
Esempio n. 8
0
 def __init__(self, curveparam=None, taurusparam=None):
     CurveItem.__init__(self, curveparam=curveparam)
     TaurusBaseComponent.__init__(self, self.__class__.__name__)
     # I need to do this because I am not using the standard model attach
     # mechanism
     self.taurusEvent.connect(self.filterEvent)
     self._xcomp = None
     self._ycomp = None
     if taurusparam is None:
         taurusparam = TaurusCurveParam()
     self.taurusparam = taurusparam
Esempio n. 9
0
File: curve.py Progetto: cmft/taurus
 def __init__(self, curveparam=None, taurusparam=None):
     CurveItem.__init__(self, curveparam=curveparam)
     TaurusBaseComponent.__init__(self, self.__class__.__name__)
     # I need to do this because I am not using the standard model attach
     # mechanism
     self.taurusEvent.connect(self.filterEvent)
     self._xcomp = None
     self._ycomp = None
     if taurusparam is None:
         taurusparam = TaurusCurveParam()
     self.taurusparam = taurusparam
Esempio n. 10
0
 def __init__(self, param=None, buffersize=512, stackMode='datetime'):
     XYImageItem.__init__(self, numpy.arange(2), numpy.arange(
         2), numpy.zeros((2, 2)), param=param)
     TaurusBaseComponent.__init__(self, self.__class__.__name__)
     self.maxBufferSize = buffersize
     self._yValues = None
     self._xBuffer = None
     self._zBuffer = None
     self.stackMode = stackMode
     self.set_interpolation(INTERP_NEAREST)
     self.__timeOffset = None
Esempio n. 11
0
    def __init__(self, parent=None):
        Qt.QObject.__init__(self, parent)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self.__panels = {}

        self._trends1d = {}
        self._trends2d = {}

        self._parent_can_notify_changes = False
        if hasattr(parent, 'experimentConfigurationChanged'):
            self._parent_can_notify_changes = True
Esempio n. 12
0
    def __init__(self, parent=None, **kwargs):

        TaurusBaseComponent.__init__(self, 'TaurusTrend')
        PlotWidget.__init__(self, parent=parent, **kwargs)

        # set up cyclic color generator
        self._curveColors = LoopList(CURVE_COLORS)
        self._curveColors.setCurrentIndex(-1)

        plot_item = self.getPlotItem()
        menu = plot_item.getViewBox().menu

        # add save & retrieve configuration actions
        saveConfigAction = QtGui.QAction('Save configuration', menu)
        saveConfigAction.triggered.connect(self.saveConfigFile)
        menu.addAction(saveConfigAction)

        loadConfigAction = QtGui.QAction('Retrieve saved configuration', menu)
        loadConfigAction.triggered.connect(self.loadConfigFile)
        menu.addAction(loadConfigAction)

        self.registerConfigProperty(self._getState,
                                    self.restoreState, 'state')

        # add legend tool
        legend_tool = PlotLegendTool(self)
        legend_tool.attachToPlotItem(plot_item)

        # add model chooser
        self._model_chooser_tool = TaurusModelChooserTool(
            self, itemClass=TaurusTrendSet)
        self._model_chooser_tool.attachToPlotItem(plot_item)

        # add Y2 axis
        self._y2 = Y2ViewBox()
        self._y2.attachToPlotItem(plot_item)

        # Add time X axis
        axis = DateAxisItem(orientation='bottom')
        axis.attachToPlotItem(plot_item)

        # add plot configuration dialog
        cprop_tool = CurvesPropertiesTool(self)
        cprop_tool.attachToPlotItem(plot_item, y2=self._y2)

        # add force read tool
        fr_tool = ForcedReadTool(self)
        fr_tool.attachToPlotItem(self.getPlotItem())

        # Register config properties
        self.registerConfigDelegate(self._y2, 'Y2Axis')
        self.registerConfigDelegate(legend_tool, 'legend')
        self.registerConfigDelegate(fr_tool, 'forceread')
Esempio n. 13
0
    def __init__(self, parent=None):
        Qt.QObject.__init__(self, parent)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self._group_mode = self.XAxis
        Qt.qApp.SDM.connectWriter("shortMessage", self, 'newShortMessage')

        self._plot = MultiPlotWidget()
        self.createPanel(self._plot,
                         'Scan plot',
                         registerconfig=False,
                         permanent=False)
Esempio n. 14
0
File: curve.py Progetto: cmft/taurus
    def __init__(self, curveparam=None, taurusparam=None):
        CurveItem.__init__(self, curveparam=curveparam)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self.__xBuffer = None
        self.__yBuffer = None

        self.__timeOffset = None

        if taurusparam is None:
            taurusparam = TaurusTrendParam()
        self.taurusparam = taurusparam
        self.updateTaurusParams()
Esempio n. 15
0
    def __init__(self, curveparam=None, taurusparam=None):
        CurveItem.__init__(self, curveparam=curveparam)
        TaurusBaseComponent.__init__(self, self.__class__.__name__)

        self.__xBuffer = None
        self.__yBuffer = None

        self.__timeOffset = None

        if taurusparam is None:
            taurusparam = TaurusTrendParam()
        self.taurusparam = taurusparam
        self.updateTaurusParams()
Esempio n. 16
0
 def __init__(self,api,qtparent,tauparent=None):
     QtGui.QListWidgetItem.__init__(self)
     TaurusBaseComponent.__init__(self,tauparent)
     self.api = api
     self.qtparent = qtparent
     self.alarm = None
     self.alarmDisabled = None
     self.alarmAcknowledged = None
     self.font=QtGui.QFont(QtCore.QString("Courier"))
     self.font.setPointSize(10)
     self.setFont(self.font)
     self.errors = 0
     self.status = ''
     self.changed = False #This flag should be kept until updateStyle is called!!!
     
     self.quality = None
     self.setTextAlignment(Qt.Qt.AlignLeft)
Esempio n. 17
0
    def __init__(self, api, qtparent, tauparent=None):
        QtGui.QListWidgetItem.__init__(self)
        TaurusBaseComponent.__init__(self, tauparent)
        self.api = api
        self.qtparent = qtparent
        self.alarm = None
        self.alarmDisabled = None
        self.alarmAcknowledged = None
        self.font = QtGui.QFont(QtCore.QString("Courier"))
        self.font.setPointSize(10)
        self.setFont(self.font)
        self.errors = 0
        self.status = ''
        self.changed = False  #This flag should be kept until updateStyle is called!!!

        self.quality = None
        self.setTextAlignment(Qt.Qt.AlignLeft)
    def __init__(self, *args, **kwargs):
        PlotDataItem.__init__(self, *args, **kwargs)
        TaurusBaseComponent.__init__(self, 'TaurusBaseComponent')
        self._UImodifiable = False
        self._maxBufferSize = 65536  # (=2**16, i.e., 64K events))
        self._xBuffer = None
        self._yBuffer = None
        self._curveColors = LoopList(CURVE_COLORS)
        self._args = args
        self._kwargs = kwargs
        self._curves = []
        self._timer = Qt.QTimer()
        self._timer.timeout.connect(self._forceRead)
        self._legend = None

        # register config properties
        self.setModelInConfig(True)
        self.registerConfigProperty(self._getCurvesOpts, self._setCurvesOpts,
                                    'opts')
Esempio n. 19
0
    def __init__(self, parent=None, **kwargs):

        TaurusBaseComponent.__init__(self, 'TaurusPlot')
        PlotWidget.__init__(self, parent=parent, **kwargs)

        # set up cyclic color generator
        self._curveColors = LoopList(CURVE_COLORS)
        self._curveColors.setCurrentIndex(-1)

        # add save & retrieve configuration actions
        menu = self.getPlotItem().getViewBox().menu
        saveConfigAction = QtGui.QAction('Save configuration', menu)
        saveConfigAction.triggered[()].connect(self.saveConfigFile)
        menu.addAction(saveConfigAction)

        loadConfigAction = QtGui.QAction('Retrieve saved configuration', menu)
        loadConfigAction.triggered[()].connect(self.loadConfigFile)
        menu.addAction(loadConfigAction)

        self.registerConfigProperty(self._getState, self.restoreState, 'state')

        # add legend tool
        legend_tool = PlotLegendTool(self)
        legend_tool.attachToPlotItem(self.getPlotItem())

        # add model chooser
        model_chooser_tool = TaurusXYModelChooserTool(self)
        model_chooser_tool.attachToPlotItem(self.getPlotItem(), self,
                                            self._curveColors)

        # add Y2 axis
        self._y2 = Y2ViewBox()
        self._y2.attachToPlotItem(self.getPlotItem())

        # add plot configuration dialog
        cprop_tool = CurvesPropertiesTool(self)
        cprop_tool.attachToPlotItem(self.getPlotItem(), y2=self._y2)

        # Register config properties
        self.registerConfigDelegate(self._y2, 'Y2Axis')
        self.registerConfigDelegate(legend_tool, 'legend')
    def __init__(self, *args, **kwargs):
        """
        Accepts same args and kwargs as PlotDataItem, plus:
        :param xModel: (str) Taurus model name for abscissas values.
                       Default=None
        :param yModel: (str) Taurus model name for ordinate values.
                       Default=None
        """
        xModel = kwargs.pop('xModel', None)
        yModel = kwargs.pop('yModel', None)
        PlotDataItem.__init__(self, *args, **kwargs)
        TaurusBaseComponent.__init__(self, 'TaurusBaseComponent')
        self._x = None
        self._y = None
        self.xModel = None
        if xModel is not None:
            self.setXModel(xModel)
        if yModel is not None:
            self.setModel(yModel)

        self.registerConfigProperty(self.getOpts, self.setOpts, 'opts')
        self.setModelInConfig(True)
        self.registerConfigProperty(self.getXModelName, self.setXModel,
                                    'XModel')
 def __init__(self, *args, **kwargs):
     ImageItem.__init__(self, *args, **kwargs)
     TaurusBaseComponent.__init__(self, "TaurusImageItem")
Esempio n. 22
0
 def __init__(self, classname):
     TaurusBaseComponent.__init__(self, classname)
     self._signalGen = Qt.QObject()