def setOpts(self, opts): # creates QPainters (QPen or QBrush) from a pickle loaded file # for adapt the serialized objects into PlotDataItem properties from taurus.qt.qtgui.tpg import deserialize_opts self.opts = deserialize_opts(opts) # This is a workaround for the following pyqtgraph's bug: # https://github.com/pyqtgraph/pyqtgraph/issues/531 if opts['connect'] == 'all': self.opts['connect'] = 'all' elif opts['connect'] == 'pairs': self.opts['connect'] = 'pairs' elif opts['connect'] == 'finite': self.opts['connect'] = 'finite'
def _setCurvesOpts(self, all_opts): """restore options to curves""" # If no curves are yet created, force a read to create them if not self._curves: self._forceRead(cache=True) # Check consistency in the number of curves if len(self._curves) != len(all_opts): self.warning( 'Cannot apply curve options (mismatch in curves number)') return from taurus.qt.qtgui.tpg import deserialize_opts for c, opts in zip(self._curves, all_opts): c.opts = deserialize_opts(opts) # This is a workaround for the following pyqtgraph's bug: # https://github.com/pyqtgraph/pyqtgraph/issues/531 if opts['connect'] == 'all': c.opts['connect'] = 'all' elif opts['connect'] == 'pairs': c.opts['connect'] = 'pairs' elif opts['connect'] == 'finite': c.opts['connect'] = 'finite'