1 #ifndef __PSEUDOAXES_ADAPTER_H__
2 #define __PSEUDOAXES_ADAPTER_H__
5 #include "AxisAdapter.h"
9 namespace PseudoAxes_ns
{
13 namespace Diffractometer_ns
{
16 class TangoHKLAdapter
;
18 struct PseudoAxesConfig
{
19 Tango::DevState state
;
21 Tango::DevBoolean initialized
;
24 class PseudoAxesAdapter
{
25 friend class TangoHKLAdapter
;
28 PseudoAxesAdapter(TangoHKLAdapter
*hklAdapter
, size_t _idx
,
29 HklPseudoAxisEngine
*engine_r
,
30 HklPseudoAxisEngine
*engine_w
);
32 virtual ~PseudoAxesAdapter(void);
34 PseudoAxesConfig
get_config(void);
36 Matrix
<double> const & get_read(void) const {return _read
;}
37 Matrix
<double> const & get_write(void) const {return _write
;}
38 Matrix
<char*> const & get_pseudo_axis_names(void) const {return _pseudo_axis_names
;}
39 std::string
const & get_proxy_name(void) const {return _proxy_name
;}
41 char const * get_name(void) const;
42 void write(Matrix
<double> const & write
) throw (Tango::DevFailed
);
44 double & get_axis_value(size_t idx
) {return _read
.data
[idx
];}
45 void set_axis_value(size_t idx
, double value
);
47 Tango::DevString
*get_mode(void);
48 void set_mode(const Tango::DevString name
);
50 void set_initialized(const Tango::DevBoolean initialized
);
52 Matrix
<char *> const &get_mode_names(void) const {return _mode_names
;}
53 Matrix
<char *> &get_mode_parameters_names(void);
55 Matrix
<double> const & get_mode_parameters(void);
56 void set_mode_parameters(Matrix
<double> const & values
);
58 void set_device(PseudoAxes_ns::PseudoAxes
*device
) {_device
= device
;}
64 void add_dynamic_attributes(void);
65 void remove_dynamic_attributes(void);
68 TangoHKLAdapter
*_hklAdapter
;
69 HklPseudoAxisEngine
*_engine_r
;
70 HklPseudoAxisEngine
*_engine_w
;
72 PseudoAxes_ns::PseudoAxes
*_device
;
73 PseudoAxesConfig _config
;
75 Matrix
<double> _write
;
76 Matrix
<char *> _pseudo_axis_names
;
77 Matrix
<char *> _mode_names
;
78 Matrix
<double> _mode_parameters
;
79 Matrix
<char *> _mode_parameters_names
;
80 std::string _proxy_name
;
81 std::vector
<Tango::Attr
*> _dynamic_attribute_pseudo_axes_axis
;
82 std::vector
<AxisAdapter
*> _axes
;
84 void update_axes_i(HklPseudoAxisEngine
*engine
);
91 #endif // __PSEUDOAXES_ADAPTER_H__