Files
seleneguide/src/seleneAngleAxis.h

155 lines
4.5 KiB
C++

#ifndef seleneAngleAxis_H
#define seleneAngleAxis_H
#include "turboPmacAxis.h"
// Forward declaration of the seleneLiftAxis class to resolve the cyclic
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
// See https://en.cppreference.com/w/cpp/language/class.
class seleneLiftAxis;
// Forward declaration of the seleneGuideController class to resolve the cyclic
// dependency. See https://en.cppreference.com/w/cpp/language/class.
class seleneGuideController;
/**
* @brief Virtual axis for setting the angle of the Selene guide
*
* Please see README.md for a detailed explanation.
*/
class seleneAngleAxis : public turboPmacAxis {
public:
/**
* @brief Construct a new seleneAngleAxis.
*
* This function should not be called directly. Instead use the constructor
* of seleneLiftAxis, which creates a seleneAngleAxis and stores a pointer
* to it.
*
* @param pController Pointer to the associated controller
* @param axisNo Index of the axis
* @param liftAxis Pointer to the associated lift axis
*/
seleneAngleAxis(seleneGuideController *pController, int axisNo,
seleneLiftAxis *liftAxis);
virtual ~seleneAngleAxis();
/**
* @brief Implementation of the `stop` function from asynMotorAxis
*
* Stops all underlying physical axes at once
*
* @param acceleration Acceleration ACCEL from the motor record. This
* value is currently not used.
* @return asynStatus
*/
asynStatus stop(double acceleration);
/**
* @brief Rotate the guide around its current lift center to the specified
* position.
*
* @param position
* @param relative
* @param min_velocity
* @param maxOffset_velocity
* @param acceleration
* @return asynStatus
*/
asynStatus doMove(double position, int relative, double min_velocity,
double maxOffset_velocity, double acceleration);
/**
* @brief Implementation of the `doPoll` function from sinqAxis.
*
* Some paramLib entries of this axis are set in the `doPoll` function of
* `seleneLiftAxis` for convenience (e.g. whether this axis is moving or
* not).
*
* @param moving
* @return asynStatus
*/
asynStatus doPoll(bool *moving);
/**
* @brief Reset all errors of the underlying physical axes.
*
* @param on
* @return asynStatus
*/
asynStatus doReset();
/**
* @brief This function does nothing, since this axis cannot be enabled /
* disabled
*
* @param on
* @return asynStatus
*/
asynStatus enable(bool on);
/**
* @brief "Home" the virtual axes by driving all underlying real axes to
* position 0.
*
* @param minVelocity
* @param maxVelocity
* @param acceleration
* @param forwards
* @return asynStatus
*/
asynStatus doHome(double minVelocity, double maxVelocity,
double acceleration, int forwards);
/**
* @brief Read the target position from the axis and write it into the
* provided pointer.
*
* @param targetPosition
* @return asynStatus
*/
asynStatus targetPosition(double *targetPosition);
/**
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
* axes positions based on it.
*
* Calling this function "normalizes" the lift axis, the angle axis and the
* offset axes by performing a "normalization" operation. For details, see
* README.md. This function does not communicate with the controller.
*
* @return asynStatus
*/
asynStatus normalizePositions();
/**
* @brief Write the encoder type in the corresponding PV
*
* Since this axis is a virtual one, it does not have an encoder. In order
* to enable reference drives (which in case of this axis simply sets all
* physical axes to their respective physical position zero), this function
* sets the encoder type to "Incremental Encoder".
*
* @return asynStatus
*/
asynStatus readEncoderType();
/**
* @brief This function does nothing, since this axis does not have an
* encoder.
*
* @return asynStatus
*/
asynStatus rereadEncoder() { return asynSuccess; }
protected:
seleneGuideController *pC_;
seleneLiftAxis *liftAxis_;
private:
// True, if a target has been set for this axis
bool targetSet_;
};
#endif