- Extended confvirtmot to allow for sequences of calls
- Extended confvirtmot to have a checkscript - Made sure that targets get updated when calling tasdrive - Fixed some output codes in tasdrive.c - Made tdchm invoke counters event message for Melone - Fixed the ConID inefficiency by caching the host name in asynnet.c - Added a traceActive function to trace SKIPPED: psi/tdchm.c
This commit is contained in:
35
tasdrive.c
35
tasdrive.c
@@ -43,7 +43,7 @@ static long TASSetValue(void *pData, SConnection * pCon, float value)
|
||||
|
||||
if (self->code > 5 && self->math->tasMode == ELASTIC) {
|
||||
SCWrite(pCon, "ERROR: cannot drive this motor in elastic mode",
|
||||
eError);
|
||||
eLogError);
|
||||
return HWFault;
|
||||
}
|
||||
setTasPar(&self->math->target, self->math->tasMode, self->code, value);
|
||||
@@ -146,7 +146,7 @@ static float TASGetValue(void *pData, SConnection * pCon)
|
||||
&self->math->current);
|
||||
if (status < 0) {
|
||||
SCWrite(pCon, "ERROR: out of memory calculating Q-E variables",
|
||||
eError);
|
||||
eLogError);
|
||||
return -999.99;
|
||||
}
|
||||
if (self->math->tasMode == ELASTIC) {
|
||||
@@ -182,7 +182,7 @@ static float TASQMGetValue(void *pData, SConnection * pCon)
|
||||
angles, &self->math->current);
|
||||
if (status < 0) {
|
||||
SCWrite(pCon, "ERROR: out of memory calculating Q-E variables",
|
||||
eError);
|
||||
eLogError);
|
||||
return -999.99;
|
||||
}
|
||||
if (self->math->tasMode == ELASTIC) {
|
||||
@@ -250,6 +250,8 @@ static float getMotorValue(pMotor mot, SConnection * pCon)
|
||||
GetDrivablePosition(mot, pCon, &val);
|
||||
return val;
|
||||
}
|
||||
/*--------------------- In devexec.c --------------------------------------*/
|
||||
void InvokeNewTarget(pExeList self, char *name, float target);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static int startTASMotor(pMotor mot, SConnection * pCon, char *name,
|
||||
@@ -268,20 +270,25 @@ static int startTASMotor(pMotor mot, SConnection * pCon, char *name,
|
||||
MotorGetPar(mot, "fixed", &fixed);
|
||||
if (ABS(fixed - 1.0) < .1) {
|
||||
snprintf(buffer, 131, "WARNING: %s is FIXED", name);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
SCWrite(pCon, buffer, eLog);
|
||||
return OKOK;
|
||||
}
|
||||
}
|
||||
mot->stopped = 0;
|
||||
if (ABS(val - target) > MOTPREC) {
|
||||
pDriv = GetDrivableInterface(mot);
|
||||
SCStartBuffering(pCon);
|
||||
/* SCStartBuffering(pCon); */
|
||||
status = pDriv->SetValue(mot, pCon, (float) target);
|
||||
mes = SCEndBuffering(pCon);
|
||||
/*
|
||||
to force updates on targets
|
||||
*/
|
||||
InvokeNewTarget(pServ->pExecutor, name, target);
|
||||
/*mes = SCEndBuffering(pCon);
|
||||
if (status != OKOK) {
|
||||
SCPrintf(pCon,eLogError, GetCharArray(mes));
|
||||
return status;
|
||||
}
|
||||
*/
|
||||
}
|
||||
writeMotPos(pCon, silent, name, val, target);
|
||||
return status;
|
||||
@@ -316,7 +323,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
status = startTASMotor(self->math->motors[MCV], pCon, "mcv",
|
||||
curve, silent);
|
||||
if (status != OKOK) {
|
||||
SCWrite(pCon,"WARNING: monochromator vertical curvature motor failed to start", eWarning);
|
||||
SCWrite(pCon,"WARNING: monochromator vertical curvature motor failed to start", eLog);
|
||||
SCSetInterrupt(pCon,eContinue);
|
||||
}
|
||||
}
|
||||
@@ -327,7 +334,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
status = startTASMotor(self->math->motors[MCH], pCon, "mch",
|
||||
curve, silent);
|
||||
if (status != OKOK) {
|
||||
SCWrite(pCon,"WARNING: monochromator horizontal curvature motor failed to start", eWarning);
|
||||
SCWrite(pCon,"WARNING: monochromator horizontal curvature motor failed to start", eLog);
|
||||
SCSetInterrupt(pCon,eContinue);
|
||||
}
|
||||
}
|
||||
@@ -354,7 +361,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
status = startTASMotor(self->math->motors[ACV], pCon, "acv",
|
||||
curve, silent);
|
||||
if (status != OKOK) {
|
||||
SCWrite(pCon,"WARNING: analyzer vertical curvature motor failed to start", eWarning);
|
||||
SCWrite(pCon,"WARNING: analyzer vertical curvature motor failed to start", eLog);
|
||||
SCSetInterrupt(pCon,eContinue);
|
||||
}
|
||||
}
|
||||
@@ -364,7 +371,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
status = startTASMotor(self->math->motors[ACH], pCon, "ach",
|
||||
curve, silent);
|
||||
if (status != OKOK) {
|
||||
SCWrite(pCon,"WARNING: analyzer horizontal curvature motor failed to start", eWarning);
|
||||
SCWrite(pCon,"WARNING: analyzer horizontal curvature motor failed to start", eLog);
|
||||
SCSetInterrupt(pCon,eContinue);
|
||||
}
|
||||
}
|
||||
@@ -422,7 +429,7 @@ static int checkQMotorLimits(ptasMot self, SConnection * pCon,
|
||||
if (status != 1) {
|
||||
retVal = 0;
|
||||
snprintf(pBueffel, 256, "ERROR: limit violation an a3: %s", error);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +441,7 @@ static int checkQMotorLimits(ptasMot self, SConnection * pCon,
|
||||
if (status != 1) {
|
||||
retVal = 0;
|
||||
snprintf(pBueffel, 256, "ERROR: limit violation an a4: %s", error);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
}
|
||||
|
||||
if (driveTilt == 1) {
|
||||
@@ -445,7 +452,7 @@ static int checkQMotorLimits(ptasMot self, SConnection * pCon,
|
||||
if (status != 1) {
|
||||
retVal = 0;
|
||||
snprintf(pBueffel, 256, "ERROR: limit violation an SGU: %s", error);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
}
|
||||
|
||||
pDrivInt = GetDrivableInterface(self->math->motors[SGL]);
|
||||
@@ -455,7 +462,7 @@ static int checkQMotorLimits(ptasMot self, SConnection * pCon,
|
||||
if (status != 1) {
|
||||
retVal = 0;
|
||||
snprintf(pBueffel, 256, "ERROR: limit violation an SGL: %s", error);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
|
||||
Reference in New Issue
Block a user