* add the autotools buildsystem
[diffractometer.git] / src / DiffractometerExtra.cpp
blob43a148f5cf5eecdab34a8f9994a35cbc58f47a1f
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 HklGeometryType Diffractometer::get_type_from_property(std::string const & name)
22 HklGeometryType type;
24 if (!strcasecmp(name.c_str(), "2CV"))
25 type = HKL_GEOMETRY_TYPE_TWOC_VERTICAL;
26 else if (!strcasecmp(name.c_str(), "E4CV"))
27 type = HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL;
28 else if (!strcasecmp(name.c_str(), "K4CV"))
29 type = HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL;
30 else if (!strcasecmp(name.c_str(), "K6C"))
31 type = HKL_GEOMETRY_TYPE_KAPPA6C;
32 else if (!strcasecmp(name.c_str(), "E6C"))
33 type = HKL_GEOMETRY_TYPE_EULERIAN6C;
34 else if (!strcasecmp(name.c_str(), "ZAXIS"))
35 type = HKL_GEOMETRY_TYPE_ZAXIS;
36 else
37 type = HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL;
39 return type;
42 void Diffractometer::create_dynamic_attributes(void)
44 if(_hklAdapter)
45 _hklAdapter->add_dynamic_attributes_to_device();
48 void Diffractometer::remove_dynamic_attributes(void)
50 if(_hklAdapter)
51 _hklAdapter->delete_dynamic_attributes();
53 } // namespace_ns