[hkl] no more hkl_engine_list_add method
[hkl.git] / hkl / hkl-engine-soleil-sirius-turret.c
blob0d2ea36f0763682c760ef5fb1ee94fe63a663b4b
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2015 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #include "hkl-factory-private.h" // for autodata_factories_, etc
23 #include "hkl-pseudoaxis-common-hkl-private.h" // for hkl_engine_hkl_new, etc
24 #include "hkl-pseudoaxis-common-q-private.h" // for hkl_engine_q2_new, etc
25 #include "hkl-pseudoaxis-common-tth-private.h" // for hkl_engine_tth2_new, etc
27 /**************************/
28 /* TURRET PseudoAxeEngine */
29 /**************************/
31 static HklMode* lifting_detector_thetah()
33 static const char *axes_r[] = {"thetah", "alphay", "alphax", "delta", "gamma"};
34 static const char* axes_w[] = {"thetah", "delta", "gamma"};
35 static const HklFunction *functions[] = {&RUBh_minus_Q_func};
36 static const HklModeAutoInfo info = {
37 HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
40 return hkl_mode_auto_new(&info,
41 &hkl_full_mode_operations,
42 TRUE);
45 static HklEngine *hkl_engine_soleil_sirius_turret_hkl_new(HklEngineList *engines)
47 HklEngine *self;
48 HklMode *default_mode;
50 self = hkl_engine_hkl_new(engines);
52 default_mode = lifting_detector_thetah();
53 hkl_engine_add_mode(self, default_mode);
54 hkl_engine_mode_set(self, default_mode);
56 return self;
59 /************************/
60 /* SOLEIL SIRIUS TURRET */
61 /************************/
63 #define HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION \
64 "+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
65 "+ 3 axes for the sample\n" \
66 "\n" \
67 " + **thetah** : rotation around the :math:`-\\vec{z}` direction (0, 0, -1)\n" \
68 " + **alphay** : rotation around the :math:`\\vec{y}` direction (0, 1, 0)\n" \
69 " + **alphax** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
70 "\n" \
71 "+ 2 axis for the detector\n" \
72 "\n" \
73 " + **delta** : rotation around the :math:`-\\vec{y}` direction (0, 0, -1)\n" \
74 " + **gamma** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
76 static const char* hkl_geometry_soleil_sirius_turret_axes[] = {"thetah", "alphay", "alphax", "delta", "gamma"};
78 static HklGeometry *hkl_geometry_new_soleil_sirius_turret(const HklFactory *factory)
80 HklGeometry *self = hkl_geometry_new(factory);
81 HklHolder *h;
83 h = hkl_geometry_add_holder(self);
84 hkl_holder_add_rotation_axis(h, "thetah", 0, 0, -1);
85 hkl_holder_add_rotation_axis(h, "alphay", 0, 1, 0);
86 hkl_holder_add_rotation_axis(h, "alphax", 1, 0, 0);
88 h = hkl_geometry_add_holder(self);
89 hkl_holder_add_rotation_axis(h, "delta", 0, 0, -1);
90 hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
92 return self;
95 static HklEngineList *hkl_engine_list_new_soleil_sirius_turret(const HklFactory *factory)
97 HklEngineList *self = hkl_engine_list_new();
99 hkl_engine_soleil_sirius_turret_hkl_new(self);
100 hkl_engine_q2_new(self);
101 hkl_engine_qper_qpar_new(self);
102 hkl_engine_tth2_new(self);
104 return self;
107 REGISTER_DIFFRACTOMETER(soleil_sirius_turret, "SOLEIL SIRIUS TURRET", HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION);