Adapted to new API
Test And Build / Lint (push) Failing after 5s
Test And Build / Build (push) Failing after 7s

This commit is contained in:
mathis_s committed 2026-11-24 09:46:50 +01:00
1 parent 0803dec4dd
commit ca2436ff74
1 file changed
+20 -19
+20 -19
View File
@@ -91,9 +91,9 @@ turboPmacAxis::turboPmacAxis(turboPmacController *pC, int axisNo,
}
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// motorErrorMessage is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
status = setStringParam(pC_->motorErrorMessage(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
@@ -180,8 +180,9 @@ asynStatus turboPmacAxis::init() {
axisNo_, axisNo_, axisNo_, axisNo_, axisNo_, axisNo_, axisNo_);
status = pC_->writeRead(axisNo_, command, response, 7);
msgPrintControlOptions options = {.maxRepetitions = 1, .minRepetitions = 0};
msgPrintControlKey keyDisconnected = msgPrintControlKey(
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, 1);
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, options);
if (status != asynSuccess) {
if (pC_->getMsgPrintControl().shouldBePrinted(keyDisconnected, true,
@@ -339,7 +340,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
}
if (timedOut) {
setAxisParamChecked(this, motorMessageText,
setAxisParamChecked(this, motorErrorMessage,
"Timed out while waiting for a handshake");
pTurboPmacA_->waitForHandshake = false;
}
@@ -459,7 +460,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
pC_->getMsgPrintControl().getSuffix());
}
resetCountStatus = false;
setAxisParamChecked(this, motorMessageText, "Emergency stop");
setAxisParamChecked(this, motorErrorMessage, "Emergency stop");
break;
case -3:
// Disabled
@@ -552,7 +553,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
userMessage, sizeof(userMessage),
"Reached unknown state P%2.2d00 = %d. Please call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
}
if (resetCountStatus) {
@@ -616,7 +617,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->getMsgPrintControl().getSuffix());
}
setAxisParamChecked(this, motorMessageText,
setAxisParamChecked(this, motorErrorMessage,
"Target position would exceed software limits");
break;
case 5:
@@ -632,7 +633,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->getMsgPrintControl().getSuffix());
}
setAxisParamChecked(this, motorMessageText,
setAxisParamChecked(this, motorErrorMessage,
"Axis received move command while it is still "
"moving. Please call the support.");
break;
@@ -653,7 +654,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"(P%2.2d01 = "
"%d). Please call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 9:
if (pC_->getMsgPrintControl().shouldBePrinted(
@@ -672,7 +673,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"No feedback from auxiliary device before movement (P%2.2d01 = "
"%d). Please call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 10:
/*
@@ -698,7 +699,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"the SPS for errors (if available). "
"Otherwise please call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 11:
// Following error
@@ -718,7 +719,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"Check if movement range is blocked. "
"Otherwise please call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 12:
@@ -736,7 +737,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"for errors (if available). Otherwise please call "
"the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 13:
@@ -755,7 +756,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"Driver hardware error (P%2.2d01 = 13). Please call the "
"support.",
axisNo_);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
case 14:
// EPICS should already prevent this issue in the first place,
@@ -773,7 +774,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
"Move command exceeds hardware limits (P%2.2d01 = %d). Please "
"call the support.",
axisNo_, error);
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
default:
@@ -787,7 +788,7 @@ asynStatus turboPmacAxis::handleError(int error, char *userMessage,
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, axisNo_,
error, pC_->getMsgPrintControl().getSuffix());
}
setAxisParamChecked(this, motorMessageText, userMessage);
setAxisParamChecked(this, motorErrorMessage, userMessage);
break;
}
return status;
@@ -1104,7 +1105,7 @@ asynStatus turboPmacAxis::rereadEncoder() {
"disabled before rereading the encoder.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
setAxisParamChecked(
this, motorMessageText,
this, motorErrorMessage,
"Axis must be disabled before rereading the encoder.");
return asynError;
} else {
@@ -1167,7 +1168,7 @@ asynStatus turboPmacAxis::enable(bool on) {
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
axStatus);
setAxisParamChecked(this, motorMessageText,
setAxisParamChecked(this, motorErrorMessage,
"Axis cannot be disabled while it is moving.");
pTurboPmacA_->enableDisable = false;
return asynError;
@@ -1252,7 +1253,7 @@ asynStatus turboPmacAxis::enable(bool on) {
// Output message to user
snprintf(command, sizeof(command), "Failed to %s within %d seconds",
on ? "enable" : "disable", timeout_enable_disable);
setAxisParamChecked(this, motorMessageText, command);
setAxisParamChecked(this, motorErrorMessage, command);
// Enabling / disabling procedure failed
pTurboPmacA_->enableDisable = false;