- Removed napi from SICS

- Added error fields to hwardware objects: motor, counter, histmem
- Optimised sinqhttpopt
- Added haddcheck which adds checks to hipadaba nodes. The current implementation
  only checks for selctions agaisnt the values property. Expand when more checks are
  required.


SKIPPED:
	psi/polterwrite.c
	psi/sinqhttpopt.c
	psi/tasinit.c
This commit is contained in:
koennecke
2013-08-14 09:50:22 +00:00
parent 255b83665c
commit 5a06bb9b90
35 changed files with 255 additions and 10598 deletions

View File

@ -18,6 +18,10 @@
Mark Koennecke, March 2009
Added an error field in the options stringdict
Mark Koennecke, June 2013
Copyright:
Labor fuer Neutronenstreuung
@ -204,6 +208,7 @@ static int HistStartCount(void *pData, SConnection * pCon)
}
/* try at least three times to do it */
StringDictUpdate(self->pDriv->pOption, "error", "None");
for (i = 0; i < 3; i++) {
iRet = self->pDriv->Start(self->pDriv, pCon);
if (iRet == OKOK) {
@ -221,6 +226,7 @@ static int HistStartCount(void *pData, SConnection * pCon)
eLogError);
SCSetInterrupt(pCon, eAbortBatch);
ReleaseCountLock(self->pCountInt);
StringDictUpdate(self->pDriv->pOption, "error", pError);
return HWFault;
}
}
@ -344,6 +350,7 @@ static int HistCountStatus(void *pData, SConnection * pCon)
SCSetInterrupt(pCon, eAbortBatch);
InvokeCallBack(self->pCall, COUNTEND, NULL);
ReleaseCountLock(self->pCountInt);
StringDictUpdate(self->pDriv->pOption, "error", pError);
return eCt;
} else {
updateHMData(self->pDriv->data);
@ -399,6 +406,7 @@ static int HistTransfer(void *pData, SConnection * pCon)
SCWrite(pCon, "ERROR: failed to fix histogram memory problem",
eError);
SCSetInterrupt(pCon, eAbortBatch);
StringDictUpdate(self->pDriv->pOption, "error", pError);
iStatus = HWFault;
}
}
@ -465,6 +473,7 @@ pHistMem CreateHistMemory(char *driver)
}
StringDictAddPair(pOption, "driver", driver);
StringDictAddPair(pOption, "update", "0");
StringDictAddPair(pOption, "error", "None");
/* initialise driver */
if (strcmp(driver, "sim") == 0) {
@ -912,6 +921,7 @@ int GetHistogramDirect(pHistMem self, SConnection * pCon,
SCWrite(pCon, pBueffel, eError);
iRet = self->pDriv->TryAndFixIt(self->pDriv, iErr);
if (iRet == COTERM) {
StringDictUpdate(self->pDriv->pOption, "error", pError);
return 0;
}
}
@ -963,6 +973,7 @@ int PresetHistogram(pHistMem self, SConnection * pCon, HistInt lVal)
SCWrite(pCon, pBueffel, eError);
iRet = self->pDriv->TryAndFixIt(self->pDriv, iErr);
if (iRet == COTERM) {
StringDictUpdate(self->pDriv->pOption, "error", pError);
return 0;
}
}
@ -1790,6 +1801,12 @@ int HistAction(SConnection * pCon, SicsInterp * pSics, void *pData,
SCSendOK(pCon);
return 1;
}
/* error */
else if (strcmp(argv[1], "error") == 0) {
StringDictGet(self->pDriv->pOption, "error", pBueffel, sizeof(pBueffel));
SCPrintf(pCon,eValue,"%s.error = %s", argv[0], pBueffel);
return 1;
}
/*-------- sum */
else if (strcmp(argv[1], "sum") == 0) {
/* read following arguments as ints and put them