* PseudoAxis is no more a friend of PseudoAxisAdapter.
[diffractometer.git] / src / AxisAdapter.h
blob189ca0e3b9de31c62259fb43618fa690ac302f62
1 #ifndef __AXIS_ADAPTER_H__
2 #define __AXIS_ADAPTER_H__
4 #include <tango.h>
5 #include <hkl/hkl-axis.h>
7 namespace DiffractometerDevice_ns {
9 struct AxisAdapter
11 AxisAdapter(HklAxis *read, HklAxis *write);
13 ~AxisAdapter(void);
15 Tango::Group *connect(std::string const & device_name);
17 std::string const get_name(void) const;
19 std::string const & get_device_name(void) const {return _device_name;}
21 Tango::DevState const & get_state(void) const {return _state;}
23 void set_state(Tango::DevState const & state) {_state = state;}
25 bool const is_ready(void) const;
27 double const & get_read(void) const {return _read;}
29 double const & get_write(void) const {return _write;}
31 /* return the write part of the axis taking into account the range */
32 double get_write_for_proxy(void);
34 void write(double value, bool simulated);
36 void from_HklAxis(void);
38 void to_HklAxis(void);
40 void from_proxy(void);
42 void to_proxy(void);
44 private:
46 std::string _device_name;
47 Tango::DeviceProxy *_proxy;
48 HklAxis *_axis_r; // pointer to axe from hkl library
49 HklAxis *_axis_w;
50 double _read;
51 double _write;
52 double _min;
53 double _max;
54 Tango::DevState _state; // state of axe
55 };
58 #endif// __Axis_Adapter_H__