- Fixed documentation typos
- In support of HMsec, allow the count command in countsec to run without a preset parameter. If this is missing the old, stored preset is used. - Removed a check which causes initialisation of the HM from a batch file fail for POLDI - fixed @nl@ encoding of \n problem with certain kinds of batch files generated by GTSE - Fixed a bug with summing on hitsmemsec. nxdataset now uses 64 bit int for dimensions. - Fixed motorsec to remove itself properly from a parent when linked. Please note that there is still the limitation that a second generation motor can only be linked once in a Hipadaba tree - Extended subsampling a HM for second generation HM - Added a hscriptnotify. This calls a script on the update of a node - POLDI has been rebuilt, chnages to data file writing - For testing, sinqhttopt now understands a special command, byteswapoff, which switches off byte swapping. Required when the HM ius run on an Intel box. SKIPPED: psi/polterwrite.c psi/sinqhttpopt.c
This commit is contained in:
@ -910,10 +910,13 @@ int HdbSubSample(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
{
|
||||
pHistMem pHM = NULL;
|
||||
pHdb node = NULL;
|
||||
int bank = 0, length = -1, status;
|
||||
int bank = 0, length = -1, status, i;
|
||||
HistInt *data = NULL;
|
||||
char *pPtr = NULL;
|
||||
char error[132];
|
||||
hdbValue v;
|
||||
HMdata hdata;
|
||||
pHdb hmnode = NULL;
|
||||
|
||||
if (argc < 4) {
|
||||
SCWrite(pCon,
|
||||
@ -928,23 +931,61 @@ int HdbSubSample(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
pPtr++;
|
||||
sscanf(pPtr, "%d", &bank);
|
||||
}
|
||||
pHM = (pHistMem) FindCommandData(pSics, argv[1], "HistMem");
|
||||
node = FindHdbNode(NULL, argv[2], pCon);
|
||||
if (pHM == NULL || node == NULL) {
|
||||
SCWrite(pCon, "ERROR: either histogram memory or node not found!",
|
||||
eError);
|
||||
if (node == NULL) {
|
||||
SCWrite(pCon, "ERROR: node not found!",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pHM->pDriv->SubSample == NULL) {
|
||||
SCWrite(pCon, "ERROR: hm does not support subsampling", eError);
|
||||
return 0;
|
||||
}
|
||||
data = pHM->pDriv->SubSample(pHM->pDriv, pCon, bank, argv[3]);
|
||||
if (data == NULL) {
|
||||
SCWrite(pCon, "ERROR: sub sampling failed", eError);
|
||||
/*
|
||||
old HM
|
||||
*/
|
||||
pHM = (pHistMem) FindCommandData(pSics, argv[1], "HistMem");
|
||||
if(pHM != NULL){
|
||||
|
||||
if (pHM->pDriv->SubSample == NULL) {
|
||||
SCWrite(pCon, "ERROR: hm does not support subsampling", eError);
|
||||
return 0;
|
||||
}
|
||||
data = pHM->pDriv->SubSample(pHM->pDriv, pCon, bank, argv[3]);
|
||||
if (data == NULL) {
|
||||
SCWrite(pCon, "ERROR: sub sampling failed", eError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
new HM
|
||||
*/
|
||||
pHM = (pHistMem) FindCommandData(pSics, argv[1], "HistMemSec");
|
||||
if(pHM != NULL){
|
||||
memset(&hdata,0,sizeof(HMdata));
|
||||
hmnode = GetHipadabaNode(pHM->pDes->parNode,"dim");
|
||||
if(hmnode == NULL){
|
||||
SCWrite(pCon,"ERROR: dim node not found",eError);
|
||||
return 0;
|
||||
}
|
||||
hdata.rank = hmnode->value.arrayLength;
|
||||
for(i = 0; i < hdata.rank; i++){
|
||||
hdata.iDim[i] = hmnode->value.v.intArray[i];
|
||||
}
|
||||
hmnode = GetHipadabaNode(pHM->pDes->parNode,"data");
|
||||
if(hmnode == NULL){
|
||||
SCWrite(pCon,"ERROR: data node not found",eError);
|
||||
return 0;
|
||||
}
|
||||
hdata.localBuffer = hmnode->value.v.intArray;
|
||||
data = subSample(&hdata, argv[3], error, sizeof(error));
|
||||
if(data == NULL){
|
||||
SCPrintf(pCon,eError,"ERROR: %s while processing %s with %s",
|
||||
error, argv[1], argv[3]);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
SCPrintf(pCon,eError,"ERROR: hm %s not found", argv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
v.dataType = HIPINTVARAR;
|
||||
v.arrayLength = data[0];
|
||||
|
Reference in New Issue
Block a user