Extended pmacAxis to properly deal with HRPT pmac motors which have an extra error condition
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
/*
|
|
This is a version of the motor axis record which adds code for having an
|
|
text field with an error message to go with the motor. The code is
|
|
courtesey Torsten Boergershausen from ESS and from the axisRecord.
|
|
|
|
Mark Koennecke, March 2017
|
|
*/
|
|
#include "SINQAxis.h"
|
|
#include "SINQController.h"
|
|
|
|
SINQAxis::SINQAxis(class SINQController *pC, int axis)
|
|
: asynMotorAxis((asynMotorController *)pC, axis),
|
|
pC_(pC)
|
|
{
|
|
updateMsgTxtFromDriver("");
|
|
}
|
|
|
|
|
|
void SINQAxis::updateMsgTxtFromDriver(const char *value)
|
|
{
|
|
if (value && value[0]) {
|
|
pC_->setIntegerParam(axisNo_,pC_->motorMessageIsFromDriver_, 1);
|
|
setStringParam(pC_->motorMessageText_,value);
|
|
} else {
|
|
pC_->setIntegerParam(axisNo_,pC_->motorMessageIsFromDriver_, 0);
|
|
setStringParam(pC_->motorMessageText_,"");
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sets the value for a string for this axis in the parameter library.
|
|
* \param[in] function The function (parameter) number
|
|
* \param[in] value Value to set */
|
|
asynStatus SINQAxis::setStringParam(int function, const char *value)
|
|
{
|
|
// Call the base class method
|
|
return pC_->setStringParam(axisNo_, function, value);
|
|
}
|