/******************************************** * detectorTowerController.h * * Detector tower controller driver based on the asynMotorController class * * Stefan Mathis, September 2024 ********************************************/ #ifndef detectorTowerController_H #define detectorTowerController_H #include "detectorTowerAxis.h" #include "turboPmacController.h" class detectorTowerController : public turboPmacController { public: /** * @brief Construct a new detectorTowerController object * * This controller object can handle both "normal" TurboPMAC axes created with the turboPmacAxis constructor and the special detectorTowerAxis. * * @param portName See sinqController constructor * @param ipPortConfigName See sinqController constructor * @param numAxes See sinqController constructor * @param movingPollPeriod See sinqController constructor * @param idlePollPeriod See sinqController constructor * @param comTimeout When trying to communicate with the device, the underlying asynOctetSyncIO interface waits for a response until this time (in seconds) has passed, then it declares a timeout. */ detectorTowerController(const char *portName, const char *ipPortConfigName, int numAxes, double movingPollPeriod, double idlePollPeriod, double comTimeout); /** * @brief Overloaded function of turboPmacController * * The function is overloaded in order to read motorCanDisable_ * * @param pasynUser * @param value * @return asynStatus */ asynStatus readInt32(asynUser *pasynUser, epicsInt32 *value); /** * @brief Overloaded function of turboPmacController * * The function is overloaded to allow resetting an error. * * @param pasynUser Specify the axis via the asynUser * @param value New value * @return asynStatus */ asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value); /** * @brief Overloaded function of turboPmacController * * The function is overloaded to immediate start of an offset movement * * @param pasynUser Specify the axis via the asynUser * @param value New value * @return asynStatus */ asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value); /** * @brief Get the axis object * * @param pasynUser Specify the axis via the asynUser * @return detectorTowerAxis* If no axis could be found, this is a * nullptr */ detectorTowerAxis *getDetectorTowerAxis(asynUser *pasynUser); /** * @brief Get the axis object * * @param axisNo Specify the axis via its index * @return detectorTowerAxis* If no axis could be found, this is a * nullptr */ detectorTowerAxis *getDetectorTowerAxis(int axisNo); private: // Indices of additional PVs #define FIRST_detectorTower_PARAM liftOffset_ int liftOffset_; int liftOffsetMove_; int liftOffsetLowLimit_; int liftOffsetHighLimit_; int tiltOffset_; int tiltOffsetMove_; int tiltOffsetLowLimit_; int tiltOffsetHighLimit_; int beamAngle_; int positionState_; int start_; int moveToWorkingPosition_; int resetError_; #define LAST_detectorTower_PARAM resetError_ friend class detectorTowerAxis; }; #define NUM_detectorTower_DRIVER_PARAMS \ (&LAST_detectorTower_PARAM - &FIRST_detectorTower_PARAM + 1) #endif /* detectorTowerController_H */