taurus-org / taurus_pyqtgraph

Moved to https://gitlab.com/taurus-org/taurus_pyqtgraph
3 stars 14 forks source link

Trend of Tango state does not work #37

Closed reszelaz closed 5 years ago

reszelaz commented 5 years ago
zreszela@pc255:~/workspace/taurus_pyqtgraph (master)> taurus tpg trend sys/tg_test/1/state                        
/usr/lib/python3/dist-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.                                  
  from ._conv import register_converters as _register_converters                                                             
MainThread     WARNING  2019-08-07 12:23:52,852 TaurusRootLogger: <frozen importlib._bootstrap>:222: DeprecationWarning: taurus.external.qt.Qwt5 is deprecated since 4.5                                                                                                

Traceback (most recent call last):                                                                                           
  File "/home/zreszela/workspace/taurus/lib/taurus/qt/qtgui/base/taurusbase.py", line 394, in filterEvent                    
    self.handleEvent(*evt)                                                                                                                 
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/taurustrendset.py", line 264, in handleEvent                            
    xValues, yValues = self._updateBuffers(evt_value)
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/taurustrendset.py", line 208, in _updateBuffers
    ntrends = numpy.size(evt_value.rvalue.magnitude)
AttributeError: 'DevState' object has no attribute 'magnitude'
Traceback (most recent call last):
  File "/home/zreszela/workspace/taurus/lib/taurus/qt/qtgui/base/taurusbase.py", line 394, in filterEvent
    self.handleEvent(*evt)
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/taurustrendset.py", line 264, in handleEvent
    xValues, yValues = self._updateBuffers(evt_value)
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/taurustrendset.py", line 208, in _updateBuffers
    ntrends = numpy.size(evt_value.rvalue.magnitude)
AttributeError: 'DevState' object has no attribute 'magnitude'
reszelaz commented 5 years ago

This was due to my wrong usage of tpg. It is not supposed to work with state on purpose. One can use the eval scheme to cast the Tango state to int:

taurus tpg trend eval:int({sys/tg_test/1/state})