bug fixes and enhancements related to evcontroller
This commit is contained in:
37
lcdriv.c
37
lcdriv.c
@ -32,12 +32,13 @@ typedef struct {
|
||||
Eve eve;
|
||||
float t[4]; /* set t. & 3 temperatures */
|
||||
int dig[4]; /* format for these */
|
||||
float coldvalve;
|
||||
int gas;
|
||||
float gas;
|
||||
int remote;
|
||||
int hot;
|
||||
} LcDriv;
|
||||
|
||||
static long LcSetGas(long pc, void *obj);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#define A EVE_ACTPAR
|
||||
#define L EVE_LOGPAR
|
||||
@ -52,7 +53,7 @@ void LcPars(LcDriv *me, EveParArg *arg) {
|
||||
sprintf(fmt, "%%.%df\tK", me->dig[3]);
|
||||
EveFloatPar(arg, "t3", &me->t[3], fmt, usInternal, (me->dig[3] >= 0) * A + L);
|
||||
|
||||
EveFloatPar(arg, "coldvalve", &me->coldvalve, "%.1f\t%%", usInternal, A + L);
|
||||
EveFloatCmd(arg, "gas", &me->gas, "%.1f\t%%", LcSetGas, usUser, A + L);
|
||||
|
||||
EveIntPar(arg, "dig1", &me->dig[1], usUser, S);
|
||||
EveIntPar(arg, "dig2", &me->dig[2], usUser, S);
|
||||
@ -95,10 +96,10 @@ static int LcRead(long pc, LcDriv *me) {
|
||||
EveWrite(eve, "X");
|
||||
FSM_NEXT
|
||||
LcStatus(me); /* check for errors */
|
||||
if (!me->remote) goto skiprmt;
|
||||
EveWrite(eve, "C0");
|
||||
me->remote = 0;
|
||||
FSM_NEXT
|
||||
// if (!me->remote) goto skiprmt;
|
||||
// EveWrite(eve, "C0");
|
||||
// me->remote = 0;
|
||||
// FSM_NEXT
|
||||
|
||||
skiprmt:
|
||||
if (me->dig[1] < 0) goto skip1;
|
||||
@ -117,9 +118,27 @@ static int LcRead(long pc, LcDriv *me) {
|
||||
FSM_NEXT
|
||||
me->t[3] = OiGetFlt(eve, me->dig[3], NULL);
|
||||
skip3:
|
||||
EveWrite(eve, "R7"); /* read gas flow */
|
||||
FSM_END
|
||||
}
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static long LcSetGas(long pc, void *obj) {
|
||||
LcDriv *me = obj;
|
||||
Eve *eve=&me->eve;
|
||||
pEVControl evc=eve->evc;
|
||||
float fld;
|
||||
float step;
|
||||
float ramp;
|
||||
char buf[4];
|
||||
SConnection *pCon;
|
||||
int a;
|
||||
|
||||
FSM_BEGIN
|
||||
if (me->remote) goto skipremote;
|
||||
EveWrite(eve, "C1");
|
||||
FSM_NEXT
|
||||
skipremote:
|
||||
OiSet(eve, "G", me->gas, 1); /* cold valve setting */
|
||||
FSM_NEXT
|
||||
me->coldvalve = OiGetFlt(eve, 1, NULL);
|
||||
quit:
|
||||
FSM_END
|
||||
}
|
||||
|
Reference in New Issue
Block a user