Initial version for the detector tower driver

This commit is contained in:
2025-02-25 17:17:41 +01:00
commit 1b01be845b
9 changed files with 1655 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
/********************************************
* 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);
asynStatus readInt32(asynUser *pasynUser, epicsInt32 *value);
asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
/**
* @brief Overloaded function of asynMotorController
*
* The function is overloaded to allow manual starting of an axis movement
*
* @param pasynUser Specify the axis via the asynUser
* @param value New value
* @return asynStatus
*/
virtual 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 *getVirtualAxis(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 *getVirtualAxis(int axisNo);
/**
* @brief Save cast of the given asynAxis pointer to a detectorTowerAxis
* pointer. If the cast fails, this function returns a nullptr.
*
* @param asynAxis
* @return detectorTowerAxis*
*/
detectorTowerAxis *castToVirtualAxis(asynMotorAxis *asynAxis);
private:
// Indices of additional PVs
#define FIRST_detectorTower_PARAM liftOffset_
int liftOffset_;
int liftOffsetLowLimit_;
int liftOffsetHighLimit_;
int tiltOffset_;
int tiltOffsetLowLimit_;
int tiltOffsetHighLimit_;
int positionState_;
int reset_;
#define LAST_detectorTower_PARAM reset_
friend class detectorTowerAxis;
};
#define NUM_detectorTower_DRIVER_PARAMS \
(&LAST_detectorTower_PARAM - &FIRST_detectorTower_PARAM + 1)
#endif /* detectorTowerController_H */