Compare commits
10 Commits
3d984f26bc
...
1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 41dfd1de5a | |||
| 07cab3ac2a | |||
| e194736206 | |||
| 30af284f5d | |||
| 6069aa9194 | |||
| c475beee66 | |||
| b1fe452ed6 | |||
| d395c7bbb7 | |||
| a6f2890c76 | |||
| fef61bc804 |
@@ -458,7 +458,7 @@ asynStatus setAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|||||||
|
|
||||||
template <typename A, typename C>
|
template <typename A, typename C>
|
||||||
asynStatus setAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus setAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (sinqController::*func)(), double writeValue,
|
int (C::*func)(), double writeValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<double>) {
|
TypeTag<double>) {
|
||||||
int indexValue = (controller->*func)();
|
int indexValue = (controller->*func)();
|
||||||
@@ -505,6 +505,8 @@ asynStatus setAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|||||||
* This function should not be used directly, but rather through its macro
|
* This function should not be used directly, but rather through its macro
|
||||||
* variant `setAxisParamChecked`.
|
* variant `setAxisParamChecked`.
|
||||||
*
|
*
|
||||||
|
* @tparam A
|
||||||
|
* @tparam C
|
||||||
* @tparam T
|
* @tparam T
|
||||||
* @param axis
|
* @param axis
|
||||||
* @param controller
|
* @param controller
|
||||||
@@ -571,7 +573,7 @@ template <typename A, typename C, typename T>
|
|||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), T *readValue,
|
int (C::*func)(), T *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<void>) {
|
size_t msgSize, TypeTag<void>) {
|
||||||
static_assert(
|
static_assert(
|
||||||
sizeof(T) == 0,
|
sizeof(T) == 0,
|
||||||
"no specialization of getAxisParam exists for the given type");
|
"no specialization of getAxisParam exists for the given type");
|
||||||
@@ -582,7 +584,7 @@ template <typename A, typename C>
|
|||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), int *readValue,
|
int (C::*func)(), int *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<int>) {
|
size_t msgSize, TypeTag<int>) {
|
||||||
int indexValue = (controller->*func)();
|
int indexValue = (controller->*func)();
|
||||||
asynStatus status =
|
asynStatus status =
|
||||||
controller->getIntegerParam(axis->axisNo(), indexValue, readValue);
|
controller->getIntegerParam(axis->axisNo(), indexValue, readValue);
|
||||||
@@ -597,16 +599,20 @@ template <typename A, typename C>
|
|||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), bool *readValue,
|
int (C::*func)(), bool *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<bool>) {
|
size_t msgSize, TypeTag<bool>) {
|
||||||
return getAxisParamImpl(axis, indexName, func, (int *)readValue,
|
int readValueInt = 0;
|
||||||
callerFunctionName, lineNumber);
|
asynStatus status =
|
||||||
|
getAxisParamImpl(axis, indexName, func, &readValueInt,
|
||||||
|
callerFunctionName, lineNumber, msgSize);
|
||||||
|
*readValue = readValueInt != 0;
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename C>
|
template <typename A, typename C>
|
||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), double *readValue,
|
int (C::*func)(), double *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<double>) {
|
size_t msgSize, TypeTag<double>) {
|
||||||
int indexValue = (controller->*func)();
|
int indexValue = (controller->*func)();
|
||||||
asynStatus status =
|
asynStatus status =
|
||||||
controller->getDoubleParam(axis->axisNo(), indexValue, readValue);
|
controller->getDoubleParam(axis->axisNo(), indexValue, readValue);
|
||||||
@@ -621,11 +627,11 @@ template <typename A, typename C>
|
|||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), char *readValue,
|
int (C::*func)(), char *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<char>) {
|
size_t msgSize, TypeTag<char>) {
|
||||||
|
|
||||||
int indexValue = (controller->*func)();
|
int indexValue = (controller->*func)();
|
||||||
asynStatus status = controller->getStringParam(
|
asynStatus status = controller->getStringParam(axis->axisNo(), indexValue,
|
||||||
axis->axisNo(), indexValue, controller->msgSize(), readValue);
|
msgSize, readValue);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
return controller->paramLibAccessFailed(
|
return controller->paramLibAccessFailed(
|
||||||
status, indexName, axis->axisNo(), callerFunctionName, lineNumber);
|
status, indexName, axis->axisNo(), callerFunctionName, lineNumber);
|
||||||
@@ -633,22 +639,11 @@ asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename C, size_t N>
|
|
||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|
||||||
int (C::*func)(), char (&readValue)[N],
|
|
||||||
const char *callerFunctionName, int lineNumber,
|
|
||||||
TypeTag<char>) {
|
|
||||||
// Decay the array to char*
|
|
||||||
return getAxisParamImpl(axis, controller, indexName, func,
|
|
||||||
static_cast<char *>(readValue), callerFunctionName,
|
|
||||||
lineNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A, typename C>
|
template <typename A, typename C>
|
||||||
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
||||||
int (C::*func)(), std::string *readValue,
|
int (C::*func)(), std::string *readValue,
|
||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
TypeTag<std::string>) {
|
size_t msgSize, TypeTag<std::string>) {
|
||||||
int indexValue = (controller->*func)();
|
int indexValue = (controller->*func)();
|
||||||
|
|
||||||
// Convert the pointer to a reference, since getStringParam expects the
|
// Convert the pointer to a reference, since getStringParam expects the
|
||||||
@@ -665,7 +660,7 @@ asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Helper function to set an integer / double / string parameter for an
|
* @brief Helper function to get an integer / double / string parameter for an
|
||||||
* axis in the paramLib
|
* axis in the paramLib
|
||||||
*
|
*
|
||||||
* This function should not be used directly, but rather through its macro
|
* This function should not be used directly, but rather through its macro
|
||||||
@@ -689,7 +684,35 @@ asynStatus getAxisParam(A *axis, C *controller, const char *indexName,
|
|||||||
int (C::*func)(), T *readValue,
|
int (C::*func)(), T *readValue,
|
||||||
const char *callerFunctionName, int lineNumber) {
|
const char *callerFunctionName, int lineNumber) {
|
||||||
return getAxisParamImpl(axis, controller, indexName, func, readValue,
|
return getAxisParamImpl(axis, controller, indexName, func, readValue,
|
||||||
callerFunctionName, lineNumber, TypeTag<T>{});
|
callerFunctionName, lineNumber,
|
||||||
|
controller->msgSize(), TypeTag<T>{});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Helper function to get a string parameter for an
|
||||||
|
* axis in the paramLib into a char array
|
||||||
|
*
|
||||||
|
* This function should not be used directly, but rather through its macro
|
||||||
|
* variant `getAxisParamChecked`. It is a specialized variant of the general
|
||||||
|
* getAxisParam defined above for char arrays.
|
||||||
|
*
|
||||||
|
* @tparam A
|
||||||
|
* @tparam C
|
||||||
|
* @tparam N
|
||||||
|
* @param axis
|
||||||
|
* @param controller
|
||||||
|
* @param indexName
|
||||||
|
* @param func
|
||||||
|
* @param callerFunctionName
|
||||||
|
* @param lineNumber
|
||||||
|
* @return asynStatus
|
||||||
|
*/
|
||||||
|
template <typename A, typename C, size_t N>
|
||||||
|
asynStatus getAxisParam(A *axis, C *controller, const char *indexName,
|
||||||
|
int (C::*func)(), char (*readValue)[N],
|
||||||
|
const char *callerFunctionName, int lineNumber) {
|
||||||
|
return getAxisParamImpl(axis, controller, indexName, func, *readValue,
|
||||||
|
callerFunctionName, lineNumber, N, TypeTag<char>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user