Renamed from pmacV3 to turboPmac
This commit is contained in:
120
src/turboPmacAxis.h
Normal file
120
src/turboPmacAxis.h
Normal file
@@ -0,0 +1,120 @@
|
||||
#ifndef turboPmacAXIS_H
|
||||
#define turboPmacAXIS_H
|
||||
#include "sinqAxis.h"
|
||||
|
||||
// Forward declaration of the controller class to resolve the cyclic dependency
|
||||
// between C804Controller.h and C804Axis.h. See
|
||||
// https://en.cppreference.com/w/cpp/language/class.
|
||||
class turboPmacController;
|
||||
|
||||
class turboPmacAxis : public sinqAxis {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new turboPmacAxis
|
||||
*
|
||||
* @param pController Pointer to the associated controller
|
||||
* @param axisNo Index of the axis
|
||||
*/
|
||||
turboPmacAxis(turboPmacController *pController, int axisNo);
|
||||
|
||||
/**
|
||||
* @brief Destroy the turboPmacAxis
|
||||
*
|
||||
*/
|
||||
virtual ~turboPmacAxis();
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `stop` function from asynMotorAxis
|
||||
*
|
||||
* @param acceleration Acceleration ACCEL from the motor record. This
|
||||
* value is currently not used.
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus stop(double acceleration);
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `doHome` function from sinqAxis. The
|
||||
* parameters are described in the documentation of `sinqAxis::doHome`.
|
||||
*
|
||||
* @param minVelocity
|
||||
* @param maxVelocity
|
||||
* @param acceleration
|
||||
* @param forwards
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus doHome(double minVelocity, double maxVelocity,
|
||||
double acceleration, int forwards);
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `doPoll` function from sinqAxis. The
|
||||
* parameters are described in the documentation of `sinqAxis::doPoll`.
|
||||
*
|
||||
* @param moving
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus doPoll(bool *moving);
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `doMove` function from sinqAxis. The
|
||||
* parameters are described in the documentation of `sinqAxis::doMove`.
|
||||
*
|
||||
* @param position
|
||||
* @param relative
|
||||
* @param min_velocity
|
||||
* @param max_velocity
|
||||
* @param acceleration
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus doMove(double position, int relative, double min_velocity,
|
||||
double max_velocity, double acceleration);
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `atFirstPoll` function from sinqAxis.
|
||||
*
|
||||
* The following steps are performed:
|
||||
* - Read out the motor status, motor position, velocity and acceleration
|
||||
* from the MCU and store this information in the parameter library.
|
||||
* - Set the enable PV accordint to the initial status of the axis.
|
||||
*
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus atFirstPoll();
|
||||
|
||||
/**
|
||||
* @brief Enable / disable the axis.
|
||||
*
|
||||
* @param on
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus enable(bool on);
|
||||
|
||||
/**
|
||||
* @brief Read the encoder type (incremental or absolute) for this axis from
|
||||
* the MCU and store the information in the PV ENCODER_TYPE.
|
||||
*
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus readEncoderType();
|
||||
|
||||
/**
|
||||
* @brief Trigger a rereading of the encoder position.
|
||||
*
|
||||
* @return asynStatus
|
||||
*/
|
||||
asynStatus rereadEncoder();
|
||||
|
||||
protected:
|
||||
turboPmacController *pC_;
|
||||
|
||||
bool initial_poll_;
|
||||
bool waitForHandshake_;
|
||||
time_t timeAtHandshake_;
|
||||
|
||||
// The axis status is used when enabling / disabling the motor
|
||||
int axisStatus_;
|
||||
|
||||
private:
|
||||
friend class turboPmacController;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user