2 Commits

Author SHA1 Message Date
2636296539 Removed debug messages 2025-05-15 13:50:26 +02:00
b09f081db9 Updated turboPmac and sinqMotor versions 2025-05-15 13:35:16 +02:00
4 changed files with 53 additions and 11 deletions

View File

@ -22,6 +22,20 @@ seleneAngleAxis::seleneAngleAxis(seleneGuideController *pController, int axisNo,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__);
}
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
}
asynStatus seleneAngleAxis::stop(double acceleration) {
@ -59,7 +73,7 @@ asynStatus seleneAngleAxis::targetPosition(double *targetPosition) {
asynStatus seleneAngleAxis::doPoll(bool *moving) {
char userMessage[pC_->MAXBUF_] = {0};
char errorMessage[pC_->MAXBUF_] = {0};
// In the doPoll method of `seleneLiftAxis`, the parameters
// `motorStatusMoving` and `motorStatusDone` of this axis have already been
@ -189,15 +203,15 @@ asynStatus seleneAngleAxis::doPoll(bool *moving) {
// axis.
pl_status =
pC_->getStringParam(liftAxis_->axisNo(), pC_->motorMessageText(),
sizeof(userMessage), userMessage);
sizeof(errorMessage), errorMessage);
if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText",
liftAxis_->axisNo(),
__PRETTY_FUNCTION__, __LINE__);
}
if (strlen(userMessage) != 0) {
pl_status = setStringParam(pC_->motorMessageText(), userMessage);
if (strlen(errorMessage) != 0) {
pl_status = setStringParam(pC_->motorMessageText(), errorMessage);
if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__,

View File

@ -99,6 +99,20 @@ seleneLiftAxis::seleneLiftAxis(seleneGuideController *pC, int axis1No,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__);
}
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
}
asynStatus seleneLiftAxis::init() {
@ -493,10 +507,6 @@ asynStatus seleneLiftAxis::startCombinedMove() {
if (status != asynSuccess) {
return status;
}
errlogPrintf("Target lift: %lf, Target angle: %lf\n", liftTargetPosition,
angleTargetPosition);
auto targetPositions =
positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition);
@ -516,8 +526,6 @@ asynStatus seleneLiftAxis::startCombinedMove() {
targetPositions[0], targetPositions[1], targetPositions[2],
targetPositions[3], targetPositions[4], targetPositions[5]);
errlogPrintf("%s\n", command);
// No answer expected
return pC_->writeRead(axisNo_, command, response, 0);
}

View File

@ -80,6 +80,20 @@ seleneOffsetAxis::seleneOffsetAxis(seleneGuideController *pController,
pC_->paramLibAccessFailed(status, "motorCanDisable", axisNo_,
__PRETTY_FUNCTION__, __LINE__);
}
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
}
asynStatus seleneOffsetAxis::init() {
@ -199,6 +213,12 @@ asynStatus seleneOffsetAxis::doPoll(bool *moving) {
// Update the parameter library
if (error != 0) {
status = setStringParam(pC_->motorMessageText(), userMessage);
if (status != asynSuccess) {
return pC_->paramLibAccessFailed(status, "motorMessageText",
axisNo_, __PRETTY_FUNCTION__,
__LINE__);
}
status = setIntegerParam(pC_->motorStatusProblem(), true);
if (status != asynSuccess) {
return pC_->paramLibAccessFailed(status, "motorStatusProblem_",