Removed friend class declaration and replaced access to private properties with accessors

This commit is contained in:
2025-03-10 17:13:11 +01:00
parent 3a3519fbaa
commit f256149eec
5 changed files with 146 additions and 147 deletions

View File

@ -45,13 +45,13 @@ auxiliaryAxis::auxiliaryAxis(detectorTowerController *pC, int axisNo)
line 40). However, we want the IOC creation to stop completely, since this line 40). However, we want the IOC creation to stop completely, since this
is a configuration error. is a configuration error.
*/ */
if (axisNo >= pC->numAxes_) { if (axisNo >= pC->numAxes()) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d: FATAL ERROR: " "Controller \"%s\", axis %d => %s, line %d: FATAL ERROR: "
"Axis index %d must be smaller than the total number of axes " "Axis index %d must be smaller than the total number of axes "
"%d", "%d",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
axisNo_, pC->numAxes_); axisNo_, pC->numAxes());
exit(-1); exit(-1);
} }
@ -85,11 +85,11 @@ asynStatus auxiliaryAxis::init() {
time_t now = time(NULL); time_t now = time(NULL);
time_t maxInitTime = 60; time_t maxInitTime = 60;
while (1) { while (1) {
status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution_, status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution(),
&motorRecResolution); &motorRecResolution);
if (status == asynParamUndefined) { if (status == asynParamUndefined) {
if (now + maxInitTime < time(NULL)) { if (now + maxInitTime < time(NULL)) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line " "Controller \"%s\", axis %d => %s, line "
"%d\nInitializing the parameter library failed.\n", "%d\nInitializing the parameter library failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, pC_->portName, axisNo_, __PRETTY_FUNCTION__,
@ -124,8 +124,8 @@ asynStatus auxiliaryAxis::doPoll(bool *moving) {
The axis is moving if the detectorTowerAxis is moving -> We read the moving The axis is moving if the detectorTowerAxis is moving -> We read the moving
status from the detectorTowerAxis. status from the detectorTowerAxis.
*/ */
pl_status = pl_status = pC_->getIntegerParam(dTA_->axisNo_, pC_->motorStatusMoving(),
pC_->getIntegerParam(dTA_->axisNo_, pC_->motorStatusMoving_, &isMoving); &isMoving);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
@ -134,7 +134,7 @@ asynStatus auxiliaryAxis::doPoll(bool *moving) {
// Update the parameter library // Update the parameter library
if (dTA_->error_ != 0) { if (dTA_->error_ != 0) {
pl_status = setIntegerParam(pC_->motorStatusProblem_, true); pl_status = setIntegerParam(pC_->motorStatusProblem(), true);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_", return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -143,7 +143,7 @@ asynStatus auxiliaryAxis::doPoll(bool *moving) {
} }
if (*moving == false) { if (*moving == false) {
pl_status = setIntegerParam(pC_->motorMoveToHome_, 0); pl_status = setIntegerParam(pC_->motorMoveToHome(), 0);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMoveToHome_", return pC_->paramLibAccessFailed(pl_status, "motorMoveToHome_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -151,14 +151,14 @@ asynStatus auxiliaryAxis::doPoll(bool *moving) {
} }
} }
pl_status = setIntegerParam(pC_->motorStatusMoving_, *moving); pl_status = setIntegerParam(pC_->motorStatusMoving(), *moving);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusMoving_", return pC_->paramLibAccessFailed(pl_status, "motorStatusMoving_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = setIntegerParam(pC_->motorStatusDone_, !(*moving)); pl_status = setIntegerParam(pC_->motorStatusDone(), !(*moving));
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
@ -168,15 +168,15 @@ asynStatus auxiliaryAxis::doPoll(bool *moving) {
// function should be called at the end of a poll implementation. // function should be called at the end of a poll implementation.
pl_status = callParamCallbacks(); pl_status = callParamCallbacks();
bool wantToPrint = pl_status != asynSuccess; bool wantToPrint = pl_status != asynSuccess;
if (pC_->msgPrintControl_.shouldBePrinted( if (pC_->getMsgPrintControl().shouldBePrinted(
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, wantToPrint, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, wantToPrint,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line " "Controller \"%s\", axis %d => %s, line "
"%d:\ncallParamCallbacks failed with %s.%s\n", "%d:\ncallParamCallbacks failed with %s.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(poll_status), pC_->stringifyAsynStatus(poll_status),
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
if (wantToPrint) { if (wantToPrint) {
poll_status = pl_status; poll_status = pl_status;
@ -193,7 +193,7 @@ asynStatus auxiliaryAxis::doMove(double position, int relative,
double motorRecResolution = 0.0; double motorRecResolution = 0.0;
asynStatus pl_status = pC_->getDoubleParam( asynStatus pl_status = pC_->getDoubleParam(
axisNo_, pC_->motorRecResolution_, &motorRecResolution); axisNo_, pC_->motorRecResolution(), &motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_", return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -224,12 +224,12 @@ asynStatus auxiliaryAxis::stop(double acceleration) {
if (rw_status != asynSuccess) { if (rw_status != asynSuccess) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStopping the movement " "Controller \"%s\", axis %d => %s, line %d\nStopping the movement "
"failed.\n", "failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__); pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
pl_status = setIntegerParam(pC_->motorStatusProblem_, true); pl_status = setIntegerParam(pC_->motorStatusProblem(), true);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_", return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,

View File

@ -71,7 +71,6 @@ class auxiliaryAxis : public turboPmacAxis {
double targetPosition_; double targetPosition_;
private: private:
friend class detectorTowerController;
friend class detectorTowerAxis; friend class detectorTowerAxis;
}; };

View File

@ -65,13 +65,13 @@ detectorTowerAxis::detectorTowerAxis(detectorTowerController *pC, int axisNo,
line 40). However, we want the IOC creation to stop completely, since this line 40). However, we want the IOC creation to stop completely, since this
is a configuration error. is a configuration error.
*/ */
if (axisNo >= pC->numAxes_) { if (axisNo >= pC->numAxes()) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d: FATAL ERROR: " "Controller \"%s\", axis %d => %s, line %d: FATAL ERROR: "
"Axis index %d must be smaller than the total number of axes " "Axis index %d must be smaller than the total number of axes "
"%d", "%d",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
axisNo_, pC->numAxes_); axisNo_, pC->numAxes());
exit(-1); exit(-1);
} }
@ -122,11 +122,11 @@ asynStatus detectorTowerAxis::init() {
time_t now = time(NULL); time_t now = time(NULL);
time_t maxInitTime = 60; time_t maxInitTime = 60;
while (1) { while (1) {
status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution_, status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution(),
&motorRecResolution); &motorRecResolution);
if (status == asynParamUndefined) { if (status == asynParamUndefined) {
if (now + maxInitTime < time(NULL)) { if (now + maxInitTime < time(NULL)) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis " "Controller \"%s\", axis "
"%ddeferredMovementCollectorLoop => %s, line " "%ddeferredMovementCollectorLoop => %s, line "
"%d\nInitializing the parameter library failed.\n", "%d\nInitializing the parameter library failed.\n",
@ -181,7 +181,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
// ========================================================================= // =========================================================================
// Motor resolution from parameter library // Motor resolution from parameter library
pl_status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution_, pl_status = pC_->getDoubleParam(axisNo_, pC_->motorRecResolution(),
&motorRecResolution); &motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_", return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_",
@ -190,7 +190,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
// Read the previous motor position // Read the previous motor position
pl_status = pC_->getDoubleParam(axisNo_, pC_->motorPosition_, pl_status = pC_->getDoubleParam(axisNo_, pC_->motorPosition(),
&previousBeamTiltAngle); &previousBeamTiltAngle);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_,
@ -240,7 +240,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
by limitsOffset on both sides. by limitsOffset on both sides.
*/ */
pl_status = pl_status =
pC_->getDoubleParam(axisNo_, pC_->motorLimitsOffset_, &limitsOffset); pC_->getDoubleParam(axisNo_, pC_->motorLimitsOffset(), &limitsOffset);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorLimitsOffset_", return pC_->paramLibAccessFailed(pl_status, "motorLimitsOffset_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -253,7 +253,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
error_ = error; error_ = error;
// Update the working position state PV // Update the working position state PV
pl_status = setIntegerParam(pC_->positionStateRBV_, positionState); pl_status = setIntegerParam(pC_->positionStateRBV(), positionState);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_", return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -261,7 +261,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
// Axis is always enabled // Axis is always enabled
pl_status = setIntegerParam(pC_->motorEnableRBV_, 1); pl_status = setIntegerParam(pC_->motorEnableRBV(), 1);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorEnableRBV_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorEnableRBV_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
@ -297,40 +297,40 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
// Axis ready // Axis ready
break; break;
case 2: case 2:
if (pC_->msgPrintControl_.shouldBePrinted(keyPosState, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyPosState, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
"Controller \"%s\", axis %d => %s, line %d\nAxis moving " "Controller \"%s\", axis %d => %s, line %d\nAxis moving "
"to or in change " "to or in change "
"position.%s\n", "position.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetCountPosState = false; resetCountPosState = false;
break; break;
case 3: case 3:
if (pC_->msgPrintControl_.shouldBePrinted(keyPosState, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyPosState, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
"Controller \"%s\", axis %d => %s, line %d\nAxis moving " "Controller \"%s\", axis %d => %s, line %d\nAxis moving "
"to working position.%s\n", "to working position.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetCountPosState = false; resetCountPosState = false;
break; break;
default: default:
if (pC_->msgPrintControl_.shouldBePrinted(keyPosState, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyPosState, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nReached unknown " "Controller \"%s\", axis %d => %s, line %d\nReached unknown "
"state P354 = %d.%s\n", "state P354 = %d.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
positionState, pC_->msgPrintControl_.getSuffix()); positionState, pC_->getMsgPrintControl().getSuffix());
} }
resetCountPosState = false; resetCountPosState = false;
@ -338,7 +338,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
"Unknown state P354 = %d has been reached. Please call " "Unknown state P354 = %d has been reached. Please call "
"the support.", "the support.",
positionState); positionState);
pl_status = setStringParam(pC_->motorMessageText_, userMessage); pl_status = setStringParam(pC_->motorMessageText(), userMessage);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -347,7 +347,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
if (resetCountPosState) { if (resetCountPosState) {
pC_->msgPrintControl_.resetCount(keyPosState, pC_->pasynUserSelf); pC_->getMsgPrintControl().resetCount(keyPosState, pC_->asynUserSelf());
} }
if (*moving) { if (*moving) {
@ -371,19 +371,19 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
// No error // No error
break; break;
case 1: case 1:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nBrake COZ not " "Controller \"%s\", axis %d => %s, line %d\nBrake COZ not "
"released (P359=1).%s\n", "released (P359=1).%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Brake COZ not released. Try resetting the axis. " "Brake COZ not released. Try resetting the axis. "
"If the problem persists, please call the support."); "If the problem persists, please call the support.");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -396,18 +396,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 2: case 2:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nMove command " "Controller \"%s\", axis %d => %s, line %d\nMove command "
"rejected because axis is already moving.%s\n", "rejected because axis is already moving.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = setStringParam(pC_->motorMessageText_, pl_status = setStringParam(pC_->motorMessageText(),
"Move command rejected because axis is " "Move command rejected because axis is "
"already moving. Please call the support"); "already moving. Please call the support");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -420,18 +420,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 3: case 3:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError motor " "Controller \"%s\", axis %d => %s, line %d\nError motor "
"FTZ.%s\n", "FTZ.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Error in motor FTZ. Try resetting the axis. If " "Error in motor FTZ. Try resetting the axis. If "
"the problem persists, please call the support"); "the problem persists, please call the support");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -444,19 +444,19 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 4: case 4:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nAxis stopped " "Controller \"%s\", axis %d => %s, line %d\nAxis stopped "
"unexpectedly.%s\n", "unexpectedly.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Axis stopped unexpectedly. Try resetting the axis " "Axis stopped unexpectedly. Try resetting the axis "
"and issue the move command again. If the problem " "and issue the move command again. If the problem "
"persists, please call the support."); "persists, please call the support.");
@ -470,19 +470,19 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 5: case 5:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nRelease removed " "Controller \"%s\", axis %d => %s, line %d\nRelease removed "
"while moving.%s\n", "while moving.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = setStringParam( pl_status = setStringParam(
pC_->motorMessageText_, pC_->motorMessageText(),
"Axis release was removed while moving. Try resetting the axis " "Axis release was removed while moving. Try resetting the axis "
"and issue the move command again. If the problem persists, please " "and issue the move command again. If the problem persists, please "
"call the support."); "call the support.");
@ -496,19 +496,19 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 6: case 6:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nEmergency stop " "Controller \"%s\", axis %d => %s, line %d\nEmergency stop "
"activated.%s\n", "activated.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, "Emergency stop activate"); setStringParam(pC_->motorMessageText(), "Emergency stop activate");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -519,18 +519,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 7: case 7:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError motor " "Controller \"%s\", axis %d => %s, line %d\nError motor "
"COZ.%s\n", "COZ.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Error in motor COZ. Try resetting the axis. If " "Error in motor COZ. Try resetting the axis. If "
"the problem persists, please call the support"); "the problem persists, please call the support");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -543,18 +543,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 8: case 8:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError motor " "Controller \"%s\", axis %d => %s, line %d\nError motor "
"COM.%s\n", "COM.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Error in motor COM. Try resetting the axis. If " "Error in motor COM. Try resetting the axis. If "
"the problem persists, please call the support"); "the problem persists, please call the support");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -567,18 +567,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 9: case 9:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError motor " "Controller \"%s\", axis %d => %s, line %d\nError motor "
"COX.%s\n", "COX.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, setStringParam(pC_->motorMessageText(),
"Error in motor COX. Try resetting the axis. If " "Error in motor COX. Try resetting the axis. If "
"the problem persists, please call the support"); "the problem persists, please call the support");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -591,18 +591,18 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
case 10: case 10:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nHit end " "Controller \"%s\", axis %d => %s, line %d\nHit end "
"switch FTZ.%s\n", "switch FTZ.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
pl_status = pl_status =
setStringParam(pC_->motorMessageText_, "Hit end switch FTZ"); setStringParam(pC_->motorMessageText(), "Hit end switch FTZ");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -614,14 +614,14 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
case 11: case 11:
// Following error // Following error
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nMaximum allowed " "Controller \"%s\", axis %d => %s, line %d\nMaximum allowed "
"following error FTZ exceeded.%s\n", "following error FTZ exceeded.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
@ -630,7 +630,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
"Check if movement range is blocked. " "Check if movement range is blocked. "
"Otherwise please call the support.", "Otherwise please call the support.",
error); error);
pl_status = setStringParam(pC_->motorMessageText_, userMessage); pl_status = setStringParam(pC_->motorMessageText(), userMessage);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -641,20 +641,20 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
break; break;
default: default:
if (pC_->msgPrintControl_.shouldBePrinted(keyError, true, if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUserSelf)) { pC_->asynUserSelf())) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nUnknown error " "Controller \"%s\", axis %d => %s, line %d\nUnknown error "
"P359 = %d.%s\n", "P359 = %d.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, error, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, error,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
resetError = false; resetError = false;
snprintf(userMessage, sizeof(userMessage), snprintf(userMessage, sizeof(userMessage),
"Unknown error P359 = %d. Please call the support.", error); "Unknown error P359 = %d. Please call the support.", error);
pl_status = setStringParam(pC_->motorMessageText_, userMessage); pl_status = setStringParam(pC_->motorMessageText(), userMessage);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -666,12 +666,12 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
if (resetError) { if (resetError) {
pC_->msgPrintControl_.resetCount(keyError, pC_->pasynUserSelf); pC_->getMsgPrintControl().resetCount(keyError, pC_->asynUserSelf());
} }
// Update the parameter library // Update the parameter library
if (error != 0) { if (error != 0) {
pl_status = setIntegerParam(pC_->motorStatusProblem_, true); pl_status = setIntegerParam(pC_->motorStatusProblem(), true);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_", return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -680,7 +680,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
if (*moving == false) { if (*moving == false) {
pl_status = setIntegerParam(pC_->motorMoveToHome_, 0); pl_status = setIntegerParam(pC_->motorMoveToHome(), 0);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMoveToHome_", return pC_->paramLibAccessFailed(pl_status, "motorMoveToHome_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -688,28 +688,28 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
} }
pl_status = setIntegerParam(pC_->motorStatusMoving_, *moving); pl_status = setIntegerParam(pC_->motorStatusMoving(), *moving);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusMoving_", return pC_->paramLibAccessFailed(pl_status, "motorStatusMoving_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = setIntegerParam(pC_->motorStatusDone_, !(*moving)); pl_status = setIntegerParam(pC_->motorStatusDone(), !(*moving));
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
pl_status = setIntegerParam(pC_->motorStatusDirection_, direction); pl_status = setIntegerParam(pC_->motorStatusDirection(), direction);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusDirection_", return pC_->paramLibAccessFailed(pl_status, "motorStatusDirection_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = pl_status = pC_->setDoubleParam(axisNo_, pC_->motorHighLimitFromDriver(),
pC_->setDoubleParam(axisNo_, pC_->motorHighLimitFromDriver_, highLimit); highLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -717,7 +717,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
} }
pl_status = pl_status =
pC_->setDoubleParam(axisNo_, pC_->motorLowLimitFromDriver_, lowLimit); pC_->setDoubleParam(axisNo_, pC_->motorLowLimitFromDriver(), lowLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -729,21 +729,21 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
double liftOffsetPosition = double liftOffsetPosition =
detectorHeight + detectorRadius * sin(beamTiltAngle); detectorHeight + detectorRadius * sin(beamTiltAngle);
pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorPosition_, pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorPosition(),
liftOffsetPosition / motorRecResolution); liftOffsetPosition / motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorPosition_", return pC_->paramLibAccessFailed(pl_status, "motorPosition_",
liftAxisNo, __PRETTY_FUNCTION__, liftAxisNo, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorHighLimitFromDriver_, pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorHighLimitFromDriver(),
liftOffsetHighLimit); liftOffsetHighLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_",
liftAxisNo, __PRETTY_FUNCTION__, liftAxisNo, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorLowLimitFromDriver_, pl_status = pC_->setDoubleParam(liftAxisNo, pC_->motorLowLimitFromDriver(),
liftOffsetLowLimit); liftOffsetLowLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_",
@ -756,7 +756,7 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
// There exists no readback value for tiltOffsetAxis_, hence we just set the // There exists no readback value for tiltOffsetAxis_, hence we just set the
// current position to the target position. // current position to the target position.
pl_status = tiltOffsetAxis_->setDoubleParam( pl_status = tiltOffsetAxis_->setDoubleParam(
pC_->motorPosition_, pC_->motorPosition(),
tiltOffsetAxis_->targetPosition_ / motorRecResolution); tiltOffsetAxis_->targetPosition_ / motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -764,14 +764,14 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
tiltAxisNo, __PRETTY_FUNCTION__, tiltAxisNo, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = pC_->setDoubleParam(tiltAxisNo, pC_->motorHighLimitFromDriver_, pl_status = pC_->setDoubleParam(tiltAxisNo, pC_->motorHighLimitFromDriver(),
tiltOffsetHighLimit); tiltOffsetHighLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_",
tiltAxisNo, __PRETTY_FUNCTION__, tiltAxisNo, __PRETTY_FUNCTION__,
__LINE__); __LINE__);
} }
pl_status = pC_->setDoubleParam(tiltAxisNo, pC_->motorLowLimitFromDriver_, pl_status = pC_->setDoubleParam(tiltAxisNo, pC_->motorLowLimitFromDriver(),
tiltOffsetLowLimit); tiltOffsetLowLimit);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_", return pC_->paramLibAccessFailed(pl_status, "motorLowLimitFromDriver_",
@ -781,14 +781,14 @@ asynStatus detectorTowerAxis::doPoll(bool *moving) {
// Transform from motor to EPICS coordinates (see comment in // Transform from motor to EPICS coordinates (see comment in
// turboPmacAxis::init()) // turboPmacAxis::init())
pl_status = pl_status = setDoubleParam(pC_->motorPosition(),
setDoubleParam(pC_->motorPosition_, beamTiltAngle / motorRecResolution); beamTiltAngle / motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_, return pC_->paramLibAccessFailed(pl_status, "motorPosition_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
} }
pl_status = setIntegerParam(pC_->positionStateRBV_, positionState); pl_status = setIntegerParam(pC_->positionStateRBV(), positionState);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_", return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -803,7 +803,7 @@ asynStatus detectorTowerAxis::doMove(double position, int relative,
double acceleration) { double acceleration) {
double motorRecResolution = 0.0; double motorRecResolution = 0.0;
asynStatus pl_status = pC_->getDoubleParam( asynStatus pl_status = pC_->getDoubleParam(
axisNo_, pC_->motorRecResolution_, &motorRecResolution); axisNo_, pC_->motorRecResolution(), &motorRecResolution);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_", return pC_->paramLibAccessFailed(pl_status, "motorRecResolution_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -835,16 +835,16 @@ asynStatus detectorTowerAxis::startCombinedMove() {
// If the axis is in changer position, it must be moved into working // If the axis is in changer position, it must be moved into working
// position before any move can be started. // position before any move can be started.
bool isInChangerPos = positionState == 2 || positionState == 3; bool isInChangerPos = positionState == 2 || positionState == 3;
if (pC_->msgPrintControl_.shouldBePrinted( if (pC_->getMsgPrintControl().shouldBePrinted(
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
isInChangerPos, pC_->pasynUserSelf)) { isInChangerPos, pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nAxis cannot be " "Controller \"%s\", axis %d => %s, line %d\nAxis cannot be "
"moved because it is moving from working to changer " "moved because it is moving from working to changer "
"position, is in changer position or is moving from changer " "position, is in changer position or is moving from changer "
"to working position.%s\n", "to working position.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
if (isInChangerPos) { if (isInChangerPos) {
startingDeferredMovement_ = false; startingDeferredMovement_ = false;
@ -858,7 +858,7 @@ asynStatus detectorTowerAxis::startCombinedMove() {
tiltOffsetAxis_->targetPosition_); tiltOffsetAxis_->targetPosition_);
// DEBUG // DEBUG
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, "%s\n", command); asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR, "%s\n", command);
// 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.
@ -872,12 +872,12 @@ asynStatus detectorTowerAxis::startCombinedMove() {
if (rw_status != asynSuccess) { if (rw_status != asynSuccess) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStarting movement to " "Controller \"%s\", axis %d => %s, line %d\nStarting movement to "
"target position %lf failed.\n", "target position %lf failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
motorCoordinatesPosition); motorCoordinatesPosition);
pl_status = setIntegerParam(pC_->motorStatusProblem_, true); pl_status = setIntegerParam(pC_->motorStatusProblem(), true);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_", return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -904,12 +904,12 @@ asynStatus detectorTowerAxis::stop(double acceleration) {
if (rw_status != asynSuccess) { if (rw_status != asynSuccess) {
asynPrint( asynPrint(
pC_->pasynUserSelf, ASYN_TRACE_ERROR, pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStopping the movement " "Controller \"%s\", axis %d => %s, line %d\nStopping the movement "
"failed.\n", "failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__); pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
pl_status = setIntegerParam(pC_->motorStatusProblem_, true); pl_status = setIntegerParam(pC_->motorStatusProblem(), true);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_", return pC_->paramLibAccessFailed(pl_status, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -923,7 +923,7 @@ asynStatus detectorTowerAxis::stop(double acceleration) {
// The detector tower axis uses absolute encoders // The detector tower axis uses absolute encoders
asynStatus detectorTowerAxis::readEncoderType() { asynStatus detectorTowerAxis::readEncoderType() {
asynStatus status = setStringParam(pC_->encoderType_, AbsoluteEncoder); asynStatus status = setStringParam(pC_->encoderType(), AbsoluteEncoder);
if (status != asynSuccess) { if (status != asynSuccess) {
return pC_->paramLibAccessFailed(status, "encoderType_", axisNo_, return pC_->paramLibAccessFailed(status, "encoderType_", axisNo_,
__PRETTY_FUNCTION__, __LINE__); __PRETTY_FUNCTION__, __LINE__);
@ -950,7 +950,7 @@ detectorTowerAxis::toggleWorkingChangerState(bool toChangingPosition) {
doPoll(&moving); doPoll(&moving);
pl_status = pl_status =
pC_->getIntegerParam(axisNo_, pC_->positionStateRBV_, &positionState); pC_->getIntegerParam(axisNo_, pC_->positionStateRBV(), &positionState);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_", return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,
@ -958,15 +958,15 @@ detectorTowerAxis::toggleWorkingChangerState(bool toChangingPosition) {
} }
if (moving) { if (moving) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nAxis is not " "Controller \"%s\", axis %d => %s, line %d\nAxis is not "
"idle and can therefore not be moved to %s state.%s\n", "idle and can therefore not be moved to %s state.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
toChangingPosition ? "changer" : "working", toChangingPosition ? "changer" : "working",
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
pl_status = setStringParam( pl_status = setStringParam(
pC_->motorMessageText_, pC_->motorMessageText(),
"Axis cannot be moved to changer position while it is moving."); "Axis cannot be moved to changer position while it is moving.");
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_", return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
@ -980,15 +980,15 @@ detectorTowerAxis::toggleWorkingChangerState(bool toChangingPosition) {
bool isAlreadyThere = (toChangingPosition == false && positionState == 1) || bool isAlreadyThere = (toChangingPosition == false && positionState == 1) ||
(toChangingPosition == true && positionState == 2); (toChangingPosition == true && positionState == 2);
if (pC_->msgPrintControl_.shouldBePrinted( if (pC_->getMsgPrintControl().shouldBePrinted(
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
isAlreadyThere, pC_->pasynUserSelf)) { isAlreadyThere, pC_->asynUserSelf())) {
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_WARNING, asynPrint(pC_->asynUserSelf(), ASYN_TRACE_WARNING,
"Controller \"%s\", axis %d => %s, line %d\nAxis is already " "Controller \"%s\", axis %d => %s, line %d\nAxis is already "
"in %s position.%s\n", "in %s position.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
toChangingPosition ? "changer" : "working", toChangingPosition ? "changer" : "working",
pC_->msgPrintControl_.getSuffix()); pC_->getMsgPrintControl().getSuffix());
} }
if (isAlreadyThere) { if (isAlreadyThere) {
return asynSuccess; return asynSuccess;
@ -997,11 +997,11 @@ detectorTowerAxis::toggleWorkingChangerState(bool toChangingPosition) {
// Move the axis into changer or working position // Move the axis into changer or working position
if (toChangingPosition) { if (toChangingPosition) {
rw_status = pC_->writeRead(axisNo_, "P350=2", response, 0); rw_status = pC_->writeRead(axisNo_, "P350=2", response, 0);
pl_status = setStringParam(pC_->motorMessageText_, pl_status = setStringParam(pC_->motorMessageText(),
"Moving to changer position ..."); "Moving to changer position ...");
} else { } else {
rw_status = pC_->writeRead(axisNo_, "P350=3", response, 0); rw_status = pC_->writeRead(axisNo_, "P350=3", response, 0);
pl_status = setStringParam(pC_->motorMessageText_, pl_status = setStringParam(pC_->motorMessageText(),
"Moving to working state ..."); "Moving to working state ...");
} }
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
@ -1019,7 +1019,7 @@ asynStatus detectorTowerAxis::reset() {
int positionState = 0; int positionState = 0;
pl_status = pl_status =
pC_->getIntegerParam(axisNo_, pC_->positionStateRBV_, &positionState); pC_->getIntegerParam(axisNo_, pC_->positionStateRBV(), &positionState);
if (pl_status != asynSuccess) { if (pl_status != asynSuccess) {
return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_", return pC_->paramLibAccessFailed(pl_status, "positionStateRBV_",
axisNo_, __PRETTY_FUNCTION__, axisNo_, __PRETTY_FUNCTION__,

View File

@ -123,7 +123,6 @@ class detectorTowerAxis : public turboPmacAxis {
auxiliaryAxis *liftOffsetAxis_; auxiliaryAxis *liftOffsetAxis_;
private: private:
friend class detectorTowerController;
friend class auxiliaryAxis; friend class auxiliaryAxis;
}; };

View File

@ -74,15 +74,16 @@ class detectorTowerController : public turboPmacController {
*/ */
detectorTowerAxis *getDetectorTowerAxis(int axisNo); detectorTowerAxis *getDetectorTowerAxis(int axisNo);
// Accessors for additional PVs
int positionStateRBV() { return positionStateRBV_; }
int changeState() { return changeState_; }
private: private:
// Indices of additional PVs // Indices of additional PVs
#define FIRST_detectorTower_PARAM positionStateRBV_ #define FIRST_detectorTower_PARAM positionStateRBV_
int positionStateRBV_; int positionStateRBV_;
int changeState_; int changeState_;
#define LAST_detectorTower_PARAM changeState_ #define LAST_detectorTower_PARAM changeState_
friend class detectorTowerAxis;
friend class auxiliaryAxis;
}; };
#define NUM_detectorTower_DRIVER_PARAMS \ #define NUM_detectorTower_DRIVER_PARAMS \
(&LAST_detectorTower_PARAM - &FIRST_detectorTower_PARAM + 1) (&LAST_detectorTower_PARAM - &FIRST_detectorTower_PARAM + 1)