Merge branch 'maint' into next
[diffractometer.git] / src / PseudoAxesAdapter.h
blob98e1ed71a726554af53ac141bd51d4ad440594d9
1 #ifndef __PSEUDOAXES_ADAPTER_H__
2 #define __PSEUDOAXES_ADAPTER_H__
4 #include "macros.h"
5 #include "AxisAdapter.h"
6 #include "Matrix.h"
8 // forward declaration
9 namespace PseudoAxes_ns {
10 class PseudoAxes;
13 namespace Diffractometer_ns {
15 //forwar declaration
16 class TangoHKLAdapter;
18 struct PseudoAxesConfig {
19 Tango::DevState state;
20 std::string status;
21 Tango::DevBoolean initialized;
22 Tango::DevString mode;
23 Matrix<double> parameters;
24 Matrix<char *> parameters_names;
25 Matrix<char *> pseudo_axes_names;
26 Matrix<char *> mode_names;
27 Matrix<double> read;
28 Matrix<double> write;
31 class PseudoAxesAdapter {
32 friend class TangoHKLAdapter;
34 public:
35 PseudoAxesAdapter(TangoHKLAdapter *hklAdapter, size_t _idx,
36 HklPseudoAxisEngine *engine_r,
37 HklPseudoAxisEngine *engine_w);
39 virtual ~PseudoAxesAdapter(void);
41 PseudoAxesConfig get_config(void);
43 std::string const & get_proxy_name(void) const {return _proxy_name;}
44 char const * get_name(void) const;
46 void set_axis_value(size_t idx, double value);
47 void set_mode(const Tango::DevString name);
48 void set_initialized(const Tango::DevBoolean initialized);
49 void set_parameters(const Matrix<double> values);
51 void set_device(PseudoAxes_ns::PseudoAxes *device) {_device = device;}
53 void init(void);
54 void load(void);
55 void save(void);
56 void apply(void);
58 void add_dynamic_attributes(void);
59 void remove_dynamic_attributes(void);
61 private:
62 TangoHKLAdapter *_hklAdapter;
63 HklPseudoAxisEngine *_engine_r;
64 HklPseudoAxisEngine *_engine_w;
65 size_t _idx;
66 bool _synchronize;
67 PseudoAxes_ns::PseudoAxes *_device;
68 PseudoAxesConfig _config;
69 std::string _proxy_name;
70 std::vector<Tango::Attr*> _dynamic_attribute_pseudo_axes_axis;
71 std::vector<AxisAdapter *> _axes;
73 void update_axes_i(HklPseudoAxisEngine *engine);
74 void update(void);
75 void load_1(void);
76 void add_dynamic_attributes_i(void);
81 #endif // __PSEUDOAXES_ADAPTER_H__