Added a license (GPL3)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "msgPrintControl.h"
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef msgPrintControl_H
|
||||
#define msgPrintControl_H
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "sinqAxis.h"
|
||||
#include "epicsExport.h"
|
||||
#include "iocsh.h"
|
||||
@@ -59,7 +61,8 @@ asynStatus setAxisParam<const char *>(sinqAxis *axis, const char *indexName,
|
||||
template <>
|
||||
asynStatus getAxisParam<int>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), int *readValue,
|
||||
const char *callerFunctionName, int lineNumber) {
|
||||
const char *callerFunctionName, int lineNumber,
|
||||
int maxChars) {
|
||||
int indexValue = (axis->pController()->*func)();
|
||||
asynStatus status = axis->pController()->getIntegerParam(
|
||||
axis->axisNo(), indexValue, readValue);
|
||||
@@ -73,16 +76,18 @@ asynStatus getAxisParam<int>(sinqAxis *axis, const char *indexName,
|
||||
template <>
|
||||
asynStatus getAxisParam<bool>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), bool *readValue,
|
||||
const char *callerFunctionName, int lineNumber) {
|
||||
const char *callerFunctionName, int lineNumber,
|
||||
int maxChars) {
|
||||
return getAxisParam(axis, indexName, func, (int *)readValue,
|
||||
callerFunctionName, lineNumber);
|
||||
}
|
||||
|
||||
template <>
|
||||
asynStatus
|
||||
getAxisParam<double>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), double *readValue,
|
||||
const char *callerFunctionName, int lineNumber) {
|
||||
asynStatus getAxisParam<double>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(),
|
||||
double *readValue,
|
||||
const char *callerFunctionName, int lineNumber,
|
||||
int maxChars) {
|
||||
int indexValue = (axis->pController()->*func)();
|
||||
asynStatus status = axis->pController()->getDoubleParam(
|
||||
axis->axisNo(), indexValue, readValue);
|
||||
@@ -96,10 +101,11 @@ getAxisParam<double>(sinqAxis *axis, const char *indexName,
|
||||
template <>
|
||||
asynStatus getAxisParam<char>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), char *readValue,
|
||||
const char *callerFunctionName, int lineNumber) {
|
||||
const char *callerFunctionName, int lineNumber,
|
||||
int maxChars) {
|
||||
int indexValue = (axis->pController()->*func)();
|
||||
asynStatus status = axis->pController()->getStringParam(
|
||||
axis->axisNo(), indexValue, readValue);
|
||||
axis->axisNo(), indexValue, maxChars, readValue);
|
||||
if (status != asynSuccess) {
|
||||
return axis->pController()->paramLibAccessFailed(
|
||||
status, indexName, axis->axisNo(), callerFunctionName, lineNumber);
|
||||
@@ -108,10 +114,11 @@ asynStatus getAxisParam<char>(sinqAxis *axis, const char *indexName,
|
||||
}
|
||||
|
||||
template <>
|
||||
asynStatus
|
||||
getAxisParam<std::string>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), std::string *readValue,
|
||||
const char *callerFunctionName, int lineNumber) {
|
||||
asynStatus getAxisParam<std::string>(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(),
|
||||
std::string *readValue,
|
||||
const char *callerFunctionName,
|
||||
int lineNumber, int maxChars) {
|
||||
int indexValue = (axis->pController()->*func)();
|
||||
|
||||
// Convert the pointer to a reference, since getStringParam expects the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
/*
|
||||
This class extends asynMotorAxis by some features used in SINQ.
|
||||
|
||||
@@ -464,12 +466,16 @@ asynStatus setAxisParam(sinqAxis *axis, const char *indexName,
|
||||
* @param readValue
|
||||
* @param callerFunctionName
|
||||
* @param lineNumber
|
||||
* @param maxChars Only used when readValue is a char*. Specifies the maximum
|
||||
* number of characters which can be placed into the buffer the pointer points
|
||||
* to.
|
||||
* @return asynStatus
|
||||
*/
|
||||
template <typename T>
|
||||
asynStatus getAxisParam(sinqAxis *axis, const char *indexName,
|
||||
int (sinqController::*func)(), T *readValue,
|
||||
const char *callerFunctionName, int lineNumber);
|
||||
const char *callerFunctionName, int lineNumber,
|
||||
int maxChars = 0);
|
||||
|
||||
/**
|
||||
* @brief Macro to get an paramLib parameter and error checking the return value
|
||||
@@ -495,15 +501,35 @@ asynStatus getAxisParam(sinqAxis *axis, const char *indexName,
|
||||
* return asynSuccess;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* If `readValue` is a `char *`, the size of the buffer needs to be provided as
|
||||
* well:
|
||||
* ```
|
||||
* char readValue[20] = {0};
|
||||
* getAxisParamChecked(this, motorStatusProblem_, &readValue, sizeof(readValue))
|
||||
* ```
|
||||
* expands to
|
||||
* ```
|
||||
* {
|
||||
* int indexValue = axis->pController()->motorStatusProblem_();
|
||||
* asynStatus status = axis->pController()->getStringParam(axis->axisNo(),
|
||||
* indexValue, sizeof(readValue), readValue); if (status != asynSuccess) {
|
||||
* return axis->pController()->paramLibAccessFailed( status,
|
||||
* "motorStatusProblem_", axis->axisNo(), __PRETTY_FUNCTION__,
|
||||
* __LINE__);
|
||||
* }
|
||||
* return asynSuccess;
|
||||
* }
|
||||
* ```
|
||||
* =============================================================================
|
||||
*/
|
||||
#define getAxisParamChecked(axis, indexGetterFunction, readValue) \
|
||||
#define getAxisParamChecked(axis, indexGetterFunction, readValue, ...) \
|
||||
{ \
|
||||
asynStatus getStatus = getAxisParam( \
|
||||
axis, #indexGetterFunction, \
|
||||
&std::remove_pointer< \
|
||||
decltype(axis->pController())>::type::indexGetterFunction, \
|
||||
readValue, __PRETTY_FUNCTION__, __LINE__); \
|
||||
readValue, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
||||
if (getStatus != asynSuccess) { \
|
||||
return getStatus; \
|
||||
} \
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "sinqController.h"
|
||||
#include "asynMotorController.h"
|
||||
#include "asynOctetSyncIO.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
/*
|
||||
This class extends asynMotorController by some features used in SINQ. See the
|
||||
README.md for details.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#---------------------------------------------
|
||||
# SINQ specific DB definitions
|
||||
#---------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user