- improvements and bug fixes
This commit is contained in:
15
euro2kdriv.c
15
euro2kdriv.c
@@ -63,6 +63,7 @@ typedef struct {
|
||||
Statistics *stat;
|
||||
double lastRd;
|
||||
char *model;
|
||||
int rdonly;
|
||||
} Euro2k;
|
||||
|
||||
static ParClass euro2kClass = { "EURO2K", sizeof(Euro2k) };
|
||||
@@ -231,6 +232,11 @@ void Euro2kParDef(void *object)
|
||||
EaseUpdate(EURO2K_SET);
|
||||
ParFloat(&drv->setpoint, PAR_NAN);
|
||||
|
||||
ParName("rdonly");
|
||||
ParLogAs(NULL);
|
||||
ParAccess(usUser);
|
||||
ParInt(&drv->rdonly, 0);
|
||||
|
||||
ParName("task");
|
||||
ParAccess(usUser);
|
||||
ParList(NULL);
|
||||
@@ -367,6 +373,11 @@ static long Euro2kRead(long pc, void *object)
|
||||
switch (pc) {
|
||||
default: /* FSM BEGIN ****************************** */
|
||||
EasePchk(drv);
|
||||
if (drv->rdonly) {
|
||||
if (getTime() < drv->lastRd + 10) {
|
||||
goto fsm_quit;
|
||||
}
|
||||
}
|
||||
if (drv->script && drv->script[0] != '\0'
|
||||
&& 0 != strcmp(drv->script, "0")) {
|
||||
pTcl = InterpGetTcl(pServ->pSics);
|
||||
@@ -482,6 +493,8 @@ static long Euro2kSet(long pc, void *object)
|
||||
default: /* FSM BEGIN ****************************** */
|
||||
EasePchk(drv);
|
||||
loop:
|
||||
if (drv->rdonly)
|
||||
goto fsm_quit;
|
||||
upd = EaseNextUpdate(drv);
|
||||
if (upd == EASE_RUN) {
|
||||
drv->setpoint = drv->d.targetValue;
|
||||
@@ -594,6 +607,8 @@ static long Euro2kStart(long pc, void *object)
|
||||
drv->unit = strdup("K");
|
||||
}
|
||||
unitGiven:
|
||||
if (drv->rdonly)
|
||||
goto quit;
|
||||
ModBusPutValue(eab, 111, modBusFloat, drv->d.upperLimit);
|
||||
return __LINE__;
|
||||
case __LINE__: /**********************************/
|
||||
|
||||
Reference in New Issue
Block a user