Hi all,
Anyone knows how to change the unit of an attribute during runtime?
thanks for helping,
regards,
Florent.
Hi all,
Anyone knows how to change the unit of an attribute during runtime?
thanks for helping,
regards,
Florent.
Hi Florent,
An easy way is to start an atkpanel on your device and to click on the “…” button at the right of the attribute you want to change the units.
Then you can refer to the Tango documentation for the meaning of the parameters:
https://tango-controls.readthedocs.io/en/latest/development/advanced/reference.html#general-purpose-parameters
You can also change it from jive by expanding your device node and then click on “Attribute config” in the tree.
Then you will have to select the Unit tab on the right.
Hoping this help,
Reynald
Hi Reynald,
thanks for your reply !
I was talking about changing the unit by c++ code into the device server itself.
Florent.
Hi Florent
This is what I am doing
Hoping this helps
Cheers
Tango::Attribute &att = get_device_attr()->get_attr_by_name("MyAttName[s][/s]);
Tango::MultiAttrProp<Tango::DevDouble> att_prop; // For a DevDouble att type
att.get_properties(att_prop);
att_prop.unit = "WhatAUnit!";
att.set_properties(att_prop);
Great!!
it helps a lot !
thank you Reynald
Cheers
Florent.
Thanks Manu for this one ![]()
Oups, didn’t see it was Manu that answer …
Florent.