- Removed old stuff in conman
- Fixed a bug in processnode which hangs SICS when processnode is called from multiple clients on the same node - Fixed a bug in multicountsersec which caused thrashing of the Tcl results which caused ugly error messages when calling the transfer script. Now a copy of the connection is made before calling the transfer script
This commit is contained in:
@ -246,21 +246,25 @@ static int MultiSecTransfer(void *pData, SConnection * pCon)
|
||||
char pBueffel[132];
|
||||
pCounter pCount = NULL;
|
||||
pHdb transfer;
|
||||
SConnection *myCon;
|
||||
|
||||
pCount = (pCounter) pData;
|
||||
|
||||
transfer = GetHipadabaNode(pCount->objectNode,"transfer");
|
||||
if(transfer != NULL){
|
||||
MacroPush(pCon);
|
||||
myCon = SCCopyConnection(pCon);
|
||||
MacroPush(myCon);
|
||||
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
|
||||
if (tclStatus != TCL_OK) {
|
||||
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
|
||||
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
MacroPop();
|
||||
SCDeleteConnection(myCon);
|
||||
return HWFault;
|
||||
}
|
||||
MacroPop();
|
||||
SCDeleteConnection(myCon);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
@ -374,34 +378,34 @@ static int areSlavesRunning(pCounter self, SConnection *pCon, int *status)
|
||||
assert(ccd != NULL);
|
||||
|
||||
if(isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
||||
if(ccd->value.v.intValue == 1 && time(NULL) > stopTime->value.v.intValue + 100) {
|
||||
SCWrite(pCon,"WARNING: CCD overrun, restarting counting...", eLogError);
|
||||
self->pCountInt->Halt(self);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
for(i = 0; i < 100; i++){
|
||||
SicsWait(1);
|
||||
if(!isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
||||
self->pCountInt->StartCount(self,pCon);
|
||||
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
||||
UpdateHipadabaPar(stopTime,MakeHdbInt(time(NULL)),pCon);
|
||||
*status = HWBusy;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
SCWrite(pCon,"ERROR: failed to stop overrun CCD",eLogError);
|
||||
*status = HWFault;
|
||||
return 0;
|
||||
} else {
|
||||
*status = HWBusy;
|
||||
if(ccd->value.v.intValue == 1 && time(NULL) > stopTime->value.v.intValue + 100) {
|
||||
SCWrite(pCon,"WARNING: CCD overrun, restarting counting...", eLogError);
|
||||
self->pCountInt->Halt(self);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
for(i = 0; i < 100; i++){
|
||||
SicsWait(1);
|
||||
if(!isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
||||
self->pCountInt->StartCount(self,pCon);
|
||||
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
||||
UpdateHipadabaPar(stopTime,MakeHdbInt(time(NULL)),pCon);
|
||||
*status = HWBusy;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
*status = HWIdle;
|
||||
UpdateHipadabaPar(myStatus,MakeHdbText("idle"),pCon);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
SCWrite(pCon,"ERROR: failed to stop overrun CCD",eLogError);
|
||||
*status = HWFault;
|
||||
return 0;
|
||||
} else {
|
||||
*status = HWBusy;
|
||||
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
*status = HWIdle;
|
||||
UpdateHipadabaPar(myStatus,MakeHdbText("idle"),pCon);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
static void multiEndCounting(pCounter self, SConnection *pCon)
|
||||
|
Reference in New Issue
Block a user