2 #include "DynamicAttrAxis.h"
4 namespace DiffractometerDevice_ns
7 AxisAttrib::AxisAttrib(char const *name
, TangoHKLAdapter
*adapter
,
9 Tango::Attr(name
, Tango::DEV_DOUBLE
, Tango::READ_WRITE
),
13 Tango::UserDefaultAttrProp axis_prop
;
14 axis_prop
.set_label(name
);
15 axis_prop
.set_format("%7.4f");
17 std::string description
;
18 description
+= "The ";
20 description
+= " axis of the diffractometer";
21 axis_prop
.set_description(description
.c_str());
22 axis_prop
.set_unit("°");
23 this->set_default_properties(axis_prop
);
26 void AxisAttrib::read(Tango::DeviceImpl
*dev
,Tango::Attribute
&att
)
30 _adapter
->read_axis(_idx
, read
, write
);
32 Tango::WAttribute
& watt
= dev
->get_device_attr()->get_w_attr_by_name(name
.c_str());
33 watt
.set_write_value(write
);
36 void AxisAttrib::write(Tango::DeviceImpl
*dev
,Tango::WAttribute
&att
)
40 att
.get_write_value(value
);
41 _adapter
->write_axis(_idx
, value
);
44 bool AxisAttrib::is_allowed(Tango::DeviceImpl
*dev
,Tango::AttReqType ty
)
46 if (dev
->get_state() == Tango::FAULT
||
47 dev
->get_state() == Tango::ALARM
)
48 if (type
== Tango::READ_REQ
)