- small improvements in drivers
This commit is contained in:
20
haakedriv.c
20
haakedriv.c
@ -141,14 +141,14 @@ static void HaakeParDef(void *object) {
|
||||
EaseBase *eab = object;
|
||||
int reset = 0;
|
||||
|
||||
ParName(""); ParFmt("%.2f"); ParTail("C");
|
||||
ParName(""); ParFmt("%.2f"); ParTail("K");
|
||||
ParFloat(&drv->t, PAR_NAN);
|
||||
|
||||
ParName("t2");
|
||||
if (drv->with2sensors) { ParFmt("%.2f"); ParTail("C"); }
|
||||
if (drv->with2sensors) { ParFmt("%.2f"); ParTail("K"); }
|
||||
ParFloat(&drv->t2, PAR_NAN);
|
||||
|
||||
ParName("set"); ParFmt("%.2f"); ParTail("C");
|
||||
ParName("set"); ParFmt("%.2f"); ParTail("K");
|
||||
ParFloat(&drv->set, PAR_NAN);
|
||||
|
||||
ParName("running"); EaseUpdate(HAAKE_ON);
|
||||
@ -175,7 +175,7 @@ static void HaakeParDef(void *object) {
|
||||
|
||||
EaseBasePar(drv);
|
||||
EaseSendPar(drv);
|
||||
EaseDrivPar(drv, "%.2f", "C");
|
||||
EaseDrivPar(drv, "%.2f", "K");
|
||||
ParStdDef();
|
||||
EaseMsgPar(drv);
|
||||
}
|
||||
@ -206,18 +206,18 @@ static long HaakeRead(long pc, void *object) {
|
||||
|
||||
EaseWrite(eab, "F1");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
drv->t = atof(eab->ans);
|
||||
drv->t = atof(eab->ans) + 273.15;
|
||||
if (!drv->with2sensors) goto nof2;
|
||||
EaseWrite(eab, "F2");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
drv->t2 = atof(eab->ans);
|
||||
drv->t2 = atof(eab->ans) + 273.15;
|
||||
if (drv->t2 < -222) {
|
||||
drv->t2 = PAR_NAN;
|
||||
}
|
||||
nof2:
|
||||
EaseWrite(eab, "S");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
drv->set = atof(eab->ans);
|
||||
drv->set = atof(eab->ans) + 273.15;
|
||||
|
||||
skipGetSet:
|
||||
ParLog(drv);
|
||||
@ -227,7 +227,7 @@ static long HaakeRead(long pc, void *object) {
|
||||
static long HaakeStart(long pc, void *object) {
|
||||
Haake *drv = ParCast(&haakeClass, object);
|
||||
EaseBase *eab = object;
|
||||
|
||||
|
||||
switch (pc) { default: /* FSM BEGIN *******************************/
|
||||
EaseWrite(eab, "V");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
@ -239,6 +239,8 @@ static long HaakeStart(long pc, void *object) {
|
||||
goto quit;
|
||||
}
|
||||
ParPrintf(drv, eStatus, "connected to haake thermostat %s", eab->version);
|
||||
EaseWrite(eab, "W TE K");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
FsmCall(HaakeRead);
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
|
||||
@ -256,7 +258,7 @@ static long HaakeSet(long pc, void *object) {
|
||||
upd = EaseNextUpdate(drv);
|
||||
switch (upd) {
|
||||
case EASE_RUN:
|
||||
snprintf(cmd, sizeof cmd, "w sw %.5g", drv->d.targetValue);
|
||||
snprintf(cmd, sizeof cmd, "w sw %.5g", drv->d.targetValue-273.17);
|
||||
break;
|
||||
case HAAKE_ON:
|
||||
snprintf(cmd, sizeof cmd, "w ts%d", drv->running);
|
||||
|
Reference in New Issue
Block a user