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__
26 #include <hkl/hkl-interval.h>
27 #include <hkl/hkl-unit.h>
31 typedef struct _HklParameter HklParameter
;
33 struct _HklParameter
{
43 extern HklParameter
*hkl_parameter_new(char const *name
,
44 double min
, double value
, double max
,
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
,
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
);
80 #endif /* __HKL_PARAMETER_H__ */