* do not throw an exception if no command "On" on the Axis.
[diffractometer.git] / src / DiffractometerExtra.cpp
blob76311ebef9b8b4f3d3f9af1881ebab386107595e
1 #include "Diffractometer.h"
2 #include "AxisAttrib.h"
3 #include "PseudoAxesAttrib.h"
4 #include "macros.h"
6 namespace Diffractometer_ns
8 void Diffractometer::refresh_crystal_parameters()
10 DEBUG_STREAM << "Diffractometer::refresh_crystal_parameters(): entering... !" << endl;
12 // Refresh Values
13 if(_hklAdapter)
14 _hklAdapter->get_sample_lattices(attr_A_read, attr_B_read, attr_C_read,
15 attr_Alpha_read, attr_Beta_read, attr_Gamma_read,
16 attr_AStar_read, attr_BStar_read, attr_CStar_read,
17 attr_AlphaStar_read, attr_BetaStar_read, attr_GammaStar_read);
20 /* this method return false if everythings goes fine, true otherwise */
21 bool Diffractometer::get_type_from_property(std::string const & name, HklGeometryType &type)
23 bool res = false;
25 if (!strcasecmp(name.c_str(), "2CV"))
26 type = HKL_GEOMETRY_TYPE_TWOC_VERTICAL;
27 else if (!strcasecmp(name.c_str(), "E4CV"))
28 type = HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL;
29 else if (!strcasecmp(name.c_str(), "K4CV"))
30 type = HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL;
31 else if (!strcasecmp(name.c_str(), "K6C"))
32 type = HKL_GEOMETRY_TYPE_KAPPA6C;
33 else if (!strcasecmp(name.c_str(), "E6C"))
34 type = HKL_GEOMETRY_TYPE_EULERIAN6C;
35 else if (!strcasecmp(name.c_str(), "ZAXIS"))
36 type = HKL_GEOMETRY_TYPE_ZAXIS;
37 else
38 res = true;
40 return res;
43 void Diffractometer::create_dynamic_attributes(void)
45 if(_hklAdapter)
46 _hklAdapter->attach_dynamic_attributes_to_device();
49 void Diffractometer::remove_dynamic_attributes(void)
51 if(_hklAdapter)
52 _hklAdapter->detach_dynamic_attributes_from_device();
54 } // namespace_ns