* switch from DeviceProxy -> AttributProxy
[diffractometer.git] / src / AxisAdapter.h
blobdb55308892e46b7891837efe699c6d68f0dc3db5
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;
23 std::string const get_proxy_name(void) const;
25 Tango::DevState const & get_state(void) const {return _state;}
26 void set_state(Tango::DevState const & state) {_state = state;}
28 bool const is_ready(void) const;
30 double const & get_read(void) const {return _read;}
32 double const & get_read_real(void) const {return _read_real;}
34 double const & get_write(void) const {return _write;}
36 double const & get_write_real(void) const {return _write_real;}
38 void write(double value);
40 void from_HklAxis(void);
42 void to_proxy(void);
44 void stop(void);
46 private:
48 TangoHKLAdapter * _hklAdapter;
49 std::string _proxy_name;
50 std::string _proxy_stop_command_name;
51 Tango::AttributeProxy *_proxy;
52 HklAxis *_axis_r;
53 HklAxis *_axis_w;
54 HklAxis *_axis_r_real;
55 HklAxis *_axis_w_real;
56 double _read;
57 double _write;
58 double _read_real;
59 double _write_real;
60 double _min;
61 double _max;
62 Tango::DevState _state; // state of axe
64 bool connect(char *proxy_name);
66 void to_HklAxis(void);
68 void from_proxy(bool simulated);
69 };
72 #endif// __Axis_Adapter_H__