- Fixes to make SL6 work
- New NeXus libraries - Added new raw binary transfer mode for mass data - Added a check script option to configurable virtual motor SKIPPED: psi/dumprot.c psi/make_gen psi/psi.c psi/rebin.c psi/sanslirebin.c
This commit is contained in:
@@ -454,11 +454,17 @@ int formatNameValue(Protocol protocol, char *name, char *value,
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static int sendZippedNodeData(pHdb node, hdbValue newValue, SConnection * pCon)
|
||||
{
|
||||
int i, *iData = NULL;
|
||||
int i, *iData = NULL, zip = 1;
|
||||
char *path = NULL;
|
||||
double sum = 0;
|
||||
char value[80];
|
||||
|
||||
path = GetHipadabaPath(node);
|
||||
if (GetHdbProperty(node, "transfer", value, 80) == 1) {
|
||||
if(strstr(value,"bin") != NULL) {
|
||||
zip = 0;
|
||||
}
|
||||
}
|
||||
switch (newValue.dataType) {
|
||||
case HIPINTAR:
|
||||
case HIPINTVARAR:
|
||||
@@ -474,10 +480,14 @@ static int sendZippedNodeData(pHdb node, hdbValue newValue, SConnection * pCon)
|
||||
}
|
||||
memset(iData, 0, newValue.arrayLength * sizeof(int));
|
||||
for (i = 0; i < newValue.arrayLength; i++) {
|
||||
sum += (double)newValue.v.intArray[i];
|
||||
/* sum += (double)newValue.v.intArray[i]; */
|
||||
iData[i] = htonl(newValue.v.intArray[i]);
|
||||
}
|
||||
SCWriteZipped(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
if(zip == 1){
|
||||
SCWriteZipped(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
} else {
|
||||
SCWriteBinary(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
}
|
||||
free(iData);
|
||||
/* printf("Wrote zipped data %s, sum %lf\n", path, sum); */
|
||||
break;
|
||||
@@ -498,8 +508,12 @@ static int sendZippedNodeData(pHdb node, hdbValue newValue, SConnection * pCon)
|
||||
sum+= newValue.v.floatArray[i];
|
||||
iData[i] = htonl((int) (newValue.v.floatArray[i] * 65536.));
|
||||
}
|
||||
SCWriteZipped(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
if(zip == 1) {
|
||||
SCWriteZipped(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
/* printf("Wrote zipped data %s, sum %lf\n", path, sum); */
|
||||
} else {
|
||||
SCWriteBinary(pCon, path, iData, newValue.arrayLength * sizeof(int));
|
||||
}
|
||||
free(iData);
|
||||
break;
|
||||
default:
|
||||
@@ -600,7 +614,7 @@ static hdbCallbackReturn SICSNotifyCallback(pHdb node, void *userData,
|
||||
* if transfer = zip always transfer data in zipped form
|
||||
*/
|
||||
if (GetHdbProperty(node, "transfer", value, 80) == 1) {
|
||||
if (strstr(value, "zip") != NULL) {
|
||||
if (strstr(value, "zip") != NULL || strstr(value,"bin") != NULL) {
|
||||
status = sendZippedNodeData(node, *(mm->v), cbInfo->pCon);
|
||||
free(pPath);
|
||||
DeleteDynString(result);
|
||||
@@ -672,9 +686,9 @@ static hdbCallbackReturn TreeChangeCallback(pHdb node, void *userData,
|
||||
char buffer[1024];
|
||||
pDynString result = NULL;
|
||||
Protocol protocol = normal_protocol;
|
||||
int outCode;
|
||||
pHdbIDMessage idm = NULL;
|
||||
pHdbPtrMessage cmm = NULL;
|
||||
int outCode;
|
||||
pHdbTreeChangeMessage tm = NULL;
|
||||
SConnection *tstCon = NULL;
|
||||
|
||||
@@ -714,7 +728,7 @@ static hdbCallbackReturn TreeChangeCallback(pHdb node, void *userData,
|
||||
result = CreateDynString(128, 128);
|
||||
if (result == NULL) {
|
||||
SCWrite(cbInfo->pCon, "ERROR: out of memory in TreeChangeCallback",
|
||||
outCode);
|
||||
eError);
|
||||
return hdbAbort;
|
||||
}
|
||||
path = GetHipadabaPath(node);
|
||||
@@ -2908,7 +2922,7 @@ static int AutoNotifyHdbNode(SConnection * pCon, SicsInterp * pSics,
|
||||
void *pData, int argc, char *argv[])
|
||||
{
|
||||
pHdb node = NULL;
|
||||
int id, status;
|
||||
int id, status, recurse = 1;
|
||||
|
||||
if (argc < 3) {
|
||||
SCWrite(pCon, "ERROR: need path and id in order to add notify",
|
||||
@@ -2923,7 +2937,11 @@ static int AutoNotifyHdbNode(SConnection * pCon, SicsInterp * pSics,
|
||||
|
||||
id = atoi(argv[2]);
|
||||
|
||||
status = InstallSICSNotify(node, pCon, id, 1);
|
||||
if(argc > 3) {
|
||||
recurse = atoi(argv[3]);
|
||||
}
|
||||
|
||||
status = InstallSICSNotify(node, pCon, id, recurse);
|
||||
if (status == 1) {
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user