Roll head back to 1.5.7
This commit is contained in:
+12
-57
@@ -245,10 +245,6 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
// Clear the communication
|
||||
setAxisParamChecked(this, motorStatusCommsError, false);
|
||||
|
||||
// Assume the motor is initially connected. During the poll, this value will
|
||||
// be set to false if the motor is not connected.
|
||||
setAxisParamChecked(this, motorConnected, true);
|
||||
|
||||
/*
|
||||
The poll function is just a wrapper around doPoll and handles mainly the
|
||||
callParamCallbacks() function. This wrapper is used to make sure
|
||||
@@ -256,11 +252,6 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
*/
|
||||
poll_status = doPoll(moving);
|
||||
|
||||
// Motor is not connected
|
||||
if (poll_status == asynDisconnected) {
|
||||
setAxisParamChecked(this, motorConnected, false);
|
||||
}
|
||||
|
||||
/*
|
||||
If the poll did not succeed OR if an error message is waiting, something
|
||||
went wrong and the motor has a status problem. Otherwise, delete the error
|
||||
@@ -342,49 +333,18 @@ asynStatus sinqAxis::doPoll(bool *moving) {
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::moveVelocity(double minVelocity, double maxVelocity,
|
||||
double acceleration) {
|
||||
|
||||
int motMode = 0;
|
||||
|
||||
// If the motor is not in velocity mode, do nothing
|
||||
getAxisParamChecked(this, motorMode, &motMode);
|
||||
if (motMode != 0) {
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
return doMoveVelocity(minVelocity, maxVelocity, acceleration);
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::doMoveVelocity(double minVelocity, double maxVelocity,
|
||||
double acceleration) {
|
||||
// Suppress unused variable warning - this is just a default fallback
|
||||
// function.
|
||||
(void)minVelocity;
|
||||
(void)maxVelocity;
|
||||
(void)acceleration;
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::move(double position, int relative, double minVelocity,
|
||||
double maxVelocity, double acceleration) {
|
||||
|
||||
// Status of parameter library operations
|
||||
asynStatus status = asynSuccess;
|
||||
double motRecRes = 0.0;
|
||||
int motMode = 0;
|
||||
double motorRecRes = 0.0;
|
||||
|
||||
// =========================================================================
|
||||
|
||||
// If the motor is not in position mode, do nothing
|
||||
getAxisParamChecked(this, motorMode, &motMode);
|
||||
if (motMode != 0) {
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
// Store the target position internally
|
||||
getAxisParamChecked(this, motorRecResolution, &motRecRes);
|
||||
pSinqA_->targetPosition = position * motRecRes;
|
||||
getAxisParamChecked(this, motorRecResolution, &motorRecRes);
|
||||
pSinqA_->targetPosition = position * motorRecRes;
|
||||
|
||||
status = doMove(position, relative, minVelocity, maxVelocity, acceleration);
|
||||
if (status != asynSuccess) {
|
||||
@@ -495,9 +455,9 @@ asynStatus sinqAxis::enable(bool on) {
|
||||
|
||||
asynStatus sinqAxis::motorPosition(double *motorPos) {
|
||||
asynStatus status = asynSuccess;
|
||||
double motRecRes = 0.0;
|
||||
double motorRecRes = 0.0;
|
||||
|
||||
getAxisParamChecked(this, motorRecResolution, &motRecRes);
|
||||
getAxisParamChecked(this, motorRecResolution, &motorRecRes);
|
||||
|
||||
/*
|
||||
We cannot use getAxisParamChecked checked here, since the name of the index
|
||||
@@ -510,16 +470,16 @@ asynStatus sinqAxis::motorPosition(double *motorPos) {
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
*motorPos = *motorPos * motRecRes;
|
||||
*motorPos = *motorPos * motorRecRes;
|
||||
return status;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::setMotorPosition(double motorPos) {
|
||||
asynStatus status = asynSuccess;
|
||||
double motRecRes = 0.0;
|
||||
double motorRecRes = 0.0;
|
||||
|
||||
getAxisParamChecked(this, motorRecResolution, &motRecRes);
|
||||
setAxisParamChecked(this, motorPosition, motorPos / motRecRes);
|
||||
getAxisParamChecked(this, motorRecResolution, &motorRecRes);
|
||||
setAxisParamChecked(this, motorPosition, motorPos / motorRecRes);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -613,7 +573,7 @@ asynStatus sinqAxis::startMovTimeoutWatchdog() {
|
||||
double motorVelocityRec = 0.0;
|
||||
double motorAccel = 0.0;
|
||||
double motorAccelRec = 0.0;
|
||||
double motRecRes = 0.0;
|
||||
double motorRecRes = 0.0;
|
||||
time_t timeContSpeed = 0;
|
||||
time_t timeAccel = 0;
|
||||
|
||||
@@ -642,7 +602,7 @@ asynStatus sinqAxis::startMovTimeoutWatchdog() {
|
||||
= VELO / MRES motorAccel = (motorVelocity - motorVelBase) / ACCL
|
||||
Therefore, we need to correct the values from the parameter library.
|
||||
*/
|
||||
getAxisParamChecked(this, motorRecResolution, &motRecRes);
|
||||
getAxisParamChecked(this, motorRecResolution, &motorRecRes);
|
||||
|
||||
// Read the velocity
|
||||
getAxisParamChecked(this, motorVelocity, &motorVelocityRec);
|
||||
@@ -651,7 +611,7 @@ asynStatus sinqAxis::startMovTimeoutWatchdog() {
|
||||
// with a sensible value (e.g. > 0)
|
||||
if (pl_status == asynSuccess && motorVelocityRec > 0.0) {
|
||||
// Convert back to the value in the VELO field
|
||||
motorVelocity = motorVelocityRec * motRecRes;
|
||||
motorVelocity = motorVelocityRec * motorRecRes;
|
||||
if (pl_status == asynSuccess) {
|
||||
|
||||
timeContSpeed =
|
||||
@@ -741,11 +701,6 @@ void sinqAxis::setTargetPosition(double targetPosition) {
|
||||
pSinqA_->targetPosition = targetPosition;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::setMode(int mode) {
|
||||
(void)mode;
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// IOC shell functions
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user