Removed friend class declaration and replaced access to private
properties with accessors
This commit is contained in:
@ -54,13 +54,13 @@ turboPmacAxis::turboPmacAxis(turboPmacController *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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,10 +82,10 @@ turboPmacAxis::turboPmacAxis(turboPmacController *pC, int axisNo,
|
|||||||
axisStatus_ = 0;
|
axisStatus_ = 0;
|
||||||
|
|
||||||
// Provide initial values for some parameter library entries
|
// Provide initial values for some parameter library entries
|
||||||
status = pC_->setIntegerParam(axisNo_, pC_->rereadEncoderPosition_, 0);
|
status = pC_->setIntegerParam(axisNo_, pC_->rereadEncoderPosition(), 0);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
|
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
|
||||||
"(setting a parameter value failed with %s)\n. Terminating IOC",
|
"(setting a parameter value failed with %s)\n. Terminating IOC",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
@ -94,10 +94,10 @@ turboPmacAxis::turboPmacAxis(turboPmacController *pC, int axisNo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// turboPmac motors can always be disabled
|
// turboPmac motors can always be disabled
|
||||||
status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable_, 1);
|
status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable(), 1);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nFATAL ERROR "
|
"Controller \"%s\", axis %d => %s, line %d\nFATAL ERROR "
|
||||||
"(setting a parameter value failed with %s)\n. Terminating IOC",
|
"(setting a parameter value failed with %s)\n. Terminating IOC",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
@ -135,11 +135,11 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -186,14 +186,14 @@ asynStatus turboPmacAxis::init() {
|
|||||||
motorPosition = motorPosition / motorRecResolution;
|
motorPosition = motorPosition / motorRecResolution;
|
||||||
|
|
||||||
// Store these values in the parameter library
|
// Store these values in the parameter library
|
||||||
status = pC_->setDoubleParam(axisNo_, pC_->motorPosition_, motorPosition);
|
status = pC_->setDoubleParam(axisNo_, pC_->motorPosition(), motorPosition);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(status, "motorPosition_", axisNo_,
|
return pC_->paramLibAccessFailed(status, "motorPosition_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial motor status is idle
|
// Initial motor status is idle
|
||||||
status = pC_->setIntegerParam(axisNo_, pC_->motorStatusDone_, 1);
|
status = pC_->setIntegerParam(axisNo_, pC_->motorStatusDone(), 1);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(status, "motorStatusDone_", axisNo_,
|
return pC_->paramLibAccessFailed(status, "motorStatusDone_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
@ -215,7 +215,7 @@ asynStatus turboPmacAxis::init() {
|
|||||||
// If we can't communicate with the parameter library, it doesn't make
|
// If we can't communicate with the parameter library, it doesn't make
|
||||||
// sense to try and upstream this to the user -> Just log the error
|
// sense to try and upstream this to the user -> Just log the error
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\ncallParamCallbacks "
|
"Controller \"%s\", axis %d => %s, line %d\ncallParamCallbacks "
|
||||||
"failed with %s.\n",
|
"failed with %s.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
@ -266,10 +266,10 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
time_t currentTime = time(NULL);
|
time_t currentTime = time(NULL);
|
||||||
bool timedOut = (currentTime > timeAtHandshake_ + 5);
|
bool timedOut = (currentTime > timeAtHandshake_ + 5);
|
||||||
|
|
||||||
if (pC_->msgPrintControl_.shouldBePrinted(
|
if (pC_->getMsgPrintControl().shouldBePrinted(
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, timedOut,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, timedOut,
|
||||||
pC_->pasynUserSelf)) {
|
pC_->asynUserSelf())) {
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nAsked for a "
|
"Controller \"%s\", axis %d => %s, line %d\nAsked for a "
|
||||||
"handshake at %ld s and didn't get a positive reply yet "
|
"handshake at %ld s and didn't get a positive reply yet "
|
||||||
"(current time is %ld s).\n",
|
"(current time is %ld s).\n",
|
||||||
@ -279,7 +279,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
|
|
||||||
if (timedOut) {
|
if (timedOut) {
|
||||||
pl_status =
|
pl_status =
|
||||||
setStringParam(pC_->motorMessageText_,
|
setStringParam(pC_->motorMessageText(),
|
||||||
"Timed out while waiting for a handshake");
|
"Timed out while waiting for a handshake");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||||
@ -315,14 +315,14 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// poll. This is already part of the movement procedure.
|
// poll. This is already part of the movement procedure.
|
||||||
*moving = true;
|
*moving = true;
|
||||||
|
|
||||||
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,
|
return pC_->paramLibAccessFailed(pl_status,
|
||||||
"motorStatusMoving_", axisNo_,
|
"motorStatusMoving_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __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_",
|
return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_",
|
||||||
axisNo_, __PRETTY_FUNCTION__,
|
axisNo_, __PRETTY_FUNCTION__,
|
||||||
@ -334,7 +334,7 @@ asynStatus turboPmacAxis::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_",
|
||||||
@ -344,14 +344,14 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
|
|
||||||
// Read the previous motor position
|
// Read the previous motor position
|
||||||
pl_status =
|
pl_status =
|
||||||
pC_->getDoubleParam(axisNo_, pC_->motorPosition_, &previousPosition);
|
pC_->getDoubleParam(axisNo_, pC_->motorPosition(), &previousPosition);
|
||||||
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__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the previous motor position
|
// Read the previous motor position
|
||||||
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorStatusDone_,
|
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorStatusDone(),
|
||||||
&previousStatusDone);
|
&previousStatusDone);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "motorStatusDone_", axisNo_,
|
||||||
@ -391,7 +391,7 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -404,7 +404,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
axisStatus_ = axStatus;
|
axisStatus_ = axStatus;
|
||||||
|
|
||||||
// Update the enablement PV
|
// Update the enablement PV
|
||||||
pl_status = setIntegerParam(pC_->motorEnableRBV_,
|
pl_status = setIntegerParam(pC_->motorEnableRBV(),
|
||||||
(axStatus != -3 && axStatus != -5));
|
(axStatus != -3 && axStatus != -5));
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorEnableRBV_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "motorEnableRBV_", axisNo_,
|
||||||
@ -433,7 +433,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// Axis is deactivated
|
// Axis is deactivated
|
||||||
*moving = false;
|
*moving = false;
|
||||||
|
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Deactivated");
|
pl_status = setStringParam(pC_->motorMessageText(), "Deactivated");
|
||||||
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__,
|
||||||
@ -444,18 +444,18 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// Emergency stop
|
// Emergency stop
|
||||||
*moving = false;
|
*moving = false;
|
||||||
|
|
||||||
if (pC_->msgPrintControl_.shouldBePrinted(keyStatus, true,
|
if (pC_->getMsgPrintControl().shouldBePrinted(keyStatus, 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());
|
||||||
}
|
}
|
||||||
resetCountStatus = false;
|
resetCountStatus = false;
|
||||||
|
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Emergency stop");
|
pl_status = setStringParam(pC_->motorMessageText(), "Emergency stop");
|
||||||
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__,
|
||||||
@ -467,7 +467,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// Disabled
|
// Disabled
|
||||||
*moving = false;
|
*moving = false;
|
||||||
|
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Disabled");
|
pl_status = setStringParam(pC_->motorMessageText(), "Disabled");
|
||||||
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__,
|
||||||
@ -499,7 +499,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
*moving = true;
|
*moving = true;
|
||||||
|
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nAxis is moving\n",
|
"Controller \"%s\", axis %d => %s, line %d\nAxis is moving\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -507,14 +507,14 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
default:
|
default:
|
||||||
*moving = false;
|
*moving = false;
|
||||||
|
|
||||||
if (pC_->msgPrintControl_.shouldBePrinted(keyStatus, true,
|
if (pC_->getMsgPrintControl().shouldBePrinted(keyStatus, true,
|
||||||
pC_->pasynUserSelf)) {
|
pC_->asynUserSelf())) {
|
||||||
|
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nReached "
|
"Controller \"%s\", axis %d => %s, line %d\nReached "
|
||||||
"unreachable state P%2.2d00 = %d.%s\n",
|
"unreachable state P%2.2d00 = %d.%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
axisNo_, axStatus, pC_->msgPrintControl_.getSuffix());
|
axisNo_, axStatus, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetCountStatus = false;
|
resetCountStatus = false;
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"Unknown state P%2.2d00 = %d has been reached. Please call "
|
"Unknown state P%2.2d00 = %d has been reached. Please call "
|
||||||
"the support.",
|
"the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -531,7 +531,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resetCountStatus) {
|
if (resetCountStatus) {
|
||||||
pC_->msgPrintControl_.resetCount(keyStatus, pC_->pasynUserSelf);
|
pC_->getMsgPrintControl().resetCount(keyStatus, pC_->asynUserSelf());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*moving) {
|
if (*moving) {
|
||||||
@ -556,17 +556,17 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
case 1:
|
case 1:
|
||||||
// EPICS should already prevent this issue in the first place,
|
// EPICS should already prevent this issue in the first place,
|
||||||
// since it contains the user limits
|
// since it contains the user limits
|
||||||
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\nTarget "
|
"Controller \"%s\", axis %d => %s, line %d\nTarget "
|
||||||
"position would exceed user limits.%s\n",
|
"position would exceed user limits.%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(),
|
||||||
"Target position would exceed software "
|
"Target position would exceed software "
|
||||||
"limits. Please call the support.");
|
"limits. Please call the support.");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
@ -579,19 +579,19 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
// Command not possible
|
// Command not possible
|
||||||
if (pC_->msgPrintControl_.shouldBePrinted(keyStatus, true,
|
if (pC_->getMsgPrintControl().shouldBePrinted(keyStatus, 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 is "
|
"Controller \"%s\", axis %d => %s, line %d\nAxis is "
|
||||||
"still moving, but received another move command. EPICS "
|
"still moving, but received another move command. EPICS "
|
||||||
"should prevent this, check if *moving is set correctly.%s\n",
|
"should prevent this, check if *moving is set correctly.%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(),
|
||||||
"Axis received move command while it is "
|
"Axis received move command while it is "
|
||||||
"still moving. Please call the support.");
|
"still moving. Please call the support.");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
@ -603,13 +603,13 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
poll_status = asynError;
|
poll_status = asynError;
|
||||||
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\nAir cushion "
|
"Controller \"%s\", axis %d => %s, line %d\nAir cushion "
|
||||||
"feedback stopped during movement (P%2.2d01 = %d).%s\n",
|
"feedback stopped during movement (P%2.2d01 = %d).%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
axisNo_, error, pC_->msgPrintControl_.getSuffix());
|
axisNo_, error, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -618,7 +618,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"%d). Please call the support.",
|
"%d). Please call the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -626,14 +626,14 @@ asynStatus turboPmacAxis::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(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nNo air cushion "
|
"Controller \"%s\", axis %d => %s, line %d\nNo air cushion "
|
||||||
"feedback before movement start (P%2.2d01 = %d).%s\n",
|
"feedback before movement start (P%2.2d01 = %d).%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, axisNo_,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, axisNo_,
|
||||||
error, pC_->msgPrintControl_.getSuffix());
|
error, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"No air cushion feedback before movement start (P%2.2d01 = "
|
"No air cushion feedback before movement start (P%2.2d01 = "
|
||||||
"%d). Please call the support.",
|
"%d). Please call the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -656,14 +656,14 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
which is not properly homed or if a bug occured.
|
which is not properly homed or if a bug occured.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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 hit the "
|
"Controller \"%s\", axis %d => %s, line %d\nAxis hit the "
|
||||||
"controller limits.%s\n",
|
"controller limits.%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
pC_->msgPrintControl_.getSuffix());
|
pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -674,7 +674,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"Otherwise please call the support.",
|
"Otherwise please call the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -686,14 +686,14 @@ asynStatus turboPmacAxis::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 exceeded.%s\n",
|
"following error 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;
|
||||||
|
|
||||||
@ -702,7 +702,7 @@ asynStatus turboPmacAxis::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.",
|
||||||
axisNo_, error);
|
axisNo_, error);
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, command);
|
pl_status = setStringParam(pC_->motorMessageText(), command);
|
||||||
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__,
|
||||||
@ -713,13 +713,13 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
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\nSecurity "
|
"Controller \"%s\", axis %d => %s, line %d\nSecurity "
|
||||||
"input is triggered (P%2.2d01 = %d).%s\n",
|
"input is triggered (P%2.2d01 = %d).%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
axisNo_, error, pC_->msgPrintControl_.getSuffix());
|
axisNo_, error, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"for errors (if available). Otherwise please call "
|
"for errors (if available). Otherwise please call "
|
||||||
"the support.",
|
"the support.",
|
||||||
axisNo_, error);
|
axisNo_, error);
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, command);
|
pl_status = setStringParam(pC_->motorMessageText(), command);
|
||||||
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__,
|
||||||
@ -741,13 +741,13 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
case 13:
|
case 13:
|
||||||
// Driver hardware error triggered
|
// Driver hardware error triggered
|
||||||
|
|
||||||
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\nDriver "
|
"Controller \"%s\", axis %d => %s, line %d\nDriver "
|
||||||
"hardware error triggered.%s\n",
|
"hardware error triggered.%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
pC_->msgPrintControl_.getSuffix());
|
pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -755,7 +755,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"Driver hardware error (P%2.2d01 = 13). "
|
"Driver hardware error (P%2.2d01 = 13). "
|
||||||
"Please call the support.",
|
"Please call the support.",
|
||||||
axisNo_);
|
axisNo_);
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, command);
|
pl_status = setStringParam(pC_->motorMessageText(), command);
|
||||||
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__,
|
||||||
@ -768,13 +768,13 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// EPICS should already prevent this issue in the first place,
|
// EPICS should already prevent this issue in the first place,
|
||||||
// since it contains the user limits
|
// since it contains the user limits
|
||||||
|
|
||||||
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\nMove "
|
"Controller \"%s\", axis %d => %s, line %d\nMove "
|
||||||
"command exceeds hardware limits (P%2.2d01 = %d).%s\n",
|
"command exceeds hardware limits (P%2.2d01 = %d).%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
axisNo_, error, pC_->msgPrintControl_.getSuffix());
|
axisNo_, error, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
"Move command exceeds hardware limits (P%2.2d01 = %d). Please "
|
"Move command exceeds hardware limits (P%2.2d01 = %d). Please "
|
||||||
"call the support.",
|
"call the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -793,21 +793,21 @@ asynStatus turboPmacAxis::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 "
|
||||||
"P%2.2d01 = %d.%s\n",
|
"P%2.2d01 = %d.%s\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, axisNo_,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, axisNo_,
|
||||||
error, pC_->msgPrintControl_.getSuffix());
|
error, pC_->getMsgPrintControl().getSuffix());
|
||||||
}
|
}
|
||||||
resetError = false;
|
resetError = false;
|
||||||
|
|
||||||
snprintf(userMessage, sizeof(userMessage),
|
snprintf(userMessage, sizeof(userMessage),
|
||||||
"Unknown error P%2.2d01 = %d. Please call the support.",
|
"Unknown error P%2.2d01 = %d. Please call the support.",
|
||||||
axisNo_, error);
|
axisNo_, 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__,
|
||||||
@ -819,12 +819,12 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -833,7 +833,7 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -841,28 +841,28 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -870,7 +870,7 @@ asynStatus turboPmacAxis::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, "motorLowLimit_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "motorLowLimit_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
@ -880,7 +880,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
|||||||
// turboPmacAxis::init())
|
// turboPmacAxis::init())
|
||||||
currentPosition = currentPosition / motorRecResolution;
|
currentPosition = currentPosition / motorRecResolution;
|
||||||
|
|
||||||
pl_status = setDoubleParam(pC_->motorPosition_, currentPosition);
|
pl_status = setDoubleParam(pC_->motorPosition(), currentPosition);
|
||||||
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__);
|
||||||
@ -909,13 +909,13 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
|
|||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorEnableRBV_, &enabled);
|
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorEnableRBV(), &enabled);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "enableMotorRBV_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "enableMotorRBV_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
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_",
|
||||||
@ -925,7 +925,7 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
|
|||||||
|
|
||||||
if (enabled == 0) {
|
if (enabled == 0) {
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nAxis is disabled.\n",
|
"Controller \"%s\", axis %d => %s, line %d\nAxis is disabled.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
@ -935,13 +935,13 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
|
|||||||
motorCoordinatesPosition = position * motorRecResolution;
|
motorCoordinatesPosition = position * motorRecResolution;
|
||||||
motorVelocity = maxVelocity * motorRecResolution;
|
motorVelocity = maxVelocity * motorRecResolution;
|
||||||
|
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nStart of axis to "
|
"Controller \"%s\", axis %d => %s, line %d\nStart of axis to "
|
||||||
"position %lf.\n",
|
"position %lf.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, position);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, position);
|
||||||
|
|
||||||
// Check if the speed is allowed to be changed
|
// Check if the speed is allowed to be changed
|
||||||
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorCanSetSpeed_,
|
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorCanSetSpeed(),
|
||||||
&motorCanSetSpeed);
|
&motorCanSetSpeed);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorCanSetSpeed_",
|
return pC_->paramLibAccessFailed(pl_status, "motorCanSetSpeed_",
|
||||||
@ -957,7 +957,7 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
|
|||||||
motorVelocity);
|
motorVelocity);
|
||||||
writeOffset = strlen(command);
|
writeOffset = strlen(command);
|
||||||
|
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nSetting speed "
|
"Controller \"%s\", axis %d => %s, line %d\nSetting speed "
|
||||||
"to %lf.\n",
|
"to %lf.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
@ -981,12 +981,12 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
|
|||||||
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__,
|
||||||
@ -1026,12 +1026,12 @@ asynStatus turboPmacAxis::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__,
|
||||||
@ -1058,15 +1058,15 @@ asynStatus turboPmacAxis::reset() {
|
|||||||
snprintf(command, sizeof(command), "P%2.2d01=0", axisNo_);
|
snprintf(command, sizeof(command), "P%2.2d01=0", axisNo_);
|
||||||
rw_status = pC_->writeRead(axisNo_, command, response, 0);
|
rw_status = pC_->writeRead(axisNo_, command, response, 0);
|
||||||
|
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, "Resetting\n");
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR, "Resetting\n");
|
||||||
|
|
||||||
if (rw_status != asynSuccess) {
|
if (rw_status != asynSuccess) {
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nResetting the "
|
"Controller \"%s\", axis %d => %s, line %d\nResetting the "
|
||||||
"error failed\n",
|
"error 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__,
|
||||||
@ -1093,7 +1093,7 @@ asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
|
|||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
pl_status = pC_->getStringParam(axisNo_, pC_->encoderType_,
|
pl_status = pC_->getStringParam(axisNo_, pC_->encoderType(),
|
||||||
sizeof(response), response);
|
sizeof(response), response);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "encoderType_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "encoderType_", axisNo_,
|
||||||
@ -1109,14 +1109,14 @@ asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
|
|||||||
return rw_status;
|
return rw_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
pl_status = setIntegerParam(pC_->motorMoveToHome_, 1);
|
pl_status = setIntegerParam(pC_->motorMoveToHome(), 1);
|
||||||
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__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Homing");
|
pl_status = setStringParam(pC_->motorMessageText(), "Homing");
|
||||||
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__,
|
||||||
@ -1124,7 +1124,7 @@ asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
|
|||||||
}
|
}
|
||||||
return callParamCallbacks();
|
return callParamCallbacks();
|
||||||
} else {
|
} else {
|
||||||
pl_status = setStringParam(pC_->motorMessageText_,
|
pl_status = setStringParam(pC_->motorMessageText(),
|
||||||
"Can't home a motor with absolute encoder");
|
"Can't home a motor with absolute encoder");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||||
@ -1183,9 +1183,9 @@ asynStatus turboPmacAxis::readEncoderType() {
|
|||||||
|
|
||||||
// If true, the encoder is incremental
|
// If true, the encoder is incremental
|
||||||
if (encoder_id <= number_of_axes) {
|
if (encoder_id <= number_of_axes) {
|
||||||
pl_status = setStringParam(pC_->encoderType_, IncrementalEncoder);
|
pl_status = setStringParam(pC_->encoderType(), IncrementalEncoder);
|
||||||
} else {
|
} else {
|
||||||
pl_status = setStringParam(pC_->encoderType_, AbsoluteEncoder);
|
pl_status = setStringParam(pC_->encoderType(), AbsoluteEncoder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
@ -1222,7 +1222,7 @@ asynStatus turboPmacAxis::rereadEncoder() {
|
|||||||
if (rw_status != asynSuccess) {
|
if (rw_status != asynSuccess) {
|
||||||
return rw_status;
|
return rw_status;
|
||||||
}
|
}
|
||||||
pl_status = pC_->getStringParam(axisNo_, pC_->encoderType_,
|
pl_status = pC_->getStringParam(axisNo_, pC_->encoderType(),
|
||||||
sizeof(encoderType), encoderType);
|
sizeof(encoderType), encoderType);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "encoderType_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "encoderType_", axisNo_,
|
||||||
@ -1231,7 +1231,7 @@ asynStatus turboPmacAxis::rereadEncoder() {
|
|||||||
|
|
||||||
// Abort if the axis is incremental
|
// Abort if the axis is incremental
|
||||||
if (strcmp(encoderType, IncrementalEncoder) == 0) {
|
if (strcmp(encoderType, IncrementalEncoder) == 0) {
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nEncoder is "
|
"Controller \"%s\", axis %d => %s, line %d\nEncoder is "
|
||||||
"not reread because it is incremental.\n",
|
"not reread because it is incremental.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
@ -1241,19 +1241,19 @@ asynStatus turboPmacAxis::rereadEncoder() {
|
|||||||
// Check if the axis is disabled. If not, inform the user that this
|
// Check if the axis is disabled. If not, inform the user that this
|
||||||
// is necessary
|
// is necessary
|
||||||
int enabled = 0;
|
int enabled = 0;
|
||||||
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorEnableRBV_, &enabled);
|
pl_status = pC_->getIntegerParam(axisNo_, pC_->motorEnableRBV(), &enabled);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "enableMotorRBV_", axisNo_,
|
return pC_->paramLibAccessFailed(pl_status, "enableMotorRBV_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabled == 1) {
|
if (enabled == 1) {
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_WARNING,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_WARNING,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nAxis must be "
|
"Controller \"%s\", axis %d => %s, line %d\nAxis must be "
|
||||||
"disabled before rereading the encoder.\n",
|
"disabled before rereading the encoder.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
pl_status = setStringParam(
|
pl_status = setStringParam(
|
||||||
pC_->motorMessageText_,
|
pC_->motorMessageText(),
|
||||||
"Axis must be disabled before rereading the encoder.");
|
"Axis must be disabled before rereading the encoder.");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||||
@ -1264,7 +1264,7 @@ asynStatus turboPmacAxis::rereadEncoder() {
|
|||||||
} else {
|
} else {
|
||||||
snprintf(command, sizeof(command), "M%2.2d=15", axisNo_);
|
snprintf(command, sizeof(command), "M%2.2d=15", axisNo_);
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nRereading absolute "
|
"Controller \"%s\", axis %d => %s, line %d\nRereading absolute "
|
||||||
"encoder via command %s.\n",
|
"encoder via command %s.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, command);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, command);
|
||||||
@ -1279,7 +1279,7 @@ asynStatus turboPmacAxis::rereadEncoder() {
|
|||||||
// turn off parameter as finished rereading
|
// turn off parameter as finished rereading
|
||||||
// this will only be immediately noticed in the read back variable
|
// this will only be immediately noticed in the read back variable
|
||||||
// though
|
// though
|
||||||
pl_status = pC_->setIntegerParam(pC_->rereadEncoderPosition_, 0);
|
pl_status = pC_->setIntegerParam(pC_->rereadEncoderPosition(), 0);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "rereadEncoderPosition_",
|
return pC_->paramLibAccessFailed(pl_status, "rereadEncoderPosition_",
|
||||||
axisNo_, __PRETTY_FUNCTION__,
|
axisNo_, __PRETTY_FUNCTION__,
|
||||||
@ -1311,13 +1311,13 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
// actually be disabled in this state!
|
// actually be disabled in this state!
|
||||||
if (axisStatus_ == 1 || axisStatus_ == 2 || axisStatus_ == 3 ||
|
if (axisStatus_ == 1 || axisStatus_ == 2 || axisStatus_ == 3 ||
|
||||||
axisStatus_ == 4 || axisStatus_ == 5) {
|
axisStatus_ == 4 || axisStatus_ == 5) {
|
||||||
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 enabled / disabled.\n",
|
"idle and can therefore not be enabled / disabled.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
|
|
||||||
pl_status =
|
pl_status =
|
||||||
setStringParam(pC_->motorMessageText_,
|
setStringParam(pC_->motorMessageText(),
|
||||||
"Axis cannot be disabled while it is moving.");
|
"Axis cannot be disabled while it is moving.");
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||||
@ -1332,7 +1332,7 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
// was sent => Do nothing
|
// was sent => Do nothing
|
||||||
if ((axisStatus_ != -3) == on) {
|
if ((axisStatus_ != -3) == on) {
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->pasynUserSelf, ASYN_TRACE_WARNING,
|
pC_->asynUserSelf(), ASYN_TRACE_WARNING,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nAxis is already %s.\n",
|
"Controller \"%s\", axis %d => %s, line %d\nAxis is already %s.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
on ? "enabled" : "disabled");
|
on ? "enabled" : "disabled");
|
||||||
@ -1349,14 +1349,14 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
|
|
||||||
// Enable / disable the axis if it is not moving
|
// Enable / disable the axis if it is not moving
|
||||||
snprintf(command, sizeof(command), "M%2.2d14=%d", axisNo_, on);
|
snprintf(command, sizeof(command), "M%2.2d14=%d", axisNo_, on);
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\n%s axis\n",
|
"Controller \"%s\", axis %d => %s, line %d\n%s axis\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
on ? "Enable" : "Disable");
|
on ? "Enable" : "Disable");
|
||||||
if (on == 0) {
|
if (on == 0) {
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Disabling ...");
|
pl_status = setStringParam(pC_->motorMessageText(), "Disabling ...");
|
||||||
} else {
|
} else {
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Enabling ...");
|
pl_status = setStringParam(pC_->motorMessageText(), "Enabling ...");
|
||||||
}
|
}
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||||
@ -1396,7 +1396,7 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
|
|
||||||
// Failed to change axis status within timeout_enable_disable => Send a
|
// Failed to change axis status within timeout_enable_disable => Send a
|
||||||
// corresponding message
|
// corresponding message
|
||||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_FLOW,
|
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_FLOW,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nFailed to %s axis "
|
"Controller \"%s\", axis %d => %s, line %d\nFailed to %s axis "
|
||||||
"within %d seconds\n",
|
"within %d seconds\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||||
@ -1405,7 +1405,7 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
// Output message to user
|
// Output message to user
|
||||||
snprintf(command, sizeof(command), "Failed to %s within %d seconds",
|
snprintf(command, sizeof(command), "Failed to %s within %d seconds",
|
||||||
on ? "enable" : "disable", timeout_enable_disable);
|
on ? "enable" : "disable", timeout_enable_disable);
|
||||||
pl_status = setStringParam(pC_->motorMessageText_, "Enabling ...");
|
pl_status = setStringParam(pC_->motorMessageText(), "Enabling ...");
|
||||||
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__,
|
||||||
|
@ -120,9 +120,6 @@ class turboPmacAxis : public sinqAxis {
|
|||||||
|
|
||||||
// The axis status is used when enabling / disabling the motor
|
// The axis status is used when enabling / disabling the motor
|
||||||
int axisStatus_;
|
int axisStatus_;
|
||||||
|
|
||||||
private:
|
|
||||||
friend class turboPmacController;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,9 +73,6 @@ class turboPmacController : public sinqController {
|
|||||||
*/
|
*/
|
||||||
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
|
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
|
||||||
|
|
||||||
protected:
|
|
||||||
asynUser *lowLevelPortUser_;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Send a command to the hardware and receive a response
|
* @brief Send a command to the hardware and receive a response
|
||||||
*
|
*
|
||||||
@ -118,12 +115,18 @@ class turboPmacController : public sinqController {
|
|||||||
const char *functionName,
|
const char *functionName,
|
||||||
int lineNumber);
|
int lineNumber);
|
||||||
|
|
||||||
protected:
|
// Accessors for additional PVs
|
||||||
|
int rereadEncoderPosition() { return rereadEncoderPosition_; }
|
||||||
|
int readConfig() { return readConfig_; }
|
||||||
|
|
||||||
// Set the maximum buffer size. This is an empirical value which must be
|
// Set the maximum buffer size. This is an empirical value which must be
|
||||||
// large enough to avoid overflows for all commands to the device /
|
// large enough to avoid overflows for all commands to the device /
|
||||||
// responses from it.
|
// responses from it.
|
||||||
static const uint32_t MAXBUF_ = 200;
|
static const uint32_t MAXBUF_ = 200;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
asynUser *lowLevelPortUser_;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Timeout for the communication process in seconds
|
Timeout for the communication process in seconds
|
||||||
*/
|
*/
|
||||||
@ -136,8 +139,6 @@ class turboPmacController : public sinqController {
|
|||||||
int rereadEncoderPosition_;
|
int rereadEncoderPosition_;
|
||||||
int readConfig_;
|
int readConfig_;
|
||||||
#define LAST_turboPmac_PARAM readConfig_
|
#define LAST_turboPmac_PARAM readConfig_
|
||||||
|
|
||||||
friend class turboPmacAxis;
|
|
||||||
};
|
};
|
||||||
#define NUM_turboPmac_DRIVER_PARAMS \
|
#define NUM_turboPmac_DRIVER_PARAMS \
|
||||||
(&LAST_turboPmac_PARAM - &FIRST_turboPmac_PARAM + 1)
|
(&LAST_turboPmac_PARAM - &FIRST_turboPmac_PARAM + 1)
|
||||||
|
Reference in New Issue
Block a user