Merge branch 'master' into status
This commit is contained in:
2
conman.c
2
conman.c
@ -1724,10 +1724,8 @@ int SCInvoke(SConnection * self, SicsInterp * pInter, char *pCommand)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
strlcpy(pCopy->deviceID, pBueffel, SCDEVIDLEN);
|
strlcpy(pCopy->deviceID, pBueffel, SCDEVIDLEN);
|
||||||
/* SCAdvanceContext(self,pBueffel); */
|
|
||||||
traceCommand(ConID(self),"in:%s", pCommand);
|
traceCommand(ConID(self),"in:%s", pCommand);
|
||||||
iRet = InterpExecute(pInter, pCopy, pCommand);
|
iRet = InterpExecute(pInter, pCopy, pCommand);
|
||||||
/* SCPopContext(self); */
|
|
||||||
SCDeleteConnection(pCopy);
|
SCDeleteConnection(pCopy);
|
||||||
StatusFileTask(NULL); /* save changed parameters */
|
StatusFileTask(NULL); /* save changed parameters */
|
||||||
|
|
||||||
|
16
devexec.h
16
devexec.h
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#line 202 "devexec.w"
|
#line 204 "devexec.w"
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
int StartCounter(pExeList self, SicsInterp *pSics, SConnection *pCon,
|
int StartCounter(pExeList self, SicsInterp *pSics, SConnection *pCon,
|
||||||
int level, char *name);
|
int level, char *name);
|
||||||
|
|
||||||
#line 249 "devexec.w"
|
#line 251 "devexec.w"
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -77,8 +77,10 @@
|
|||||||
int DevExecTask(void *pEL);
|
int DevExecTask(void *pEL);
|
||||||
void DevExecSignal(void *pEL, int iSignal, void *pSigData);
|
void DevExecSignal(void *pEL, int iSignal, void *pSigData);
|
||||||
|
|
||||||
|
int GetDevExecInstStatus(pExeList self);
|
||||||
|
|
||||||
#line 251 "devexec.w"
|
|
||||||
|
#line 253 "devexec.w"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -98,7 +100,7 @@
|
|||||||
*/
|
*/
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#line 142 "devexec.w"
|
#line 144 "devexec.w"
|
||||||
|
|
||||||
int StopExe(pExeList self, char *name);
|
int StopExe(pExeList self, char *name);
|
||||||
int StopExeWait(pExeList self);
|
int StopExeWait(pExeList self);
|
||||||
@ -122,7 +124,7 @@
|
|||||||
int ContinueExecution(pExeList self);
|
int ContinueExecution(pExeList self);
|
||||||
|
|
||||||
|
|
||||||
#line 269 "devexec.w"
|
#line 271 "devexec.w"
|
||||||
|
|
||||||
/*-------------------------- Commands ------------------------------------*/
|
/*-------------------------- Commands ------------------------------------*/
|
||||||
int DevexecAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
int DevexecAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||||
@ -164,13 +166,13 @@
|
|||||||
|
|
||||||
/*--------------------------- Locking ---------------------------------*/
|
/*--------------------------- Locking ---------------------------------*/
|
||||||
|
|
||||||
#line 190 "devexec.w"
|
#line 192 "devexec.w"
|
||||||
|
|
||||||
void LockDeviceExecutor(pExeList self);
|
void LockDeviceExecutor(pExeList self);
|
||||||
void UnlockDeviceExecutor(pExeList self);
|
void UnlockDeviceExecutor(pExeList self);
|
||||||
|
|
||||||
|
|
||||||
#line 309 "devexec.w"
|
#line 311 "devexec.w"
|
||||||
|
|
||||||
/* -------------------------- Executor management -------------------------*/
|
/* -------------------------- Executor management -------------------------*/
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ static int SimConfig(pHistDriver self, SConnection * pCon,
|
|||||||
self->pPriv = NewSIMCounter("HistoSim", fFail);
|
self->pPriv = NewSIMCounter("HistoSim", fFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
configured test value
|
configured test value
|
||||||
*/
|
*/
|
||||||
|
@ -246,21 +246,25 @@ static int MultiSecTransfer(void *pData, SConnection * pCon)
|
|||||||
char pBueffel[132];
|
char pBueffel[132];
|
||||||
pCounter pCount = NULL;
|
pCounter pCount = NULL;
|
||||||
pHdb transfer;
|
pHdb transfer;
|
||||||
|
SConnection *myCon;
|
||||||
|
|
||||||
pCount = (pCounter) pData;
|
pCount = (pCounter) pData;
|
||||||
|
|
||||||
transfer = GetHipadabaNode(pCount->objectNode,"transfer");
|
transfer = GetHipadabaNode(pCount->objectNode,"transfer");
|
||||||
if(transfer != NULL){
|
if(transfer != NULL){
|
||||||
MacroPush(pCon);
|
myCon = SCCopyConnection(pCon);
|
||||||
|
MacroPush(myCon);
|
||||||
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
|
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
|
||||||
if (tclStatus != TCL_OK) {
|
if (tclStatus != TCL_OK) {
|
||||||
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
|
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
|
||||||
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
||||||
SCWrite(pCon, pBueffel, eError);
|
SCWrite(pCon, pBueffel, eError);
|
||||||
MacroPop();
|
MacroPop();
|
||||||
|
SCDeleteConnection(myCon);
|
||||||
return HWFault;
|
return HWFault;
|
||||||
}
|
}
|
||||||
MacroPop();
|
MacroPop();
|
||||||
|
SCDeleteConnection(myCon);
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
@ -374,34 +378,34 @@ static int areSlavesRunning(pCounter self, SConnection *pCon, int *status)
|
|||||||
assert(ccd != NULL);
|
assert(ccd != NULL);
|
||||||
|
|
||||||
if(isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
if(isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
||||||
if(ccd->value.v.intValue == 1 && time(NULL) > stopTime->value.v.intValue + 100) {
|
if(ccd->value.v.intValue == 1 && time(NULL) > stopTime->value.v.intValue + 100) {
|
||||||
SCWrite(pCon,"WARNING: CCD overrun, restarting counting...", eLogError);
|
SCWrite(pCon,"WARNING: CCD overrun, restarting counting...", eLogError);
|
||||||
self->pCountInt->Halt(self);
|
self->pCountInt->Halt(self);
|
||||||
ReleaseCountLock(self->pCountInt);
|
ReleaseCountLock(self->pCountInt);
|
||||||
for(i = 0; i < 100; i++){
|
for(i = 0; i < 100; i++){
|
||||||
SicsWait(1);
|
SicsWait(1);
|
||||||
if(!isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
if(!isTaskGroupRunning(pServ->pTasker,slaveID->value.v.intValue)){
|
||||||
self->pCountInt->StartCount(self,pCon);
|
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;
|
|
||||||
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
||||||
|
UpdateHipadabaPar(stopTime,MakeHdbInt(time(NULL)),pCon);
|
||||||
|
*status = HWBusy;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
*status = HWIdle;
|
SCWrite(pCon,"ERROR: failed to stop overrun CCD",eLogError);
|
||||||
UpdateHipadabaPar(myStatus,MakeHdbText("idle"),pCon);
|
*status = HWFault;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else {
|
||||||
return 1;
|
*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)
|
static void multiEndCounting(pCounter self, SConnection *pCon)
|
||||||
|
@ -1552,6 +1552,7 @@ static int SctProcessCmd(pSICSOBJ ccmd, SConnection * con,
|
|||||||
{
|
{
|
||||||
SctData *data = NULL;
|
SctData *data = NULL;
|
||||||
SctController *c;
|
SctController *c;
|
||||||
|
time_t startTime;
|
||||||
|
|
||||||
c = (SctController *) ccmd->pPrivate;
|
c = (SctController *) ccmd->pPrivate;
|
||||||
|
|
||||||
@ -1581,9 +1582,10 @@ static int SctProcessCmd(pSICSOBJ ccmd, SConnection * con,
|
|||||||
data->busy = 1;
|
data->busy = 1;
|
||||||
data->inMacro = SCinMacro(con);
|
data->inMacro = SCinMacro(con);
|
||||||
|
|
||||||
|
startTime = time(NULL);
|
||||||
DevQueue(c->devser, data, WritePRIO,
|
DevQueue(c->devser, data, WritePRIO,
|
||||||
SctWriteHandler, SctMatch, NULL, SctDataInfo);
|
SctWriteHandler, SctTransactMatch, NULL, SctDataInfo);
|
||||||
while (data->busy == 1) {
|
while (data->busy == 1 && time(NULL) < startTime + 20) {
|
||||||
TaskYield(pServ->pTasker);
|
TaskYield(pServ->pTasker);
|
||||||
}
|
}
|
||||||
SctKillData(data);
|
SctKillData(data);
|
||||||
|
Reference in New Issue
Block a user