- Fixes to hkl code

- Fixes to make RITA work
- tasub extended to calculate UB from cell alone, support for elastic mode
- New MultiCounter as abstraction for counting on HM's
- regression test driver for counters
This commit is contained in:
koennecke
2006-09-13 07:12:00 +00:00
parent 87d81cf474
commit cb3bf30bbf
33 changed files with 1961 additions and 671 deletions

View File

@ -33,10 +33,14 @@
#define HIPFLOATAR 4
#define HIPINTVARAR 5
#define HIPFLOATVARAR 6
#define HIPOBJ 7
/* -------- callback types */
#define HCBSET 0
#define HCBUPDATE 1
#define HCBREAD 2
/*--------- error codes */
#define HDBTYPEMISMATCH -7701
#define HDBLENGTHMISMATCH -7702
/*===================== structure definitions ===================================*/
typedef struct __hdbValue {
int dataType;
@ -47,6 +51,7 @@ typedef struct __hdbValue {
char *text;
int *intArray;
double *floatArray;
void *obj;
}v;
}hdbValue;
/*------------------------------------------------------------------------------*/
@ -77,6 +82,15 @@ typedef struct __hdbcallback {
}hdbCallback, *pHdbCallback;
/*======================== Function protoypes: hdbData ========================*/
hdbValue makeHdbValue(int datatype, int length);
/**
* make a hdbValue and initailize it with the data in the void
* pointer. Do not initialise when data = NULL.
* @param dataType The datatype of the hdbValue
* @param The array length of the hdbValue
* @param data Initialisation data for hdbValue
* @return a suitably defined hdbValue
*/
hdbValue makeHdbData(int datatype, int length, void *data);
/**
* wrap an integer as an hdbValue
* @param initValue the initial value of the int
@ -147,6 +161,12 @@ int compareHdbValue(hdbValue v1, hdbValue v2);
* @return 1 on success, 0 on when out of memory
*/
int cloneHdbValue(hdbValue *source, hdbValue *clone);
/**
* get the length of the hdbValue in bytes.
* @param v The hdbValue to calculate the length for
* @return the number of data bytes
*/
int getHdbValueLength(hdbValue v);
/*========================== function protoypes: Nodes =======================*/
/**
* make a new hipadaba node
@ -156,7 +176,7 @@ int cloneHdbValue(hdbValue *source, hdbValue *clone);
*/
pHdb MakeHipadabaNode(char *name, int datatype, int length);
/**
* add a child to a node
* add a child to a node at the end of the child list.
* @param parent The node to which to add the child
* @param child The node to add
*/
@ -250,8 +270,8 @@ void InternalRemoveHipadabaCallback(pHdb root, int internalID);
*/
int SetHipadabaPar(pHdb node, hdbValue v, void *callData);
/**
* Update a hipadaba parameter. This is an internal update of a parameter, during
* driving etc.
* Update a hipadaba parameter. This is an internal update of a parameter,
* during driving etc.
* @param node The node for which to update the parameter
* @param v The new value for the node
* @param callData Additonal context data to be passed to the callback functions
@ -266,5 +286,41 @@ int UpdateHipadabaPar(pHdb node, hdbValue v, void *callData);
* @return 0 on failure, 1 on success
*/
int GetHipadabaPar(pHdb node, hdbValue *v, void *callData);
/**
* Set a hipadaba parameter. This is an external set for a parameter. It may cause
* motors to start driving etc.
* @param node The node for which to set the parameter
* param dataType The datatype the value ought to have
* @param data A pointer to the data to set.
* @param length The length of data
* @param callData Additonal context data to be passed to the callback functions
* @return 0 on failure, a negative error code on failure
*/
int SetHdbPar(pHdb node, int dataType, void *data, int length,
void *callData);
/**
* Updates a hipadaba parameter. This does not cause an active parameter to
* start driving but invokes all nitifications which may be regsitered on
* this parameter.
* @param node The node for which to set the parameter
* param dataType The datatype the value ought to have
* @param data A pointer to the data to set.
* @param length The length of data
* @param callData Additonal context data to be passed to the callback functions
* @return 0 on failure, a negative error code on failure
*/
int UpdateHdbPar(pHdb node, int dataType, void *data, int length,
void *callData);
/**
* Read a hipadaba parameter
* @param node The node for which to read the parameter
* @param dataType The expected type of the data
* @param data A pointer to which data will be copied
* @param length The length of data.
* @param callData Additonal context data to be passed to the callback functions
* @return 0 on failure, a negative error code on failures.
*/
int GetHdbPar(pHdb node, int dataType, void *data, int length,
void *callData);
#endif