- Connections write timeouts were incorrectly handled in asynnetc. Fixed.
- Implemented the desired run/drive behaviour: drive waits for what it started run starts, and success waits for everything to finish. This required changes to a lot of files. - Fixed a bug in remob which supressed required messages
This commit is contained in:
20
motorsec.c
20
motorsec.c
@@ -96,7 +96,14 @@ static long SecMotorRun(void *sulf, SConnection * pCon, float fNew)
|
||||
{
|
||||
pMotor self = (pMotor) sulf;
|
||||
hdbValue v;
|
||||
|
||||
int accesscode;
|
||||
|
||||
assert(SICSHdbGetPar(self, NULL, "accesscode", &v) == 1);
|
||||
accesscode = (int)v.v.doubleValue;
|
||||
if(!SCMatchRights(pCon, accesscode)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
v = MakeHdbFloat(fNew);
|
||||
return SetHipadabaPar(self->pDescriptor->parNode, v, pCon);
|
||||
}
|
||||
@@ -206,13 +213,13 @@ static int checkPosition(pMotor self, SConnection * pCon)
|
||||
SecMotorGetPar(self, "maxretry", &maxretry);
|
||||
if (ABS(target - hard) > precision) {
|
||||
if (self->retryCount >= (int) maxretry) {
|
||||
SCPrintf(pCon, eError,
|
||||
SCPrintf(pCon, eLogError,
|
||||
"ERROR: Aborting %s after %d retries, off position by %f",
|
||||
self->name, (int) maxretry, target - hard);
|
||||
return HWFault;
|
||||
}
|
||||
self->retryCount++;
|
||||
SCPrintf(pCon, eWarning, "WARNING: %s off position by %f, restarting",
|
||||
SCPrintf(pCon, eLog, "WARNING: %s off position by %f, restarting",
|
||||
self->name, target - hard);
|
||||
node = GetHipadabaNode(self->pDescriptor->parNode, "status");
|
||||
assert(node != NULL);
|
||||
@@ -279,6 +286,8 @@ static int SecMotorStatus(void *sulf, SConnection * pCon)
|
||||
v.v.text);
|
||||
status = HWFault;
|
||||
}
|
||||
ReleaseHdbValue(&v);
|
||||
|
||||
/*
|
||||
* when terminating: force an update of the position.
|
||||
*/
|
||||
@@ -608,8 +617,9 @@ pMotor SecMotorInit(char *name)
|
||||
free(pM);
|
||||
return NULL;
|
||||
}
|
||||
/* TODO: give it a sicsdev here */
|
||||
node = pM->pDescriptor->parNode;
|
||||
SetHdbProperty(node,"type","drivable");
|
||||
SetHdbProperty(node,"sicsdev", name);
|
||||
pM->objectNode = node;
|
||||
AppendHipadabaCallback(pM->pDescriptor->parNode,
|
||||
MakeHipadabaCallback(SecMotorCallback, pM, NULL));
|
||||
@@ -674,7 +684,7 @@ pMotor SecMotorInit(char *name)
|
||||
SetHdbProperty(child, "__save", "true");
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
child = MakeSICSHdbPar("precision", usMugger, MakeHdbFloat(.1));
|
||||
child = MakeSICSHdbPar("precision", usMugger, MakeHdbFloat(.01));
|
||||
SetHdbProperty(child, "__save", "true");
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user