2 Commits
1.2.4 ... 1.2.5

Author SHA1 Message Date
6c64b4cee8 Now compiles with warning flags for C++
Some checks failed
Test And Build / Lint (push) Successful in 4s
Test And Build / Build (push) Failing after 6s
2025-12-23 13:48:18 +01:00
df09b1949e Updated turboPmac version which applies compile flags to the C++ code as well 2025-12-23 13:36:21 +01:00
9 changed files with 64 additions and 24 deletions

View File

@@ -42,4 +42,5 @@ DBDS += turboPmac/sinqMotor/src/sinqMotor.dbd
DBDS += turboPmac/src/turboPmac.dbd DBDS += turboPmac/src/turboPmac.dbd
DBDS += src/detectorTower.dbd DBDS += src/detectorTower.dbd
USR_CFLAGS += -Wall -Wextra -Wunused-result -Wextra -Werror -fvisibility=hidden # -Wpedantic // Does not work because EPICS macros trigger warnings USR_CFLAGS += -Wall -Wextra -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
USR_CXXFLAGS += -Wall -Wextra -Wunused-result -Werror

View File

@@ -179,6 +179,10 @@ asynStatus detectorTowerAngleAxis::poll(bool *moving) {
} }
asynStatus detectorTowerAngleAxis::doPoll(bool *moving) { asynStatus detectorTowerAngleAxis::doPoll(bool *moving) {
// Suppress unused variable warning
(void)moving;
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nThe doPoll method " "Controller \"%s\", axis %d => %s, line %d\nThe doPoll method "
"of this axis type should not be reachable. This is a bug.\n", "of this axis type should not be reachable. This is a bug.\n",
@@ -187,9 +191,16 @@ asynStatus detectorTowerAngleAxis::doPoll(bool *moving) {
} }
asynStatus detectorTowerAngleAxis::doMove(double position, int relative, asynStatus detectorTowerAngleAxis::doMove(double position, int relative,
double min_velocity, double minVelocity,
double max_velocity, double maxVelocity,
double acceleration) { double acceleration) {
// Suppress unused variable warning
(void)relative;
(void)minVelocity;
(void)maxVelocity;
(void)acceleration;
double motorRecResolution = 0.0; double motorRecResolution = 0.0;
getAxisParamChecked(this, motorRecResolution, &motorRecResolution); getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
@@ -276,6 +287,9 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) {
// ========================================================================= // =========================================================================
// Suppress unused variable warning
(void)acceleration;
status = pC_->writeRead(axisNo_, "P350=8", response, 0); status = pC_->writeRead(axisNo_, "P350=8", response, 0);
if (status != asynSuccess) { if (status != asynSuccess) {
@@ -540,8 +554,9 @@ static const iocshArg *const CreateAxisArgs[] = {
&CreateAxisArg2, &CreateAxisArg2,
&CreateAxisArg3, &CreateAxisArg3,
}; };
static const iocshFuncDef configDetectorTowerCreateAxis = {"detectorTowerAxis", static const iocshFuncDef configDetectorTowerCreateAxis = {
4, CreateAxisArgs}; "detectorTowerAxis", 4, CreateAxisArgs,
"Create new instances of detectorTower axes."};
static void configDetectorTowerCreateAxisCallFunc(const iocshArgBuf *args) { static void configDetectorTowerCreateAxisCallFunc(const iocshArgBuf *args) {
detectorTowerCreateAxis(args[0].sval, args[1].ival, args[2].ival, detectorTowerCreateAxis(args[0].sval, args[1].ival, args[2].ival,
args[3].ival); args[3].ival);
@@ -595,7 +610,8 @@ static const iocshArg *const setDeferredMovementWaitArgs[] = {
&setDeferredMovementWaitArg0, &setDeferredMovementWaitArg1, &setDeferredMovementWaitArg0, &setDeferredMovementWaitArg1,
&setDeferredMovementWaitArg2}; &setDeferredMovementWaitArg2};
static const iocshFuncDef setDeferredMovementWaitDef = { static const iocshFuncDef setDeferredMovementWaitDef = {
"setDeferredMovementWait", 3, setDeferredMovementWaitArgs}; "setDeferredMovementWait", 3, setDeferredMovementWaitArgs,
"Set the wait time in seconds for the deferred movement."};
static void setDeferredMovementWaitCallFunc(const iocshArgBuf *args) { static void setDeferredMovementWaitCallFunc(const iocshArgBuf *args) {
setDeferredMovementWait(args[0].sval, args[1].ival, args[2].dval); setDeferredMovementWait(args[0].sval, args[1].ival, args[2].dval);

View File

@@ -56,13 +56,13 @@ class HIDDEN detectorTowerAngleAxis : public turboPmacAxis {
* *
* @param position * @param position
* @param relative * @param relative
* @param min_velocity * @param minVelocity
* @param max_velocity * @param maxVelocity
* @param acceleration * @param acceleration
* @return asynStatus * @return asynStatus
*/ */
asynStatus doMove(double position, int relative, double min_velocity, asynStatus doMove(double position, int relative, double minVelocity,
double max_velocity, double acceleration); double maxVelocity, double acceleration);
/** /**
* @brief Start a movement to the target positions of this axis and the * @brief Start a movement to the target positions of this axis and the

View File

@@ -26,7 +26,8 @@ detectorTowerController::detectorTowerController(
const char *portName, const char *ipPortConfigName, int numAxes, const char *portName, const char *ipPortConfigName, int numAxes,
double movingPollPeriod, double idlePollPeriod, double comTimeout) double movingPollPeriod, double idlePollPeriod, double comTimeout)
: turboPmacController(portName, ipPortConfigName, numAxes, movingPollPeriod, : turboPmacController(portName, ipPortConfigName, numAxes, movingPollPeriod,
idlePollPeriod, NUM_detectorTower_DRIVER_PARAMS) idlePollPeriod, comTimeout,
NUM_detectorTower_DRIVER_PARAMS)
{ {
@@ -1005,7 +1006,8 @@ static const iocshArg *const CreateControllerArgs[] = {
&CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2, &CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2,
&CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5}; &CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5};
static const iocshFuncDef configDetectorTowerCreateController = { static const iocshFuncDef configDetectorTowerCreateController = {
"detectorTowerController", 6, CreateControllerArgs}; "detectorTowerController", 6, CreateControllerArgs,
"Create a new instance of a detector tower controller."};
static void static void
configDetectorTowerCreateControllerCallFunc(const iocshArgBuf *args) { configDetectorTowerCreateControllerCallFunc(const iocshArgBuf *args) {
detectorTowerCreateController(args[0].sval, args[1].sval, args[2].ival, detectorTowerCreateController(args[0].sval, args[1].sval, args[2].ival,

View File

@@ -149,6 +149,10 @@ asynStatus detectorTowerLiftAxis::poll(bool *moving) {
} }
asynStatus detectorTowerLiftAxis::doPoll(bool *moving) { asynStatus detectorTowerLiftAxis::doPoll(bool *moving) {
// Suppress unused variable warnings
(void)moving;
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nThe doPoll method " "Controller \"%s\", axis %d => %s, line %d\nThe doPoll method "
"of this axis type should not be reachable. This is a bug.\n", "of this axis type should not be reachable. This is a bug.\n",
@@ -157,9 +161,14 @@ asynStatus detectorTowerLiftAxis::doPoll(bool *moving) {
} }
asynStatus detectorTowerLiftAxis::doMove(double position, int relative, asynStatus detectorTowerLiftAxis::doMove(double position, int relative,
double min_velocity, double minVelocity, double maxVelocity,
double max_velocity,
double acceleration) { double acceleration) {
// Suppress unused variable warnings
(void)relative;
(void)minVelocity;
(void)maxVelocity;
(void)acceleration;
double motorRecResolution = 0.0; double motorRecResolution = 0.0;
getAxisParamChecked(this, motorRecResolution, &motorRecResolution); getAxisParamChecked(this, motorRecResolution, &motorRecResolution);

View File

@@ -52,13 +52,13 @@ class HIDDEN detectorTowerLiftAxis : public turboPmacAxis {
* *
* @param position * @param position
* @param relative * @param relative
* @param min_velocity * @param minVelocity
* @param max_velocity * @param maxVelocity
* @param acceleration * @param acceleration
* @return asynStatus * @return asynStatus
*/ */
asynStatus doMove(double position, int relative, double min_velocity, asynStatus doMove(double position, int relative, double minVelocity,
double max_velocity, double acceleration); double maxVelocity, double acceleration);
/** /**
* @brief Calls the `reset` function of the associated angle axis. * @brief Calls the `reset` function of the associated angle axis.

View File

@@ -146,6 +146,10 @@ asynStatus detectorTowerSupportAxis::poll(bool *moving) {
} }
asynStatus detectorTowerSupportAxis::doPoll(bool *moving) { asynStatus detectorTowerSupportAxis::doPoll(bool *moving) {
// Suppress unused variable warnings
(void)moving;
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nThe doPoll method " "Controller \"%s\", axis %d => %s, line %d\nThe doPoll method "
"of this axis type should not be reachable. This is a bug.\n", "of this axis type should not be reachable. This is a bug.\n",

View File

@@ -56,13 +56,21 @@ class HIDDEN detectorTowerSupportAxis : public turboPmacAxis {
* *
* @param position * @param position
* @param relative * @param relative
* @param min_velocity * @param minVelocity
* @param max_velocity * @param maxVelocity
* @param acceleration * @param acceleration
* @return asynStatus * @return asynStatus
*/ */
asynStatus doMove(double position, int relative, double min_velocity, asynStatus doMove(double position, int relative, double minVelocity,
double max_velocity, double acceleration) { double maxVelocity, double acceleration) {
// Suppress unused variable warnings
(void)position;
(void)relative;
(void)minVelocity;
(void)maxVelocity;
(void)acceleration;
return asynSuccess; return asynSuccess;
} }