Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
588ca158c1 | |||
3780dee24f | |||
c736c191d0 |
@ -38,6 +38,8 @@ seleneAngleAxis::seleneAngleAxis(seleneGuideController *pController, int axisNo,
|
||||
}
|
||||
}
|
||||
|
||||
seleneAngleAxis::~seleneAngleAxis() {}
|
||||
|
||||
asynStatus seleneAngleAxis::stop(double acceleration) {
|
||||
return liftAxis_->stop(acceleration);
|
||||
}
|
||||
@ -54,21 +56,20 @@ asynStatus seleneAngleAxis::doMove(double position, int relative,
|
||||
axisNo_, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
targetPosition_ = position * motorRecResolution;
|
||||
setTargetPosition(position * motorRecResolution);
|
||||
targetSet_ = true;
|
||||
return liftAxis_->startCombinedMoveFromVirtualAxis();
|
||||
targetSet_ = false;
|
||||
}
|
||||
|
||||
asynStatus seleneAngleAxis::targetPosition(double *targetPosition) {
|
||||
asynStatus status = asynSuccess;
|
||||
|
||||
double seleneAngleAxis::targetPosition() {
|
||||
if (targetSet_) {
|
||||
*targetPosition = targetPosition_;
|
||||
return turboPmacAxis::targetPosition();
|
||||
} else {
|
||||
status = motorPosition(targetPosition);
|
||||
double targetPos = 0;
|
||||
motorPosition(&targetPos);
|
||||
return targetPos;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus seleneAngleAxis::doPoll(bool *moving) {
|
||||
|
@ -32,6 +32,8 @@ class seleneAngleAxis : public turboPmacAxis {
|
||||
seleneAngleAxis(seleneGuideController *pController, int axisNo,
|
||||
seleneLiftAxis *liftAxis);
|
||||
|
||||
virtual ~seleneAngleAxis();
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `stop` function from asynMotorAxis
|
||||
*
|
||||
@ -100,13 +102,11 @@ class seleneAngleAxis : public turboPmacAxis {
|
||||
double acceleration, int forwards);
|
||||
|
||||
/**
|
||||
* @brief Read the target position from the axis and write it into the
|
||||
* provided pointer.
|
||||
* @brief Override of the superclass method
|
||||
*
|
||||
* @param targetPosition
|
||||
* @return asynStatus
|
||||
* @return double
|
||||
*/
|
||||
asynStatus targetPosition(double *targetPosition);
|
||||
double targetPosition();
|
||||
|
||||
/**
|
||||
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
||||
|
@ -48,6 +48,8 @@ seleneGuideController::seleneGuideController(
|
||||
}
|
||||
}
|
||||
|
||||
seleneGuideController::~seleneGuideController() {}
|
||||
|
||||
asynStatus seleneGuideController::writeInt32(asynUser *pasynUser,
|
||||
epicsInt32 value) {
|
||||
int function = pasynUser->reason;
|
||||
|
@ -34,6 +34,8 @@ class seleneGuideController : public turboPmacController {
|
||||
int numAxes, double movingPollPeriod,
|
||||
double idlePollPeriod, double comTimeout);
|
||||
|
||||
virtual ~seleneGuideController();
|
||||
|
||||
/**
|
||||
* @brief Overloaded function of turboPmacController
|
||||
*
|
||||
|
@ -115,6 +115,8 @@ seleneLiftAxis::seleneLiftAxis(seleneGuideController *pC, int axis1No,
|
||||
}
|
||||
}
|
||||
|
||||
seleneLiftAxis::~seleneLiftAxis() {}
|
||||
|
||||
asynStatus seleneLiftAxis::init() {
|
||||
|
||||
// Local variable declaration
|
||||
@ -470,22 +472,21 @@ asynStatus seleneLiftAxis::doMove(double position, int relative,
|
||||
return pC_->paramLibAccessFailed(status, "motorRecResolution_", axisNo_,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
targetPosition_ = position * motorRecResolution;
|
||||
setTargetPosition(position * motorRecResolution);
|
||||
targetSet_ = true;
|
||||
status = startCombinedMoveFromVirtualAxis();
|
||||
targetSet_ = false;
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus seleneLiftAxis::targetPosition(double *targetPosition) {
|
||||
asynStatus status = asynSuccess;
|
||||
|
||||
double seleneLiftAxis::targetPosition() {
|
||||
if (targetSet_) {
|
||||
*targetPosition = targetPosition_;
|
||||
return turboPmacAxis::targetPosition();
|
||||
} else {
|
||||
status = motorPosition(targetPosition);
|
||||
double targetPos = 0;
|
||||
motorPosition(&targetPos);
|
||||
return targetPos;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus seleneLiftAxis::startCombinedMove() {
|
||||
@ -494,30 +495,18 @@ asynStatus seleneLiftAxis::startCombinedMove() {
|
||||
char response[pC_->MAXBUF_] = {0};
|
||||
double liftTargetPosition = 0.0;
|
||||
double angleTargetPosition = 0.0;
|
||||
asynStatus status = asynSuccess;
|
||||
|
||||
// =========================================================================
|
||||
|
||||
status = targetPosition(&liftTargetPosition);
|
||||
if (status != asynSuccess) {
|
||||
return status;
|
||||
}
|
||||
|
||||
status = angleAxis_->targetPosition(&angleTargetPosition);
|
||||
if (status != asynSuccess) {
|
||||
return status;
|
||||
}
|
||||
liftTargetPosition = targetPosition();
|
||||
angleTargetPosition = angleAxis_->targetPosition();
|
||||
auto targetPositions =
|
||||
positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition);
|
||||
|
||||
// Apply the offsets of the individual offset axes
|
||||
for (int i = 0; i < numAxes_; i++) {
|
||||
double offsetTargetPosition = 0.0;
|
||||
status = offsetAxes_[i]->targetPosition(&offsetTargetPosition);
|
||||
if (status != asynSuccess) {
|
||||
return status;
|
||||
}
|
||||
targetPositions[i] = targetPositions[i] + offsetTargetPosition;
|
||||
targetPositions[i] =
|
||||
targetPositions[i] + offsetAxes_[i]->targetPosition();
|
||||
}
|
||||
|
||||
// Set all target positions and send the move command
|
||||
|
@ -39,6 +39,8 @@ class seleneLiftAxis : public turboPmacAxis {
|
||||
int axis3No, int axis4No, int axis5No, int axis6No,
|
||||
int liftAxisNo, int angleAxisNo);
|
||||
|
||||
virtual ~seleneLiftAxis();
|
||||
|
||||
/**
|
||||
* @brief Implementation of the `stop` function from asynMotorAxis
|
||||
*
|
||||
@ -254,13 +256,11 @@ class seleneLiftAxis : public turboPmacAxis {
|
||||
bool virtualAxisMovement() { return virtualAxisMovement_; }
|
||||
|
||||
/**
|
||||
* @brief Read the target position from the axis and write it into the
|
||||
* provided pointer.
|
||||
* @brief Override of the superclass method
|
||||
*
|
||||
* @param targetPosition
|
||||
* @return asynStatus
|
||||
* @return double
|
||||
*/
|
||||
asynStatus targetPosition(double *targetPosition);
|
||||
double targetPosition();
|
||||
|
||||
/**
|
||||
* @brief Access the position of the lift axis
|
||||
|
@ -96,6 +96,8 @@ seleneOffsetAxis::seleneOffsetAxis(seleneGuideController *pController,
|
||||
}
|
||||
}
|
||||
|
||||
seleneOffsetAxis::~seleneOffsetAxis() {}
|
||||
|
||||
asynStatus seleneOffsetAxis::init() {
|
||||
|
||||
// Local variable declaration
|
||||
@ -149,15 +151,14 @@ asynStatus seleneOffsetAxis::init() {
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus seleneOffsetAxis::targetPosition(double *targetPosition) {
|
||||
asynStatus status = asynSuccess;
|
||||
|
||||
double seleneOffsetAxis::targetPosition() {
|
||||
if (targetSet_) {
|
||||
*targetPosition = targetPosition_;
|
||||
return turboPmacAxis::targetPosition();
|
||||
} else {
|
||||
status = motorPosition(targetPosition);
|
||||
double targetPos = 0;
|
||||
motorPosition(&targetPos);
|
||||
return targetPos;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus seleneOffsetAxis::doPoll(bool *moving) {
|
||||
@ -330,7 +331,7 @@ asynStatus seleneOffsetAxis::doMove(double position, int relative,
|
||||
}
|
||||
|
||||
// Set the target position
|
||||
targetPosition_ = position * motorRecResolution;
|
||||
setTargetPosition(position * motorRecResolution);
|
||||
targetSet_ = true;
|
||||
asynStatus status = liftAxis_->startCombinedMoveFromOffsetAxis();
|
||||
targetSet_ = false;
|
||||
|
@ -30,6 +30,8 @@ class seleneOffsetAxis : public turboPmacAxis {
|
||||
seleneOffsetAxis(seleneGuideController *pController, int axisNo,
|
||||
double xPos, double zPos);
|
||||
|
||||
virtual ~seleneOffsetAxis();
|
||||
|
||||
/**
|
||||
* @brief Initialize this offset axis
|
||||
*
|
||||
@ -79,13 +81,11 @@ class seleneOffsetAxis : public turboPmacAxis {
|
||||
asynStatus setPositionsFromEncoderPosition(double encoderPosition);
|
||||
|
||||
/**
|
||||
* @brief Read the target position from the axis and write it into the
|
||||
* provided pointer.
|
||||
* @brief Override of the superclass method
|
||||
*
|
||||
* @param targetPosition
|
||||
* @return asynStatus
|
||||
* @return double
|
||||
*/
|
||||
asynStatus targetPosition(double *targetPosition);
|
||||
double targetPosition();
|
||||
|
||||
/**
|
||||
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
||||
|
Submodule turboPmac updated: a11d10cb6c...4bc3388bc6
Reference in New Issue
Block a user