Compare commits

..

1 Commits
1.6.0 ... main

Author SHA1 Message Date
2578081814 Added dedicated interface function for setting the operation mode.
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s
2026-01-20 16:47:36 +01:00
4 changed files with 20 additions and 1 deletions

View File

@@ -331,6 +331,8 @@ available in the IOC shell.
This function is also available in the IOC shell. This function is also available in the IOC shell.
- `setScaleMovTimeout`: Set a scaling factor for the expected movement time. - `setScaleMovTimeout`: Set a scaling factor for the expected movement time.
This function is also available in the IOC shell. This function is also available in the IOC shell.
- `setMode`: This is an empty function which should be overwritten by concrete
driver implementations.
#### msgPrintControl.h #### msgPrintControl.h
In addition to the two extension classes this library also includes a mechanism In addition to the two extension classes this library also includes a mechanism

View File

@@ -732,6 +732,11 @@ void sinqAxis::setTargetPosition(double targetPosition) {
pSinqA_->targetPosition = targetPosition; pSinqA_->targetPosition = targetPosition;
} }
asynStatus sinqAxis::setMode(int mode) {
(void)mode;
return asynSuccess;
}
// ============================================================================= // =============================================================================
// IOC shell functions // IOC shell functions
extern "C" { extern "C" {

View File

@@ -434,6 +434,18 @@ class HIDDEN sinqAxis : public asynMotorAxis {
*/ */
asynStatus assertConnected(); asynStatus assertConnected();
/**
* @brief Set the operation mode (position or velocity) of the axis. It
* should be implemented by a child class of sinqAxis.
*
* This function is called from within sinqController::writeInt32 if a new
* operation mode has been set.
*
* @param mode: New operation mode. 0 is position mode, 1 is velocity mode.
* @return asynStatus
*/
virtual asynStatus setMode(int mode);
/** /**
* @brief Return a pointer to the axis controller. * @brief Return a pointer to the axis controller.
* *

View File

@@ -510,7 +510,7 @@ asynStatus sinqController::writeInt32(asynUser *pasynUser, epicsInt32 value) {
// for velocity mode): // for velocity mode):
if (value == 0 || value == 1) { if (value == 0 || value == 1) {
setAxisParamChecked(axis, motorMode, value); setAxisParamChecked(axis, motorMode, value);
return asynMotorController::writeInt32(pasynUser, value); return axis->setMode(value);
} else { } else {
int axisNo; int axisNo;
getAddress(pasynUser, &axisNo); getAddress(pasynUser, &axisNo);