- 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:
105
sicshipadaba.c
105
sicshipadaba.c
@@ -541,6 +541,12 @@ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v){
|
||||
|
||||
return result;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
pHdb CreateSICSHdbPar(char *name, int priv, int dataType,
|
||||
int length, void *data){
|
||||
return MakeSICSHdbPar(name,priv,makeHdbData(dataType,
|
||||
length,data));
|
||||
}
|
||||
/*----------------------------------------------------------------------------*/
|
||||
pHdb MakeSICSHdbDriv(char *name, int priv, void *sicsObject, int dataType){
|
||||
pHdb result = NULL;
|
||||
@@ -659,6 +665,12 @@ pHdb MakeSICSScriptPar(char *name, char *setScript, char *readScript,
|
||||
|
||||
return result;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
pHdb CreateSICSScriptPar(char *name, char *setScript, char *readScript,
|
||||
int dataType, int length, void *data){
|
||||
return MakeSICSScriptPar(name,setScript,readScript,
|
||||
makeHdbData(dataType, length,data));
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static void removeNodeFromUpdateList(pHdb node){
|
||||
pHdb current = NULL;
|
||||
@@ -774,14 +786,23 @@ int AddSICSHdbMemPar(pHdb node, char *name, int priv,
|
||||
return 1;
|
||||
}
|
||||
/*==================== access suport functions ==============================*/
|
||||
int SICSHdbGetFloat(pHdb parent, SConnection *pCon,
|
||||
char *path, float *value){
|
||||
hdbValue v;
|
||||
int SICSHdbGetPar(void *obj, SConnection *pCon,
|
||||
char *path, int dataType, void *data, int length){
|
||||
pHdb par = NULL;
|
||||
int status;
|
||||
char buffer[256];
|
||||
pDummy pDum;
|
||||
|
||||
par = GetHipadabaNode(parent,path);
|
||||
pDum = (pDummy)obj;
|
||||
if(pDum == NULL || pDum->pDescriptor->parNode == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
}
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
par = GetHipadabaNode(pDum->pDescriptor->parNode,path);
|
||||
if(par == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
@@ -790,31 +811,31 @@ int SICSHdbGetFloat(pHdb parent, SConnection *pCon,
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
status = GetHipadabaPar(par,&v,pCon);
|
||||
status = GetHdbPar(par,dataType,data,length,pCon);
|
||||
if(status < 0){
|
||||
return status;
|
||||
}
|
||||
if(v.dataType == HIPFLOAT){
|
||||
*value = (float)v.v.doubleValue;
|
||||
} else if(v.dataType == HIPINT){
|
||||
*value = (float)v.v.intValue;
|
||||
} else {
|
||||
/*
|
||||
* it is an error to call this for array dada types
|
||||
*/
|
||||
assert(0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int SICSHdbSetFloat(pHdb parent, SConnection *pCon,
|
||||
char *path, float value){
|
||||
int SICSHdbUpdatePar(void *obj, SConnection *pCon,
|
||||
char *path, int dataType,void *data, int dataLength ){
|
||||
hdbValue v;
|
||||
pHdb par = NULL;
|
||||
int status;
|
||||
char buffer[256];
|
||||
pDummy pDum;
|
||||
|
||||
par = GetHipadabaNode(parent,path);
|
||||
pDum = (pDummy)obj;
|
||||
if(pDum == NULL || pDum->pDescriptor->parNode == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
}
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
par = GetHipadabaNode(pDum->pDescriptor->parNode,path);
|
||||
if(par == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
@@ -822,26 +843,46 @@ int SICSHdbSetFloat(pHdb parent, SConnection *pCon,
|
||||
}
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
v.dataType = par->value.dataType;
|
||||
if(v.dataType == HIPFLOAT){
|
||||
v.v.doubleValue = (double)value;
|
||||
} else if(v.dataType == HIPINT){
|
||||
v.v.intValue = (int)value;
|
||||
} else {
|
||||
/*
|
||||
* it is an error to call this for array dada types
|
||||
*/
|
||||
assert(0);
|
||||
}
|
||||
|
||||
status = SetHipadabaPar(par,v,pCon);
|
||||
status = UpdateHdbPar(par,dataType,data,dataLength,pCon);
|
||||
if(status < 0){
|
||||
return status;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int SICSHdbSetPar(void *obj, SConnection *pCon,
|
||||
char *path, int dataType,void *data, int dataLength ){
|
||||
hdbValue v;
|
||||
pHdb par = NULL;
|
||||
int status;
|
||||
char buffer[256];
|
||||
pDummy pDum;
|
||||
|
||||
pDum = (pDummy)obj;
|
||||
if(pDum == NULL || pDum->pDescriptor->parNode == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
}
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
par = GetHipadabaNode(pDum->pDescriptor->parNode,path);
|
||||
if(par == NULL){
|
||||
if(pCon != NULL){
|
||||
snprintf(buffer,255,"ERROR: parameter %s not found", path);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
}
|
||||
return SICSNOPAR;
|
||||
}
|
||||
|
||||
status = SetHdbPar(par,dataType,data,dataLength,pCon);
|
||||
if(status < 0){
|
||||
return status;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int InstallSICSNotify(pHdb node, SConnection *pCon, int id, int recurse){
|
||||
pHdb currentChild = NULL;
|
||||
|
||||
Reference in New Issue
Block a user