- 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:
koennecke
2013-09-16 09:27:50 +00:00
parent 5a06bb9b90
commit 3e6501d806
14 changed files with 220 additions and 42 deletions

View File

@@ -2392,6 +2392,8 @@ static int SetHdbNode(SConnection * pCon, SicsInterp * pSics, void *pData,
pDynString parData = NULL;
char error[512], value[132];
int i, status, priv;
pIDrivable pDriv = NULL;
pDummy data = NULL;
if (argc < 3) {
@@ -2415,6 +2417,25 @@ static int SetHdbNode(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
/**
* special code to handle certain types of motors right
**/
status = GetHdbProperty(targetNode,"sicsdev",value,sizeof(value));
if(status == 1){
data = (pDummy)FindCommandData(pSics,value,NULL);
if(data != NULL){
pDriv = GetDrivableInterface(data);
if(pDriv != NULL){
status = StartDevice(pServ->pExecutor,value, data->pDescriptor,
data, pCon,RUNRUN, atof(argv[2]));
if(status == 1){
SCSendOK(pCon);
}
return status;
}
}
}
if (!cloneHdbValue(&targetNode->value, &newValue)) {
SCWrite(pCon, "ERROR: out of memory cloning node", eError);
@@ -3848,6 +3869,63 @@ static int AddCheck(SConnection * pCon, SicsInterp * pSics,
return 1;
}
/*---------------------------------------------------------------------------*/
static hdbCallbackReturn SICSNotifyScriptCallback(pHdb node, void *userData,
pHdbMessage message)
{
char *pPath = NULL;
int macro, status;
pHdbDataMessage mm = NULL;
SConnection *tstCon;
char script[256];
/*
* Deal with update messages
*/
if ((mm = GetHdbUpdateMessage(message)) == NULL) {
return hdbContinue;
}
status = GetHdbProperty(node, "updatescript", script, sizeof(script));
if(status == 0){
tracePar(node->name,"ERROR: did not find updatescript property");
return hdbContinue;
}
copyHdbValue(mm->v, &node->value);
status = Tcl_Eval(InterpGetTcl(pServ->pSics), script);
if (status != TCL_OK) {
tracePar(node->name,"ERROR: %s while evaluating updatescript %s",
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)), script);
}
return hdbContinue;
}
/*---------------------------------------------------------------------------*/
static int AddScriptNotify(SConnection * pCon, SicsInterp * pSics,
void *pData, int argc, char *argv[])
{
pHdb node = NULL;
if(argc < 3) {
SCWrite(pCon,"ERROR: Parameter missing, Usage: hscriptnotify node script",
eError);
return 0;
}
node = FindHdbNode(NULL,argv[1],pCon);
if (node == NULL) {
SCPrintf(pCon,eLogError, "ERROR: node %s to add script update not found",
argv[1]);
return 0;
}
SetHdbProperty(node,"updatescript",strdup(argv[2]));
AppendHipadabaCallback(node,MakeHipadabaCallback(SICSNotifyScriptCallback,
NULL,NULL));
SCSendOK(pCon);
return 1;
}
/*======================= Factory Functions =================================*/
void killSICSHipadaba()
{
@@ -3891,6 +3969,7 @@ int InstallSICSHipadaba(SConnection * pCon, SicsInterp * pSics,
AddCommand(pSics, "hlistprop", ListSICSHdbProperty, NULL, NULL);
AddCommand(pSics, "hcallnotify",CallNotify, NULL, NULL);
AddCommand(pSics, "haddcheck",AddCheck, NULL, NULL);
AddCommand(pSics, "hscriptnotify",AddScriptNotify, NULL, NULL);
InstallSICSPoll(pCon, pSics, pData, argc, argv);
poller = (pSicsPoll) FindCommandData(pSics, "sicspoll", "SicsPoll");