improvements:

- added is_running to driveable ease objects
- ighdriv.c: try <maxtry> times when status reply failes
- ipsdriv.c: fix trainedTo parameter
- reduced SEA version of SICS
This commit is contained in:
2021-09-16 12:35:06 +02:00
parent 21299efa80
commit f16d738b4a
10 changed files with 607 additions and 80 deletions

View File

@ -287,6 +287,7 @@ void IpsParDef(void *object)
ParCmd(IpsConfirm, NULL);
EaseBasePar(drv);
EaseRunPar(drv);
EaseSendPar(drv);
ParStdDef();
@ -369,7 +370,7 @@ static void IpsStatus(Ips * drv)
drv->remote = 3; /* signal to switch back to C0 local locked */
}
if (drv->d.hwstate == HWBusy && drv->d.b.doit == NULL) {
drv->d.hwstate = HWIdle;
EaseUpdateHwstate(drv, HWIdle);
drv->d.stopped = 0;
}
}
@ -604,7 +605,7 @@ static long IpsStart(long pc, void *object)
Tcl_Interp *pTcl = NULL;
int iRet;
char msg[256];
char *script;
switch (pc) {
default: /* FSM BEGIN ****************************** */
@ -682,7 +683,10 @@ static long IpsStart(long pc, void *object)
if (drv->startScript && drv->startScript[0] != '\0'
&& 0 != strcmp(drv->startScript, "0")) {
pTcl = InterpGetTcl(pServ->pSics);
iRet = Tcl_Eval(pTcl, drv->startScript);
script = strdup(drv->startScript);
iRet = Tcl_Eval(pTcl, script);
free(script);
if (iRet != TCL_OK) {
snprintf(msg, sizeof msg, "%s", pTcl->result);
EaseStop(eab, msg);
@ -725,7 +729,7 @@ static long IpsChangeField(long pc, void *object)
}
EaseSetUpdate(eab, EASE_RUN, 0);
if (drv->nowait) {
drv->d.hwstate = HWIdle;
EaseUpdateHwstate(drv, HWIdle);
drv->d.eMode = EVMonitor; /* finish drive, continue in background */
}
EaseWrite(eab, "F7"); /* switch to tesla on display */
@ -924,7 +928,7 @@ static long IpsChangeField(long pc, void *object)
if (drv->trainMode == 0) {
drv->trainMode = 3; /* remember that we must go to train mode */
}
drv->trainedTo = fabs(fld);
drv->trainedTo = fabs(drv->current);
} else {
if (drv->trainMode == 1) {
drv->trainMode = 2; /* remember that we must go to fast mode */
@ -946,7 +950,7 @@ static long IpsChangeField(long pc, void *object)
goto ramping;
target_reached:
drv->d.hwstate = HWIdle;
EaseUpdateHwstate(drv, HWIdle);
drv->d.eMode = EVMonitor; /* we are at field, drive has finished */
if (drv->persmode != 1)
goto hold_finish;
@ -987,7 +991,7 @@ static long IpsChangeField(long pc, void *object)
finish:
EaseWrite(eab, "C0");
drv->remote = 0; /* local state */
drv->d.hwstate = HWIdle;
EaseUpdateHwstate(drv, HWIdle);
drv->tim = time(NULL); /* time of last field change */
return __LINE__;
case __LINE__: /**********************************/