diff --git a/src/detectorTowerAngleAxis.cpp b/src/detectorTowerAngleAxis.cpp index 337282d..69cb300 100644 --- a/src/detectorTowerAngleAxis.cpp +++ b/src/detectorTowerAngleAxis.cpp @@ -1,5 +1,7 @@ #include "detectorTowerAngleAxis.h" #include "detectorTowerController.h" +#include "detectorTowerLiftAxis.h" +#include "detectorTowerSupportAxis.h" #include "turboPmacController.h" #include #include @@ -172,7 +174,7 @@ asynStatus detectorTowerAngleAxis::poll(bool *moving) { if (axisNo() < liftAxis()->axisNo() && axisNo() < supportAxis()->axisNo()) { status = pC_->pollDetectorAxes(moving, this, liftAxis(), supportAxis()); } else { - getAxisParamChecked(this, motorStatusMoving, &moving); + getAxisParamChecked(this, motorStatusMoving, moving); } setWasMoving(*moving); return status; @@ -204,10 +206,7 @@ asynStatus detectorTowerAngleAxis::doMove(double position, int relative, asynStatus detectorTowerAngleAxis::startCombinedMove() { // Status of read-write-operations of ASCII commands to the controller - asynStatus rwStatus = asynSuccess; - - // Status of parameter library operations - asynStatus plStatus = asynSuccess; + asynStatus status = asynSuccess; char command[pC_->MAXBUF_] = {0}; char response[pC_->MAXBUF_] = {0}; @@ -252,12 +251,12 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() { pC_->lock(); // We don't expect an answer - rwStatus = pC_->writeRead(axisNo_, command, response, 0); + status = pC_->writeRead(axisNo_, command, response, 0); // Free the controller again pC_->unlock(); - if (rwStatus != asynSuccess) { + if (status != asynSuccess) { asynPrint( pC_->pasynUser(), ASYN_TRACE_ERROR, "Controller \"%s\", axis %d => %s, line %d\nStarting movement to " @@ -268,24 +267,21 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() { callParamCallbacks(); } - return rwStatus; + return status; } asynStatus detectorTowerAngleAxis::stop(double acceleration) { // Status of read-write-operations of ASCII commands to the controller - asynStatus rwStatus = asynSuccess; - - // Status of parameter library operations - asynStatus plStatus = asynSuccess; + asynStatus status = asynSuccess; char response[pC_->MAXBUF_] = {0}; // ========================================================================= - rwStatus = pC_->writeRead(axisNo_, "P350=8", response, 0); + status = pC_->writeRead(axisNo_, "P350=8", response, 0); - if (rwStatus != asynSuccess) { + if (status != asynSuccess) { asynPrint( pC_->pasynUser(), ASYN_TRACE_ERROR, "Controller \"%s\", axis %d => %s, line %d\nStopping the movement " @@ -300,7 +296,7 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) { startingDeferredMovement_ = false; deferredMovementWait_ = false; - return rwStatus; + return status; } // The detector tower axis uses absolute encoders @@ -315,16 +311,16 @@ detectorTowerAngleAxis::toggleWorkingChangerState(bool toChangingPosition) { char response[pC_->MAXBUF_] = {0}; // Status of read-write-operations of ASCII commands to the controller - asynStatus rwStatus = asynSuccess; + asynStatus status = asynSuccess; bool moving = false; int positionState = 0; // ========================================================================= - rwStatus = poll(&moving); - if (rwStatus != asynSuccess) { - return rwStatus; + status = poll(&moving); + if (status != asynSuccess) { + return status; } getAxisParamChecked(this, positionStateRBV, &positionState); @@ -365,9 +361,9 @@ detectorTowerAngleAxis::toggleWorkingChangerState(bool toChangingPosition) { // Move the axis into changer or working position if (toChangingPosition) { - rwStatus = pC_->writeRead(axisNo_, "P350=2", response, 0); + status = pC_->writeRead(axisNo_, "P350=2", response, 0); } else { - rwStatus = pC_->writeRead(axisNo_, "P350=3", response, 0); + status = pC_->writeRead(axisNo_, "P350=3", response, 0); } setAxisParamChecked(this, changeStateRBV, toChangingPosition); @@ -421,7 +417,6 @@ asynStatus detectorTowerAngleAxis::adjustOrigin(double newOrigin) { asynStatus detectorTowerAngleAxis::doReset() { char response[pC_->MAXBUF_] = {0}; - asynStatus plStatus = asynSuccess; int positionState = 0; getAxisParamChecked(this, positionStateRBV, &positionState); diff --git a/src/detectorTowerAngleAxis.h b/src/detectorTowerAngleAxis.h index 15fa67c..2ed5f84 100644 --- a/src/detectorTowerAngleAxis.h +++ b/src/detectorTowerAngleAxis.h @@ -2,13 +2,6 @@ #define detectorTowerAngleAxis_H #include "detectorTowerController.h" #include "turboPmacAxis.h" -#include - -// Forward declaration of the controller class to resolve the cyclic dependency -// between the controller and the axis .h-file. See -// https://en.cppreference.com/w/cpp/language/class. -class detectorTowerLiftAxis; -class detectorTowerSupportAxis; class detectorTowerAngleAxis : public turboPmacAxis { public: diff --git a/src/detectorTowerController.cpp b/src/detectorTowerController.cpp index 98c7d68..80c2589 100644 --- a/src/detectorTowerController.cpp +++ b/src/detectorTowerController.cpp @@ -1,6 +1,7 @@ #include "detectorTowerController.h" #include "detectorTowerAngleAxis.h" -#include "turboPmacController.h" +#include "detectorTowerLiftAxis.h" +#include "detectorTowerSupportAxis.h" #include #include #include diff --git a/src/detectorTowerController.h b/src/detectorTowerController.h index 73bf130..06dbb4c 100644 --- a/src/detectorTowerController.h +++ b/src/detectorTowerController.h @@ -8,11 +8,15 @@ #ifndef detectorTowerController_H #define detectorTowerController_H -#include "detectorTowerAngleAxis.h" -#include "detectorTowerLiftAxis.h" -#include "detectorTowerSupportAxis.h" #include "turboPmacController.h" +// Forward declaration of the axis classes to resolve the cyclic dependency +// between the controller and the axis .h-file. See +// https://en.cppreference.com/w/cpp/language/class. +class detectorTowerAngleAxis; +class detectorTowerLiftAxis; +class detectorTowerSupportAxis; + class detectorTowerController : public turboPmacController { public: diff --git a/src/detectorTowerLiftAxis.cpp b/src/detectorTowerLiftAxis.cpp index 0d13db3..7f4ee4f 100644 --- a/src/detectorTowerLiftAxis.cpp +++ b/src/detectorTowerLiftAxis.cpp @@ -1,6 +1,7 @@ #include "detectorTowerLiftAxis.h" #include "detectorTowerAngleAxis.h" #include "detectorTowerController.h" +#include "detectorTowerSupportAxis.h" #include "turboPmacController.h" #include #include @@ -138,7 +139,7 @@ asynStatus detectorTowerLiftAxis::poll(bool *moving) { status = pC_->pollDetectorAxes(moving, angleAxis(), this, angleAxis()->supportAxis()); } else { - getAxisParamChecked(this, motorStatusMoving, &moving); + getAxisParamChecked(this, motorStatusMoving, moving); } setWasMoving(*moving); return status; diff --git a/src/detectorTowerLiftAxis.h b/src/detectorTowerLiftAxis.h index 2f6b7cf..da170a6 100644 --- a/src/detectorTowerLiftAxis.h +++ b/src/detectorTowerLiftAxis.h @@ -3,11 +3,6 @@ #include "detectorTowerController.h" #include "turboPmacAxis.h" -// Forward declaration of the controller class to resolve the cyclic dependency -// between the controller and the axis .h-file. See -// https://en.cppreference.com/w/cpp/language/class. -class detectorTowerAngleAxis; - class detectorTowerLiftAxis : public turboPmacAxis { public: /** diff --git a/src/detectorTowerSupportAxis.cpp b/src/detectorTowerSupportAxis.cpp index a9f64e5..c971233 100644 --- a/src/detectorTowerSupportAxis.cpp +++ b/src/detectorTowerSupportAxis.cpp @@ -1,6 +1,7 @@ #include "detectorTowerSupportAxis.h" #include "detectorTowerAngleAxis.h" #include "detectorTowerController.h" +#include "detectorTowerLiftAxis.h" #include "turboPmacController.h" #include #include @@ -138,7 +139,7 @@ asynStatus detectorTowerSupportAxis::poll(bool *moving) { status = pC_->pollDetectorAxes(moving, angleAxis(), angleAxis()->liftAxis(), this); } else { - getAxisParamChecked(this, motorStatusMoving, &moving); + getAxisParamChecked(this, motorStatusMoving, moving); } setWasMoving(*moving); return status; diff --git a/src/detectorTowerSupportAxis.h b/src/detectorTowerSupportAxis.h index cd7a463..edd65d3 100644 --- a/src/detectorTowerSupportAxis.h +++ b/src/detectorTowerSupportAxis.h @@ -3,11 +3,6 @@ #include "detectorTowerController.h" #include "turboPmacAxis.h" -// Forward declaration of the controller class to resolve the cyclic dependency -// between the controller and the axis .h-file. See -// https://en.cppreference.com/w/cpp/language/class. -class detectorTowerAngleAxis; - /** * @brief Passive axis which is mostly controlled indirectly by the hardware * diff --git a/turboPmac b/turboPmac index 1703542..f423002 160000 --- a/turboPmac +++ b/turboPmac @@ -1 +1 @@ -Subproject commit 1703542770aecbb752801f7812c47e4054b78f1a +Subproject commit f423002d23aa958f48c3d63dd8887439ff26ae0f