- Fixed a normalisation problem in diffscan when the first value
did not have enough counts - Reduced polling frequency in emon - Fixed a scriptcontext bug which would cause it to dump core in SctTransact on interrupts - Fixed an issue with missing <nl> at the end of batch files - Added a feature which does not call halt when counting stops in hmcontrol.c This is necessary for the BOA CCD - Initalized doNotFree properly in hipadaba.c - Added the travelling salesman reflection measurement algorithm - Added another component to amorset - Removed old SicsWait from nserver.c - Added a means to nxscript to write 16 bit data for BOA - Modified tasub to accept a drivabel as a motor and not only a motor. This became necessary to make EIGER work as A2 on EIGER is a virtual motor SKIPPED: psi/amorcomp.h psi/amordrive.h psi/amorset.c psi/amorset.h psi/amorset.tex psi/amorset.w psi/el734hp.c psi/el737hpdriv.c psi/make_gen psi/pardef.c psi/polterwrite.c psi/psi.c psi/sinqhttpopt.c
This commit is contained in:
57
hdbtable.c
57
hdbtable.c
@@ -295,6 +295,53 @@ static int GetRowCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
||||
return 1;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int GetRowNoCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
||||
pHdb par[], int nPar)
|
||||
{
|
||||
pHdb row = NULL, child, data;
|
||||
int i, nodeNo;
|
||||
char path[132];
|
||||
pDynString result, val;
|
||||
|
||||
if(nPar < 1){
|
||||
SCWrite(pCon,"ERROR: need index of row to read",eError);
|
||||
return 0;
|
||||
}
|
||||
nodeNo = par[0]->value.v.intValue;
|
||||
|
||||
data = GetHipadabaNode(self->objectNode,"data");
|
||||
assert(data != NULL);
|
||||
row = data->child;
|
||||
for(i = 0; i < nodeNo; i++){
|
||||
row = row->next;
|
||||
if(row == NULL){
|
||||
SCPrintf(pCon,eError,"ERROR: row %d not found", nodeNo);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
result = CreateDynString(128,128);
|
||||
if(result == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory in GetRowCmd", eError);
|
||||
return 0;
|
||||
}
|
||||
child = row->child;
|
||||
while(child != NULL){
|
||||
val = formatValue(child->value, child);
|
||||
if(val != NULL){
|
||||
DynStringConcat(result,GetCharArray(val));
|
||||
if(child->next != NULL){
|
||||
DynStringConcatChar(result,',');
|
||||
}
|
||||
DeleteDynString(val);
|
||||
}
|
||||
child = child->next;
|
||||
}
|
||||
SCWrite(pCon,GetCharArray(result),eValue);
|
||||
DeleteDynString(result);
|
||||
return 1;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int ListTblCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
||||
pHdb par[], int nPar)
|
||||
{
|
||||
@@ -414,7 +461,15 @@ pSICSOBJ MakeHdbTable(char *name, char *hdbclass)
|
||||
node = MakeHipadabaNode("id",HIPTEXT,1);
|
||||
SetHdbProperty(node,"priv","user");
|
||||
AddHipadabaChild(cmd,node, NULL);
|
||||
|
||||
|
||||
cmd = AddSICSHdbPar(result->objectNode, "getno", usUser,
|
||||
MakeSICSFunc(GetRowNoCmd));
|
||||
SetHdbProperty(cmd,"type","command");
|
||||
SetHdbProperty(cmd,"priv","user");
|
||||
node = MakeHipadabaNode("id",HIPINT,1);
|
||||
SetHdbProperty(node,"priv","user");
|
||||
AddHipadabaChild(cmd,node, NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user