Adjusted function for reading the target position
This commit is contained in:
@ -56,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) {
|
||||
|
@ -102,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
|
||||
|
@ -472,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() {
|
||||
@ -500,26 +499,15 @@ asynStatus seleneLiftAxis::startCombinedMove() {
|
||||
|
||||
// =========================================================================
|
||||
|
||||
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
|
||||
|
@ -256,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
|
||||
|
@ -151,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) {
|
||||
@ -332,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;
|
||||
|
@ -81,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
|
||||
|
Reference in New Issue
Block a user