Updated turboPmac version

This commit is contained in:
2025-06-18 08:20:50 +02:00
parent cf6f836416
commit bc8561c299
9 changed files with 31 additions and 46 deletions

View File

@ -1,5 +1,7 @@
#include "detectorTowerAngleAxis.h" #include "detectorTowerAngleAxis.h"
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "detectorTowerLiftAxis.h"
#include "detectorTowerSupportAxis.h"
#include "turboPmacController.h" #include "turboPmacController.h"
#include <epicsExport.h> #include <epicsExport.h>
#include <errlog.h> #include <errlog.h>
@ -172,7 +174,7 @@ asynStatus detectorTowerAngleAxis::poll(bool *moving) {
if (axisNo() < liftAxis()->axisNo() && axisNo() < supportAxis()->axisNo()) { if (axisNo() < liftAxis()->axisNo() && axisNo() < supportAxis()->axisNo()) {
status = pC_->pollDetectorAxes(moving, this, liftAxis(), supportAxis()); status = pC_->pollDetectorAxes(moving, this, liftAxis(), supportAxis());
} else { } else {
getAxisParamChecked(this, motorStatusMoving, &moving); getAxisParamChecked(this, motorStatusMoving, moving);
} }
setWasMoving(*moving); setWasMoving(*moving);
return status; return status;
@ -204,10 +206,7 @@ asynStatus detectorTowerAngleAxis::doMove(double position, int relative,
asynStatus detectorTowerAngleAxis::startCombinedMove() { asynStatus detectorTowerAngleAxis::startCombinedMove() {
// Status of read-write-operations of ASCII commands to the controller // Status of read-write-operations of ASCII commands to the controller
asynStatus rwStatus = asynSuccess; asynStatus status = asynSuccess;
// Status of parameter library operations
asynStatus plStatus = asynSuccess;
char command[pC_->MAXBUF_] = {0}; char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0}; char response[pC_->MAXBUF_] = {0};
@ -252,12 +251,12 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() {
pC_->lock(); pC_->lock();
// We don't expect an answer // We don't expect an answer
rwStatus = pC_->writeRead(axisNo_, command, response, 0); status = pC_->writeRead(axisNo_, command, response, 0);
// Free the controller again // Free the controller again
pC_->unlock(); pC_->unlock();
if (rwStatus != asynSuccess) { if (status != asynSuccess) {
asynPrint( asynPrint(
pC_->pasynUser(), ASYN_TRACE_ERROR, pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStarting movement to " "Controller \"%s\", axis %d => %s, line %d\nStarting movement to "
@ -268,24 +267,21 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() {
callParamCallbacks(); callParamCallbacks();
} }
return rwStatus; return status;
} }
asynStatus detectorTowerAngleAxis::stop(double acceleration) { asynStatus detectorTowerAngleAxis::stop(double acceleration) {
// Status of read-write-operations of ASCII commands to the controller // Status of read-write-operations of ASCII commands to the controller
asynStatus rwStatus = asynSuccess; asynStatus status = asynSuccess;
// Status of parameter library operations
asynStatus plStatus = asynSuccess;
char response[pC_->MAXBUF_] = {0}; 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( asynPrint(
pC_->pasynUser(), ASYN_TRACE_ERROR, pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStopping the movement " "Controller \"%s\", axis %d => %s, line %d\nStopping the movement "
@ -300,7 +296,7 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) {
startingDeferredMovement_ = false; startingDeferredMovement_ = false;
deferredMovementWait_ = false; deferredMovementWait_ = false;
return rwStatus; return status;
} }
// The detector tower axis uses absolute encoders // The detector tower axis uses absolute encoders
@ -315,16 +311,16 @@ detectorTowerAngleAxis::toggleWorkingChangerState(bool toChangingPosition) {
char response[pC_->MAXBUF_] = {0}; char response[pC_->MAXBUF_] = {0};
// Status of read-write-operations of ASCII commands to the controller // Status of read-write-operations of ASCII commands to the controller
asynStatus rwStatus = asynSuccess; asynStatus status = asynSuccess;
bool moving = false; bool moving = false;
int positionState = 0; int positionState = 0;
// ========================================================================= // =========================================================================
rwStatus = poll(&moving); status = poll(&moving);
if (rwStatus != asynSuccess) { if (status != asynSuccess) {
return rwStatus; return status;
} }
getAxisParamChecked(this, positionStateRBV, &positionState); getAxisParamChecked(this, positionStateRBV, &positionState);
@ -365,9 +361,9 @@ detectorTowerAngleAxis::toggleWorkingChangerState(bool toChangingPosition) {
// Move the axis into changer or working position // Move the axis into changer or working position
if (toChangingPosition) { if (toChangingPosition) {
rwStatus = pC_->writeRead(axisNo_, "P350=2", response, 0); status = pC_->writeRead(axisNo_, "P350=2", response, 0);
} else { } else {
rwStatus = pC_->writeRead(axisNo_, "P350=3", response, 0); status = pC_->writeRead(axisNo_, "P350=3", response, 0);
} }
setAxisParamChecked(this, changeStateRBV, toChangingPosition); setAxisParamChecked(this, changeStateRBV, toChangingPosition);
@ -421,7 +417,6 @@ asynStatus detectorTowerAngleAxis::adjustOrigin(double newOrigin) {
asynStatus detectorTowerAngleAxis::doReset() { asynStatus detectorTowerAngleAxis::doReset() {
char response[pC_->MAXBUF_] = {0}; char response[pC_->MAXBUF_] = {0};
asynStatus plStatus = asynSuccess;
int positionState = 0; int positionState = 0;
getAxisParamChecked(this, positionStateRBV, &positionState); getAxisParamChecked(this, positionStateRBV, &positionState);

View File

@ -2,13 +2,6 @@
#define detectorTowerAngleAxis_H #define detectorTowerAngleAxis_H
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "turboPmacAxis.h" #include "turboPmacAxis.h"
#include <errlog.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 detectorTowerLiftAxis;
class detectorTowerSupportAxis;
class detectorTowerAngleAxis : public turboPmacAxis { class detectorTowerAngleAxis : public turboPmacAxis {
public: public:

View File

@ -1,6 +1,7 @@
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "detectorTowerAngleAxis.h" #include "detectorTowerAngleAxis.h"
#include "turboPmacController.h" #include "detectorTowerLiftAxis.h"
#include "detectorTowerSupportAxis.h"
#include <epicsExport.h> #include <epicsExport.h>
#include <errlog.h> #include <errlog.h>
#include <iocsh.h> #include <iocsh.h>

View File

@ -8,11 +8,15 @@
#ifndef detectorTowerController_H #ifndef detectorTowerController_H
#define detectorTowerController_H #define detectorTowerController_H
#include "detectorTowerAngleAxis.h"
#include "detectorTowerLiftAxis.h"
#include "detectorTowerSupportAxis.h"
#include "turboPmacController.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 { class detectorTowerController : public turboPmacController {
public: public:

View File

@ -1,6 +1,7 @@
#include "detectorTowerLiftAxis.h" #include "detectorTowerLiftAxis.h"
#include "detectorTowerAngleAxis.h" #include "detectorTowerAngleAxis.h"
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "detectorTowerSupportAxis.h"
#include "turboPmacController.h" #include "turboPmacController.h"
#include <epicsExport.h> #include <epicsExport.h>
#include <errlog.h> #include <errlog.h>
@ -138,7 +139,7 @@ asynStatus detectorTowerLiftAxis::poll(bool *moving) {
status = pC_->pollDetectorAxes(moving, angleAxis(), this, status = pC_->pollDetectorAxes(moving, angleAxis(), this,
angleAxis()->supportAxis()); angleAxis()->supportAxis());
} else { } else {
getAxisParamChecked(this, motorStatusMoving, &moving); getAxisParamChecked(this, motorStatusMoving, moving);
} }
setWasMoving(*moving); setWasMoving(*moving);
return status; return status;

View File

@ -3,11 +3,6 @@
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "turboPmacAxis.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 { class detectorTowerLiftAxis : public turboPmacAxis {
public: public:
/** /**

View File

@ -1,6 +1,7 @@
#include "detectorTowerSupportAxis.h" #include "detectorTowerSupportAxis.h"
#include "detectorTowerAngleAxis.h" #include "detectorTowerAngleAxis.h"
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "detectorTowerLiftAxis.h"
#include "turboPmacController.h" #include "turboPmacController.h"
#include <epicsExport.h> #include <epicsExport.h>
#include <errlog.h> #include <errlog.h>
@ -138,7 +139,7 @@ asynStatus detectorTowerSupportAxis::poll(bool *moving) {
status = pC_->pollDetectorAxes(moving, angleAxis(), status = pC_->pollDetectorAxes(moving, angleAxis(),
angleAxis()->liftAxis(), this); angleAxis()->liftAxis(), this);
} else { } else {
getAxisParamChecked(this, motorStatusMoving, &moving); getAxisParamChecked(this, motorStatusMoving, moving);
} }
setWasMoving(*moving); setWasMoving(*moving);
return status; return status;

View File

@ -3,11 +3,6 @@
#include "detectorTowerController.h" #include "detectorTowerController.h"
#include "turboPmacAxis.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 * @brief Passive axis which is mostly controlled indirectly by the hardware
* *