* do not remove dynamic devices when stopping the Diffractometer device.
[diffractometer.git] / src / AxisAdapter.h
blobb3892e1b0953ac366834b19aa6606c366a8b9412
1 #ifndef __AXIS_ADAPTER_H__
2 #define __AXIS_ADAPTER_H__
4 #include <tango.h>
5 #include <hkl/hkl-axis.h>
7 namespace Diffractometer_ns {
9 // forward declaration
10 class TangoHKLAdapter;
12 class AxisAdapter
14 friend class TangoHKLAdapter;
16 public:
17 AxisAdapter(TangoHKLAdapter * hklAdapter, HklAxis *axis_r, HklAxis *axis_w,
18 HklAxis *axis_r_real, HklAxis *axis_w_real);
20 virtual ~AxisAdapter(void);
22 std::string const get_name(void) const;
24 std::string const & get_device_name(void) const {return _device_name;}
26 Tango::DevState const & get_state(void) const {return _state;}
27 void set_state(Tango::DevState const & state) {_state = state;}
29 bool const is_ready(void) const;
31 double const & get_read(void) const {return _read;}
33 double const & get_read_real(void) const {return _read_real;}
35 double const & get_write(void) const {return _write;}
37 double const & get_write_real(void) const {return _write_real;}
39 void write(double value);
41 void from_HklAxis(void);
42 private:
44 TangoHKLAdapter * _hklAdapter;
45 std::string _device_name;
46 Tango::DeviceProxy *_proxy;
47 HklAxis *_axis_r;
48 HklAxis *_axis_w;
49 HklAxis *_axis_r_real;
50 HklAxis *_axis_w_real;
51 double _read;
52 double _write;
53 double _read_real;
54 double _write_real;
55 double _min;
56 double _max;
57 Tango::DevState _state; // state of axe
59 Tango::Group *connect(std::string const & device_name);
61 void to_HklAxis(void);
63 void from_proxy(bool simulated);
65 void to_proxy(void);
66 };
69 #endif// __Axis_Adapter_H__