Taurus ignores the Tango display unit attribute property
The display unit is an attribute property. According to Tango documentation, this is a numerical factor that must be applied to the attribute value before displaying it in GUIs.
It seems that Taurus is not taking it into account for the display of attribute values.
Here is a exemple using PyTango
MyDevice.py
import tango
from tango.server import Device, attribute, run
class MyDevice(Device):
def init_device(self):
super().init_device()
@attribute(dtype=tango.DevDouble, display_unit=10)
def value(self):
return 1.0
if __name__ == '__main__':
try:
run((MyDevice,))
except Exception as e:
print(e)
raise
TaurusApp.py
import sys
from taurus.external.qt import Qt
from taurus import Attribute
from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.display import TaurusLabel
app = TaurusApplication(sys.argv, cmd_line_parser=None,)
panel = Qt.QWidget()
layout = Qt.QHBoxLayout()
panel.setLayout(layout)
w = TaurusLabel()
layout.addWidget(w)
a = Attribute(<domain>/<family>/<member>/value)
print(a.display_unit)
w.model = a
panel.show()
sys.exit(app.exec_())
The display unit is properly grabbed by Taurus (and printed through print(a.display_unit)
). However, it is not used to convert the attribute and the value presented by the GUI is 1.0 instead of 10.0.
Tested version : taurus 5.1.8