hkl-pseudoaxis-private: hkl Reference Manual

## hkl-pseudoaxis-private hkl-pseudoaxis-private |

## Functions

#define | HKL_MODE_INFO_RO()
#define | HKL_MODE_INFO()
#define | HKL_MODE_INFO_RO_WITH_PARAMS()
#define | HKL_MODE_INFO_WITH_PARAMS()
void | hkl_mode_free_real ()
int | hkl_mode_initialized_get_real ()
int | hkl_mode_initialized_get ()
int | hkl_mode_initialized_set_real ()
int | hkl_mode_initialized_set ()
int | hkl_mode_get_real ()
int | hkl_mode_set_real ()
int | hkl_mode_init ()
HklMode * | hkl_mode_new ()
void | hkl_mode_free ()
#define | HKL_ENGINE_INFO()
#define | HKL_ENGINE_LIST_INFO()
GQuark | hkl_engine_error_quark ()
void | set_geometry_axes ()
void | hkl_engine_release ()
void | hkl_engine_free_real ()
void | hkl_engine_free ()
void | hkl_engine_init ()
HklParameter * | register_mode_parameter ()
HklParameter * | register_pseudo_axis ()
void | hkl_engine_add_mode ()
void | hkl_engine_add_geometry ()
void | hkl_engine_prepare_internal ()
void | hkl_engine_mode_set ()
int | hkl_engine_get ()
int | hkl_engine_list_post_engine_set ()
int | hkl_engine_set ()
GQuark | hkl_engine_list_error_quark ()
void | hkl_engine_list_clear ()
void | hkl_engine_list_free_real ()
int | hkl_engine_list_post_engine_set_real ()
HklEngineList * | hkl_engine_list_new_with_info ()
HklEngineList * | hkl_engine_list_new ()
HklEngineList * | hkl_engine_list_new_copy ()

## Types and Values

typedef | darray_mode
struct | HklModeInfo
struct | HklModeOperations
#define | HKL_MODE_OPERATIONS_DEFAULTS
struct | HklMode
struct | HklEngineInfo
| HklEngine
struct | HklEngineListInfo
#define | HKL_ENGINE_LIST_INFO_DEFAULTS
struct | HklEngineListOperations
#define | HKL_ENGINE_LIST_OPERATIONS_DEFAULTS
| HklEngineList
#define | HKL_ENGINE_ERROR
enum | HklEngineError
struct | HklEngineOperations
#define | HKL_ENGINE_OPERATIONS_DEFAULTS
#define | HKL_ENGINE_LIST_ERROR
enum | HklEngineListError

## Description

## Functions

### HKL_MODE_INFO_RO()

    #define HKL_MODE_INFO_RO(_name, _axes) .name=_name, .axes_r=DARRAY(_axes)

### HKL_MODE_INFO()

    #define HKL_MODE_INFO(_name, _axes_r, _axes_w) HKL_MODE_INFO_RO((_name), (_axes_r)), .axes_w=DARRAY((_axes_w))

### HKL_MODE_INFO_RO_WITH_PARAMS()

    #define HKL_MODE_INFO_RO_WITH_PARAMS(_name, _axes, _parameters) HKL_MODE_INFO_RO((_name), (_axes)), .parameters=DARRAY(_parameters)

### HKL_MODE_INFO_WITH_PARAMS()

    #define             HKL_MODE_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _parameters)

### hkl_mode_free_real ()

    void
    hkl_mode_free_real (HklMode *self);

### hkl_mode_initialized_get_real ()

    int
    hkl_mode_initialized_get_real (const HklMode *self);

### hkl_mode_initialized_get ()

    int
    hkl_mode_initialized_get (const HklMode *self);

### hkl_mode_initialized_set_real ()

    int
    hkl_mode_initialized_set_real ();

### hkl_mode_initialized_set ()

    int
    hkl_mode_initialized_set (HklMode *self,
                              HklEngine *engine,
                              HklGeometry *geometry,
                              HklDetector *detector,
                              HklSample *sample,
                              int initialized,
                              GError **error);

### hkl_mode_get_real ()

    int
    hkl_mode_get_real ();

### hkl_mode_set_real ()

    int
    hkl_mode_set_real ();

### hkl_mode_init ()

    int
    hkl_mode_init (HklMode *self,
                   const HklModeInfo *info,
                   const HklModeOperations *ops);

### hkl_mode_new ()

    HklMode *
    hkl_mode_new (const HklModeInfo *info,
                  const HklModeOperations *op,
                  int initialized);

### hkl_mode_free ()

    void
    hkl_mode_free (HklMode *self);

delete an HklMode

[skip]

### HKL_ENGINE_INFO()

    #define             HKL_ENGINE_INFO(_name, _pseudo_axes, _dependencies)

### HKL_ENGINE_LIST_INFO()

    #define HKL_ENGINE_LIST_INFO(_parameters) .parameters = DARRAY(_parameters)

### hkl_engine_error_quark ()

    GQuark
    hkl_engine_error_quark ();

### set_geometry_axes ()

    void
    set_geometry_axes (HklEngine *engine,
                       const double values[]);

### hkl_engine_release ()

    void
    hkl_engine_release (HklEngine *self);

### hkl_engine_free_real ()

    void
    hkl_engine_free_real ();

### hkl_engine_free ()

    void
    hkl_engine_free (HklEngine *self);

### hkl_engine_init ()

    void
    hkl_engine_init (HklEngine *self,
                     const HklEngineInfo *info,
                     const HklEngineOperations *ops,
                     HklEngineList *engines);

### register_mode_parameter ()

    HklParameter *
    register_mode_parameter (HklMode *mode,
                             unsigned int index);

### register_pseudo_axis ()

    HklParameter *
    register_pseudo_axis (HklEngine *self,
                          HklEngineList *engines,
                          const HklParameter *pseudo_axis);

### hkl_engine_add_mode ()

    void
    hkl_engine_add_mode (HklEngine *self);

add an HklMode to the self HklEngine

[skip]

#### Parameters

mode | the mode to add |

### hkl_engine_add_geometry ()

    void
    hkl_engine_add_geometry (HklEngine *self,
                             double const x[]);

This method try to be clever by allocating memory only if the current length of the geometries is not large enought. Then it just set the geometry axes and copy it to the right geometries. We do not gives the x len as it is equal to the self->axes_len.

[skip]

#### Parameters

self | the current PseudoAxeEngine |
x | x A vector of double with the axes values to put in the geometry. |

### hkl_engine_prepare_internal ()

    void
    hkl_engine_prepare_internal (HklEngine *self);

### hkl_engine_mode_set ()

    void
    hkl_engine_mode_set (HklEngine *self,
                         HklMode *mode);

This method also populate the self->axes from the mode->axis_names. this is to speed the computation of the numerical axes.

[skip]

#### Parameters

self | the HklEngine |
name | the mode to select |

### hkl_engine_get ()

    int
    hkl_engine_get (HklEngine *self);

get the values of the pseudo-axes from the real-axes values

[skip]

#### Parameters

self | The HklEngine |
error | return location for a GError, or NULL |

#### Returns

TRUE if succeded or FALSE otherwise.

### hkl_engine_list_post_engine_set ()

    int
    hkl_engine_list_post_engine_set ();

### hkl_engine_set ()

    int
    hkl_engine_set (HklEngine *self,
                    GError **error);

use the HklPseudoaxisEngine values to compute the real axes values.

[skip]

#### Parameters

self | the HklEngine |
error | return location for a GError, or NULL |

#### Returns

TRUE if succeded or FALSE otherwise.

### hkl_engine_list_error_quark ()

    GQuark
    hkl_engine_list_error_quark (void);

### hkl_engine_list_clear ()

    void
    hkl_engine_list_clear (HklEngineList *self);

remove all engine from the engine list

[skip]

#### Parameters

self | the engine list to clear |

### hkl_engine_list_free_real ()

    void
    hkl_engine_list_free_real (HklEngineList *self);

destructor

[skip]

#### Parameters

self | the HklEngineList to destroy |

### hkl_engine_list_post_engine_set_real ()

    int
    hkl_engine_list_post_engine_set_real ();

### hkl_engine_list_new_with_info ()

    HklEngineList *
    hkl_engine_list_new_with_info (const HklEngineListInfo *info,
                                   const HklEngineListOperations *ops);

default constructor with info part

[skip]

#### Parameters

info | the info part of the HklEngineList |

### hkl_engine_list_new ()

    HklEngineList *
    hkl_engine_list_new (void);

default constructor

[skip]

### hkl_engine_list_new_copy ()

    HklEngineList *
    hkl_engine_list_new_copy ();

dummy copy constructor for the binding

[skip]

#### Returns

NULL all the time the structure is non-copyable.

[transfer none]

## Types and Values

### darray_mode

    typedef darray(HklMode *) darray_mode;

### struct HklModeInfo

    struct HklModeInfo {
    	const char *name;
    	const darray_string axes_r;
    	const darray_string axes_w;
    	const darray(const HklParameter) parameters;
    };

### struct HklModeOperations

    struct HklModeOperations {
    	unsigned long capabilities;

    	void (* free)(HklMode *self);
    	int (* initialized_get)(const HklMode *self);
    	int (* initialized_set)(HklMode *self,
    				HklEngine *engine,
    				HklGeometry *geometry,
    				HklDetector *detector,
    				HklSample *sample,
    				int initialized,
    				GError **error);
    	int (* get)(HklMode *self,
    		    HklEngine *engine,
    		    HklGeometry *geometry,
    		    HklDetector *detector,
    		    HklSample *sample,
    		    GError **error);
    	int (* set)(HklMode *self,
    		    HklEngine *engine,
    		    HklGeometry *geometry,
    		    HklDetector *detector,
    		    HklSample *sample,
    		    GError **error);
    };

### HKL_MODE_OPERATIONS_DEFAULTS

    #define             HKL_MODE_OPERATIONS_DEFAULTS

### struct HklMode

    struct HklMode {
    	const HklModeInfo *info;
    	const HklModeOperations *ops;
    	darray_parameter parameters;
    	darray_string parameters_names;
    	int initialized;
    };

### struct HklEngineInfo

    struct HklEngineInfo {
    	const char *name;
    	const darray(const HklParameter *) pseudo_axes;
    	unsigned int dependencies;
    };

### HklEngine

    typedef struct {
    	const HklEngineInfo *info;
    	const HklEngineOperations *ops;
    	HklGeometry *geometry;
    	HklDetector *detector;
    	HklSample *sample;
    	HklMode *mode; /* not owned */
    	HklEngineList *engines; /* not owned */
    	darray_parameter axes;
    	darray_parameter pseudo_axes;
    	darray_string pseudo_axis_names;
    	darray_mode modes;
    	darray_string mode_names;
    } HklEngine;

### struct HklEngineListInfo

    struct HklEngineListInfo {
    	const darray(const HklParameter *) parameters;
    };

### HKL_ENGINE_LIST_INFO_DEFAULTS

    #define HKL_ENGINE_LIST_INFO_DEFAULTS .parameters = darray_new()

### struct HklEngineListOperations

    struct HklEngineListOperations {
    	void (* free)(HklEngineList *self);
    	int (* post_engine_set)(HklEngineList *self);
    };

### HKL_ENGINE_LIST_OPERATIONS_DEFAULTS

    #define             HKL_ENGINE_LIST_OPERATIONS_DEFAULTS

### HklEngineList

    typedef struct {
    	_darray(HklEngine *); /* must be the first memeber */
    	const HklEngineListInfo *info;
    	const HklEngineListOperations *ops;
    	HklGeometryList *geometries;
    	HklGeometry *geometry;
    	HklDetector *detector;
    	HklSample *sample;
    	darray_parameter pseudo_axes;
    	darray_parameter parameters;
    	darray_string parameters_names;
    } HklEngineList;

### HKL_ENGINE_ERROR

    #define HKL_ENGINE_ERROR hkl_engine_error_quark ()

### enum HklEngineError

#### Members

HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_GET |  |
HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_SET |  |
HKL_ENGINE_ERROR_PSEUDO_AXIS_SET |  |
HKL_ENGINE_ERROR_INITIALIZE |  |
HKL_ENGINE_ERROR_SET |  |
HKL_ENGINE_ERROR_GET |  |
HKL_ENGINE_ERROR_PARAMETER_GET |  |
HKL_ENGINE_ERROR_PARAMETER_SET |  |
HKL_ENGINE_ERROR_CURRENT_MODE_SET |  |

### struct HklEngineOperations

    struct HklEngineOperations {
    	void (*free)(HklEngine *self);
    };

### HKL_ENGINE_OPERATIONS_DEFAULTS

    #define HKL_ENGINE_OPERATIONS_DEFAULTS .free=hkl_engine_free_real

### HKL_ENGINE_LIST_ERROR

    #define HKL_ENGINE_LIST_ERROR hkl_engine_list_error_quark ()

### enum HklEngineListError

#### Members

HKL_ENGINE_LIST_ERROR_ENGINE_GET_BY_NAME |  |
HKL_ENGINE_LIST_ERROR_PSEUDO_AXIS_GET_BY_NAME |  |
HKL_ENGINE_LIST_ERROR_PARAMETER_GET |  |
HKL_ENGINE_LIST_ERROR_PARAMETER_SET |  |