* add the liststore to contain all the diffractometers
[hkl.git] / hkl / hkl-parameter.h
blobc206164469ac2d5fbb21c2ca40a496ea13fc54b7
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>
22 #ifndef __HKL_PARAMETER_H__
23 #define __HKL_PARAMETER_H__
25 #include <stdio.h>
26 #include <hkl/hkl-interval.h>
27 #include <hkl/hkl-unit.h>
29 HKL_BEGIN_DECLS
31 typedef struct _HklParameter HklParameter;
33 struct _HklParameter {
34 const char *name;
35 HklInterval range;
36 double value;
37 HklUnit const *unit;
38 HklUnit const *punit;
39 int fit;
40 int changed;
43 extern HklParameter *hkl_parameter_new(char const *name,
44 double min, double value, double max,
45 int fit, int changed,
46 HklUnit const *unit,
47 HklUnit const *punit);
49 extern HklParameter *hkl_parameter_new_copy(HklParameter const *self);
51 extern int hkl_parameter_init(HklParameter *self, char const *name,
52 double min, double value, double max,
53 int fit, int changed,
54 HklUnit const *unit, HklUnit const *punit);
56 extern void hkl_parameter_free(HklParameter *self);
58 extern void hkl_parameter_set_value(HklParameter *self, double value);
60 extern double hkl_parameter_get_value_unit(HklParameter const *self);
62 extern int hkl_parameter_set_value_unit(HklParameter *self, double value);
64 extern double hkl_parameter_get_max(HklParameter const *self);
66 extern void hkl_parameter_get_range_unit(HklParameter const *self, double *min, double *max);
68 extern void hkl_parameter_set_range(HklParameter *self, double min, double max);
70 extern void hkl_parameter_set_range_unit(HklParameter *self, double min, double max);
72 extern void hkl_parameter_randomize(HklParameter *self);
74 extern int hkl_parameter_is_valid(const HklParameter *self);
76 extern void hkl_parameter_fprintf(FILE *f, HklParameter *self);
78 HKL_END_DECLS
80 #endif /* __HKL_PARAMETER_H__ */