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:
2025-05-14 15:49:37 +02:00
parent 9792697d03
commit 9bc90cff61
5 changed files with 48 additions and 70 deletions

View File

@ -233,13 +233,14 @@ It calls `doReset` and performs some fast polls after `doReset` returns.
- `poll`: This is a wrapper around `doPoll` which performs some bookkeeping tasks before and after calling `doPoll`:
Before calling `doPoll`:
- Reset the status problem flag, the communication error flag and the error message.
- Check if the paramLib already contains an old error message. If so, put it into a temporary bufffer
After calling `doPoll`:
- Call `checkMovTimeoutWatchdog`. If the movement timed out, create an error message for the user
- Update the readback-value for the axis enablement.
- Reset `motorStatusProblem_`, `motorStatusCommsError_` and `motorMessageText_` if `doPoll` returned `asynSuccess`
- If `doPoll` returns anything other than `asynSuccess` or if an old error message is waiting in the temporary buffer, set `motorStatusProblem` to true, otherwise to false. If an old error message is waiting in the temporary buffer, but `doPoll` returned `asynSuccess`, overwrite the paramLib entry for `motorMessageText` with the old error message.
- Run `callParamCallbacks`
- Reset `motorMessageText` AFTER updating the PVs. This makes sure that the error message is shown for at least one poll cycle.
- Return the status of `doPoll`
- `motorPosition`: Returns the parameter library value of the motor position, accounted for the motor record resolution (see section "Motor record resolution MRES")
- `setMotorPosition`: Writes the given value into the parameter library, accounted for the motor record resolution (see section "Motor record resolution MRES")