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-2010 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>
25 #include <glib-object.h>
28 #include "hkl-gui-pseudoaxes.h"
36 #define HKL_GUI_TYPE_WINDOW (hkl_gui_window_get_type ())
37 #define HKL_GUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindow))
38 #define HKL_GUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
39 #define HKL_GUI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_WINDOW))
40 #define HKL_GUI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_WINDOW))
41 #define HKL_GUI_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
43 G_DEFINE_TYPE (HklGuiWindow
, hkl_gui_window
, G_TYPE_OBJECT
);
46 REFLECTION_COL_INDEX
= 0,
51 REFLECTION_COL_REFLECTION
,
52 REFLECTION_COL_N_COLUMNS
66 PSEUDO_AXIS_COL_PARAMETER
= 0,
67 PSEUDO_AXIS_COL_ENGINE
,
70 PSEUDO_AXIS_COL_WRITE
,
71 PSEUDO_AXIS_COL_N_COLUMNS
75 PARAMETER_COL_PARAMETER
= 0,
78 PARAMETER_COL_N_COLUMNS
82 SAMPLE_COL_SAMPLE
= 0,
83 SAMPLE_COL_REFLECTIONS
,
95 SOLUTION_COL_INDEX
= 0,
96 SOLUTION_COL_N_COLUMNS
100 DIFFRACTOMETER_COL_NAME
= 0,
101 DIFFRACTOMETER_COL_FACTORY
,
102 DIFFRACTOMETER_COL_DIFFRACTOMETER
,
103 DIFFRACTOMETER_COL_N_COLUMNS
110 struct diffractometer_t
{
111 HklGeometry
*geometry
;
112 HklDetector
*detector
;
113 HklEngineList
*engines
;
117 static struct diffractometer_t
*
118 create_diffractometer(HklFactory
*factory
)
120 struct diffractometer_t
*self
;
122 self
= malloc(sizeof(*self
));
124 self
->geometry
= hkl_factory_create_new_geometry (factory
);
125 self
->engines
= hkl_factory_create_new_engine_list (factory
);
126 self
->detector
= hkl_detector_factory_new (HKL_DETECTOR_TYPE_0D
);
127 hkl_detector_idx_set (self
->detector
, 1);
133 delete_diffractometer(struct diffractometer_t
*self
)
135 hkl_geometry_free(self
->geometry
);
136 hkl_engine_list_free(self
->engines
);
137 hkl_detector_free(self
->detector
);
142 dump_diffractometer(struct diffractometer_t
*self
)
144 /* hkl_geometry_fprintf(stderr, self->geometry); */
145 /* hkl_engine_list_fprintf(stderr, self->engines); */
146 /* hkl_detector_fprintf(stderr, self->detector); */
153 struct _HklGuiWindowPrivate
{
155 GtkLabel
* _label_UB11
;
156 GtkLabel
* _label_UB12
;
157 GtkLabel
* _label_UB13
;
158 GtkLabel
* _label_UB21
;
159 GtkLabel
* _label_UB22
;
160 GtkLabel
* _label_UB23
;
161 GtkLabel
* _label_UB31
;
162 GtkLabel
* _label_UB32
;
163 GtkLabel
* _label_UB33
;
165 GtkSpinButton
* _spinbutton_a
;
166 GtkSpinButton
* _spinbutton_b
;
167 GtkSpinButton
* _spinbutton_c
;
168 GtkSpinButton
* _spinbutton_alpha
;
169 GtkSpinButton
* _spinbutton_beta
;
170 GtkSpinButton
* _spinbutton_gamma
;
171 GtkSpinButton
* _spinbutton_a_min
;
172 GtkSpinButton
* _spinbutton_b_min
;
173 GtkSpinButton
* _spinbutton_c_min
;
174 GtkSpinButton
* _spinbutton_alpha_min
;
175 GtkSpinButton
* _spinbutton_beta_min
;
176 GtkSpinButton
* _spinbutton_gamma_min
;
177 GtkSpinButton
* _spinbutton_a_max
;
178 GtkSpinButton
* _spinbutton_b_max
;
179 GtkSpinButton
* _spinbutton_c_max
;
180 GtkSpinButton
* _spinbutton_alpha_max
;
181 GtkSpinButton
* _spinbutton_beta_max
;
182 GtkSpinButton
* _spinbutton_gamma_max
;
183 GtkSpinButton
* _spinbutton_lambda
;
184 GtkSpinButton
* _spinbutton_a_star
;
185 GtkSpinButton
* _spinbutton_b_star
;
186 GtkSpinButton
* _spinbutton_c_star
;
187 GtkSpinButton
* _spinbutton_alpha_star
;
188 GtkSpinButton
* _spinbutton_beta_star
;
189 GtkSpinButton
* _spinbutton_gamma_star
;
190 GtkSpinButton
* _spinbutton_ux
;
191 GtkSpinButton
* _spinbutton_uy
;
192 GtkSpinButton
* _spinbutton_uz
;
193 GtkSpinButton
* _spinbutton_U11
;
194 GtkSpinButton
* _spinbutton_U12
;
195 GtkSpinButton
* _spinbutton_U13
;
196 GtkSpinButton
* _spinbutton_U21
;
197 GtkSpinButton
* _spinbutton_U22
;
198 GtkSpinButton
* _spinbutton_U23
;
199 GtkSpinButton
* _spinbutton_U31
;
200 GtkSpinButton
* _spinbutton_U32
;
201 GtkSpinButton
* _spinbutton_U33
;
202 GtkCheckButton
* _checkbutton_a
;
203 GtkCheckButton
* _checkbutton_b
;
204 GtkCheckButton
* _checkbutton_c
;
205 GtkCheckButton
* _checkbutton_alpha
;
206 GtkCheckButton
* _checkbutton_beta
;
207 GtkCheckButton
* _checkbutton_gamma
;
208 GtkCheckButton
* _checkbutton_Ux
;
209 GtkCheckButton
* _checkbutton_Uy
;
210 GtkCheckButton
* _checkbutton_Uz
;
211 GtkTreeView
* _treeview_reflections
;
212 GtkTreeView
* _treeview_crystals
;
213 GtkTreeView
* _treeview_axes
;
214 GtkTreeView
* _treeview_pseudo_axes
;
215 GtkTreeView
* _treeview_pseudo_axes_parameters
;
216 GtkTreeView
* _treeview_solutions
;
217 GtkToolButton
* _toolbutton_add_reflection
;
218 GtkToolButton
* _toolbutton_goto_reflection
;
219 GtkToolButton
* _toolbutton_del_reflection
;
220 GtkToolButton
* _toolbutton_setUB
;
221 GtkToolButton
* _toolbutton_computeUB
;
222 GtkToolButton
* _toolbutton_add_crystal
;
223 GtkToolButton
* _toolbutton_copy_crystal
;
224 GtkToolButton
* _toolbutton_del_crystal
;
225 GtkToolButton
* _toolbutton_affiner
;
226 GtkStatusbar
* _statusbar
;
227 GtkImageMenuItem
* _menuitem5
;
228 GtkVBox
* _box_info_bar
; /* fake for the infor bar */
233 GtkComboBox
* _combobox1
;
234 GtkListStore
* _liststore_diffractometer
;
235 GtkListStore
* _liststore_axis
;
236 GtkListStore
* _liststore_pseudo_axes
;
237 GtkListStore
* _liststore_solutions
;
238 GtkListStore
* _liststore_reflections
;
240 GtkListStore
* store_samples
;
241 GtkInfoBar
*info_bar
;
242 GtkLabel
*info_message
;
244 darray(HklGuiEngine
*) pseudo_frames
;
246 struct diffractometer_t
*diffractometer
; /* unowned */
247 HklSample
*sample
; /* unowned */
248 HklLattice
*reciprocal
;
251 #define HKL_GUI_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_WINDOW, HklGuiWindowPrivate))
254 finalize_liststore_diffractometer(GtkTreeModel
*model
,
259 struct diffractometer_t
*diffractometer
;
261 gtk_tree_model_get(model
, iter
,
262 DIFFRACTOMETER_COL_DIFFRACTOMETER
, &diffractometer
,
264 delete_diffractometer(diffractometer
);
270 finalize (GObject
* object
)
272 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(object
);
274 g_object_unref(priv
->builder
);
276 darray_free(priv
->pseudo_frames
);
278 gtk_tree_model_foreach(GTK_TREE_MODEL(priv
->_liststore_diffractometer
),
279 finalize_liststore_diffractometer
,
282 G_OBJECT_CLASS (hkl_gui_window_parent_class
)->finalize (object
);
285 HklGuiWindow
* hkl_gui_window_new (void)
287 return g_object_new (HKL_GUI_TYPE_WINDOW
, NULL
);
291 #define get_object(builder, type, priv, name) priv->_ ## name = type(gtk_builder_get_object(builder, #name))
294 hkl_gui_window_get_widgets_and_objects_from_ui (HklGuiWindow
* self
)
296 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
299 g_return_if_fail (self
!= NULL
);
301 priv
->builder
= builder
= gtk_builder_new ();
302 gtk_builder_add_from_file (builder
, "ghkl.ui", NULL
);
304 get_object(builder
, GTK_LIST_STORE
, priv
, liststore_diffractometer
);
305 get_object(builder
, GTK_LIST_STORE
, priv
, liststore_axis
);
306 get_object(builder
, GTK_LIST_STORE
, priv
, liststore_pseudo_axes
);
307 get_object(builder
, GTK_LIST_STORE
, priv
, liststore_reflections
);
309 get_object(builder
, GTK_LABEL
, priv
, label_UB11
);
310 get_object(builder
, GTK_LABEL
, priv
, label_UB12
);
311 get_object(builder
, GTK_LABEL
, priv
, label_UB13
);
312 get_object(builder
, GTK_LABEL
, priv
, label_UB21
);
313 get_object(builder
, GTK_LABEL
, priv
, label_UB22
);
314 get_object(builder
, GTK_LABEL
, priv
, label_UB23
);
315 get_object(builder
, GTK_LABEL
, priv
, label_UB31
);
316 get_object(builder
, GTK_LABEL
, priv
, label_UB32
);
317 get_object(builder
, GTK_LABEL
, priv
, label_UB33
);
319 get_object(builder
, GTK_BUTTON
, priv
, button2
);
321 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_a
);
322 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_a_min
);
323 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_a_max
);
324 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_a_star
);
326 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_b
);
327 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_b_min
);
328 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_b_max
);
329 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_b_star
);
331 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_c
);
332 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_c_min
);
333 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_c_max
);
334 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_c_star
);
336 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_alpha
);
337 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_alpha_min
);
338 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_alpha_max
);
339 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_alpha_star
);
341 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_beta
);
342 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_beta_min
);
343 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_beta_max
);
344 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_beta_star
);
346 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_gamma
);
347 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_gamma_min
);
348 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_gamma_max
);
349 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_gamma_star
);
351 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_lambda
);
353 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_ux
);
354 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_uy
);
355 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_uz
);
357 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U11
);
358 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U12
);
359 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U13
);
360 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U21
);
361 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U22
);
362 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U23
);
363 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U31
);
364 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U32
);
365 get_object(builder
, GTK_SPIN_BUTTON
, priv
, spinbutton_U33
);
368 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_a
);
369 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_b
);
370 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_c
);
371 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_alpha
);
372 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_beta
);
373 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_gamma
);
374 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_Ux
);
375 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_Uy
);
376 get_object(builder
, GTK_CHECK_BUTTON
, priv
, checkbutton_Uz
);
379 get_object(builder
, GTK_TREE_VIEW
, priv
, treeview_reflections
);
380 get_object(builder
, GTK_TREE_VIEW
, priv
, treeview_crystals
);
381 get_object(builder
, GTK_TREE_VIEW
, priv
, treeview_axes
);
382 get_object(builder
, GTK_TREE_VIEW
, priv
, treeview_pseudo_axes
);
383 get_object(builder
, GTK_TREE_VIEW
, priv
, treeview_solutions
);
384 priv
->_treeview_pseudo_axes_parameters
= GTK_TREE_VIEW(gtk_builder_get_object (builder
, "treeview_pseudoAxes_parameters"));
387 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_add_reflection
);
388 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_goto_reflection
);
389 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_del_reflection
);
390 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_setUB
);
391 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_computeUB
);
392 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_add_crystal
);
393 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_copy_crystal
);
394 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_del_crystal
);
395 get_object(builder
, GTK_TOOL_BUTTON
, priv
, toolbutton_affiner
);
397 get_object(builder
, GTK_STATUSBAR
, priv
, statusbar
);
399 get_object(builder
, GTK_IMAGE_MENU_ITEM
, priv
, menuitem5
);
401 get_object(builder
, GTK_VBOX
, priv
, vbox7
);
402 get_object(builder
, GTK_VBOX
, priv
, vbox2
);
403 get_object(builder
, GTK_VBOX
, priv
, box_info_bar
);
405 get_object(builder
, GTK_DIALOG
, priv
, dialog1
);
407 get_object(builder
, GTK_COMBO_BOX
, priv
, combobox1
);
409 gtk_builder_connect_signals (builder
, self
);
413 update_pseudo_axes_frames (HklGuiWindow
* self
)
415 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
416 HklGuiEngine
**engine
;
418 g_return_if_fail (self
!= NULL
);
420 darray_foreach(engine
, priv
->pseudo_frames
){
421 hkl_gui_engine_update(*engine
);
426 raise_error(HklGuiWindow
*self
, HklError
**error
)
428 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
430 g_return_if_fail (self
!= NULL
);
431 g_return_if_fail (error
!= NULL
);
433 /* show an error message */
434 gtk_label_set_text (GTK_LABEL (priv
->info_message
),
435 hkl_error_message_get(*error
));
436 gtk_info_bar_set_message_type (priv
->info_bar
,
438 gtk_widget_show (GTK_WIDGET(priv
->info_bar
));
440 hkl_error_clear(error
);
444 clear_error(HklGuiWindow
*self
, HklError
**error
)
446 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
448 g_return_if_fail (self
!= NULL
);
450 gtk_widget_hide(GTK_WIDGET(priv
->info_bar
));
454 _update_axis (GtkTreeModel
*model
, GtkTreePath
*path
,
455 GtkTreeIter
*iter
, gpointer data
)
457 HklParameter
*parameter
;
458 gdouble value
, min
, max
;
460 gtk_tree_model_get (model
, iter
,
461 AXIS_COL_AXIS
, ¶meter
,
464 hkl_parameter_min_max_unit_get(parameter
, &min
, &max
);
465 value
= hkl_parameter_value_unit_get(parameter
);
467 gtk_list_store_set(GTK_LIST_STORE(model
), iter
,
468 AXIS_COL_READ
, value
,
469 AXIS_COL_WRITE
, value
,
477 update_axes (HklGuiWindow
* self
)
479 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
481 g_return_if_fail (self
!= NULL
);
483 gtk_tree_model_foreach(GTK_TREE_MODEL(priv
->_liststore_axis
),
489 _update_pseudo_axes (GtkTreeModel
*model
, GtkTreePath
*path
,
490 GtkTreeIter
*iter
, gpointer data
)
492 HklParameter
*parameter
;
493 gdouble value
, min
, max
;
495 gtk_tree_model_get (model
, iter
,
496 PSEUDO_AXIS_COL_PARAMETER
, ¶meter
,
499 hkl_parameter_min_max_unit_get(parameter
, &min
, &max
);
500 value
= hkl_parameter_value_unit_get(parameter
);
502 gtk_list_store_set(GTK_LIST_STORE(model
), iter
,
503 PSEUDO_AXIS_COL_READ
, value
,
504 PSEUDO_AXIS_COL_WRITE
, value
,
510 update_pseudo_axes (HklGuiWindow
* self
)
512 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
514 g_return_if_fail (self
!= NULL
);
516 gtk_tree_model_foreach(GTK_TREE_MODEL(priv
->_liststore_pseudo_axes
),
522 update_solutions (HklGuiWindow
* self
)
524 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
525 const HklGeometryList
*geometries
;
526 const darray_item
*items
;
527 GtkTreeIter iter
= {0};
529 g_return_if_fail (self
!= NULL
);
531 geometries
= hkl_engine_list_geometries(priv
->diffractometer
->engines
);
533 gtk_list_store_clear(priv
->_liststore_solutions
);
534 items
= hkl_geometry_list_items_get(geometries
);
535 if (darray_size(*items
)){
536 gint n_values
= gtk_tree_model_get_n_columns (GTK_TREE_MODEL(priv
->_liststore_solutions
));
537 GValue
*values
= g_new0(GValue
, n_values
);
538 gint
*columns
= g_new0(gint
, n_values
);
541 /* prepare the GValue before using them */
542 g_value_init(&values
[0], G_TYPE_INT
);
543 for(i
=1; i
<n_values
; ++i
)
544 g_value_init(&values
[i
], G_TYPE_DOUBLE
);
546 for(i
=0; i
<darray_size(*items
);++i
){
548 const HklGeometry
*geometry
;
549 HklParameter
**parameter
;
550 const darray_parameter
*parameters
;
552 geometry
= hkl_geometry_list_item_geometry_get(darray_item(*items
, i
));
553 parameters
= hkl_geometry_axes_get(geometry
);
555 g_value_set_int(&values
[column
], i
);
558 darray_foreach(parameter
, *parameters
){
559 double value
= hkl_parameter_value_unit_get(*parameter
);
562 g_value_set_double(&values
[column
], value
);
563 columns
[column
] = column
;
565 gtk_list_store_insert_with_valuesv(priv
->_liststore_solutions
,
567 columns
, values
, n_values
);
575 hkl_engine_to_axes(HklGuiWindow
*self
, HklEngine
*engine
)
577 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
578 HklError
*error
= NULL
;
581 g_return_val_if_fail (self
!= NULL
, FALSE
);
582 g_return_val_if_fail (engine
!= NULL
, FALSE
);
584 if(hkl_engine_set(engine
, &error
)){
585 clear_error(self
, &error
);
586 hkl_engine_list_select_solution(priv
->diffractometer
->engines
, 0);
587 hkl_engine_list_get(priv
->diffractometer
->engines
);
590 update_pseudo_axes (self
);
591 update_pseudo_axes_frames (self
);
593 raise_error(self
, &error
);
594 dump_diffractometer(priv
->diffractometer
);
597 update_solutions (self
);
602 pseudo_axes_frame_changed_cb (HklGuiEngine
*gui_engine
, HklGuiWindow
*self
)
606 g_return_if_fail (self
!= NULL
);
608 g_object_get(G_OBJECT(gui_engine
),
612 hkl_engine_to_axes(self
, engine
);
616 set_up_pseudo_axes_frames (HklGuiWindow
* self
)
618 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
619 HklGuiEngine
**pseudo
;
622 darray_engine
*engines
;
624 g_return_if_fail (self
!= NULL
);
626 darray_foreach (pseudo
, priv
->pseudo_frames
){
627 gtk_container_remove(GTK_CONTAINER(priv
->_vbox2
),
628 GTK_WIDGET (hkl_gui_engine_get_frame (*pseudo
)));
629 g_object_unref(*pseudo
);
631 darray_size (priv
->pseudo_frames
) = 0;
633 engines
= hkl_engine_list_engines (priv
->diffractometer
->engines
);
634 darray_foreach (engine
, *engines
){
635 HklGuiEngine
*pseudo
;
637 pseudo
= hkl_gui_engine_new (*engine
);
638 darray_append(priv
->pseudo_frames
, pseudo
);
639 gtk_container_add (GTK_CONTAINER (priv
->_vbox2
),
640 GTK_WIDGET (hkl_gui_engine_get_frame(pseudo
)));
642 g_signal_connect_object (pseudo
,
644 G_CALLBACK(pseudo_axes_frame_changed_cb
),
648 gtk_widget_show_all (GTK_WIDGET (priv
->_vbox2
));
653 set_up_diffractometer_model (HklGuiWindow
* self
)
655 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
657 HklFactory
**factories
;
659 g_return_if_fail (self
!= NULL
);
661 factories
= hkl_factory_get_all(&n
);
663 GtkTreeIter iter
= {0};
665 gtk_list_store_append (priv
->_liststore_diffractometer
, &iter
);
666 gtk_list_store_set (priv
->_liststore_diffractometer
,
668 DIFFRACTOMETER_COL_NAME
, hkl_factory_name(factories
[i
]),
669 DIFFRACTOMETER_COL_FACTORY
, factories
[i
],
670 DIFFRACTOMETER_COL_DIFFRACTOMETER
, NULL
,
676 set_up_tree_view_axes (HklGuiWindow
* self
)
678 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
679 HklParameter
**parameter
;
680 const darray_parameter
*parameters
;
681 GtkCellRenderer
* renderer
= NULL
;
682 GtkTreeViewColumn
* column
= NULL
;
685 g_return_if_fail (self
!= NULL
);
687 gtk_list_store_clear (priv
->_liststore_axis
);
689 parameters
= hkl_geometry_axes_get(priv
->diffractometer
->geometry
);
690 darray_foreach (parameter
, *parameters
){
691 GtkTreeIter iter
= {0};
693 gtk_list_store_append (priv
->_liststore_axis
, &iter
);
694 gtk_list_store_set (priv
->_liststore_axis
, &iter
,
695 AXIS_COL_AXIS
, *parameter
,
696 AXIS_COL_NAME
, hkl_parameter_name_get(*parameter
),
704 set_up_tree_view_pseudo_axes (HklGuiWindow
* self
)
706 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
707 HklParameter
**parameter
;
708 const darray_parameter
*parameters
;
710 const darray_engine
*engines
;
712 GtkCellRendererText
* renderer
= NULL
;
713 GtkTreeViewColumn
* column
= NULL
;
716 g_return_if_fail (self
!= NULL
);
718 gtk_list_store_clear(priv
->_liststore_pseudo_axes
);
720 engines
= hkl_engine_list_engines(priv
->diffractometer
->engines
);
721 darray_foreach(engine
, *engines
){
722 parameters
= hkl_engine_pseudo_axes(*engine
);
723 darray_foreach(parameter
, *parameters
){
724 GtkTreeIter iter
= {0};
726 gtk_list_store_append (priv
->_liststore_pseudo_axes
, &iter
);
727 gtk_list_store_set (priv
->_liststore_pseudo_axes
, &iter
,
728 PSEUDO_AXIS_COL_PARAMETER
, *parameter
,
729 PSEUDO_AXIS_COL_ENGINE
, *engine
,
730 PSEUDO_AXIS_COL_NAME
, hkl_parameter_name_get(*parameter
),
735 update_pseudo_axes (self
);
739 _delete_column(gpointer data
,
742 gtk_tree_view_remove_column (GTK_TREE_VIEW(user_data
),
743 GTK_TREE_VIEW_COLUMN(data
));
747 set_up_tree_view_solutions (HklGuiWindow
* self
)
749 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
750 const darray_parameter
*parameters
;
752 GtkCellRenderer
* renderer
= NULL
;
753 GtkTreeViewColumn
* column
= NULL
;
758 g_return_if_fail (self
!= NULL
);
760 parameters
= hkl_geometry_axes_get(priv
->diffractometer
->geometry
);
762 n_columns
= SOLUTION_COL_N_COLUMNS
+ darray_size(*parameters
);
764 /* prepare types for the liststore */
765 types
= g_new0 (GType
, n_columns
);
767 /* first remove all the columns */
768 columns
= gtk_tree_view_get_columns (priv
->_treeview_solutions
);
769 g_list_foreach(columns
, _delete_column
, priv
->_treeview_solutions
);
770 g_list_free(columns
);
772 /* now add the index column */
773 renderer
= gtk_cell_renderer_text_new ();
774 column
= gtk_tree_view_column_new_with_attributes ("index",
776 SOLUTION_COL_INDEX
, NULL
);
778 gtk_tree_view_append_column (priv
->_treeview_solutions
, column
);
779 types
[0] = G_TYPE_INT
;
781 /* add the axes column */
782 for(i
=1; i
<n_columns
; ++i
){
783 HklParameter
*parameter
;
785 parameter
= darray_item(*parameters
, i
- SOLUTION_COL_N_COLUMNS
);
786 renderer
= gtk_cell_renderer_text_new ();
787 column
= gtk_tree_view_column_new_with_attributes (hkl_parameter_name_get(parameter
),
791 gtk_tree_view_append_column (priv
->_treeview_solutions
, column
);
792 types
[i
] = G_TYPE_DOUBLE
;
795 if (priv
->_liststore_solutions
)
796 g_object_unref(priv
->_liststore_solutions
);
797 priv
->_liststore_solutions
= gtk_list_store_newv (n_columns
, types
);
800 gtk_tree_view_set_model (priv
->_treeview_solutions
,
801 GTK_TREE_MODEL(priv
->_liststore_solutions
));
803 update_solutions (self
);
807 set_up_info_bar(HklGuiWindow
*self
)
809 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
810 GtkWidget
*content_area
;
812 g_return_if_fail (self
!= NULL
);
814 /* set up info bar until we can use glade for this purpose or
819 priv
->info_bar
= GTK_INFO_BAR(gtk_info_bar_new ());
820 gtk_widget_set_no_show_all (GTK_WIDGET(priv
->info_bar
), TRUE
);
822 priv
->info_message
= GTK_LABEL(gtk_label_new (""));
823 gtk_widget_show (GTK_WIDGET(priv
->info_message
));
825 content_area
= gtk_info_bar_get_content_area (GTK_INFO_BAR (priv
->info_bar
));
826 gtk_container_add (GTK_CONTAINER (content_area
),
827 GTK_WIDGET(priv
->info_message
));
828 gtk_info_bar_add_button (priv
->info_bar
,
829 GTK_STOCK_OK
, GTK_RESPONSE_OK
);
830 g_signal_connect (priv
->info_bar
, "response",
831 G_CALLBACK (gtk_widget_hide
), NULL
);
833 gtk_box_pack_start(GTK_BOX(priv
->_box_info_bar
),
834 GTK_WIDGET(priv
->info_bar
),
839 hkl_gui_window_combobox1_changed_cb(GtkComboBox
*combobox
, gpointer
*user_data
)
841 HklGuiWindow
*self
= HKL_GUI_WINDOW(user_data
);
842 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
844 struct diffractometer_t
*dif
= NULL
;
846 GtkTreeIter iter
= {0};
848 if(gtk_combo_box_get_active_iter (combobox
, &iter
)){
849 gtk_tree_model_get(GTK_TREE_MODEL(priv
->_liststore_diffractometer
),
851 DIFFRACTOMETER_COL_FACTORY
, &factory
,
852 DIFFRACTOMETER_COL_DIFFRACTOMETER
, &dif
,
856 dif
= create_diffractometer(factory
);
857 gtk_list_store_set(priv
->_liststore_diffractometer
,
859 DIFFRACTOMETER_COL_DIFFRACTOMETER
, dif
,
864 priv
->diffractometer
= dif
;
865 /* TODO check if this is the right place for this */
866 hkl_engine_list_init(dif
->engines
, dif
->geometry
, dif
->detector
, priv
->sample
);
868 set_up_pseudo_axes_frames(self
);
869 set_up_tree_view_axes(self
);
870 //hkl_gui_window_set_up_tree_view_pseudo_axes_parameters(self);
871 set_up_tree_view_pseudo_axes(self
);
873 /* FIXME create the right solution Model Column */
874 /* this._solutionModelColumns = 0; */
875 set_up_tree_view_solutions(self
);
876 set_up_info_bar(self
);
885 hkl_gui_window_cellrendererspin1_edited_cb(GtkCellRendererText
*renderer
,
890 HklGuiWindow
*self
= HKL_GUI_WINDOW(user_data
);
891 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
892 GtkTreeIter iter
= {0};
894 HklParameter
* parameter
= NULL
;
896 g_return_if_fail (renderer
!= NULL
);
897 g_return_if_fail (path
!= NULL
);
898 g_return_if_fail (new_text
!= NULL
);
899 g_return_if_fail (user_data
!= NULL
);
901 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_axis
),
904 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_axis
), &iter
,
905 AXIS_COL_AXIS
, ¶meter
,
908 value
= atof(new_text
); /* TODO need to check for the right conversion */
909 hkl_parameter_value_unit_set (parameter
, value
, NULL
);
910 hkl_geometry_axis_set(priv
->diffractometer
->geometry
,
913 hkl_engine_list_get(priv
->diffractometer
->engines
);
915 /* ok so set the model with the new value */
916 gtk_list_store_set (priv
->_liststore_axis
, &iter
,
917 AXIS_COL_READ
, value
,
918 AXIS_COL_WRITE
, value
,
921 update_pseudo_axes (self
);
922 update_pseudo_axes_frames (self
);
928 hkl_gui_window_cellrendererspin3_edited_cb(GtkCellRendererText
*renderer
,
933 HklGuiWindow
*self
= HKL_GUI_WINDOW(user_data
);
934 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
935 GtkTreeIter iter
= {0};
937 HklParameter
* parameter
= NULL
;
940 g_return_if_fail (renderer
!= NULL
);
941 g_return_if_fail (path
!= NULL
);
942 g_return_if_fail (new_text
!= NULL
);
943 g_return_if_fail (user_data
!= NULL
);
945 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_axis
),
948 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_axis
), &iter
,
949 AXIS_COL_AXIS
, ¶meter
,
952 value
= atof(new_text
); /* TODO need to check for the right conversion */
953 hkl_parameter_min_max_unit_get (parameter
, &shit
, &max
);
954 hkl_parameter_min_max_unit_set (parameter
, value
, max
);
956 gtk_list_store_set (priv
->_liststore_axis
, &iter
,
960 update_pseudo_axes (self
);
966 hkl_gui_window_cellrendererspin4_edited_cb(GtkCellRendererText
*renderer
,
971 HklGuiWindow
*self
= HKL_GUI_WINDOW(user_data
);
972 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
973 GtkTreeIter iter
= {0};
975 HklParameter
* parameter
= NULL
;
978 g_return_if_fail (renderer
!= NULL
);
979 g_return_if_fail (path
!= NULL
);
980 g_return_if_fail (new_text
!= NULL
);
981 g_return_if_fail (user_data
!= NULL
);
983 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_axis
),
986 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_axis
), &iter
,
987 AXIS_COL_AXIS
, ¶meter
,
990 value
= atof(new_text
); /* TODO need to check for the right conversion */
991 hkl_parameter_min_max_unit_get (parameter
, &min
, &shit
);
992 hkl_parameter_min_max_unit_set (parameter
, min
, value
);
994 gtk_list_store_set (priv
->_liststore_axis
, &iter
,
998 update_pseudo_axes (self
);
1002 /* pseudo axis write */
1004 hkl_gui_window_cellrenderertext5_edited_cb(GtkCellRendererText
*renderer
,
1009 HklGuiWindow
*self
= HKL_GUI_WINDOW(user_data
);
1010 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
1011 GtkTreeIter iter
= {0};
1012 gdouble value
= 0.0;
1014 HklParameter
* parameter
= NULL
;
1015 HklEngine
*engine
= NULL
;
1016 HklError
*error
= NULL
;
1018 g_return_if_fail (renderer
!= NULL
);
1019 g_return_if_fail (path
!= NULL
);
1020 g_return_if_fail (new_text
!= NULL
);
1021 g_return_if_fail (user_data
!= NULL
);
1023 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_pseudo_axes
),
1026 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_pseudo_axes
), &iter
,
1027 PSEUDO_AXIS_COL_PARAMETER
, ¶meter
,
1028 PSEUDO_AXIS_COL_ENGINE
, &engine
,
1031 value
= atof(new_text
); /* TODO need to check for the right conversion */
1032 old_value
= hkl_parameter_value_unit_get(parameter
);
1034 g_assert(error
!= NULL
|| error
== NULL
);
1035 hkl_parameter_value_unit_set (parameter
, value
, &error
);
1037 raise_error(self
, &error
);
1040 if (hkl_engine_to_axes(self
, engine
)){
1041 gtk_list_store_set (priv
->_liststore_pseudo_axes
,
1043 PSEUDO_AXIS_COL_WRITE
, value
,
1046 hkl_parameter_value_unit_set(parameter
, old_value
, NULL
);
1052 hkl_gui_window_treeview_solutions_cursor_changed_cb (GtkTreeView
*tree_view
,
1055 HklGuiWindow
* self
= HKL_GUI_WINDOW(user_data
);
1056 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(user_data
);
1058 GtkTreePath
* path
= NULL
;
1059 GtkTreeViewColumn
* focus_column
= NULL
;
1060 GtkTreeIter iter
= {0};
1063 g_return_if_fail (tree_view
!= NULL
);
1064 g_return_if_fail (user_data
!= NULL
);
1066 gtk_tree_view_get_cursor (tree_view
, &path
, &focus_column
);
1067 gtk_tree_model_get_iter (GTK_TREE_MODEL(priv
->_liststore_solutions
), &iter
, path
);
1068 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_solutions
), &iter
,
1069 SOLUTION_COL_INDEX
, &index
,
1072 hkl_engine_list_select_solution (priv
->diffractometer
->engines
, index
);
1073 hkl_engine_list_get (priv
->diffractometer
->engines
);
1076 update_pseudo_axes (self
);
1077 update_pseudo_axes_frames (self
);
1079 gtk_tree_path_free (path
);
1084 hkl_gui_window_cellrenderertext7_edited_cb(GtkCellRendererText
* _sender
, const gchar
* path
,
1085 const gchar
* new_text
, gpointer self
)
1087 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
1089 g_return_if_fail (self
!= NULL
);
1090 g_return_if_fail (path
!= NULL
);
1091 g_return_if_fail (new_text
!= NULL
);
1097 HklSampleReflection
* reflection
= NULL
;
1098 GtkTreeIter iter
= {0};
1100 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1102 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1104 REFLECTION_COL_REFLECTION
, &reflection
,
1107 hkl_sample_reflection_hkl_get (reflection
, &h
, &k
, &l
);
1109 hkl_sample_reflection_hkl_set (reflection
, h
, k
, l
);
1110 gtk_list_store_set (priv
->_liststore_reflections
,
1112 REFLECTION_COL_H
, h
,
1119 hkl_gui_window_cellrenderertext8_edited_cb (GtkCellRendererText
* _sender
, const gchar
* path
,
1120 const gchar
* new_text
, gpointer self
)
1122 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
1124 g_return_if_fail (self
!= NULL
);
1125 g_return_if_fail (path
!= NULL
);
1126 g_return_if_fail (new_text
!= NULL
);
1132 HklSampleReflection
* reflection
= NULL
;
1133 GtkTreeIter iter
= {0};
1135 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1137 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1139 REFLECTION_COL_REFLECTION
, &reflection
,
1142 hkl_sample_reflection_hkl_get (reflection
, &h
, &k
, &l
);
1144 hkl_sample_reflection_hkl_set (reflection
, h
, k
, l
);
1145 gtk_list_store_set (priv
->_liststore_reflections
,
1147 REFLECTION_COL_K
, k
,
1154 hkl_gui_window_cellrenderertext9_edited_cb (GtkCellRendererText
* _sender
, const gchar
* path
,
1155 const gchar
* new_text
, gpointer self
)
1157 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
1159 g_return_if_fail (self
!= NULL
);
1160 g_return_if_fail (path
!= NULL
);
1161 g_return_if_fail (new_text
!= NULL
);
1167 HklSampleReflection
* reflection
= NULL
;
1168 GtkTreeIter iter
= {0};
1170 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1172 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1174 REFLECTION_COL_REFLECTION
, &reflection
,
1177 hkl_sample_reflection_hkl_get (reflection
, &h
, &k
, &l
);
1179 hkl_sample_reflection_hkl_set (reflection
, h
, k
, l
);
1180 gtk_list_store_set (priv
->_liststore_reflections
,
1182 REFLECTION_COL_L
, l
,
1187 /* reflection flag */
1189 hkl_gui_window_cellrenderertoggle1_toggled_cb (GtkCellRendererToggle
* renderer
, const gchar
* path
,
1192 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
1194 g_return_if_fail (self
!= NULL
);
1195 g_return_if_fail (path
!= NULL
);
1199 HklSampleReflection
* reflection
= NULL
;
1200 GtkTreeIter iter
= {0};
1202 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1204 gtk_tree_model_get (GTK_TREE_MODEL(priv
->_liststore_reflections
),
1206 REFLECTION_COL_REFLECTION
, &reflection
,
1209 flag
= gtk_cell_renderer_toggle_get_active(renderer
);
1210 hkl_sample_reflection_flag_set (reflection
, flag
);
1211 gtk_list_store_set (priv
->_liststore_reflections
,
1213 REFLECTION_COL_FLAG
, flag
,
1220 static void _hkl_gui_window_on_spinbutton_lambda_value_changed_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
1222 hkl_gui_window_on_spinbutton_lambda_value_changed (self);
1227 static void _hkl_gui_window_on_spinbutton_uxuyuz_value_changed_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
1229 hkl_gui_window_on_spinbutton_uxuyuz_value_changed (self);
1234 static void _hkl_gui_window_on_button2_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) {
1236 hkl_gui_window_on_button2_clicked (self);
1241 static void _hkl_gui_window_on_checkbutton_a_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1243 hkl_gui_window_on_checkbutton_a_toggled (self);
1248 static void _hkl_gui_window_on_checkbutton_b_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1250 hkl_gui_window_on_checkbutton_b_toggled (self);
1255 static void _hkl_gui_window_on_checkbutton_c_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1257 hkl_gui_window_on_checkbutton_c_toggled (self);
1262 static void _hkl_gui_window_on_checkbutton_alpha_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1264 hkl_gui_window_on_checkbutton_alpha_toggled (self);
1269 static void _hkl_gui_window_on_checkbutton_beta_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1271 hkl_gui_window_on_checkbutton_beta_toggled (self);
1276 static void _hkl_gui_window_on_checkbutton_gamma_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1278 hkl_gui_window_on_checkbutton_gamma_toggled (self);
1283 static void _hkl_gui_window_on_checkbutton_Ux_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1285 hkl_gui_window_on_checkbutton_Ux_toggled (self);
1290 static void _hkl_gui_window_on_checkbutton_Uy_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1292 hkl_gui_window_on_checkbutton_Uy_toggled (self);
1297 static void _hkl_gui_window_on_checkbutton_Uz_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1299 hkl_gui_window_on_checkbutton_Uz_toggled (self);
1304 static gboolean _hkl_gui_window_on_tree_view_reflections_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
1306 result = hkl_gui_window_on_tree_view_reflections_key_press_event (event, self);
1313 static void _hkl_gui_window_on_tree_view_pseudo_axes_cursor_changed_gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self) {
1315 hkl_gui_window_on_tree_view_pseudo_axes_cursor_changed (self);
1320 static void _hkl_gui_window_on_tree_view_crystals_cursor_changed_gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self) {
1322 hkl_gui_window_on_tree_view_crystals_cursor_changed (self);
1327 static gboolean _hkl_gui_window_on_tree_view_crystals_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
1329 result = hkl_gui_window_on_tree_view_crystals_key_press_event (event, self);
1336 static void _hkl_gui_window_on_toolbutton_add_reflection_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1338 hkl_gui_window_on_toolbutton_add_reflection_clicked (self);
1343 static void _hkl_gui_window_on_toolbutton_goto_reflection_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1345 hkl_gui_window_on_toolbutton_goto_reflection_clicked (self);
1350 static void _hkl_gui_window_on_toolbutton_del_reflection_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1352 hkl_gui_window_on_toolbutton_del_reflection_clicked (self);
1357 static void _hkl_gui_window_on_toolbutton_setUB_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1359 hkl_gui_window_on_toolbutton_setUB_clicked (self);
1364 static void _hkl_gui_window_on_toolbutton_computeUB_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1366 hkl_gui_window_on_toolbutton_computeUB_clicked (self);
1371 static void _hkl_gui_window_on_toolbutton_add_crystal_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1373 hkl_gui_window_on_toolbutton_add_crystal_clicked (self);
1378 static void _hkl_gui_window_on_toolbutton_copy_crystal_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1380 hkl_gui_window_on_toolbutton_copy_crystal_clicked (self);
1385 static void _hkl_gui_window_on_toolbutton_del_crystal_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1387 hkl_gui_window_on_toolbutton_del_crystal_clicked (self);
1392 static void _hkl_gui_window_on_toolbutton_affiner_clicked_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1394 hkl_gui_window_on_toolbutton_affiner_clicked (self);
1399 static void _hkl_gui_window_on_menuitem5_activate_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
1401 hkl_gui_window_on_menuitem5_activate (self);
1406 static void _hkl_gui_window_on_button1_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) {
1408 hkl_gui_window_on_button1_clicked (self);
1413 static void _hkl_gui_window_on_combobox1_changed_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
1415 hkl_gui_window_on_combobox1_changed (self);
1418 #define CONNECT_SPINBUTTON(name) \
1419 g_signal_connect_object (priv->_ ## name, \
1421 (GCallback) SPINBUTTON_VALUE_CHANGED_CB(name), \
1424 #define CONNECT_UX_UY_UZ(name) \
1425 g_signal_connect_object (priv->_ ## name, \
1427 (GCallback) _hkl_gui_window_on_spinbutton_uxuyuz_value_changed_gtk_spin_button_value_changed, \
1430 #define CONNECT_CHECKBUTTON(name) \
1431 g_signal_connect_object (priv->_ ## name, \
1433 (GCallback) CHECKBUTTON_TOGGLED_CB(name), \
1436 hkl_gui_window_connect_all_signals (HklGuiWindow* self)
1438 HklGuiWindowPrivate *priv = self->priv;
1440 g_return_if_fail (self != NULL);
1442 CONNECT_SPINBUTTON(spinbutton_a);
1443 CONNECT_SPINBUTTON(spinbutton_a_min);
1444 CONNECT_SPINBUTTON(spinbutton_a_max);
1445 CONNECT_SPINBUTTON(spinbutton_a_star);
1447 CONNECT_SPINBUTTON(spinbutton_b);
1448 CONNECT_SPINBUTTON(spinbutton_b_min);
1449 CONNECT_SPINBUTTON(spinbutton_b_max);
1450 CONNECT_SPINBUTTON(spinbutton_b_star);
1452 CONNECT_SPINBUTTON(spinbutton_c);
1453 CONNECT_SPINBUTTON(spinbutton_c_min);
1454 CONNECT_SPINBUTTON(spinbutton_c_max);
1455 CONNECT_SPINBUTTON(spinbutton_c_star);
1457 CONNECT_SPINBUTTON(spinbutton_alpha);
1458 CONNECT_SPINBUTTON(spinbutton_alpha_min);
1459 CONNECT_SPINBUTTON(spinbutton_alpha_max);
1460 CONNECT_SPINBUTTON(spinbutton_alpha_star);
1462 CONNECT_SPINBUTTON(spinbutton_beta);
1463 CONNECT_SPINBUTTON(spinbutton_beta_min);
1464 CONNECT_SPINBUTTON(spinbutton_beta_max);
1465 CONNECT_SPINBUTTON(spinbutton_beta_star);
1467 CONNECT_SPINBUTTON(spinbutton_alpha);
1468 CONNECT_SPINBUTTON(spinbutton_alpha_min);
1469 CONNECT_SPINBUTTON(spinbutton_alpha_max);
1470 CONNECT_SPINBUTTON(spinbutton_alpha_star);
1472 g_signal_connect_object (priv->_spinbutton_lambda,
1474 (GCallback) _hkl_gui_window_on_spinbutton_lambda_value_changed_gtk_spin_button_value_changed,
1477 CONNECT_UX_UY_UZ(spinbutton_ux);
1478 CONNECT_UX_UY_UZ(spinbutton_uy);
1479 CONNECT_UX_UY_UZ(spinbutton_uz);
1481 g_signal_connect_object (priv->_button2,
1483 (GCallback) _hkl_gui_window_on_button2_clicked_gtk_button_clicked,
1486 CONNECT_CHECKBUTTON(checkbutton_a);
1487 CONNECT_CHECKBUTTON(checkbutton_b);
1488 CONNECT_CHECKBUTTON(checkbutton_c);
1489 CONNECT_CHECKBUTTON(checkbutton_alpha);
1490 CONNECT_CHECKBUTTON(checkbutton_beta);
1491 CONNECT_CHECKBUTTON(checkbutton_gamma);
1492 CONNECT_CHECKBUTTON(checkbutton_Ux);
1493 CONNECT_CHECKBUTTON(checkbutton_Uy);
1494 CONNECT_CHECKBUTTON(checkbutton_Uz);
1496 g_signal_connect_object (GTK_WIDGET(priv->_treeview_reflections),
1498 (GCallback) _hkl_gui_window_on_tree_view_reflections_key_press_event_gtk_widget_key_press_event,
1501 g_signal_connect_object (priv->_treeview_pseudo_axes,
1503 (GCallback) _hkl_gui_window_on_tree_view_pseudo_axes_cursor_changed_gtk_tree_view_cursor_changed,
1506 g_signal_connect_object (priv->_treeview_crystals,
1508 (GCallback) _hkl_gui_window_on_tree_view_crystals_cursor_changed_gtk_tree_view_cursor_changed, self, 0);
1510 g_signal_connect_object (GTK_WIDGET(priv->_treeview_crystals),
1512 (GCallback) _hkl_gui_window_on_tree_view_crystals_key_press_event_gtk_widget_key_press_event,
1515 g_signal_connect_object (priv->_toolbutton_add_reflection,
1517 (GCallback) _hkl_gui_window_on_toolbutton_add_reflection_clicked_gtk_tool_button_clicked,
1520 g_signal_connect_object (priv->_toolbutton_goto_reflection,
1522 (GCallback) _hkl_gui_window_on_toolbutton_goto_reflection_clicked_gtk_tool_button_clicked,
1525 g_signal_connect_object (priv->_toolbutton_del_reflection,
1527 (GCallback) _hkl_gui_window_on_toolbutton_del_reflection_clicked_gtk_tool_button_clicked,
1530 g_signal_connect_object (priv->_toolbutton_setUB,
1532 (GCallback) _hkl_gui_window_on_toolbutton_setUB_clicked_gtk_tool_button_clicked,
1535 g_signal_connect_object (priv->_toolbutton_computeUB,
1537 (GCallback) _hkl_gui_window_on_toolbutton_computeUB_clicked_gtk_tool_button_clicked,
1540 g_signal_connect_object (priv->_toolbutton_add_crystal,
1542 (GCallback) _hkl_gui_window_on_toolbutton_add_crystal_clicked_gtk_tool_button_clicked,
1545 g_signal_connect_object (priv->_toolbutton_copy_crystal,
1547 (GCallback) _hkl_gui_window_on_toolbutton_copy_crystal_clicked_gtk_tool_button_clicked,
1550 g_signal_connect_object (priv->_toolbutton_del_crystal,
1552 (GCallback) _hkl_gui_window_on_toolbutton_del_crystal_clicked_gtk_tool_button_clicked,
1555 g_signal_connect_object (priv->_toolbutton_affiner,
1557 (GCallback) _hkl_gui_window_on_toolbutton_affiner_clicked_gtk_tool_button_clicked,
1560 g_signal_connect_object (GTK_MENU_ITEM(priv->_menuitem5),
1562 (GCallback) _hkl_gui_window_on_menuitem5_activate_gtk_menu_item_activate,
1565 g_signal_connect_object (priv->_button1,
1567 (GCallback) _hkl_gui_window_on_button1_clicked_gtk_button_clicked,
1570 g_signal_connect_object (priv->_combobox1,
1572 (GCallback) _hkl_gui_window_on_combobox1_changed_gtk_combo_box_changed,
1580 static void _hkl_gui_window_on_cell_tree_view_axes_read_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1582 hkl_gui_window_on_cell_tree_view_axes_read_edited (path, new_text, self);
1587 static void _hkl_gui_window_on_cell_tree_view_axes_write_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1589 hkl_gui_window_on_cell_tree_view_axes_write_edited (path, new_text, self);
1594 static void _hkl_gui_window_on_cell_tree_view_axes_min_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1596 hkl_gui_window_on_cell_tree_view_axes_min_edited (path, new_text, self);
1601 static void _hkl_gui_window_on_cell_tree_view_axes_max_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1603 hkl_gui_window_on_cell_tree_view_axes_max_edited (path, new_text, self);
1609 static void _hkl_gui_window_on_cell_tree_view_pseudo_axes_write_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1611 hkl_gui_window_on_cell_tree_view_pseudo_axes_write_edited (path, new_text, self);
1616 static void _hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled_gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
1618 hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled (path, self);
1623 static void _hkl_gui_window_on_cell_tree_view_pseudo_axes_parameters_value_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1625 hkl_gui_window_on_cell_tree_view_pseudo_axes_parameters_value_edited (path, new_text, self);
1630 static void hkl_gui_window_set_up_tree_view_pseudo_axes_parameters (HklGuiWindow* self) {
1631 GtkCellRendererText* renderer = NULL;
1632 GtkTreeViewColumn* column = NULL;
1633 GtkTreeView* _tmp0_;
1634 GList* _tmp1_ = NULL;
1637 GtkCellRendererText* _tmp5_;
1638 GtkCellRendererText* _tmp6_;
1639 GtkTreeViewColumn* _tmp7_;
1640 GtkTreeView* _tmp8_;
1641 GtkTreeViewColumn* _tmp9_;
1642 GtkCellRendererText* _tmp10_;
1643 GtkCellRendererText* _tmp11_;
1644 GtkCellRendererText* _tmp12_;
1645 GtkCellRendererText* _tmp13_;
1646 GtkTreeViewColumn* _tmp14_;
1647 GtkTreeView* _tmp15_;
1648 GtkTreeViewColumn* _tmp16_;
1650 g_return_if_fail (self != NULL);
1652 _tmp0_ = priv->_treeview_pseudo_axes_parameters;
1654 _tmp1_ = gtk_tree_view_get_columns (_tmp0_);
1661 GList* col_collection = NULL;
1662 GList* col_it = NULL;
1664 col_collection = _tmp2_;
1666 for (col_it = col_collection; col_it != NULL; col_it = col_it->next) {
1668 GtkTreeViewColumn* col = NULL;
1670 col = (GtkTreeViewColumn*) col_it->data;
1673 GtkTreeView* _tmp3_;
1674 GtkTreeViewColumn* _tmp4_;
1676 _tmp3_ = priv->_treeview_pseudo_axes_parameters;
1680 gtk_tree_view_remove_column (_tmp3_, _tmp4_);
1686 _tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1688 g_object_ref_sink (_tmp5_);
1690 _g_object_unref0 (renderer);
1696 _tmp7_ = gtk_tree_view_column_new_with_attributes ("name", (GtkCellRenderer*) _tmp6_, "text", PARAMETER_COL_NAME, NULL);
1698 g_object_ref_sink (_tmp7_);
1700 _g_object_unref0 (column);
1704 _tmp8_ = priv->_treeview_pseudo_axes_parameters;
1708 gtk_tree_view_append_column (_tmp8_, _tmp9_);
1710 _tmp10_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1712 g_object_ref_sink (_tmp10_);
1714 _g_object_unref0 (renderer);
1720 g_signal_connect_object (_tmp11_, "edited", (GCallback) _hkl_gui_window_on_cell_tree_view_pseudo_axes_parameters_value_edited_gtk_cell_renderer_text_edited, self, 0);
1724 g_object_set (_tmp12_, "editable", TRUE, NULL);
1728 _tmp14_ = gtk_tree_view_column_new_with_attributes ("read", (GtkCellRenderer*) _tmp13_, "text", PARAMETER_COL_VALUE, NULL);
1730 g_object_ref_sink (_tmp14_);
1732 _g_object_unref0 (column);
1736 _tmp15_ = priv->_treeview_pseudo_axes_parameters;
1740 gtk_tree_view_append_column (_tmp15_, _tmp16_);
1742 _g_list_free0 (columns);
1744 _g_object_unref0 (column);
1746 _g_object_unref0 (renderer);
1751 static void _hkl_gui_window_on_tree_view1_cursor_changed_gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self) {
1753 hkl_gui_window_on_tree_view1_cursor_changed (self);
1762 static void _hkl_gui_window_on_cell_tree_view_crystals_name_edited_gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
1764 hkl_gui_window_on_cell_tree_view_crystals_name_edited (path, new_text, self);
1769 static void hkl_gui_window_set_up_tree_view_crystals (HklGuiWindow* self) {
1770 GtkTreeViewColumn* column = NULL;
1771 GtkCellRendererText* renderer = NULL;
1772 GtkTreeView* _tmp0_;
1773 GList* _tmp1_ = NULL;
1776 GtkCellRendererText* _tmp5_;
1777 GtkCellRendererText* _tmp6_;
1778 GtkCellRendererText* _tmp7_;
1779 GtkCellRendererText* _tmp8_;
1780 GtkTreeViewColumn* _tmp9_;
1781 GtkTreeView* _tmp10_;
1782 GtkTreeViewColumn* _tmp11_;
1783 GtkCellRendererText* _tmp12_;
1784 GtkCellRendererText* _tmp13_;
1785 GtkTreeViewColumn* _tmp14_;
1786 GtkTreeView* _tmp15_;
1787 GtkTreeViewColumn* _tmp16_;
1788 GtkCellRendererText* _tmp17_;
1789 GtkCellRendererText* _tmp18_;
1790 GtkTreeViewColumn* _tmp19_;
1791 GtkTreeView* _tmp20_;
1792 GtkTreeViewColumn* _tmp21_;
1793 GtkCellRendererText* _tmp22_;
1794 GtkCellRendererText* _tmp23_;
1795 GtkTreeViewColumn* _tmp24_;
1796 GtkTreeView* _tmp25_;
1797 GtkTreeViewColumn* _tmp26_;
1798 GtkCellRendererText* _tmp27_;
1799 GtkCellRendererText* _tmp28_;
1800 GtkTreeViewColumn* _tmp29_;
1801 GtkTreeView* _tmp30_;
1802 GtkTreeViewColumn* _tmp31_;
1803 GtkCellRendererText* _tmp32_;
1804 GtkCellRendererText* _tmp33_;
1805 GtkTreeViewColumn* _tmp34_;
1806 GtkTreeView* _tmp35_;
1807 GtkTreeViewColumn* _tmp36_;
1808 GtkCellRendererText* _tmp37_;
1809 GtkCellRendererText* _tmp38_;
1810 GtkTreeViewColumn* _tmp39_;
1811 GtkTreeView* _tmp40_;
1812 GtkTreeViewColumn* _tmp41_;
1813 GtkTreeView* _tmp42_;
1814 GtkTreeSelection* _tmp43_ = NULL;
1816 g_return_if_fail (self != NULL);
1818 _tmp0_ = priv->_treeview_crystals;
1820 _tmp1_ = gtk_tree_view_get_columns (_tmp0_);
1827 GList* col_collection = NULL;
1828 GList* col_it = NULL;
1830 col_collection = _tmp2_;
1832 for (col_it = col_collection; col_it != NULL; col_it = col_it->next) {
1834 GtkTreeViewColumn* col = NULL;
1836 col = (GtkTreeViewColumn*) col_it->data;
1839 GtkTreeView* _tmp3_;
1840 GtkTreeViewColumn* _tmp4_;
1842 _tmp3_ = priv->_treeview_crystals;
1846 gtk_tree_view_remove_column (_tmp3_, _tmp4_);
1852 _tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1854 g_object_ref_sink (_tmp5_);
1856 _g_object_unref0 (renderer);
1862 g_signal_connect_object (_tmp6_, "edited", (GCallback) _hkl_gui_window_on_cell_tree_view_crystals_name_edited_gtk_cell_renderer_text_edited, self, 0);
1866 g_object_set (_tmp7_, "editable", TRUE, NULL);
1870 _tmp9_ = gtk_tree_view_column_new_with_attributes ("name", (GtkCellRenderer*) _tmp8_, "text", SAMPLE_COL_NAME, NULL);
1872 g_object_ref_sink (_tmp9_);
1874 _g_object_unref0 (column);
1878 _tmp10_ = priv->_treeview_crystals;
1882 gtk_tree_view_append_column (_tmp10_, _tmp11_);
1884 _tmp12_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1886 g_object_ref_sink (_tmp12_);
1888 _g_object_unref0 (renderer);
1894 _tmp14_ = gtk_tree_view_column_new_with_attributes ("a", (GtkCellRenderer*) _tmp13_, "text", SAMPLE_COL_A, NULL);
1896 g_object_ref_sink (_tmp14_);
1898 _g_object_unref0 (column);
1902 _tmp15_ = priv->_treeview_crystals;
1906 gtk_tree_view_append_column (_tmp15_, _tmp16_);
1908 _tmp17_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1910 g_object_ref_sink (_tmp17_);
1912 _g_object_unref0 (renderer);
1918 _tmp19_ = gtk_tree_view_column_new_with_attributes ("b", (GtkCellRenderer*) _tmp18_, "text", SAMPLE_COL_B, NULL);
1920 g_object_ref_sink (_tmp19_);
1922 _g_object_unref0 (column);
1926 _tmp20_ = priv->_treeview_crystals;
1930 gtk_tree_view_append_column (_tmp20_, _tmp21_);
1932 _tmp22_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1934 g_object_ref_sink (_tmp22_);
1936 _g_object_unref0 (renderer);
1942 _tmp24_ = gtk_tree_view_column_new_with_attributes ("c", (GtkCellRenderer*) _tmp23_, "text", SAMPLE_COL_C, NULL);
1944 g_object_ref_sink (_tmp24_);
1946 _g_object_unref0 (column);
1950 _tmp25_ = priv->_treeview_crystals;
1954 gtk_tree_view_append_column (_tmp25_, _tmp26_);
1956 _tmp27_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1958 g_object_ref_sink (_tmp27_);
1960 _g_object_unref0 (renderer);
1966 _tmp29_ = gtk_tree_view_column_new_with_attributes ("alpha", (GtkCellRenderer*) _tmp28_, "text", SAMPLE_COL_ALPHA, NULL);
1968 g_object_ref_sink (_tmp29_);
1970 _g_object_unref0 (column);
1974 _tmp30_ = priv->_treeview_crystals;
1978 gtk_tree_view_append_column (_tmp30_, _tmp31_);
1980 _tmp32_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1982 g_object_ref_sink (_tmp32_);
1984 _g_object_unref0 (renderer);
1990 _tmp34_ = gtk_tree_view_column_new_with_attributes ("beta", (GtkCellRenderer*) _tmp33_, "text", SAMPLE_COL_BETA, NULL);
1992 g_object_ref_sink (_tmp34_);
1994 _g_object_unref0 (column);
1998 _tmp35_ = priv->_treeview_crystals;
2002 gtk_tree_view_append_column (_tmp35_, _tmp36_);
2004 _tmp37_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
2006 g_object_ref_sink (_tmp37_);
2008 _g_object_unref0 (renderer);
2014 _tmp39_ = gtk_tree_view_column_new_with_attributes ("gamma", (GtkCellRenderer*) _tmp38_, "text", SAMPLE_COL_GAMMA, NULL);
2016 g_object_ref_sink (_tmp39_);
2018 _g_object_unref0 (column);
2022 _tmp40_ = priv->_treeview_crystals;
2026 gtk_tree_view_append_column (_tmp40_, _tmp41_);
2028 _tmp42_ = priv->_treeview_crystals;
2030 _tmp43_ = gtk_tree_view_get_selection (_tmp42_);
2032 gtk_tree_selection_set_mode (_tmp43_, GTK_SELECTION_MULTIPLE);
2034 _g_list_free0 (columns);
2036 _g_object_unref0 (renderer);
2038 _g_object_unref0 (column);
2043 static void hkl_gui_window_set_up_3D (HklGuiWindow* self) {
2044 HklGeometry* _tmp0_;
2045 HklGeometryConfig* _tmp1_;
2046 HklGeometryType _tmp2_;
2048 HklGui3DFrame* _tmp8_;
2049 GtkFrame* _tmp9_ = NULL;
2053 g_return_if_fail (self != NULL);
2055 _tmp0_ = priv->geometry;
2057 _tmp1_ = _tmp0_->config;
2059 _tmp2_ = (*_tmp1_).type;
2063 case HKL_GEOMETRY_TYPE_KAPPA6C:
2066 HklGeometry* _tmp3_;
2067 HklGui3DFrame* _tmp4_;
2069 _tmp3_ = priv->geometry;
2071 _tmp4_ = hkl_gui_3d_frame_new ("../data/diffabs.yaml", _tmp3_);
2073 _g_object_unref0 (priv->Frame3D);
2075 priv->Frame3D = _tmp4_;
2081 case HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL:
2084 HklGeometry* _tmp5_;
2085 HklGui3DFrame* _tmp6_;
2087 _tmp5_ = priv->geometry;
2089 _tmp6_ = hkl_gui_3d_frame_new ("../data/cristal4C.yaml", _tmp5_);
2091 _g_object_unref0 (priv->Frame3D);
2093 priv->Frame3D = _tmp6_;
2104 _tmp7_ = priv->_vbox7;
2106 _tmp8_ = priv->Frame3D;
2108 _tmp9_ = hkl_gui_3d_frame_frame (_tmp8_);
2112 gtk_box_pack_start ((GtkBox*) _tmp7_, (GtkWidget*) _tmp10_, TRUE, TRUE, (guint) 0);
2114 _g_object_unref0 (_tmp10_);
2116 _tmp11_ = priv->_vbox7;
2118 gtk_widget_show_all ((GtkWidget*) _tmp11_);
2123 static void hkl_gui_window_update_source (HklGuiWindow* self) {
2124 HklGeometry* _tmp0_;
2126 g_return_if_fail (self != NULL);
2128 _tmp0_ = priv->geometry;
2130 if (_tmp0_ != NULL) {
2132 HklGeometry* _tmp1_;
2133 gdouble _tmp2_ = 0.0;
2135 GtkSpinButton* _tmp3_;
2138 _tmp1_ = priv->geometry;
2140 _tmp2_ = hkl_source_get_wavelength (&_tmp1_->source);
2144 _tmp3_ = priv->_spinbutton_lambda;
2148 gtk_spin_button_set_value (_tmp3_, _tmp4_);
2154 static void hkl_gui_window_update_pseudo_axes_parameters (HklGuiWindow* self) {
2156 GeeMapIterator* _tmp1_ = NULL;
2157 GeeMapIterator* iter;
2159 g_return_if_fail (self != NULL);
2161 _tmp0_ = priv->hash_store_pseudo_axis_parameter;
2163 _tmp1_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) _tmp0_);
2169 GeeMapIterator* _tmp2_;
2170 gboolean _tmp3_ = FALSE;
2171 GtkListStore* model = NULL;
2172 GtkTreeIter iter2 = {0};
2173 gboolean valid = FALSE;
2174 GeeMapIterator* _tmp4_;
2175 gpointer _tmp5_ = NULL;
2176 GtkListStore* _tmp6_;
2177 GtkTreeIter _tmp7_ = {0};
2178 gboolean _tmp8_ = FALSE;
2182 _tmp3_ = gee_map_iterator_next (_tmp2_);
2192 _tmp5_ = gee_map_iterator_get_value (_tmp4_);
2194 _g_object_unref0 (model);
2196 model = (GtkListStore*) _tmp5_;
2200 _tmp8_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp6_, &_tmp7_);
2209 HklParameter* parameter = NULL;
2210 GtkListStore* _tmp10_;
2211 GtkTreeIter _tmp11_;
2212 GtkListStore* _tmp12_;
2213 GtkTreeIter _tmp13_;
2214 HklParameter* _tmp14_;
2215 const gchar* _tmp15_;
2216 HklParameter* _tmp16_;
2217 HklParameter _tmp17_;
2218 gdouble _tmp18_ = 0.0;
2219 GtkListStore* _tmp19_;
2220 gboolean _tmp20_ = FALSE;
2234 gtk_tree_model_get ((GtkTreeModel*) _tmp10_, &_tmp11_, PARAMETER_COL_PARAMETER, ¶meter, -1);
2240 _tmp14_ = parameter;
2242 _tmp15_ = (*_tmp14_).name;
2244 _tmp16_ = parameter;
2248 _tmp18_ = hkl_parameter_get_value_unit (&_tmp17_);
2250 gtk_list_store_set (_tmp12_, &_tmp13_, PARAMETER_COL_NAME, _tmp15_, PARAMETER_COL_VALUE, _tmp18_, -1);
2254 _tmp20_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp19_, &iter2);
2260 _g_object_unref0 (model);
2264 _g_object_unref0 (iter);
2269 static void hkl_gui_window_update_lattice (HklGuiWindow* self) {
2270 HklSampleList* _tmp0_;
2275 g_return_if_fail (self != NULL);
2277 _tmp0_ = priv->samples;
2279 _tmp1_ = _tmp0_->current;
2285 if (_tmp2_ != NULL) {
2287 GtkSpinButton* _tmp3_;
2290 HklParameter* _tmp6_;
2291 HklParameter _tmp7_;
2292 gdouble _tmp8_ = 0.0;
2293 GtkSpinButton* _tmp9_;
2295 HklLattice* _tmp11_;
2296 HklParameter* _tmp12_;
2297 HklParameter _tmp13_;
2298 gdouble _tmp14_ = 0.0;
2299 GtkSpinButton* _tmp15_;
2301 HklLattice* _tmp17_;
2302 HklParameter* _tmp18_;
2303 HklParameter _tmp19_;
2304 gdouble _tmp20_ = 0.0;
2305 GtkSpinButton* _tmp21_;
2307 HklLattice* _tmp23_;
2308 HklParameter* _tmp24_;
2309 HklParameter _tmp25_;
2310 gdouble _tmp26_ = 0.0;
2311 GtkSpinButton* _tmp27_;
2313 HklLattice* _tmp29_;
2314 HklParameter* _tmp30_;
2315 HklParameter _tmp31_;
2316 gdouble _tmp32_ = 0.0;
2317 GtkSpinButton* _tmp33_;
2319 HklLattice* _tmp35_;
2320 HklParameter* _tmp36_;
2321 HklParameter _tmp37_;
2322 gdouble _tmp38_ = 0.0;
2324 _tmp3_ = priv->_spinbutton_a;
2328 _tmp5_ = _tmp4_->lattice;
2334 _tmp8_ = hkl_parameter_get_value_unit (&_tmp7_);
2336 gtk_spin_button_set_value (_tmp3_, _tmp8_);
2338 _tmp9_ = priv->_spinbutton_b;
2342 _tmp11_ = _tmp10_->lattice;
2344 _tmp12_ = _tmp11_->b;
2348 _tmp14_ = hkl_parameter_get_value_unit (&_tmp13_);
2350 gtk_spin_button_set_value (_tmp9_, _tmp14_);
2352 _tmp15_ = priv->_spinbutton_c;
2356 _tmp17_ = _tmp16_->lattice;
2358 _tmp18_ = _tmp17_->c;
2362 _tmp20_ = hkl_parameter_get_value_unit (&_tmp19_);
2364 gtk_spin_button_set_value (_tmp15_, _tmp20_);
2366 _tmp21_ = priv->_spinbutton_alpha;
2370 _tmp23_ = _tmp22_->lattice;
2372 _tmp24_ = _tmp23_->alpha;
2376 _tmp26_ = hkl_parameter_get_value_unit (&_tmp25_);
2378 gtk_spin_button_set_value (_tmp21_, _tmp26_);
2380 _tmp27_ = priv->_spinbutton_beta;
2384 _tmp29_ = _tmp28_->lattice;
2386 _tmp30_ = _tmp29_->beta;
2390 _tmp32_ = hkl_parameter_get_value_unit (&_tmp31_);
2392 gtk_spin_button_set_value (_tmp27_, _tmp32_);
2394 _tmp33_ = priv->_spinbutton_gamma;
2398 _tmp35_ = _tmp34_->lattice;
2400 _tmp36_ = _tmp35_->gamma;
2404 _tmp38_ = hkl_parameter_get_value_unit (&_tmp37_);
2406 gtk_spin_button_set_value (_tmp33_, _tmp38_);
2412 static void hkl_gui_window_update_lattice_parameters (HklGuiWindow* self) {
2413 HklSampleList* _tmp0_;
2418 g_return_if_fail (self != NULL);
2420 _tmp0_ = priv->samples;
2422 _tmp1_ = _tmp0_->current;
2428 if (_tmp2_ != NULL) {
2432 HklParameter* parameter = NULL;
2435 HklParameter* _tmp5_;
2436 HklParameter* _tmp6_;
2437 HklParameter _tmp7_;
2438 gdouble _tmp8_ = 0.0;
2439 gdouble _tmp9_ = 0.0;
2440 GtkSpinButton* _tmp10_;
2442 GtkSpinButton* _tmp12_;
2444 GtkCheckButton* _tmp14_;
2445 HklParameter* _tmp15_;
2448 HklLattice* _tmp18_;
2449 HklParameter* _tmp19_;
2450 HklParameter* _tmp20_;
2451 HklParameter _tmp21_;
2452 gdouble _tmp22_ = 0.0;
2453 gdouble _tmp23_ = 0.0;
2454 GtkSpinButton* _tmp24_;
2456 GtkSpinButton* _tmp26_;
2458 GtkCheckButton* _tmp28_;
2459 HklParameter* _tmp29_;
2462 HklLattice* _tmp32_;
2463 HklParameter* _tmp33_;
2464 HklParameter* _tmp34_;
2465 HklParameter _tmp35_;
2466 gdouble _tmp36_ = 0.0;
2467 gdouble _tmp37_ = 0.0;
2468 GtkSpinButton* _tmp38_;
2470 GtkSpinButton* _tmp40_;
2472 GtkCheckButton* _tmp42_;
2473 HklParameter* _tmp43_;
2476 HklLattice* _tmp46_;
2477 HklParameter* _tmp47_;
2478 HklParameter* _tmp48_;
2479 HklParameter _tmp49_;
2480 gdouble _tmp50_ = 0.0;
2481 gdouble _tmp51_ = 0.0;
2482 GtkSpinButton* _tmp52_;
2484 GtkSpinButton* _tmp54_;
2486 GtkCheckButton* _tmp56_;
2487 HklParameter* _tmp57_;
2490 HklLattice* _tmp60_;
2491 HklParameter* _tmp61_;
2492 HklParameter* _tmp62_;
2493 HklParameter _tmp63_;
2494 gdouble _tmp64_ = 0.0;
2495 gdouble _tmp65_ = 0.0;
2496 GtkSpinButton* _tmp66_;
2498 GtkSpinButton* _tmp68_;
2500 GtkCheckButton* _tmp70_;
2501 HklParameter* _tmp71_;
2504 HklLattice* _tmp74_;
2505 HklParameter* _tmp75_;
2506 HklParameter* _tmp76_;
2507 HklParameter _tmp77_;
2508 gdouble _tmp78_ = 0.0;
2509 gdouble _tmp79_ = 0.0;
2510 GtkSpinButton* _tmp80_;
2512 GtkSpinButton* _tmp82_;
2514 GtkCheckButton* _tmp84_;
2515 HklParameter* _tmp85_;
2520 _tmp4_ = _tmp3_->lattice;
2530 hkl_parameter_get_range_unit (&_tmp7_, &_tmp8_, &_tmp9_);
2536 _tmp10_ = priv->_spinbutton_a_min;
2540 gtk_spin_button_set_value (_tmp10_, _tmp11_);
2542 _tmp12_ = priv->_spinbutton_a_max;
2546 gtk_spin_button_set_value (_tmp12_, _tmp13_);
2548 _tmp14_ = priv->_checkbutton_a;
2550 _tmp15_ = parameter;
2552 _tmp16_ = (*_tmp15_).fit;
2554 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp14_, _tmp16_);
2558 _tmp18_ = _tmp17_->lattice;
2560 _tmp19_ = _tmp18_->b;
2562 parameter = _tmp19_;
2564 _tmp20_ = parameter;
2568 hkl_parameter_get_range_unit (&_tmp21_, &_tmp22_, &_tmp23_);
2574 _tmp24_ = priv->_spinbutton_b_min;
2578 gtk_spin_button_set_value (_tmp24_, _tmp25_);
2580 _tmp26_ = priv->_spinbutton_b_max;
2584 gtk_spin_button_set_value (_tmp26_, _tmp27_);
2586 _tmp28_ = priv->_checkbutton_b;
2588 _tmp29_ = parameter;
2590 _tmp30_ = (*_tmp29_).fit;
2592 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp28_, _tmp30_);
2596 _tmp32_ = _tmp31_->lattice;
2598 _tmp33_ = _tmp32_->c;
2600 parameter = _tmp33_;
2602 _tmp34_ = parameter;
2606 hkl_parameter_get_range_unit (&_tmp35_, &_tmp36_, &_tmp37_);
2612 _tmp38_ = priv->_spinbutton_c_min;
2616 gtk_spin_button_set_value (_tmp38_, _tmp39_);
2618 _tmp40_ = priv->_spinbutton_c_max;
2622 gtk_spin_button_set_value (_tmp40_, _tmp41_);
2624 _tmp42_ = priv->_checkbutton_c;
2626 _tmp43_ = parameter;
2628 _tmp44_ = (*_tmp43_).fit;
2630 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp42_, _tmp44_);
2634 _tmp46_ = _tmp45_->lattice;
2636 _tmp47_ = _tmp46_->alpha;
2638 parameter = _tmp47_;
2640 _tmp48_ = parameter;
2644 hkl_parameter_get_range_unit (&_tmp49_, &_tmp50_, &_tmp51_);
2650 _tmp52_ = priv->_spinbutton_alpha_min;
2654 gtk_spin_button_set_value (_tmp52_, _tmp53_);
2656 _tmp54_ = priv->_spinbutton_alpha_max;
2660 gtk_spin_button_set_value (_tmp54_, _tmp55_);
2662 _tmp56_ = priv->_checkbutton_alpha;
2664 _tmp57_ = parameter;
2666 _tmp58_ = (*_tmp57_).fit;
2668 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp56_, _tmp58_);
2672 _tmp60_ = _tmp59_->lattice;
2674 _tmp61_ = _tmp60_->beta;
2676 parameter = _tmp61_;
2678 _tmp62_ = parameter;
2682 hkl_parameter_get_range_unit (&_tmp63_, &_tmp64_, &_tmp65_);
2688 _tmp66_ = priv->_spinbutton_beta_min;
2692 gtk_spin_button_set_value (_tmp66_, _tmp67_);
2694 _tmp68_ = priv->_spinbutton_beta_max;
2698 gtk_spin_button_set_value (_tmp68_, _tmp69_);
2700 _tmp70_ = priv->_checkbutton_beta;
2702 _tmp71_ = parameter;
2704 _tmp72_ = (*_tmp71_).fit;
2706 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp70_, _tmp72_);
2710 _tmp74_ = _tmp73_->lattice;
2712 _tmp75_ = _tmp74_->gamma;
2714 parameter = _tmp75_;
2716 _tmp76_ = parameter;
2720 hkl_parameter_get_range_unit (&_tmp77_, &_tmp78_, &_tmp79_);
2726 _tmp80_ = priv->_spinbutton_gamma_min;
2730 gtk_spin_button_set_value (_tmp80_, _tmp81_);
2732 _tmp82_ = priv->_spinbutton_gamma_max;
2736 gtk_spin_button_set_value (_tmp82_, _tmp83_);
2738 _tmp84_ = priv->_checkbutton_gamma;
2740 _tmp85_ = parameter;
2742 _tmp86_ = (*_tmp85_).fit;
2744 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp84_, _tmp86_);
2750 static void hkl_gui_window_update_reciprocal_lattice (HklGuiWindow* self) {
2751 HklSampleList* _tmp0_;
2756 g_return_if_fail (self != NULL);
2758 _tmp0_ = priv->samples;
2760 _tmp1_ = _tmp0_->current;
2766 if (_tmp2_ != NULL) {
2771 GtkSpinButton* _tmp6_;
2773 HklParameter* _tmp8_;
2774 HklParameter _tmp9_;
2775 gdouble _tmp10_ = 0.0;
2776 GtkSpinButton* _tmp11_;
2777 HklLattice* _tmp12_;
2778 HklParameter* _tmp13_;
2779 HklParameter _tmp14_;
2780 gdouble _tmp15_ = 0.0;
2781 GtkSpinButton* _tmp16_;
2782 HklLattice* _tmp17_;
2783 HklParameter* _tmp18_;
2784 HklParameter _tmp19_;
2785 gdouble _tmp20_ = 0.0;
2786 GtkSpinButton* _tmp21_;
2787 HklLattice* _tmp22_;
2788 HklParameter* _tmp23_;
2789 HklParameter _tmp24_;
2790 gdouble _tmp25_ = 0.0;
2791 GtkSpinButton* _tmp26_;
2792 HklLattice* _tmp27_;
2793 HklParameter* _tmp28_;
2794 HklParameter _tmp29_;
2795 gdouble _tmp30_ = 0.0;
2796 GtkSpinButton* _tmp31_;
2797 HklLattice* _tmp32_;
2798 HklParameter* _tmp33_;
2799 HklParameter _tmp34_;
2800 gdouble _tmp35_ = 0.0;
2804 _tmp4_ = _tmp3_->lattice;
2806 _tmp5_ = priv->reciprocal;
2808 hkl_lattice_reciprocal (_tmp4_, _tmp5_);
2810 _tmp6_ = priv->_spinbutton_a_star;
2812 _tmp7_ = priv->reciprocal;
2818 _tmp10_ = hkl_parameter_get_value_unit (&_tmp9_);
2820 gtk_spin_button_set_value (_tmp6_, _tmp10_);
2822 _tmp11_ = priv->_spinbutton_b_star;
2824 _tmp12_ = priv->reciprocal;
2826 _tmp13_ = _tmp12_->b;
2830 _tmp15_ = hkl_parameter_get_value_unit (&_tmp14_);
2832 gtk_spin_button_set_value (_tmp11_, _tmp15_);
2834 _tmp16_ = priv->_spinbutton_c_star;
2836 _tmp17_ = priv->reciprocal;
2838 _tmp18_ = _tmp17_->c;
2842 _tmp20_ = hkl_parameter_get_value_unit (&_tmp19_);
2844 gtk_spin_button_set_value (_tmp16_, _tmp20_);
2846 _tmp21_ = priv->_spinbutton_alpha_star;
2848 _tmp22_ = priv->reciprocal;
2850 _tmp23_ = _tmp22_->alpha;
2854 _tmp25_ = hkl_parameter_get_value_unit (&_tmp24_);
2856 gtk_spin_button_set_value (_tmp21_, _tmp25_);
2858 _tmp26_ = priv->_spinbutton_beta_star;
2860 _tmp27_ = priv->reciprocal;
2862 _tmp28_ = _tmp27_->beta;
2866 _tmp30_ = hkl_parameter_get_value_unit (&_tmp29_);
2868 gtk_spin_button_set_value (_tmp26_, _tmp30_);
2870 _tmp31_ = priv->_spinbutton_gamma_star;
2872 _tmp32_ = priv->reciprocal;
2874 _tmp33_ = _tmp32_->gamma;
2878 _tmp35_ = hkl_parameter_get_value_unit (&_tmp34_);
2880 gtk_spin_button_set_value (_tmp31_, _tmp35_);
2886 static gchar* double_to_string (gdouble self) {
2887 gchar* result = NULL;
2888 gchar* _tmp0_ = NULL;
2890 gint _tmp1__length1;
2891 const gchar* _tmp2_ = NULL;
2895 _tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
2899 _tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
2901 _tmp2_ = g_ascii_dtostr (_tmp1_, G_ASCII_DTOSTR_BUF_SIZE, self);
2903 _tmp3_ = g_strdup (_tmp2_);
2907 _tmp1_ = (g_free (_tmp1_), NULL);
2916 static void hkl_gui_window_update_UB (HklGuiWindow* self) {
2917 HklSampleList* _tmp0_;
2922 g_return_if_fail (self != NULL);
2924 _tmp0_ = priv->samples;
2926 _tmp1_ = _tmp0_->current;
2932 if (_tmp2_ != NULL) {
2936 HklMatrix _tmp4_ = {0};
2940 gint _tmp7__length1;
2942 gint _tmp8__length1;
2944 gchar* _tmp10_ = NULL;
2949 gint _tmp14__length1;
2951 gint _tmp15__length1;
2953 gchar* _tmp17_ = NULL;
2958 gint _tmp21__length1;
2960 gint _tmp22__length1;
2962 gchar* _tmp24_ = NULL;
2967 gint _tmp28__length1;
2969 gint _tmp29__length1;
2971 gchar* _tmp31_ = NULL;
2976 gint _tmp35__length1;
2978 gint _tmp36__length1;
2980 gchar* _tmp38_ = NULL;
2985 gint _tmp42__length1;
2987 gint _tmp43__length1;
2989 gchar* _tmp45_ = NULL;
2994 gint _tmp49__length1;
2996 gint _tmp50__length1;
2998 gchar* _tmp52_ = NULL;
3003 gint _tmp56__length1;
3005 gint _tmp57__length1;
3007 gchar* _tmp59_ = NULL;
3012 gint _tmp63__length1;
3014 gint _tmp64__length1;
3016 gchar* _tmp66_ = NULL;
3021 hkl_sample_get_UB (_tmp3_, &_tmp4_);
3027 _tmp5_ = priv->_label_UB11;
3031 _tmp7_ = _tmp6_.data;
3033 _tmp7__length1 = -1;
3037 _tmp8__length1 = -1;
3041 _tmp10_ = double_to_string (_tmp9_);
3045 gtk_label_set_text (_tmp5_, _tmp11_);
3049 _tmp12_ = priv->_label_UB12;
3053 _tmp14_ = _tmp13_.data;
3055 _tmp14__length1 = -1;
3057 _tmp15_ = _tmp14_[0];
3059 _tmp15__length1 = -1;
3061 _tmp16_ = _tmp15_[1];
3063 _tmp17_ = double_to_string (_tmp16_);
3067 gtk_label_set_text (_tmp12_, _tmp18_);
3071 _tmp19_ = priv->_label_UB13;
3075 _tmp21_ = _tmp20_.data;
3077 _tmp21__length1 = -1;
3079 _tmp22_ = _tmp21_[0];
3081 _tmp22__length1 = -1;
3083 _tmp23_ = _tmp22_[2];
3085 _tmp24_ = double_to_string (_tmp23_);
3089 gtk_label_set_text (_tmp19_, _tmp25_);
3093 _tmp26_ = priv->_label_UB21;
3097 _tmp28_ = _tmp27_.data;
3099 _tmp28__length1 = -1;
3101 _tmp29_ = _tmp28_[1];
3103 _tmp29__length1 = -1;
3105 _tmp30_ = _tmp29_[0];
3107 _tmp31_ = double_to_string (_tmp30_);
3111 gtk_label_set_text (_tmp26_, _tmp32_);
3115 _tmp33_ = priv->_label_UB22;
3119 _tmp35_ = _tmp34_.data;
3121 _tmp35__length1 = -1;
3123 _tmp36_ = _tmp35_[1];
3125 _tmp36__length1 = -1;
3127 _tmp37_ = _tmp36_[1];
3129 _tmp38_ = double_to_string (_tmp37_);
3133 gtk_label_set_text (_tmp33_, _tmp39_);
3137 _tmp40_ = priv->_label_UB23;
3141 _tmp42_ = _tmp41_.data;
3143 _tmp42__length1 = -1;
3145 _tmp43_ = _tmp42_[1];
3147 _tmp43__length1 = -1;
3149 _tmp44_ = _tmp43_[2];
3151 _tmp45_ = double_to_string (_tmp44_);
3155 gtk_label_set_text (_tmp40_, _tmp46_);
3159 _tmp47_ = priv->_label_UB31;
3163 _tmp49_ = _tmp48_.data;
3165 _tmp49__length1 = -1;
3167 _tmp50_ = _tmp49_[2];
3169 _tmp50__length1 = -1;
3171 _tmp51_ = _tmp50_[0];
3173 _tmp52_ = double_to_string (_tmp51_);
3177 gtk_label_set_text (_tmp47_, _tmp53_);
3181 _tmp54_ = priv->_label_UB32;
3185 _tmp56_ = _tmp55_.data;
3187 _tmp56__length1 = -1;
3189 _tmp57_ = _tmp56_[2];
3191 _tmp57__length1 = -1;
3193 _tmp58_ = _tmp57_[1];
3195 _tmp59_ = double_to_string (_tmp58_);
3199 gtk_label_set_text (_tmp54_, _tmp60_);
3203 _tmp61_ = priv->_label_UB33;
3207 _tmp63_ = _tmp62_.data;
3209 _tmp63__length1 = -1;
3211 _tmp64_ = _tmp63_[2];
3213 _tmp64__length1 = -1;
3215 _tmp65_ = _tmp64_[2];
3217 _tmp66_ = double_to_string (_tmp65_);
3221 gtk_label_set_text (_tmp61_, _tmp67_);
3231 static void hkl_gui_window_update_UxUyUz (HklGuiWindow* self) {
3232 HklSampleList* _tmp0_;
3237 g_return_if_fail (self != NULL);
3239 _tmp0_ = priv->samples;
3241 _tmp1_ = _tmp0_->current;
3247 if (_tmp2_ != NULL) {
3249 GtkSpinButton* _tmp3_;
3251 HklParameter* _tmp5_;
3252 gdouble _tmp6_ = 0.0;
3253 GtkSpinButton* _tmp7_;
3255 HklParameter* _tmp9_;
3256 gdouble _tmp10_ = 0.0;
3257 GtkSpinButton* _tmp11_;
3259 HklParameter* _tmp13_;
3260 gdouble _tmp14_ = 0.0;
3261 GtkCheckButton* _tmp15_;
3263 HklParameter* _tmp17_;
3265 GtkCheckButton* _tmp19_;
3267 HklParameter* _tmp21_;
3269 GtkCheckButton* _tmp23_;
3271 HklParameter* _tmp25_;
3274 _tmp3_ = priv->_spinbutton_ux;
3278 _tmp5_ = _tmp4_->ux;
3280 _tmp6_ = hkl_parameter_get_value_unit (_tmp5_);
3282 gtk_spin_button_set_value (_tmp3_, _tmp6_);
3284 _tmp7_ = priv->_spinbutton_uy;
3288 _tmp9_ = _tmp8_->uy;
3290 _tmp10_ = hkl_parameter_get_value_unit (_tmp9_);
3292 gtk_spin_button_set_value (_tmp7_, _tmp10_);
3294 _tmp11_ = priv->_spinbutton_uz;
3298 _tmp13_ = _tmp12_->uz;
3300 _tmp14_ = hkl_parameter_get_value_unit (_tmp13_);
3302 gtk_spin_button_set_value (_tmp11_, _tmp14_);
3304 _tmp15_ = priv->_checkbutton_Ux;
3308 _tmp17_ = _tmp16_->ux;
3310 _tmp18_ = (*_tmp17_).fit;
3312 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp15_, _tmp18_);
3314 _tmp19_ = priv->_checkbutton_Uy;
3318 _tmp21_ = _tmp20_->uy;
3320 _tmp22_ = (*_tmp21_).fit;
3322 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp19_, _tmp22_);
3324 _tmp23_ = priv->_checkbutton_Uz;
3328 _tmp25_ = _tmp24_->uz;
3330 _tmp26_ = (*_tmp25_).fit;
3332 gtk_toggle_button_set_active ((GtkToggleButton*) _tmp23_, _tmp26_);
3338 static void _hkl_gui_window_update_reflections (HklSample* sample, GtkListStore* model) {
3340 GtkListStore* _tmp0_;
3342 HklSampleReflection** _tmp2_;
3343 gint _tmp2__length1;
3345 g_return_if_fail (sample != NULL);
3347 g_return_if_fail (model != NULL);
3351 gtk_list_store_clear (_tmp0_);
3357 _tmp2_ = _tmp1_->reflections;
3359 _tmp2__length1 = _tmp1_->reflections_len;
3362 HklSampleReflection** reflection_collection = NULL;
3363 gint reflection_collection_length1 = 0;
3364 gint _reflection_collection_size_ = 0;
3365 gint reflection_it = 0;
3367 reflection_collection = _tmp2_;
3369 reflection_collection_length1 = _tmp2__length1;
3371 for (reflection_it = 0; reflection_it < _tmp2__length1; reflection_it = reflection_it + 1) {
3373 HklSampleReflection* reflection = NULL;
3375 reflection = reflection_collection[reflection_it];
3378 GtkTreeIter iter = {0};
3379 GtkListStore* _tmp3_;
3380 GtkTreeIter _tmp4_ = {0};
3381 GtkListStore* _tmp5_;
3384 HklSampleReflection* _tmp8_;
3387 gint _tmp10__length1;
3389 HklSampleReflection* _tmp12_;
3392 gint _tmp14__length1;
3394 HklSampleReflection* _tmp16_;
3397 gint _tmp18__length1;
3399 HklSampleReflection* _tmp20_;
3404 gtk_list_store_append (_tmp3_, &_tmp4_);
3416 _tmp8_ = reflection;
3418 _tmp9_ = _tmp8_->hkl;
3420 _tmp10_ = _tmp9_.data;
3422 _tmp10__length1 = _tmp9_.data_length1;
3424 _tmp11_ = _tmp10_[0];
3426 _tmp12_ = reflection;
3428 _tmp13_ = _tmp12_->hkl;
3430 _tmp14_ = _tmp13_.data;
3432 _tmp14__length1 = _tmp13_.data_length1;
3434 _tmp15_ = _tmp14_[1];
3436 _tmp16_ = reflection;
3438 _tmp17_ = _tmp16_->hkl;
3440 _tmp18_ = _tmp17_.data;
3442 _tmp18__length1 = _tmp17_.data_length1;
3444 _tmp19_ = _tmp18_[2];
3446 _tmp20_ = reflection;
3448 _tmp21_ = _tmp20_->flag;
3450 gtk_list_store_set (_tmp5_, &_tmp6_, REFLECTION_COL_INDEX, _tmp7_, REFLECTION_COL_H, _tmp11_, REFLECTION_COL_K, _tmp15_, REFLECTION_COL_L, _tmp19_, REFLECTION_COL_FLAG, _tmp21_, -1);
3458 static void hkl_gui_window_update_tree_view_crystals (HklGuiWindow* self) {
3459 GtkListStore* reflections = NULL;
3460 GtkTreeIter iter = {0};
3461 GtkListStore* _tmp0_;
3462 GtkTreeView* _tmp1_;
3463 GtkListStore* _tmp2_;
3464 HklSampleList* _tmp3_;
3466 gint _tmp4__length1;
3468 g_return_if_fail (self != NULL);
3470 _tmp0_ = gtk_list_store_new ((gint) SAMPLE_COL_N_COLUMNS, G_TYPE_POINTER, GTK_TYPE_LIST_STORE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
3472 _g_object_unref0 (priv->store_samples);
3474 priv->store_samples = _tmp0_;
3476 _tmp1_ = priv->_treeview_crystals;
3478 _tmp2_ = priv->store_samples;
3480 gtk_tree_view_set_model (_tmp1_, (GtkTreeModel*) _tmp2_);
3482 _tmp3_ = priv->samples;
3484 _tmp4_ = _tmp3_->samples;
3486 _tmp4__length1 = _tmp3_->len;
3489 HklSample** sample_collection = NULL;
3490 gint sample_collection_length1 = 0;
3491 gint _sample_collection_size_ = 0;
3494 sample_collection = _tmp4_;
3496 sample_collection_length1 = _tmp4__length1;
3498 for (sample_it = 0; sample_it < _tmp4__length1; sample_it = sample_it + 1) {
3500 HklSample* sample = NULL;
3502 sample = sample_collection[sample_it];
3507 HklLattice* lattice;
3508 GtkListStore* _tmp7_;
3510 GtkListStore* _tmp9_;
3511 GtkListStore* _tmp10_;
3512 GtkTreeIter _tmp11_ = {0};
3513 GtkListStore* _tmp12_;
3514 GtkTreeIter _tmp13_;
3516 GtkListStore* _tmp15_;
3518 const gchar* _tmp17_;
3519 HklLattice* _tmp18_;
3520 HklParameter* _tmp19_;
3521 HklParameter _tmp20_;
3522 gdouble _tmp21_ = 0.0;
3523 HklLattice* _tmp22_;
3524 HklParameter* _tmp23_;
3525 HklParameter _tmp24_;
3526 gdouble _tmp25_ = 0.0;
3527 HklLattice* _tmp26_;
3528 HklParameter* _tmp27_;
3529 HklParameter _tmp28_;
3530 gdouble _tmp29_ = 0.0;
3531 HklLattice* _tmp30_;
3532 HklParameter* _tmp31_;
3533 HklParameter _tmp32_;
3534 gdouble _tmp33_ = 0.0;
3535 HklLattice* _tmp34_;
3536 HklParameter* _tmp35_;
3537 HklParameter _tmp36_;
3538 gdouble _tmp37_ = 0.0;
3539 HklLattice* _tmp38_;
3540 HklParameter* _tmp39_;
3541 HklParameter _tmp40_;
3542 gdouble _tmp41_ = 0.0;
3543 gboolean _tmp42_ = FALSE;
3544 HklSampleList* _tmp43_;
3550 _tmp6_ = _tmp5_->lattice;
3554 _tmp7_ = gtk_list_store_new ((gint) REFLECTION_COL_N_COLUMNS, G_TYPE_INT, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
3556 _g_object_unref0 (reflections);
3558 reflections = _tmp7_;
3562 _tmp9_ = reflections;
3564 _hkl_gui_window_update_reflections (_tmp8_, _tmp9_);
3566 _tmp10_ = priv->store_samples;
3568 gtk_list_store_append (_tmp10_, &_tmp11_);
3572 _tmp12_ = priv->store_samples;
3578 _tmp15_ = reflections;
3582 _tmp17_ = _tmp16_->name;
3586 _tmp19_ = _tmp18_->a;
3590 _tmp21_ = hkl_parameter_get_value_unit (&_tmp20_);
3594 _tmp23_ = _tmp22_->b;
3598 _tmp25_ = hkl_parameter_get_value_unit (&_tmp24_);
3602 _tmp27_ = _tmp26_->c;
3606 _tmp29_ = hkl_parameter_get_value_unit (&_tmp28_);
3610 _tmp31_ = _tmp30_->alpha;
3614 _tmp33_ = hkl_parameter_get_value_unit (&_tmp32_);
3618 _tmp35_ = _tmp34_->beta;
3622 _tmp37_ = hkl_parameter_get_value_unit (&_tmp36_);
3626 _tmp39_ = _tmp38_->gamma;
3630 _tmp41_ = hkl_parameter_get_value_unit (&_tmp40_);
3632 gtk_list_store_set (_tmp12_, &_tmp13_, SAMPLE_COL_SAMPLE, _tmp14_, SAMPLE_COL_REFLECTIONS, _tmp15_, SAMPLE_COL_NAME, _tmp17_, SAMPLE_COL_A, _tmp21_, SAMPLE_COL_B, _tmp25_, SAMPLE_COL_C, _tmp29_, SAMPLE_COL_ALPHA, _tmp33_, SAMPLE_COL_BETA, _tmp37_, SAMPLE_COL_GAMMA, _tmp41_, -1);
3634 _tmp43_ = priv->samples;
3636 _tmp44_ = _tmp43_->current;
3638 if (_tmp44_ != NULL) {
3640 HklSampleList* _tmp45_;
3642 const gchar* _tmp47_;
3644 const gchar* _tmp49_;
3646 _tmp45_ = priv->samples;
3648 _tmp46_ = _tmp45_->current;
3650 _tmp47_ = _tmp46_->name;
3654 _tmp49_ = _tmp48_->name;
3656 _tmp42_ = g_strcmp0 (_tmp47_, _tmp49_) == 0;
3668 GtkTreePath* path = NULL;
3669 GtkListStore* _tmp51_;
3670 GtkTreeIter _tmp52_;
3671 GtkTreePath* _tmp53_ = NULL;
3672 GtkTreeView* _tmp54_;
3673 GtkTreePath* _tmp55_;
3674 GtkTreeView* _tmp56_;
3675 GtkListStore* _tmp57_;
3677 _tmp51_ = priv->store_samples;
3681 _tmp53_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp51_, &_tmp52_);
3683 _gtk_tree_path_free0 (path);
3687 _tmp54_ = priv->_treeview_crystals;
3691 gtk_tree_view_set_cursor (_tmp54_, _tmp55_, NULL, FALSE);
3693 _tmp56_ = priv->_treeview_reflections;
3695 _tmp57_ = reflections;
3697 gtk_tree_view_set_model (_tmp56_, (GtkTreeModel*) _tmp57_);
3699 _gtk_tree_path_free0 (path);
3706 _g_object_unref0 (reflections);
3711 static void hkl_gui_window_update_reflections (HklGuiWindow* self, HklSample* sample) {
3712 gboolean valid = FALSE;
3713 GtkTreeIter iter = {0};
3714 GtkListStore* _tmp0_;
3715 GtkTreeIter _tmp1_ = {0};
3716 gboolean _tmp2_ = FALSE;
3718 g_return_if_fail (self != NULL);
3720 g_return_if_fail (sample != NULL);
3722 _tmp0_ = priv->store_samples;
3724 _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
3733 HklSample* sample_iter = NULL;
3734 GtkListStore* model = NULL;
3735 GtkListStore* _tmp4_;
3739 GtkListStore* _tmp10_;
3740 gboolean _tmp11_ = FALSE;
3750 _tmp4_ = priv->store_samples;
3754 gtk_tree_model_get ((GtkTreeModel*) _tmp4_, &_tmp5_, SAMPLE_COL_SAMPLE, &sample_iter, SAMPLE_COL_REFLECTIONS, &model, -1);
3758 _tmp7_ = sample_iter;
3760 if (_tmp6_ == _tmp7_) {
3763 GtkListStore* _tmp9_;
3769 _hkl_gui_window_update_reflections (_tmp8_, _tmp9_);
3771 _g_object_unref0 (model);
3777 _tmp10_ = priv->store_samples;
3779 _tmp11_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp10_, &iter);
3783 _g_object_unref0 (model);
3789 static void hkl_gui_window_update_crystal_model (HklGuiWindow* self, HklSample* sample) {
3790 GtkTreeIter iter = {0};
3791 gboolean valid = FALSE;
3792 GtkListStore* _tmp0_;
3793 GtkTreeIter _tmp1_ = {0};
3794 gboolean _tmp2_ = FALSE;
3796 g_return_if_fail (self != NULL);
3798 g_return_if_fail (sample != NULL);
3800 _tmp0_ = priv->store_samples;
3802 _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
3812 GtkListStore* _tmp4_;
3814 const gchar* _tmp6_;
3816 const gchar* _tmp8_;
3817 GtkListStore* _tmp37_;
3818 gboolean _tmp38_ = FALSE;
3828 _tmp4_ = priv->store_samples;
3832 gtk_tree_model_get ((GtkTreeModel*) _tmp4_, &_tmp5_, SAMPLE_COL_NAME, &name, -1);
3838 _tmp8_ = _tmp7_->name;
3840 if (g_strcmp0 (_tmp6_, _tmp8_) == 0) {
3843 HklLattice* _tmp10_;
3844 HklLattice* lattice;
3845 GtkListStore* _tmp11_;
3846 GtkTreeIter _tmp12_;
3847 HklLattice* _tmp13_;
3848 HklParameter* _tmp14_;
3849 HklParameter _tmp15_;
3850 gdouble _tmp16_ = 0.0;
3851 HklLattice* _tmp17_;
3852 HklParameter* _tmp18_;
3853 HklParameter _tmp19_;
3854 gdouble _tmp20_ = 0.0;
3855 HklLattice* _tmp21_;
3856 HklParameter* _tmp22_;
3857 HklParameter _tmp23_;
3858 gdouble _tmp24_ = 0.0;
3859 HklLattice* _tmp25_;
3860 HklParameter* _tmp26_;
3861 HklParameter _tmp27_;
3862 gdouble _tmp28_ = 0.0;
3863 HklLattice* _tmp29_;
3864 HklParameter* _tmp30_;
3865 HklParameter _tmp31_;
3866 gdouble _tmp32_ = 0.0;
3867 HklLattice* _tmp33_;
3868 HklParameter* _tmp34_;
3869 HklParameter _tmp35_;
3870 gdouble _tmp36_ = 0.0;
3874 _tmp10_ = _tmp9_->lattice;
3878 _tmp11_ = priv->store_samples;
3884 _tmp14_ = _tmp13_->a;
3888 _tmp16_ = hkl_parameter_get_value_unit (&_tmp15_);
3892 _tmp18_ = _tmp17_->b;
3896 _tmp20_ = hkl_parameter_get_value_unit (&_tmp19_);
3900 _tmp22_ = _tmp21_->c;
3904 _tmp24_ = hkl_parameter_get_value_unit (&_tmp23_);
3908 _tmp26_ = _tmp25_->alpha;
3912 _tmp28_ = hkl_parameter_get_value_unit (&_tmp27_);
3916 _tmp30_ = _tmp29_->beta;
3920 _tmp32_ = hkl_parameter_get_value_unit (&_tmp31_);
3924 _tmp34_ = _tmp33_->gamma;
3928 _tmp36_ = hkl_parameter_get_value_unit (&_tmp35_);
3930 gtk_list_store_set (_tmp11_, &_tmp12_, SAMPLE_COL_A, _tmp16_, SAMPLE_COL_B, _tmp20_, SAMPLE_COL_C, _tmp24_, SAMPLE_COL_ALPHA, _tmp28_, SAMPLE_COL_BETA, _tmp32_, SAMPLE_COL_GAMMA, _tmp36_, -1);
3938 _tmp37_ = priv->store_samples;
3940 _tmp38_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp37_, &iter);
3954 static void hkl_gui_window_on_tree_view_pseudo_axes_cursor_changed (HklGuiWindow* self) {
3955 GtkTreePath* path = NULL;
3956 GtkTreeViewColumn* focus_column = NULL;
3957 GtkListStore* model = NULL;
3958 GtkTreeIter iter = {0};
3959 HklPseudoAxis* pseudoAxis = NULL;
3960 GtkTreeView* _tmp0_;
3961 GtkTreePath* _tmp1_ = NULL;
3962 GtkTreeViewColumn* _tmp2_ = NULL;
3963 GtkTreeViewColumn* _tmp3_;
3964 GtkListStore* _tmp4_;
3965 GtkTreeIter _tmp5_ = {0};
3966 GtkListStore* _tmp6_;
3969 gpointer _tmp9_ = NULL;
3970 GtkTreeView* _tmp10_;
3972 g_return_if_fail (self != NULL);
3974 _tmp0_ = priv->_treeview_pseudo_axes;
3976 gtk_tree_view_get_cursor (_tmp0_, &_tmp1_, &_tmp2_);
3978 _gtk_tree_path_free0 (path);
3982 _g_object_unref0 (focus_column);
3984 _tmp3_ = _g_object_ref0 (_tmp2_);
3986 focus_column = _tmp3_;
3988 _tmp4_ = priv->store_pseudo_axis;
3990 gtk_tree_model_get_iter ((GtkTreeModel*) _tmp4_, &_tmp5_, path);
3994 _tmp6_ = priv->store_pseudo_axis;
3998 gtk_tree_model_get ((GtkTreeModel*) _tmp6_, &_tmp7_, PSEUDO_AXIS_COL_PSEUDOAXIS, &pseudoAxis, -1);
4000 _tmp8_ = priv->hash_store_pseudo_axis_parameter;
4002 _tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, pseudoAxis);
4004 _g_object_unref0 (model);
4006 model = (GtkListStore*) _tmp9_;
4008 _tmp10_ = priv->_treeview_pseudo_axes_parameters;
4010 gtk_tree_view_set_model (_tmp10_, (GtkTreeModel*) model);
4012 _g_object_unref0 (model);
4014 _g_object_unref0 (focus_column);
4016 _gtk_tree_path_free0 (path);
4021 static void hkl_gui_window_on_tree_view_crystals_cursor_changed (HklGuiWindow* self) {
4022 GtkTreePath* path = NULL;
4023 GtkTreeViewColumn* focus_column = NULL;
4024 GtkTreeModel* model = NULL;
4025 GtkListStore* reflections = NULL;
4026 GtkTreeIter iter = {0};
4028 GtkTreeView* _tmp0_;
4029 GtkTreePath* _tmp1_ = NULL;
4030 GtkTreeViewColumn* _tmp2_ = NULL;
4031 GtkTreeViewColumn* _tmp3_;
4032 GtkTreeView* _tmp4_;
4033 GtkTreeModel* _tmp5_ = NULL;
4034 GtkTreeModel* _tmp6_;
4035 GtkTreeIter _tmp7_ = {0};
4037 HklSampleList* _tmp9_;
4038 HklPseudoAxisEngineList* _tmp10_;
4039 HklGeometry* _tmp11_;
4040 HklDetector* _tmp12_;
4041 HklSampleList* _tmp13_;
4043 GtkTreeView* _tmp15_;
4045 g_return_if_fail (self != NULL);
4047 _tmp0_ = priv->_treeview_crystals;
4049 gtk_tree_view_get_cursor (_tmp0_, &_tmp1_, &_tmp2_);
4051 _gtk_tree_path_free0 (path);
4055 _g_object_unref0 (focus_column);
4057 _tmp3_ = _g_object_ref0 (_tmp2_);
4059 focus_column = _tmp3_;
4061 _tmp4_ = priv->_treeview_crystals;
4063 _tmp5_ = gtk_tree_view_get_model (_tmp4_);
4065 _tmp6_ = _g_object_ref0 (_tmp5_);
4067 _g_object_unref0 (model);
4071 gtk_tree_model_get_iter (model, &_tmp7_, path);
4077 gtk_tree_model_get (model, &_tmp8_, SAMPLE_COL_NAME, &name, SAMPLE_COL_REFLECTIONS, &reflections, -1);
4079 _tmp9_ = priv->samples;
4081 hkl_sample_list_select_current (_tmp9_, name);
4083 _tmp10_ = priv->engines;
4085 _tmp11_ = priv->geometry;
4087 _tmp12_ = priv->detector;
4089 _tmp13_ = priv->samples;
4091 _tmp14_ = _tmp13_->current;
4093 hkl_pseudo_axis_engine_list_init (_tmp10_, _tmp11_, _tmp12_, _tmp14_);
4095 _tmp15_ = priv->_treeview_reflections;
4097 gtk_tree_view_set_model (_tmp15_, (GtkTreeModel*) reflections);
4099 hkl_gui_window_update_lattice (self);
4101 hkl_gui_window_update_lattice_parameters (self);
4103 hkl_gui_window_update_reciprocal_lattice (self);
4105 hkl_gui_window_update_UxUyUz (self);
4107 hkl_gui_window_update_UB (self);
4109 hkl_gui_window_update_pseudo_axes (self);
4111 hkl_gui_window_update_pseudo_axes_frames (self);
4115 _g_object_unref0 (reflections);
4117 _g_object_unref0 (model);
4119 _g_object_unref0 (focus_column);
4121 _gtk_tree_path_free0 (path);
4125 static void hkl_gui_window_on_spinbutton_lambda_value_changed (HklGuiWindow* self) {
4126 HklGeometry* _tmp0_;
4127 GtkSpinButton* _tmp1_;
4128 gdouble _tmp2_ = 0.0;
4130 g_return_if_fail (self != NULL);
4132 _tmp0_ = priv->geometry;
4134 _tmp1_ = priv->_spinbutton_lambda;
4136 _tmp2_ = gtk_spin_button_get_value (_tmp1_);
4138 _tmp0_->source.wave_length = _tmp2_;
4140 hkl_gui_window_update_pseudo_axes (self);
4142 hkl_gui_window_update_pseudo_axes_frames (self);
4147 static void hkl_gui_window_on_spinbutton_uxuyuz_value_changed (HklGuiWindow* self) {
4149 g_return_if_fail (self != NULL);
4154 static void hkl_gui_window_on_button2_clicked (HklGuiWindow* self) {
4155 HklSampleList* _tmp0_;
4160 g_return_if_fail (self != NULL);
4162 _tmp0_ = priv->samples;
4164 _tmp1_ = _tmp0_->current;
4170 if (_tmp2_ != NULL) {
4173 GtkSpinButton* _tmp4_;
4174 gdouble _tmp5_ = 0.0;
4175 GtkSpinButton* _tmp6_;
4176 gdouble _tmp7_ = 0.0;
4177 GtkSpinButton* _tmp8_;
4178 gdouble _tmp9_ = 0.0;
4179 GtkSpinButton* _tmp10_;
4180 gdouble _tmp11_ = 0.0;
4181 GtkSpinButton* _tmp12_;
4182 gdouble _tmp13_ = 0.0;
4183 GtkSpinButton* _tmp14_;
4184 gdouble _tmp15_ = 0.0;
4186 GtkSpinButton* _tmp17_;
4187 gdouble _tmp18_ = 0.0;
4188 GtkSpinButton* _tmp19_;
4189 gdouble _tmp20_ = 0.0;
4190 GtkSpinButton* _tmp21_;
4191 gdouble _tmp22_ = 0.0;
4193 HklLattice* _tmp24_;
4194 HklParameter* _tmp25_;
4195 GtkSpinButton* _tmp26_;
4196 gdouble _tmp27_ = 0.0;
4197 GtkSpinButton* _tmp28_;
4198 gdouble _tmp29_ = 0.0;
4199 HklParameter _tmp30_;
4201 HklLattice* _tmp32_;
4202 HklParameter* _tmp33_;
4203 GtkSpinButton* _tmp34_;
4204 gdouble _tmp35_ = 0.0;
4205 GtkSpinButton* _tmp36_;
4206 gdouble _tmp37_ = 0.0;
4207 HklParameter _tmp38_;
4209 HklLattice* _tmp40_;
4210 HklParameter* _tmp41_;
4211 GtkSpinButton* _tmp42_;
4212 gdouble _tmp43_ = 0.0;
4213 GtkSpinButton* _tmp44_;
4214 gdouble _tmp45_ = 0.0;
4215 HklParameter _tmp46_;
4217 HklLattice* _tmp48_;
4218 HklParameter* _tmp49_;
4219 GtkSpinButton* _tmp50_;
4220 gdouble _tmp51_ = 0.0;
4221 GtkSpinButton* _tmp52_;
4222 gdouble _tmp53_ = 0.0;
4223 HklParameter _tmp54_;
4225 HklLattice* _tmp56_;
4226 HklParameter* _tmp57_;
4227 GtkSpinButton* _tmp58_;
4228 gdouble _tmp59_ = 0.0;
4229 GtkSpinButton* _tmp60_;
4230 gdouble _tmp61_ = 0.0;
4231 HklParameter _tmp62_;
4233 HklLattice* _tmp64_;
4234 HklParameter* _tmp65_;
4235 GtkSpinButton* _tmp66_;
4236 gdouble _tmp67_ = 0.0;
4237 GtkSpinButton* _tmp68_;
4238 gdouble _tmp69_ = 0.0;
4239 HklParameter _tmp70_;
4244 _tmp4_ = priv->_spinbutton_a;
4246 _tmp5_ = gtk_spin_button_get_value (_tmp4_);
4248 _tmp6_ = priv->_spinbutton_b;
4250 _tmp7_ = gtk_spin_button_get_value (_tmp6_);
4252 _tmp8_ = priv->_spinbutton_c;
4254 _tmp9_ = gtk_spin_button_get_value (_tmp8_);
4256 _tmp10_ = priv->_spinbutton_alpha;
4258 _tmp11_ = gtk_spin_button_get_value (_tmp10_);
4260 _tmp12_ = priv->_spinbutton_beta;
4262 _tmp13_ = gtk_spin_button_get_value (_tmp12_);
4264 _tmp14_ = priv->_spinbutton_gamma;
4266 _tmp15_ = gtk_spin_button_get_value (_tmp14_);
4268 hkl_sample_set_lattice (_tmp3_, _tmp5_, _tmp7_, _tmp9_, _tmp11_ * HKL_DEGTORAD, _tmp13_ * HKL_DEGTORAD, _tmp15_ * HKL_DEGTORAD);
4272 _tmp17_ = priv->_spinbutton_ux;
4274 _tmp18_ = gtk_spin_button_get_value (_tmp17_);
4276 _tmp19_ = priv->_spinbutton_uy;
4278 _tmp20_ = gtk_spin_button_get_value (_tmp19_);
4280 _tmp21_ = priv->_spinbutton_uz;
4282 _tmp22_ = gtk_spin_button_get_value (_tmp21_);
4284 hkl_sample_set_U_from_euler (_tmp16_, _tmp18_ * HKL_DEGTORAD, _tmp20_ * HKL_DEGTORAD, _tmp22_ * HKL_DEGTORAD);
4288 _tmp24_ = _tmp23_->lattice;
4290 _tmp25_ = _tmp24_->a;
4292 _tmp26_ = priv->_spinbutton_a_min;
4294 _tmp27_ = gtk_spin_button_get_value (_tmp26_);
4296 _tmp28_ = priv->_spinbutton_a_max;
4298 _tmp29_ = gtk_spin_button_get_value (_tmp28_);
4302 hkl_parameter_set_range_unit (&_tmp30_, _tmp27_, _tmp29_);
4306 _tmp32_ = _tmp31_->lattice;
4308 _tmp33_ = _tmp32_->b;
4310 _tmp34_ = priv->_spinbutton_b_min;
4312 _tmp35_ = gtk_spin_button_get_value (_tmp34_);
4314 _tmp36_ = priv->_spinbutton_b_max;
4316 _tmp37_ = gtk_spin_button_get_value (_tmp36_);
4320 hkl_parameter_set_range_unit (&_tmp38_, _tmp35_, _tmp37_);
4324 _tmp40_ = _tmp39_->lattice;
4326 _tmp41_ = _tmp40_->c;
4328 _tmp42_ = priv->_spinbutton_c_min;
4330 _tmp43_ = gtk_spin_button_get_value (_tmp42_);
4332 _tmp44_ = priv->_spinbutton_c_max;
4334 _tmp45_ = gtk_spin_button_get_value (_tmp44_);
4338 hkl_parameter_set_range_unit (&_tmp46_, _tmp43_, _tmp45_);
4342 _tmp48_ = _tmp47_->lattice;
4344 _tmp49_ = _tmp48_->alpha;
4346 _tmp50_ = priv->_spinbutton_alpha_min;
4348 _tmp51_ = gtk_spin_button_get_value (_tmp50_);
4350 _tmp52_ = priv->_spinbutton_alpha_max;
4352 _tmp53_ = gtk_spin_button_get_value (_tmp52_);
4356 hkl_parameter_set_range_unit (&_tmp54_, _tmp51_, _tmp53_);
4360 _tmp56_ = _tmp55_->lattice;
4362 _tmp57_ = _tmp56_->beta;
4364 _tmp58_ = priv->_spinbutton_beta_min;
4366 _tmp59_ = gtk_spin_button_get_value (_tmp58_);
4368 _tmp60_ = priv->_spinbutton_beta_max;
4370 _tmp61_ = gtk_spin_button_get_value (_tmp60_);
4374 hkl_parameter_set_range_unit (&_tmp62_, _tmp59_, _tmp61_);
4378 _tmp64_ = _tmp63_->lattice;
4380 _tmp65_ = _tmp64_->gamma;
4382 _tmp66_ = priv->_spinbutton_gamma_min;
4384 _tmp67_ = gtk_spin_button_get_value (_tmp66_);
4386 _tmp68_ = priv->_spinbutton_gamma_max;
4388 _tmp69_ = gtk_spin_button_get_value (_tmp68_);
4392 hkl_parameter_set_range_unit (&_tmp70_, _tmp67_, _tmp69_);
4396 hkl_gui_window_update_crystal_model (self, _tmp71_);
4398 hkl_gui_window_update_reciprocal_lattice (self);
4400 hkl_gui_window_update_UB (self);
4402 hkl_gui_window_update_pseudo_axes (self);
4404 hkl_gui_window_update_pseudo_axes_frames (self);
4410 static void hkl_gui_window_on_checkbutton_a_toggled (HklGuiWindow* self) {
4411 HklSampleList* _tmp0_;
4416 g_return_if_fail (self != NULL);
4418 _tmp0_ = priv->samples;
4420 _tmp1_ = _tmp0_->current;
4426 if (_tmp2_ != NULL) {
4430 HklParameter* _tmp5_;
4431 GtkCheckButton* _tmp6_;
4432 gboolean _tmp7_ = FALSE;
4436 _tmp4_ = _tmp3_->lattice;
4440 _tmp6_ = priv->_checkbutton_a;
4442 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4444 (*_tmp5_).fit = _tmp7_;
4450 static void hkl_gui_window_on_checkbutton_b_toggled (HklGuiWindow* self) {
4451 HklSampleList* _tmp0_;
4456 g_return_if_fail (self != NULL);
4458 _tmp0_ = priv->samples;
4460 _tmp1_ = _tmp0_->current;
4466 if (_tmp2_ != NULL) {
4470 HklParameter* _tmp5_;
4471 GtkCheckButton* _tmp6_;
4472 gboolean _tmp7_ = FALSE;
4476 _tmp4_ = _tmp3_->lattice;
4480 _tmp6_ = priv->_checkbutton_b;
4482 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4484 (*_tmp5_).fit = _tmp7_;
4490 static void hkl_gui_window_on_checkbutton_c_toggled (HklGuiWindow* self) {
4491 HklSampleList* _tmp0_;
4496 g_return_if_fail (self != NULL);
4498 _tmp0_ = priv->samples;
4500 _tmp1_ = _tmp0_->current;
4506 if (_tmp2_ != NULL) {
4510 HklParameter* _tmp5_;
4511 GtkCheckButton* _tmp6_;
4512 gboolean _tmp7_ = FALSE;
4516 _tmp4_ = _tmp3_->lattice;
4520 _tmp6_ = priv->_checkbutton_c;
4522 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4524 (*_tmp5_).fit = _tmp7_;
4530 static void hkl_gui_window_on_checkbutton_alpha_toggled (HklGuiWindow* self) {
4531 HklSampleList* _tmp0_;
4536 g_return_if_fail (self != NULL);
4538 _tmp0_ = priv->samples;
4540 _tmp1_ = _tmp0_->current;
4546 if (_tmp2_ != NULL) {
4550 HklParameter* _tmp5_;
4551 GtkCheckButton* _tmp6_;
4552 gboolean _tmp7_ = FALSE;
4556 _tmp4_ = _tmp3_->lattice;
4558 _tmp5_ = _tmp4_->alpha;
4560 _tmp6_ = priv->_checkbutton_alpha;
4562 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4564 (*_tmp5_).fit = _tmp7_;
4570 static void hkl_gui_window_on_checkbutton_beta_toggled (HklGuiWindow* self) {
4571 HklSampleList* _tmp0_;
4576 g_return_if_fail (self != NULL);
4578 _tmp0_ = priv->samples;
4580 _tmp1_ = _tmp0_->current;
4586 if (_tmp2_ != NULL) {
4590 HklParameter* _tmp5_;
4591 GtkCheckButton* _tmp6_;
4592 gboolean _tmp7_ = FALSE;
4596 _tmp4_ = _tmp3_->lattice;
4598 _tmp5_ = _tmp4_->beta;
4600 _tmp6_ = priv->_checkbutton_beta;
4602 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4604 (*_tmp5_).fit = _tmp7_;
4610 static void hkl_gui_window_on_checkbutton_gamma_toggled (HklGuiWindow* self) {
4611 HklSampleList* _tmp0_;
4616 g_return_if_fail (self != NULL);
4618 _tmp0_ = priv->samples;
4620 _tmp1_ = _tmp0_->current;
4626 if (_tmp2_ != NULL) {
4630 HklParameter* _tmp5_;
4631 GtkCheckButton* _tmp6_;
4632 gboolean _tmp7_ = FALSE;
4636 _tmp4_ = _tmp3_->lattice;
4638 _tmp5_ = _tmp4_->gamma;
4640 _tmp6_ = priv->_checkbutton_gamma;
4642 _tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
4644 (*_tmp5_).fit = _tmp7_;
4650 static void hkl_gui_window_on_checkbutton_Ux_toggled (HklGuiWindow* self) {
4651 HklSampleList* _tmp0_;
4656 g_return_if_fail (self != NULL);
4658 _tmp0_ = priv->samples;
4660 _tmp1_ = _tmp0_->current;
4666 if (_tmp2_ != NULL) {
4669 HklParameter* _tmp4_;
4670 GtkCheckButton* _tmp5_;
4671 gboolean _tmp6_ = FALSE;
4675 _tmp4_ = _tmp3_->ux;
4677 _tmp5_ = priv->_checkbutton_Ux;
4679 _tmp6_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp5_);
4681 (*_tmp4_).fit = _tmp6_;
4687 static void hkl_gui_window_on_checkbutton_Uy_toggled (HklGuiWindow* self) {
4688 HklSampleList* _tmp0_;
4693 g_return_if_fail (self != NULL);
4695 _tmp0_ = priv->samples;
4697 _tmp1_ = _tmp0_->current;
4703 if (_tmp2_ != NULL) {
4706 HklParameter* _tmp4_;
4707 GtkCheckButton* _tmp5_;
4708 gboolean _tmp6_ = FALSE;
4712 _tmp4_ = _tmp3_->uy;
4714 _tmp5_ = priv->_checkbutton_Uy;
4716 _tmp6_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp5_);
4718 (*_tmp4_).fit = _tmp6_;
4724 static void hkl_gui_window_on_checkbutton_Uz_toggled (HklGuiWindow* self) {
4725 HklSampleList* _tmp0_;
4730 g_return_if_fail (self != NULL);
4732 _tmp0_ = priv->samples;
4734 _tmp1_ = _tmp0_->current;
4740 if (_tmp2_ != NULL) {
4743 HklParameter* _tmp4_;
4744 GtkCheckButton* _tmp5_;
4745 gboolean _tmp6_ = FALSE;
4749 _tmp4_ = _tmp3_->uz;
4751 _tmp5_ = priv->_checkbutton_Uz;
4753 _tmp6_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp5_);
4755 (*_tmp4_).fit = _tmp6_;
4761 static gdouble double_parse (const gchar* str) {
4762 gdouble result = 0.0;
4763 const gchar* _tmp0_;
4764 gdouble _tmp1_ = 0.0;
4766 g_return_val_if_fail (str != NULL, 0.0);
4770 _tmp1_ = g_ascii_strtod (_tmp0_, NULL);
4781 static void hkl_gui_window_on_cell_tree_view_axes_write_edited (const gchar* path, const gchar* new_text, HklGuiWindow* self) {
4782 GtkTreeIter iter = {0};
4783 gdouble value = 0.0;
4784 HklAxis* axis = NULL;
4785 GtkListStore* _tmp0_;
4786 const gchar* _tmp1_;
4787 GtkTreeIter _tmp2_ = {0};
4788 GtkListStore* _tmp3_;
4790 const gchar* _tmp5_;
4791 gdouble _tmp6_ = 0.0;
4793 HklGeometry* _tmp8_;
4794 GtkListStore* _tmp9_;
4795 GtkTreeIter _tmp10_;
4797 g_return_if_fail (self != NULL);
4799 g_return_if_fail (path != NULL);
4801 g_return_if_fail (new_text != NULL);
4803 _tmp0_ = priv->store_axis;
4807 gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp0_, &_tmp2_, _tmp1_);
4811 _tmp3_ = priv->store_axis;
4815 gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, AXIS_COL_AXIS, &axis, -1);
4819 _tmp6_ = double_parse (_tmp5_);
4825 hkl_axis_set_value_unit (&_tmp7_, value);
4827 _tmp8_ = priv->geometry;
4828 hkl_geometry_update (_tmp8_);
4830 _tmp9_ = priv->store_axis;
4834 gtk_list_store_set (_tmp9_, &_tmp10_, AXIS_COL_WRITE, value, -1);
4836 hkl_gui_window_update_pseudo_axes (self);
4838 hkl_gui_window_update_pseudo_axes_frames (self);
4845 static void hkl_gui_window_on_cell_tree_view_pseudo_axes_is_initialized_toggled (const gchar* path, HklGuiWindow* self) {
4846 GtkTreeModel* model = NULL;
4847 GtkTreeIter iter = {0};
4848 HklPseudoAxis* pseudoAxis = NULL;
4849 gboolean old_flag = FALSE;
4850 GtkTreeView* _tmp0_;
4851 GtkTreeModel* _tmp1_ = NULL;
4852 GtkTreeModel* _tmp2_;
4853 GtkTreeModel* _tmp3_;
4854 const gchar* _tmp4_;
4855 GtkTreeIter _tmp5_ = {0};
4856 GtkTreeModel* _tmp6_;
4860 g_return_if_fail (self != NULL);
4862 g_return_if_fail (path != NULL);
4864 _tmp0_ = priv->_treeview_pseudo_axes;
4866 _tmp1_ = gtk_tree_view_get_model (_tmp0_);
4868 _tmp2_ = _g_object_ref0 (_tmp1_);
4870 _g_object_unref0 (model);
4878 gtk_tree_model_get_iter_from_string (_tmp3_, &_tmp5_, _tmp4_);
4886 gtk_tree_model_get (_tmp6_, &_tmp7_, PSEUDO_AXIS_COL_PSEUDOAXIS, &pseudoAxis, PSEUDO_AXIS_COL_INITIALIZED, &old_flag, -1);
4892 HklPseudoAxis* _tmp9_;
4893 HklPseudoAxisEngine* _tmp10_;
4894 gboolean _tmp11_ = FALSE;
4896 _tmp9_ = pseudoAxis;
4898 _tmp10_ = _tmp9_->engine;
4900 _tmp11_ = hkl_pseudo_axis_engine_initialize (_tmp10_, NULL);
4904 hkl_gui_window_update_pseudo_axes (self);
4909 _g_object_unref0 (model);
4914 static void hkl_gui_window_on_cell_tree_view_pseudo_axes_parameters_value_edited (const gchar* path, const gchar* new_text, HklGuiWindow* self) {
4915 GtkListStore* model = NULL;
4916 GtkTreeIter iter = {0};
4917 gdouble value = 0.0;
4918 HklParameter* parameter;
4919 GtkTreeView* _tmp0_;
4920 GtkTreeModel* _tmp1_ = NULL;
4921 GtkListStore* _tmp2_;
4922 const gchar* _tmp3_;
4923 GtkTreeIter _tmp4_ = {0};
4925 const gchar* _tmp6_;
4926 gdouble _tmp7_ = 0.0;
4927 HklParameter _tmp8_;
4930 g_return_if_fail (self != NULL);
4932 g_return_if_fail (path != NULL);
4934 g_return_if_fail (new_text != NULL);
4938 _tmp0_ = priv->_treeview_pseudo_axes_parameters;
4940 _tmp1_ = gtk_tree_view_get_model (_tmp0_);
4942 _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GTK_TYPE_LIST_STORE) ? ((GtkListStore*) _tmp1_) : NULL);
4944 _g_object_unref0 (model);
4950 gtk_tree_model_get_iter_from_string ((GtkTreeModel*) model, &_tmp4_, _tmp3_);
4956 gtk_tree_model_get ((GtkTreeModel*) model, &_tmp5_, PARAMETER_COL_PARAMETER, parameter, -1);
4960 _tmp7_ = double_parse (_tmp6_);
4964 _tmp8_ = *parameter;
4966 hkl_parameter_set_value_unit (&_tmp8_, value);
4970 gtk_list_store_set (model, &_tmp9_, PARAMETER_COL_VALUE, value, -1);
4972 hkl_gui_window_update_pseudo_axes (self);
4974 hkl_gui_window_update_pseudo_axes_parameters (self);
4976 _g_object_unref0 (model);
4981 static void hkl_gui_window_on_cell_tree_view_crystals_name_edited (const gchar* path, const gchar* new_text, HklGuiWindow* self) {
4982 GtkTreeModel* model = NULL;
4983 GtkTreeIter iter = {0};
4984 HklSample* sample = NULL;
4986 GtkTreeView* _tmp0_;
4987 GtkTreeModel* _tmp1_ = NULL;
4988 GtkTreeModel* _tmp2_;
4989 GtkTreeModel* _tmp3_;
4990 const gchar* _tmp4_;
4991 GtkTreeIter _tmp5_ = {0};
4992 GtkTreeModel* _tmp6_;
4994 HklSampleList* _tmp8_;
4995 const gchar* _tmp9_;
4996 HklSample* _tmp10_ = NULL;
4999 g_return_if_fail (self != NULL);
5001 g_return_if_fail (path != NULL);
5003 g_return_if_fail (new_text != NULL);
5005 _tmp0_ = priv->_treeview_crystals;
5007 _tmp1_ = gtk_tree_view_get_model (_tmp0_);
5009 _tmp2_ = _g_object_ref0 (_tmp1_);
5011 _g_object_unref0 (model);
5019 gtk_tree_model_get_iter_from_string (_tmp3_, &_tmp5_, _tmp4_);
5027 gtk_tree_model_get (_tmp6_, &_tmp7_, SAMPLE_COL_NAME, &name, -1);
5029 _tmp8_ = priv->samples;
5033 _tmp10_ = hkl_sample_list_get_by_name (_tmp8_, _tmp9_);
5039 if (_tmp11_ != NULL) {
5042 const gchar* _tmp13_;
5048 hkl_sample_set_name (_tmp12_, _tmp13_);
5050 hkl_gui_window_update_tree_view_crystals (self);
5056 _g_object_unref0 (model);
5063 static void hkl_gui_window_on_toolbutton_add_reflection_clicked (HklGuiWindow* self) {
5064 HklSampleList* _tmp0_;
5069 g_return_if_fail (self != NULL);
5071 _tmp0_ = priv->samples;
5073 _tmp1_ = _tmp0_->current;
5079 if (_tmp2_ != NULL) {
5085 HklGeometry* _tmp4_;
5086 HklDetector* _tmp5_;
5090 HklSampleReflection* _tmp9_ = NULL;
5101 _tmp4_ = priv->geometry;
5103 _tmp5_ = priv->detector;
5111 _tmp9_ = hkl_sample_add_reflection (_tmp3_, _tmp4_, _tmp5_, _tmp6_, _tmp7_, _tmp8_);
5115 hkl_gui_window_update_reflections (self, _tmp10_);
5121 static void _gtk_tree_path_free0_ (gpointer var) {
5123 (var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
5128 static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
5130 g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
5137 static void hkl_gui_window_on_toolbutton_goto_reflection_clicked (HklGuiWindow* self) {
5138 HklSampleList* _tmp0_;
5143 g_return_if_fail (self != NULL);
5145 _tmp0_ = priv->samples;
5147 _tmp1_ = _tmp0_->current;
5153 if (_tmp2_ != NULL) {
5155 GtkTreeSelection* selection = NULL;
5157 GtkTreeView* _tmp3_;
5158 GtkTreeSelection* _tmp4_ = NULL;
5159 GtkTreeSelection* _tmp5_;
5160 GtkTreeSelection* _tmp6_;
5164 _tmp3_ = priv->_treeview_reflections;
5166 _tmp4_ = gtk_tree_view_get_selection (_tmp3_);
5168 _tmp5_ = _g_object_ref0 (_tmp4_);
5170 _g_object_unref0 (selection);
5176 _tmp7_ = gtk_tree_selection_count_selected_rows (_tmp6_);
5178 nb_rows = (guint) _tmp7_;
5182 if (_tmp8_ == ((guint) 1)) {
5185 GtkTreeIter iter = {0};
5186 GtkTreeModel* model = NULL;
5187 GtkTreeSelection* _tmp9_;
5188 GtkTreeModel* _tmp10_ = NULL;
5189 GList* _tmp11_ = NULL;
5190 GtkTreeModel* _tmp12_;
5192 GtkTreeModel* _tmp13_;
5194 gconstpointer _tmp15_;
5195 GtkTreeIter _tmp16_ = {0};
5196 GtkTreeModel* _tmp17_;
5197 GtkTreeIter _tmp18_;
5198 HklGeometry* _tmp19_;
5200 HklSampleReflection** _tmp21_;
5201 gint _tmp21__length1;
5203 HklSampleReflection* _tmp23_;
5204 HklGeometry* _tmp24_;
5208 _tmp11_ = gtk_tree_selection_get_selected_rows (_tmp9_, &_tmp10_);
5210 _g_object_unref0 (model);
5212 _tmp12_ = _g_object_ref0 (_tmp10_);
5222 _tmp15_ = _tmp14_->data;
5224 gtk_tree_model_get_iter (_tmp13_, &_tmp16_, (GtkTreePath*) _tmp15_);
5232 gtk_tree_model_get (_tmp17_, &_tmp18_, REFLECTION_COL_INDEX, &index, -1);
5234 _tmp19_ = priv->geometry;
5238 _tmp21_ = _tmp20_->reflections;
5240 _tmp21__length1 = _tmp20_->reflections_len;
5244 _tmp23_ = _tmp21_[_tmp22_];
5246 _tmp24_ = _tmp23_->geometry;
5248 hkl_geometry_init_geometry (_tmp19_, _tmp24_);
5250 hkl_gui_window_update_source (self);
5252 hkl_gui_window_update_axes (self);
5254 hkl_gui_window_update_pseudo_axes (self);
5256 __g_list_free__gtk_tree_path_free0_0 (list);
5258 _g_object_unref0 (model);
5265 if (_tmp25_ > ((guint) 0)) {
5267 GtkStatusbar* _tmp26_;
5269 _tmp26_ = priv->_statusBar;
5271 gtk_statusbar_push (_tmp26_, (guint) 0, "Please select only one reflection.");
5274 GtkStatusbar* _tmp27_;
5276 _tmp27_ = priv->_statusBar;
5278 gtk_statusbar_push (_tmp27_, (guint) 0, "Please select at least one reflection.");
5283 _g_object_unref0 (selection);
5289 static gpointer _gtk_tree_path_copy0 (gpointer self) {
5291 return self ? gtk_tree_path_copy (self) : NULL;
5296 static void hkl_gui_window_on_toolbutton_del_reflection_clicked (HklGuiWindow* self) {
5297 HklSample* sample = NULL;
5298 HklSampleList* _tmp0_;
5302 g_return_if_fail (self != NULL);
5304 _tmp0_ = priv->samples;
5306 _tmp1_ = _tmp0_->current;
5312 if (_tmp2_ != NULL) {
5314 GtkTreeSelection* selection = NULL;
5316 GtkTreeView* _tmp3_;
5317 GtkTreeSelection* _tmp4_ = NULL;
5318 GtkTreeSelection* _tmp5_;
5319 GtkTreeSelection* _tmp6_;
5323 _tmp3_ = priv->_treeview_reflections;
5325 _tmp4_ = gtk_tree_view_get_selection (_tmp3_);
5327 _tmp5_ = _g_object_ref0 (_tmp4_);
5329 _g_object_unref0 (selection);
5335 _tmp7_ = gtk_tree_selection_count_selected_rows (_tmp6_);
5337 nb_rows = (guint) _tmp7_;
5341 if (_tmp8_ > ((guint) 0)) {
5343 GtkTreeModel* model = NULL;
5344 GtkTreeIter iter = {0};
5345 GtkTreeSelection* _tmp9_;
5346 GtkTreeModel* _tmp10_ = NULL;
5347 GList* _tmp11_ = NULL;
5348 GtkTreeModel* _tmp12_;
5351 guint* _tmp14_ = NULL;
5353 gint indexes_length1;
5354 gint _indexes_size_;
5357 GtkMessageDialog* _tmp24_;
5358 GtkMessageDialog* dialog;
5359 GtkMessageDialog* _tmp25_;
5366 _tmp11_ = gtk_tree_selection_get_selected_rows (_tmp9_, &_tmp10_);
5368 _g_object_unref0 (model);
5370 _tmp12_ = _g_object_ref0 (_tmp10_);
5378 _tmp14_ = g_new0 (guint, _tmp13_);
5382 indexes_length1 = _tmp13_;
5384 _indexes_size_ = indexes_length1;
5391 GList* path_collection = NULL;
5392 GList* path_it = NULL;
5394 path_collection = _tmp15_;
5396 for (path_it = path_collection; path_it != NULL; path_it = path_it->next) {
5398 GtkTreePath* _tmp16_;
5399 GtkTreePath* path = NULL;
5401 _tmp16_ = _gtk_tree_path_copy0 ((GtkTreePath*) path_it->data);
5406 GtkTreeModel* _tmp17_;
5407 GtkTreePath* _tmp18_;
5408 GtkTreeIter _tmp19_ = {0};
5409 GtkTreeModel* _tmp20_;
5410 GtkTreeIter _tmp21_;
5412 gint _tmp22__length1;
5419 gtk_tree_model_get_iter (_tmp17_, &_tmp19_, _tmp18_);
5429 _tmp22__length1 = indexes_length1;
5435 gtk_tree_model_get (_tmp20_, &_tmp21_, REFLECTION_COL_INDEX, &_tmp22_[_tmp23_], -1);
5437 _gtk_tree_path_free0 (path);
5443 _tmp24_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, "Are you sure that you want to delete reflections");
5445 g_object_ref_sink (_tmp24_);
5451 _tmp26_ = gtk_dialog_run ((GtkDialog*) _tmp25_);
5459 case GTK_RESPONSE_YES:
5476 gint _tmp33__length1;
5502 if (!(((guint) _tmp31_) < _tmp32_)) {
5510 _tmp33__length1 = indexes_length1;
5514 _tmp35_ = _tmp33_[_tmp34_];
5518 index = _tmp35_ - _tmp36_;
5524 hkl_sample_del_reflection (_tmp37_, (gsize) _tmp38_);
5531 hkl_gui_window_update_reflections (self, _tmp39_);
5542 _g_object_unref0 (dialog);
5544 indexes = (g_free (indexes), NULL);
5546 __g_list_free__gtk_tree_path_free0_0 (list);
5548 _g_object_unref0 (model);
5551 GtkStatusbar* _tmp40_;
5553 _tmp40_ = priv->_statusBar;
5555 gtk_statusbar_push (_tmp40_, (guint) 0, "Please select at least one reflection.");
5559 _g_object_unref0 (selection);
5565 static void hkl_gui_window_on_toolbutton_setUB_clicked (HklGuiWindow* self) {
5566 HklSampleList* _tmp0_;
5569 g_return_if_fail (self != NULL);
5571 _tmp0_ = priv->samples;
5573 _tmp1_ = _tmp0_->current;
5575 if (_tmp1_ != NULL) {
5578 HklSampleList* _tmp2_;
5580 HklMatrix _tmp4_ = {0};
5583 gint _tmp6__length1;
5585 gint _tmp7__length1;
5586 GtkSpinButton* _tmp8_;
5587 gdouble _tmp9_ = 0.0;
5591 gint _tmp12__length1;
5593 gint _tmp13__length1;
5594 GtkSpinButton* _tmp14_;
5595 gdouble _tmp15_ = 0.0;
5599 gint _tmp18__length1;
5601 gint _tmp19__length1;
5602 GtkSpinButton* _tmp20_;
5603 gdouble _tmp21_ = 0.0;
5607 gint _tmp24__length1;
5609 gint _tmp25__length1;
5610 GtkSpinButton* _tmp26_;
5611 gdouble _tmp27_ = 0.0;
5615 gint _tmp30__length1;
5617 gint _tmp31__length1;
5618 GtkSpinButton* _tmp32_;
5619 gdouble _tmp33_ = 0.0;
5623 gint _tmp36__length1;
5625 gint _tmp37__length1;
5626 GtkSpinButton* _tmp38_;
5627 gdouble _tmp39_ = 0.0;
5631 gint _tmp42__length1;
5633 gint _tmp43__length1;
5634 GtkSpinButton* _tmp44_;
5635 gdouble _tmp45_ = 0.0;
5639 gint _tmp48__length1;
5641 gint _tmp49__length1;
5642 GtkSpinButton* _tmp50_;
5643 gdouble _tmp51_ = 0.0;
5647 gint _tmp54__length1;
5649 gint _tmp55__length1;
5650 GtkSpinButton* _tmp56_;
5651 gdouble _tmp57_ = 0.0;
5653 HklSampleList* _tmp59_;
5655 HklSampleList* _tmp61_;
5658 HklSampleList* _tmp64_;
5661 _tmp2_ = priv->samples;
5663 _tmp3_ = _tmp2_->current;
5665 hkl_sample_get_UB (_tmp3_, &_tmp4_);
5673 _tmp6_ = _tmp5_.data;
5675 _tmp6__length1 = -1;
5679 _tmp7__length1 = -1;
5681 _tmp8_ = priv->_spinbutton_U11;
5683 _tmp9_ = gtk_spin_button_get_value (_tmp8_);
5687 _tmp10_ = _tmp7_[0];
5691 _tmp12_ = _tmp11_.data;
5693 _tmp12__length1 = -1;
5695 _tmp13_ = _tmp12_[0];
5697 _tmp13__length1 = -1;
5699 _tmp14_ = priv->_spinbutton_U12;
5701 _tmp15_ = gtk_spin_button_get_value (_tmp14_);
5703 _tmp13_[1] = _tmp15_;
5705 _tmp16_ = _tmp13_[1];
5709 _tmp18_ = _tmp17_.data;
5711 _tmp18__length1 = -1;
5713 _tmp19_ = _tmp18_[0];
5715 _tmp19__length1 = -1;
5717 _tmp20_ = priv->_spinbutton_U13;
5719 _tmp21_ = gtk_spin_button_get_value (_tmp20_);
5721 _tmp19_[2] = _tmp21_;
5723 _tmp22_ = _tmp19_[2];
5727 _tmp24_ = _tmp23_.data;
5729 _tmp24__length1 = -1;
5731 _tmp25_ = _tmp24_[1];
5733 _tmp25__length1 = -1;
5735 _tmp26_ = priv->_spinbutton_U21;
5737 _tmp27_ = gtk_spin_button_get_value (_tmp26_);
5739 _tmp25_[0] = _tmp27_;
5741 _tmp28_ = _tmp25_[0];
5745 _tmp30_ = _tmp29_.data;
5747 _tmp30__length1 = -1;
5749 _tmp31_ = _tmp30_[1];
5751 _tmp31__length1 = -1;
5753 _tmp32_ = priv->_spinbutton_U22;
5755 _tmp33_ = gtk_spin_button_get_value (_tmp32_);
5757 _tmp31_[1] = _tmp33_;
5759 _tmp34_ = _tmp31_[1];
5763 _tmp36_ = _tmp35_.data;
5765 _tmp36__length1 = -1;
5767 _tmp37_ = _tmp36_[1];
5769 _tmp37__length1 = -1;
5771 _tmp38_ = priv->_spinbutton_U23;
5773 _tmp39_ = gtk_spin_button_get_value (_tmp38_);
5775 _tmp37_[2] = _tmp39_;
5777 _tmp40_ = _tmp37_[2];
5781 _tmp42_ = _tmp41_.data;
5783 _tmp42__length1 = -1;
5785 _tmp43_ = _tmp42_[2];
5787 _tmp43__length1 = -1;
5789 _tmp44_ = priv->_spinbutton_U31;
5791 _tmp45_ = gtk_spin_button_get_value (_tmp44_);
5793 _tmp43_[0] = _tmp45_;
5795 _tmp46_ = _tmp43_[0];
5799 _tmp48_ = _tmp47_.data;
5801 _tmp48__length1 = -1;
5803 _tmp49_ = _tmp48_[2];
5805 _tmp49__length1 = -1;
5807 _tmp50_ = priv->_spinbutton_U32;
5809 _tmp51_ = gtk_spin_button_get_value (_tmp50_);
5811 _tmp49_[1] = _tmp51_;
5813 _tmp52_ = _tmp49_[1];
5817 _tmp54_ = _tmp53_.data;
5819 _tmp54__length1 = -1;
5821 _tmp55_ = _tmp54_[2];
5823 _tmp55__length1 = -1;
5825 _tmp56_ = priv->_spinbutton_U33;
5827 _tmp57_ = gtk_spin_button_get_value (_tmp56_);
5829 _tmp55_[2] = _tmp57_;
5831 _tmp58_ = _tmp55_[2];
5833 _tmp59_ = priv->samples;
5835 _tmp60_ = _tmp59_->current;
5837 hkl_sample_set_UB (_tmp60_, &UB);
5839 _tmp61_ = priv->samples;
5841 _tmp62_ = _tmp61_->current;
5845 hkl_sample_fprintf (_tmp63_, _tmp62_);
5847 hkl_gui_window_update_lattice (self);
5849 hkl_gui_window_update_lattice_parameters (self);
5851 hkl_gui_window_update_reciprocal_lattice (self);
5853 _tmp64_ = priv->samples;
5855 _tmp65_ = _tmp64_->current;
5857 hkl_gui_window_update_crystal_model (self, _tmp65_);
5859 hkl_gui_window_update_UB (self);
5861 hkl_gui_window_update_UxUyUz (self);
5863 hkl_gui_window_update_pseudo_axes (self);
5865 hkl_gui_window_update_pseudo_axes_frames (self);
5873 static void hkl_gui_window_on_toolbutton_computeUB_clicked (HklGuiWindow* self) {
5874 HklSampleList* _tmp0_;
5879 g_return_if_fail (self != NULL);
5881 _tmp0_ = priv->samples;
5883 _tmp1_ = _tmp0_->current;
5889 if (_tmp2_ != NULL) {
5895 hkl_sample_compute_UB_busing_levy (_tmp3_, (gsize) 0, (gsize) 1);
5897 hkl_gui_window_update_UB (self);
5899 hkl_gui_window_update_UxUyUz (self);
5901 hkl_gui_window_update_pseudo_axes (self);
5903 hkl_gui_window_update_pseudo_axes_frames (self);
5909 static void hkl_gui_window_on_toolbutton_add_crystal_clicked (HklGuiWindow* self) {
5910 HklSample* sample = NULL;
5914 g_return_if_fail (self != NULL);
5916 _tmp0_ = hkl_sample_new ("new_sample", HKL_SAMPLE_TYPE_MONOCRYSTAL);
5922 if (_tmp1_ != NULL) {
5924 GtkTreePath* path = NULL;
5925 GtkTreeViewColumn* column = NULL;
5926 HklSampleList* _tmp2_;
5928 HklSampleList* _tmp4_;
5929 GtkTreeView* _tmp5_;
5930 GtkTreePath* _tmp6_ = NULL;
5931 GtkTreeViewColumn* _tmp7_ = NULL;
5932 GtkTreeViewColumn* _tmp8_;
5933 GtkTreeView* _tmp9_;
5934 GtkTreeViewColumn* _tmp10_ = NULL;
5935 GtkTreeViewColumn* _tmp11_;
5936 GtkTreeView* _tmp12_;
5937 GtkTreePath* _tmp13_;
5938 GtkTreeViewColumn* _tmp14_;
5940 _tmp2_ = priv->samples;
5946 hkl_sample_list_append (_tmp2_, _tmp3_);
5948 _tmp4_ = priv->samples;
5950 hkl_sample_list_select_current (_tmp4_, "new_sample");
5952 hkl_gui_window_update_tree_view_crystals (self);
5954 _tmp5_ = priv->_treeview_crystals;
5956 gtk_tree_view_get_cursor (_tmp5_, &_tmp6_, &_tmp7_);
5958 _gtk_tree_path_free0 (path);
5962 _g_object_unref0 (column);
5964 _tmp8_ = _g_object_ref0 (_tmp7_);
5968 _tmp9_ = priv->_treeview_crystals;
5970 _tmp10_ = gtk_tree_view_get_column (_tmp9_, 0);
5972 _tmp11_ = _g_object_ref0 (_tmp10_);
5974 _g_object_unref0 (column);
5978 _tmp12_ = priv->_treeview_crystals;
5984 gtk_tree_view_set_cursor (_tmp12_, _tmp13_, _tmp14_, TRUE);
5986 _g_object_unref0 (column);
5988 _gtk_tree_path_free0 (path);
5994 static void hkl_gui_window_on_toolbutton_copy_crystal_clicked (HklGuiWindow* self) {
5995 GtkTreePath* path = NULL;
5996 GtkTreeViewColumn* column = NULL;
5997 HklSampleList* _tmp0_;
5999 HklSample* old_sample;
6001 HklSampleList* _tmp4_;
6006 HklSampleList* _tmp8_;
6008 HklSampleList* _tmp10_;
6009 GtkTreeView* _tmp11_;
6010 GtkTreePath* _tmp12_ = NULL;
6011 GtkTreeViewColumn* _tmp13_ = NULL;
6012 GtkTreeViewColumn* _tmp14_;
6013 GtkTreeView* _tmp15_;
6014 GtkTreeViewColumn* _tmp16_ = NULL;
6015 GtkTreeViewColumn* _tmp17_;
6016 GtkTreeView* _tmp18_;
6017 GtkTreePath* _tmp19_;
6018 GtkTreeViewColumn* _tmp20_;
6020 g_return_if_fail (self != NULL);
6022 _tmp0_ = priv->samples;
6024 _tmp1_ = _tmp0_->current;
6026 old_sample = _tmp1_;
6028 _tmp2_ = old_sample;
6030 if (_tmp2_ == NULL) {
6032 GtkStatusbar* _tmp3_;
6034 _tmp3_ = priv->_statusBar;
6036 gtk_statusbar_push (_tmp3_, (guint) 0, "Please select a crystal to copy.");
6038 _g_object_unref0 (column);
6040 _gtk_tree_path_free0 (path);
6046 _tmp4_ = priv->samples;
6048 _tmp5_ = _tmp4_->current;
6050 _tmp6_ = hkl_sample_new_copy (_tmp5_);
6056 hkl_sample_set_name (_tmp7_, "copy");
6058 _tmp8_ = priv->samples;
6064 hkl_sample_list_append (_tmp8_, _tmp9_);
6066 _tmp10_ = priv->samples;
6068 hkl_sample_list_select_current (_tmp10_, "copy");
6070 hkl_gui_window_update_tree_view_crystals (self);
6072 _tmp11_ = priv->_treeview_crystals;
6074 gtk_tree_view_get_cursor (_tmp11_, &_tmp12_, &_tmp13_);
6076 _gtk_tree_path_free0 (path);
6080 _g_object_unref0 (column);
6082 _tmp14_ = _g_object_ref0 (_tmp13_);
6086 _tmp15_ = priv->_treeview_crystals;
6088 _tmp16_ = gtk_tree_view_get_column (_tmp15_, 0);
6090 _tmp17_ = _g_object_ref0 (_tmp16_);
6092 _g_object_unref0 (column);
6096 _tmp18_ = priv->_treeview_crystals;
6102 gtk_tree_view_set_cursor (_tmp18_, _tmp19_, _tmp20_, TRUE);
6104 _g_object_unref0 (column);
6106 _gtk_tree_path_free0 (path);
6111 static void hkl_gui_window_on_toolbutton_del_crystal_clicked (HklGuiWindow* self) {
6112 HklSampleList* _tmp0_;
6115 g_return_if_fail (self != NULL);
6117 _tmp0_ = priv->samples;
6119 _tmp1_ = _tmp0_->current;
6121 if (_tmp1_ != NULL) {
6123 HklSampleList* _tmp2_;
6124 HklSampleList* _tmp3_;
6127 _tmp2_ = priv->samples;
6129 _tmp3_ = priv->samples;
6131 _tmp4_ = _tmp3_->current;
6133 hkl_sample_list_del (_tmp2_, _tmp4_);
6135 hkl_gui_window_update_tree_view_crystals (self);
6141 static void hkl_gui_window_on_toolbutton_affiner_clicked (HklGuiWindow* self) {
6142 HklSampleList* _tmp0_;
6148 g_return_if_fail (self != NULL);
6150 _tmp0_ = priv->samples;
6152 _tmp1_ = _tmp0_->current;
6158 if (_tmp2_ != NULL) {
6164 hkl_sample_affine (_tmp3_);
6170 hkl_gui_window_update_crystal_model (self, _tmp4_);
6172 hkl_gui_window_update_lattice (self);
6174 hkl_gui_window_update_reciprocal_lattice (self);
6176 hkl_gui_window_update_UB (self);
6178 hkl_gui_window_update_UxUyUz (self);
6183 static gboolean hkl_gui_window_on_tree_view_reflections_key_press_event (GdkEventKey* event, HklGuiWindow* self) {
6184 gboolean result = FALSE;
6186 g_return_val_if_fail (self != NULL, FALSE);
6188 g_return_val_if_fail (event != NULL, FALSE);
6197 static gboolean hkl_gui_window_on_tree_view_crystals_key_press_event (GdkEventKey* event, HklGuiWindow* self) {
6198 gboolean result = FALSE;
6200 g_return_val_if_fail (self != NULL, FALSE);
6202 g_return_val_if_fail (event != NULL, FALSE);
6211 static void hkl_gui_window_on_menuitem5_activate (HklGuiWindow* self) {
6214 g_return_if_fail (self != NULL);
6216 _tmp0_ = priv->_dialog1;
6218 gtk_widget_show ((GtkWidget*) _tmp0_);
6223 void hkl_gui_window_on_button1_clicked (HklGuiWindow* self) {
6226 g_return_if_fail (self != NULL);
6228 _tmp0_ = priv->_dialog1;
6230 gtk_widget_hide ((GtkWidget*) _tmp0_);
6235 void hkl_gui_window_on_combobox1_changed (HklGuiWindow* self) {
6237 HklGeometryConfig config = {0};
6238 GtkComboBox* _tmp0_;
6240 HklGeometryConfig _tmp2_;
6241 HklGeometryConfig _tmp3_;
6242 HklGeometry* _tmp4_ = NULL;
6243 HklGeometryConfig _tmp5_;
6244 HklPseudoAxisEngineList* _tmp6_ = NULL;
6245 HklPseudoAxisEngineList* _tmp7_;
6246 HklGeometry* _tmp8_;
6247 HklDetector* _tmp9_;
6248 HklSampleList* _tmp10_;
6251 g_return_if_fail (self != NULL);
6253 _tmp0_ = priv->_combobox1;
6255 _tmp1_ = gtk_combo_box_get_active (_tmp0_);
6257 idx = (gsize) _tmp1_;
6259 _tmp2_ = hkl_geometry_factory_configs[idx];
6265 _tmp4_ = hkl_geometry_factory_new (&_tmp3_, 50 * HKL_DEGTORAD);
6267 _hkl_geometry_free0 (priv->geometry);
6269 priv->geometry = _tmp4_;
6273 _tmp6_ = hkl_pseudo_axis_engine_list_factory (&_tmp5_);
6275 _hkl_pseudo_axis_engine_list_free0 (priv->engines);
6277 priv->engines = _tmp6_;
6279 _tmp7_ = priv->engines;
6281 _tmp8_ = priv->geometry;
6283 _tmp9_ = priv->detector;
6285 _tmp10_ = priv->samples;
6287 _tmp11_ = _tmp10_->current;
6289 hkl_pseudo_axis_engine_list_init (_tmp7_, _tmp8_, _tmp9_, _tmp11_);
6291 hkl_gui_window_set_up_pseudo_axes_frames (self);
6293 hkl_gui_window_set_up_tree_view_axes (self);
6295 hkl_gui_window_set_up_tree_view_pseudo_axes_parameters (self);
6297 hkl_gui_window_set_up_tree_view_pseudo_axes (self);
6299 hkl_gui_window_set_up_tree_view_treeview1 (self);
6301 hkl_gui_window_set_up_3D (self);
6308 hkl_gui_window_class_init (HklGuiWindowClass
*class)
6310 GObjectClass
*gobject_class
= G_OBJECT_CLASS (class);
6312 g_type_class_add_private (class, sizeof (HklGuiWindowPrivate
));
6314 /* virtual method */
6315 gobject_class
->finalize
= finalize
;
6319 static void hkl_gui_window_init (HklGuiWindow
* self
)
6321 HklGuiWindowPrivate
*priv
= HKL_GUI_WINDOW_GET_PRIVATE(self
);
6323 priv
->diffractometer
= NULL
;
6325 darray_init(priv
->pseudo_frames
);
6327 priv
->sample
= hkl_sample_new ("test");
6328 priv
->reciprocal
= hkl_lattice_new_default ();
6330 hkl_gui_window_get_widgets_and_objects_from_ui (self
);
6332 set_up_diffractometer_model (self
);
6334 //hkl_gui_window_set_up_tree_view_crystals (self);
6336 //hkl_gui_window_update_tree_view_crystals (self);
6338 //hkl_gui_window_update_source (self);
6340 //hkl_gui_window_update_lattice (self);
6342 //hkl_gui_window_update_lattice_parameters (self);
6344 //hkl_gui_window_update_reciprocal_lattice (self);
6346 //hkl_gui_window_update_UxUyUz (self);
6348 //hkl_gui_window_update_UB (self);
6350 //hkl_gui_window_connect_all_signals (self);
6353 int main (int argc
, char ** argv
)
6355 gtk_init (&argc
, &argv
);
6357 hkl_gui_window_new ();