- Introduced a state filed into first generation objects
- Fixed some issues with error returns not being properly handled in devexec - Fixed a bug in motorlist which caused limit checks to fail - Fixed an issue with the TDCHM not properly updating the counter values on finish - Readded getHipadabaPar in ChainCallback as this caused a problem in ei - Made tasdrive ignore sgu, sgl when out of plane not allowed SKIPPED: psi/eigermono.c psi/sinqhttp.c psi/tdchm.c
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "commandlog.h"
|
||||
#include "arrayutil.h"
|
||||
#include "HistMem.h"
|
||||
#include "asynnet.h"
|
||||
|
||||
#define MAX_HDB_PATH 1024
|
||||
|
||||
@@ -2547,7 +2548,63 @@ static int ZipReadHdbNode(SConnection * pCon, SicsInterp * pSics,
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int BinReadHdbNode(SConnection *pCon, SicsInterp *pSics,
|
||||
void *pData, int argc, char *argv[])
|
||||
{
|
||||
static int binMagic = 7333;
|
||||
pHdb targetNode = NULL;
|
||||
char oriPath[512];
|
||||
hdbValue val;
|
||||
int *data = NULL, i;
|
||||
|
||||
if (argc < 2) {
|
||||
SCWrite(pCon, "ERROR: need path to node", eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strlcpy(oriPath, argv[1], 511);
|
||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||
if (targetNode == NULL) {
|
||||
return 0;
|
||||
}
|
||||
val = targetNode->value;
|
||||
switch(val.dataType){
|
||||
case HIPINTAR:
|
||||
case HIPINTVARAR:
|
||||
data = malloc(val.arrayLength+2*sizeof(int));
|
||||
if(data == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory in BinReadHdbNode",eError);
|
||||
return 0;
|
||||
}
|
||||
data[0] = binMagic;
|
||||
data[1] = val.arrayLength;
|
||||
memcpy(data+2,val.v.intArray,val.arrayLength*sizeof(int));
|
||||
break;
|
||||
case HIPFLOATAR:
|
||||
case HIPFLOATVARAR:
|
||||
data = malloc(val.arrayLength+2*sizeof(int));
|
||||
if(data == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory in BinReadHdbNode",eError);
|
||||
return 0;
|
||||
}
|
||||
data[0] = binMagic;
|
||||
data[1] = val.arrayLength;
|
||||
for(i = 0; i < val.arrayLength; i++){
|
||||
data[i+2] = (int)(val.v.floatArray[i]*65536.);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SCWrite(pCon,"ERROR: cannot send binary data for this node type",eError);
|
||||
return 0;
|
||||
}
|
||||
if(data != NULL){
|
||||
ANETwrite(pCon->sockHandle,data,(val.arrayLength+2)*sizeof(int));
|
||||
free(data);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int GetHdbNode(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[])
|
||||
@@ -3314,12 +3371,15 @@ static hdbCallbackReturn ChainCallback(pHdb node, void *userData,
|
||||
}
|
||||
|
||||
if (slave != NULL) {
|
||||
/*
|
||||
memset(&vv, 0, sizeof(hdbValue));
|
||||
GetHipadabaPar(slave, &vv, mm->callData);
|
||||
/*
|
||||
The GetHipadabaPar here has to happen. Otherwise
|
||||
necessary calculations to update the slave are not
|
||||
performed.
|
||||
*/
|
||||
UpdateHipadabaPar(slave, *(mm->v), mm->callData);
|
||||
/* ReleaseHdbValue(&vv); */
|
||||
GetHipadabaPar(slave, &vv, mm->callData);
|
||||
UpdateHipadabaPar(slave, vv, mm->callData);
|
||||
ReleaseHdbValue(&vv);
|
||||
}
|
||||
return hdbContinue;
|
||||
}
|
||||
@@ -3735,6 +3795,7 @@ int InstallSICSHipadaba(SConnection * pCon, SicsInterp * pSics,
|
||||
AddCommand(pSics, "hval", GetHdbVal, NULL, NULL);
|
||||
AddCommand(pSics, "hzipget", ZipGetHdbNode, NULL, NULL);
|
||||
AddCommand(pSics, "hzipread", ZipReadHdbNode, NULL, NULL);
|
||||
AddCommand(pSics, "hbinread", BinReadHdbNode, NULL, NULL);
|
||||
AddCommand(pSics, "hlist", ListHdbNode, NULL, NULL);
|
||||
AddCommand(pSics, "hnotify", AutoNotifyHdbNode, NULL, NULL);
|
||||
AddCommand(pSics, "hdelcb", RemoveHdbCallback, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user