Simplified paramLib access and show error messages for one poll cycle
Simplified getting and setting paramLib entries via a macro and created a mechanism within poll() which makes sure that error messages are shown for at least one poll cycle. Also moved MAXBUF_ to the SinqController level.
This commit is contained in:
@ -327,8 +327,17 @@ asynStatus sinqAxis::poll(bool *moving) {
|
||||
message entry which is currently in the paramLib.
|
||||
*/
|
||||
if (poll_status != asynSuccess || waitingMessage[0] != '\0') {
|
||||
/*
|
||||
If doPoll cleared the error message paramLib entry, but an old message
|
||||
is still waiting, set the old message.
|
||||
*/
|
||||
getAxisParamChecked(this, motorMessageText, &newMessage);
|
||||
if (newMessage[0] == '\0') {
|
||||
setAxisParamChecked(this, motorMessageText, waitingMessage);
|
||||
}
|
||||
setAxisParamChecked(this, motorStatusProblem, true);
|
||||
} else {
|
||||
// No errors are waiting -> Clear everything.
|
||||
setAxisParamChecked(this, motorMessageText, "");
|
||||
setAxisParamChecked(this, motorStatusProblem, false);
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ asynStatus sinqController::checkComTimeoutWatchdog(sinqAxis *axis) {
|
||||
asynStatus status =
|
||||
checkComTimeoutWatchdog(axis->axisNo(), errorMessage, MAXBUF_);
|
||||
if (status == asynError) {
|
||||
setAxisParamChecked(axis, motorMessageText, motorMessage);
|
||||
setAxisParamChecked(axis, motorMessageText, errorMessage);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user