* implemente the MotorOn method.
[diffractometer.git] / src / AxisAdapter.h
blobf26ca1022c7eda98818210f12edc63693c3a445f
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 void on(void);
48 private:
50 TangoHKLAdapter * _hklAdapter;
51 std::string _proxy_name;
52 std::string _proxy_stop_command_name;
53 std::string _proxy_on_command_name;
54 Tango::AttributeProxy *_proxy;
55 HklAxis *_axis_r;
56 HklAxis *_axis_w;
57 HklAxis *_axis_r_real;
58 HklAxis *_axis_w_real;
59 double _read;
60 double _write;
61 double _read_real;
62 double _write_real;
63 double _min;
64 double _max;
65 Tango::DevState _state; // state of axe
67 bool connect(char *proxy_name);
69 void to_HklAxis(void);
71 void from_proxy(bool simulated);
72 };
75 #endif// __Axis_Adapter_H__