9 Commits
0.2.1 ... 1.0.0

8 changed files with 22 additions and 72 deletions

View File

@ -189,7 +189,7 @@ asynStatus detectorTowerAngleAxis::poll(bool *moving) {
__LINE__); __LINE__);
} }
} }
wasMoving_ = *moving; setWasMoving(*moving);
return status; return status;
} }
@ -216,7 +216,7 @@ asynStatus detectorTowerAngleAxis::doMove(double position, int relative,
// Signal to the deferredMovementCollectorLoop that a movement should be // Signal to the deferredMovementCollectorLoop that a movement should be
// started to the defined target position. // started to the defined target position.
targetPosition_ = position * motorRecResolution; setTargetPosition(position * motorRecResolution);
receivedTarget_ = true; receivedTarget_ = true;
return asynSuccess; return asynSuccess;
@ -282,7 +282,7 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() {
// Set the target positions for beam tilt, detector tilt offset and lift // Set the target positions for beam tilt, detector tilt offset and lift
// offset // offset
snprintf(command, sizeof(command), "Q451=%lf Q454=%lf P350=1", snprintf(command, sizeof(command), "Q451=%lf Q454=%lf P350=1",
targetPosition_, liftAxis_->targetPosition_); targetPosition(), liftAxis_->targetPosition());
// Lock the access to the controller since this function runs in another // Lock the access to the controller since this function runs in another
// thread than the poll method. // thread than the poll method.
@ -343,6 +343,10 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) {
return asynError; return asynError;
} }
// Reset the deferred movement flags
startingDeferredMovement_ = false;
deferredMovementWait_ = false;
return rwStatus; return rwStatus;
} }
@ -526,6 +530,10 @@ asynStatus detectorTowerAngleAxis::doReset() {
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
// Reset the deferred movement flags
startingDeferredMovement_ = false;
deferredMovementWait_ = false;
/* /*
Check which action should be performed: Check which action should be performed:
- If error_ == 10 or 11 (FTZ motor error): P352 = 3 (Recover FTZ) - If error_ == 10 or 11 (FTZ motor error): P352 = 3 (Recover FTZ)

View File

@ -106,11 +106,13 @@ detectorTowerController::detectorTowerController(
} }
} }
detectorTowerController::~detectorTowerController() {}
asynStatus detectorTowerController::readInt32(asynUser *pasynUser, asynStatus detectorTowerController::readInt32(asynUser *pasynUser,
epicsInt32 *value) { epicsInt32 *value) {
// The detector axes cannot be disabled // The detector axes cannot be disabled
if (pasynUser->reason == motorCanDisable_) { if (pasynUser->reason == motorCanDisable()) {
detectorTowerAngleAxis *aAxis = getDetectorTowerAngleAxis(pasynUser); detectorTowerAngleAxis *aAxis = getDetectorTowerAngleAxis(pasynUser);
if (aAxis != nullptr) { if (aAxis != nullptr) {
*value = 0; *value = 0;
@ -150,31 +152,6 @@ asynStatus detectorTowerController::writeInt32(asynUser *pasynUser,
} }
} }
/*
Due to a bug which is currently not understood, the reset has to be handled
here rather than using the default implementation in sinqController. Piping
the motor reset request to sinqController causes segfaults. It might be due
to the fact that the default `reset` implementation of sinqAxis locks the
controller in order to perform some fast polls and that for some reason this
behaviour cannot be overwritten even by providing custom `reset` methods for
all three axes.
*/
if (pasynUser->reason == motorReset_) {
detectorTowerAngleAxis *aAxis = getDetectorTowerAngleAxis(pasynUser);
if (aAxis != nullptr) {
return aAxis->reset();
}
detectorTowerLiftAxis *lAxis = getDetectorTowerLiftAxis(pasynUser);
if (lAxis != nullptr) {
return lAxis->reset();
}
detectorTowerSupportAxis *sAxis =
getDetectorTowerSupportAxis(pasynUser);
if (sAxis != nullptr) {
return sAxis->reset();
}
}
return turboPmacController::writeInt32(pasynUser, value); return turboPmacController::writeInt32(pasynUser, value);
} }

View File

@ -35,6 +35,8 @@ class detectorTowerController : public turboPmacController {
int numAxes, double movingPollPeriod, int numAxes, double movingPollPeriod,
double idlePollPeriod, double comTimeout); double idlePollPeriod, double comTimeout);
virtual ~detectorTowerController();
/** /**
* @brief Overloaded function of turboPmacController * @brief Overloaded function of turboPmacController
* *

View File

@ -154,7 +154,7 @@ asynStatus detectorTowerLiftAxis::poll(bool *moving) {
__LINE__); __LINE__);
} }
} }
wasMoving_ = *moving; setWasMoving(*moving);
return status; return status;
} }
@ -183,7 +183,7 @@ asynStatus detectorTowerLiftAxis::doMove(double position, int relative,
// Signal to the deferredMovementCollectorLoop (of the // Signal to the deferredMovementCollectorLoop (of the
// detectorTowerAngleAxis) that a movement should be started to the // detectorTowerAngleAxis) that a movement should be started to the
// defined target position. // defined target position.
targetPosition_ = position * motorRecResolution; setTargetPosition(position * motorRecResolution);
angleAxis_->receivedTarget_ = true; angleAxis_->receivedTarget_ = true;
return asynSuccess; return asynSuccess;
@ -192,37 +192,8 @@ asynStatus detectorTowerLiftAxis::doMove(double position, int relative,
asynStatus detectorTowerLiftAxis::reset() { return angleAxis()->reset(); }; asynStatus detectorTowerLiftAxis::reset() { return angleAxis()->reset(); };
asynStatus detectorTowerLiftAxis::stop(double acceleration) { asynStatus detectorTowerLiftAxis::stop(double acceleration) {
return angleAxis()->stop(acceleration);
// Status of read-write-operations of ASCII commands to the controller };
asynStatus rwStatus = asynSuccess;
// Status of parameter library operations
asynStatus plStatus = asynSuccess;
char response[pC_->MAXBUF_] = {0};
// =========================================================================
rwStatus = pC_->writeRead(axisNo_, "P350=8", response, 0);
if (rwStatus != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStopping "
"the movement "
"failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
plStatus = setIntegerParam(pC_->motorStatusProblem(), true);
if (plStatus != asynSuccess) {
return pC_->paramLibAccessFailed(plStatus, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__,
__LINE__);
}
return asynError;
}
return rwStatus;
}
asynStatus detectorTowerLiftAxis::readEncoderType() { asynStatus detectorTowerLiftAxis::readEncoderType() {
return angleAxis()->readEncoderType(); return angleAxis()->readEncoderType();

View File

@ -19,10 +19,6 @@ class detectorTowerLiftAxis : public turboPmacAxis {
detectorTowerLiftAxis(detectorTowerController *pController, int axisNo, detectorTowerLiftAxis(detectorTowerController *pController, int axisNo,
detectorTowerAngleAxis *angleAxis); detectorTowerAngleAxis *angleAxis);
/**
* @brief Destroy the turboPmacAxis
*
*/
virtual ~detectorTowerLiftAxis(); virtual ~detectorTowerLiftAxis();
/** /**

View File

@ -155,7 +155,7 @@ asynStatus detectorTowerSupportAxis::poll(bool *moving) {
__LINE__); __LINE__);
} }
} }
wasMoving_ = *moving; setWasMoving(*moving);
return status; return status;
} }

View File

@ -24,10 +24,6 @@ class detectorTowerSupportAxis : public turboPmacAxis {
detectorTowerSupportAxis(detectorTowerController *pController, int axisNo, detectorTowerSupportAxis(detectorTowerController *pController, int axisNo,
detectorTowerAngleAxis *angleAxis); detectorTowerAngleAxis *angleAxis);
/**
* @brief Destroy the detectorTowerSupportAxis
*
*/
virtual ~detectorTowerSupportAxis(); virtual ~detectorTowerSupportAxis();
/** /**