Implemented a feature which allows for an additional field for having a text message
with a motor axis. To this purpose a new derived class SINQAxis and SINQController were added which other drivers using this feature can derive from. The proof of concept and test platform is the EL734 driver.
This commit is contained in:
36
sinqEPICSApp/src/SINQAxis.cpp
Normal file
36
sinqEPICSApp/src/SINQAxis.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user