- arrobj.c: fixed bug when format sepcifier in array content
- fsm.c: fixed bug - ipsdriv.c: fixed problem with old PS: no negative field, resolution
This commit is contained in:
16
ipsdriv.c
16
ipsdriv.c
@ -194,7 +194,11 @@ void IpsParDef(void *object)
|
||||
ParPrintf(drv, eWarning, "limit is too high, set back to %.5g\n",
|
||||
drv->maxlimit);
|
||||
}
|
||||
drv->d.lowerLimit = -drv->d.upperLimit;
|
||||
if (drv->d.b.syntax) { /* IPS */
|
||||
drv->d.lowerLimit = -drv->d.upperLimit;
|
||||
} else { /* PS */
|
||||
drv->d.lowerLimit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ParName("ramp");
|
||||
@ -609,8 +613,10 @@ static long IpsStart(long pc, void *object)
|
||||
case __LINE__: /**********************************/
|
||||
if (0 == strncmp(eab->version, "IPS120", 6)) {
|
||||
eab->syntax = 1;
|
||||
drv->d.lowerLimit = -drv->d.upperLimit;
|
||||
} else if (0 == strncmp(eab->version, "PS", 2)) {
|
||||
eab->syntax = 0;
|
||||
drv->d.lowerLimit = 0;
|
||||
} else {
|
||||
snprintf(msg, sizeof msg,
|
||||
"unknown power supply version: %s", eab->version);
|
||||
@ -699,6 +705,7 @@ static long IpsChangeField(long pc, void *object)
|
||||
float fld;
|
||||
float step;
|
||||
float ramp;
|
||||
float eps;
|
||||
time_t delay;
|
||||
|
||||
switch (pc) {
|
||||
@ -905,7 +912,12 @@ static long IpsChangeField(long pc, void *object)
|
||||
fld = drv->current - step;
|
||||
} else {
|
||||
fld = drv->d.targetValue;
|
||||
if (fabs(drv->current - drv->d.targetValue) < 1e-5)
|
||||
if (eab->syntax) {
|
||||
eps = 7.0e-5; /* IPS has 4 digits after decimal point */
|
||||
} else {
|
||||
eps = 7.0e-4; /* PS has 3 digits after decimal point */
|
||||
}
|
||||
if (fabs(drv->current - drv->d.targetValue) < eps)
|
||||
goto target_reached;
|
||||
}
|
||||
if (fabs(fld) >= drv->trainedTo) {
|
||||
|
Reference in New Issue
Block a user