Assorted bug fixes

- If SctProcessNode ran into a timeout, its action data wa sdeleted. If data came
  later, this caused SICS to crash. This is now fixed
- sget leaked connections under certain circumstances
- Cosmetic fix to hipadaba.c
- yet another chnage to the TRICS file format in fourmess.c, now it prints magnetic field
  instead of the proton count
This commit is contained in:
2015-07-30 13:57:55 +02:00
parent 950cddc8e5
commit 64d44c2824
4 changed files with 38 additions and 5 deletions

View File

@ -393,7 +393,7 @@ static int FourMessStoreIntern(pSICSOBJ self, SConnection * pCon,
double fHkl[3], double fPosition[4], char *extra)
{
pFourMess priv = self->pPrivate;
float fSum, fSigma, fTemp, fStep, fPreset;
float fSum, fSigma, fTemp, fMF, fStep, fPreset;
int i, iLF, iRet, iNP, ii;
long *lCounts = NULL;
pEVControl pEva = NULL;
@ -486,6 +486,23 @@ static int FourMessStoreIntern(pSICSOBJ self, SConnection * pCon,
iRet = EVCGetPos(pEva, pCon, &fTemp);
}
/* get mf */
fMF = -777.77;
pEva = (pEVControl) FindCommandData(pServ->pSics, "mf",
"Environment Controller");
if (pEva == NULL) {
pPtr = (pDummy) FindCommandData(pServ->pSics, "mf",
"RemObject");
if (pPtr != NULL) {
pDriv = pPtr->pDescriptor->GetInterface(pPtr, DRIVEID);
if (pDriv != NULL) {
fMF = pDriv->GetValue(pPtr, pCon);
}
}
} else {
iRet = EVCGetPos(pEva, pCon, &fMF);
}
/* write profile */
if (priv->profFile) {
/* collect data */
@ -493,12 +510,16 @@ static int FourMessStoreIntern(pSICSOBJ self, SConnection * pCon,
GetScanVarStep(priv->pScanner, 0, &fStep);
fPreset = GetScanPreset(priv->pScanner);
prot = getProtonAverage(priv);
/*
They rather wanted fMF in place of the proton average which fell victim to the
monitor assignement chaos anyway.
*/
if(extra == NULL){
fprintf(priv->profFile, "%3d %7.4f %9.0f %7.3f %12f %s\n", iNP, fStep,
fPreset, fTemp, prot, pBueffel);
fPreset, fTemp, fMF, pBueffel);
} else {
fprintf(priv->profFile, "%3d %7.4f %9.0f %7.3f %12f %s %s\n", iNP, fStep,
fPreset, fTemp, prot, pBueffel,extra);
fPreset, fTemp, fMF, pBueffel,extra);
}
for (i = 0; i < iNP; i++) {
for (ii = 0; ii < 10 && i < iNP; ii++) {

View File

@ -1194,7 +1194,7 @@ int GetHdbProperty(pHdb node, char *key, char *value, int len)
/*---------------------------------------------------------------------------*/
char *GetHdbProp(pHdb node, char *key)
{
if (node != NULL && node->properties != NULL) {
if (node != NULL && isHdbNodeValid(node) && node->properties != NULL) {
return StringDictGetShort(node->properties, key);
} else {
return NULL;

View File

@ -1620,8 +1620,19 @@ static int SctProcessCmd(pSICSOBJ ccmd, SConnection * con,
startTime = time(NULL);
DevQueue(c->devser, data, WritePRIO,
SctWriteHandler, SctTransactMatch, NULL, SctDataInfo);
while (data->busy == 1 && time(NULL) < startTime + 20) {
while (data->busy == 1){
TaskYield(pServ->pTasker);
if(time(NULL) >= startTime + 20) {
/*
if data would still come after such a long timeout, it
might end up in the next action: see comment in devser.c
*/
SCPrintf(con,eError,"ERROR: timeout processing node %s", par[0]->value.v.text);
DevRemoveAction(c->devser,data);
SctKillData(data);
return 0;
}
}
SctKillData(data);

View File

@ -153,6 +153,7 @@ static int InvokeSICSFunc(void *ms, void *userData)
SCsetMacro(pCon,0);
if(!status){
self->success = 0;
SCDeleteConnection(pCon);
return MPSTOP;
}
self->response = strdup(Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));