upgrading copyright year from 2015 to 2016
[hkl.git] / hkl / hkl-engine-soleil-sirius-turret.c
blobba8801ee7e497b6a7efa5d39946ca3f175691848
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-2016 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
26 #include "hkl-pseudoaxis-common-readonly-private.h"
28 #define THETAH "thetah"
29 #define ALPHAY "alphay"
30 #define ALPHAX "alphax"
31 #define DELTA "delta"
32 #define GAMMA "gamma"
34 /************/
35 /* mode hkl */
36 /************/
38 static HklMode* lifting_detector_thetah()
40 static const char *axes_r[] = {THETAH, ALPHAY, ALPHAX, DELTA, GAMMA};
41 static const char* axes_w[] = {THETAH, DELTA, GAMMA};
42 static const HklFunction *functions[] = {&RUBh_minus_Q_func};
43 static const HklModeAutoInfo info = {
44 HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
47 return hkl_mode_auto_new(&info,
48 &hkl_full_mode_operations,
49 TRUE);
52 static HklEngine *hkl_engine_soleil_sirius_turret_hkl_new(HklEngineList *engines)
54 HklEngine *self;
55 HklMode *default_mode;
57 self = hkl_engine_hkl_new(engines);
59 default_mode = lifting_detector_thetah();
60 hkl_engine_add_mode(self, default_mode);
61 hkl_engine_mode_set(self, default_mode);
63 return self;
66 /*****************/
67 /* mode readonly */
68 /*****************/
70 REGISTER_READONLY_INCIDENCE(hkl_engine_soleil_sirius_turret_incidence_new,
71 P99_PROTECT({THETAH, ALPHAY, ALPHAX}),
72 surface_parameters_z);
74 REGISTER_READONLY_EMERGENCE(hkl_engine_soleil_sirius_turret_emergence_new,
75 P99_PROTECT({THETAH, ALPHAY, ALPHAX, DELTA, GAMMA}),
76 surface_parameters_z);
78 /************************/
79 /* SOLEIL SIRIUS TURRET */
80 /************************/
82 #define HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION \
83 "+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
84 "+ 3 axes for the sample\n" \
85 "\n" \
86 " + **" THETAH "** : rotation around the :math:`-\\vec{z}` direction (0, 0, -1)\n" \
87 " + **" ALPHAY "** : rotation around the :math:`\\vec{y}` direction (0, 1, 0)\n" \
88 " + **" ALPHAX "** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
89 "\n" \
90 "+ 2 axis for the detector\n" \
91 "\n" \
92 " + **" DELTA "** : rotation around the :math:`-\\vec{y}` direction (0, 0, -1)\n" \
93 " + **" GAMMA "** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
95 static const char* hkl_geometry_soleil_sirius_turret_axes[] = {THETAH, ALPHAY, ALPHAX, DELTA, GAMMA};
97 static HklGeometry *hkl_geometry_new_soleil_sirius_turret(const HklFactory *factory)
99 HklGeometry *self = hkl_geometry_new(factory);
100 HklHolder *h;
102 h = hkl_geometry_add_holder(self);
103 hkl_holder_add_rotation_axis(h, THETAH, 0, 0, -1);
104 hkl_holder_add_rotation_axis(h, ALPHAY, 0, 1, 0);
105 hkl_holder_add_rotation_axis(h, ALPHAX, 1, 0, 0);
107 h = hkl_geometry_add_holder(self);
108 hkl_holder_add_rotation_axis(h, DELTA, 0, 0, -1);
109 hkl_holder_add_rotation_axis(h, GAMMA, 0, -1, 0);
111 return self;
114 static HklEngineList *hkl_engine_list_new_soleil_sirius_turret(const HklFactory *factory)
116 HklEngineList *self = hkl_engine_list_new();
118 hkl_engine_soleil_sirius_turret_hkl_new(self);
119 hkl_engine_q2_new(self);
120 hkl_engine_qper_qpar_new(self);
121 hkl_engine_tth2_new(self);
122 hkl_engine_soleil_sirius_turret_incidence_new(self);
123 hkl_engine_soleil_sirius_turret_emergence_new(self);
125 return self;
128 REGISTER_DIFFRACTOMETER(soleil_sirius_turret, "SOLEIL SIRIUS TURRET", HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION);