Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c9de618ec | |||
| b834dc3f8d | |||
| ee6235e74a | |||
| 48c068826c | |||
| c494fc88a5 | |||
| e0fa9ef3a9 | |||
| dc6d5c40b3 | |||
| 56288b1db8 |
30
.gitea/workflows/action.yaml
Normal file
30
.gitea/workflows/action.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Test And Build
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Lint:
|
||||||
|
runs-on: linepics
|
||||||
|
steps:
|
||||||
|
- name: checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: cppcheck
|
||||||
|
run: cppcheck --std=c++17 --addon=cert --addon=misc --error-exitcode=1 src/*.cpp
|
||||||
|
- name: formatting
|
||||||
|
run: clang-format --style=file --Werror --dry-run src/*.cpp src/*.h
|
||||||
|
Build:
|
||||||
|
runs-on: linepics
|
||||||
|
steps:
|
||||||
|
- name: checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- run: |
|
||||||
|
pushd turboPmac
|
||||||
|
sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
||||||
|
echo -e "\nIGNORE_SUBMODULES += sinqmotor" >> Makefile
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
- run: |
|
||||||
|
sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
||||||
|
echo -e "\nIGNORE_SUBMODULES += turboPmac" >> Makefile
|
||||||
|
make install
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
default:
|
|
||||||
image: docker.psi.ch:5000/sinqdev/sinqepics:latest
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- lint
|
|
||||||
- build
|
|
||||||
- test
|
|
||||||
|
|
||||||
cppcheck:
|
|
||||||
stage: lint
|
|
||||||
script:
|
|
||||||
- cppcheck --std=c++17 --addon=cert --addon=misc --error-exitcode=1 src/*.cpp
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 week
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
|
|
||||||
formatting:
|
|
||||||
stage: lint
|
|
||||||
script:
|
|
||||||
- clang-format --style=file --Werror --dry-run src/*.cpp
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 week
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
|
|
||||||
# clangtidy:
|
|
||||||
# stage: lint
|
|
||||||
# script:
|
|
||||||
# - curl https://docker.psi.ch:5000/v2/_catalog
|
|
||||||
# # - dnf update -y
|
|
||||||
# # - dnf install -y clang-tools-extra
|
|
||||||
# # - clang-tidy sinqEPICSApp/src/*.cpp sinqEPICSApp/src/*.c sinqEPICSApp/src/*.h -checks=cppcoreguidelines-*,cert-*
|
|
||||||
# # tags:
|
|
||||||
# # - sinq
|
|
||||||
|
|
||||||
build_module:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- export SINQMOTOR_VERSION="$(grep 'sinqMotor_VERSION=' Makefile | cut -d= -f2)"
|
|
||||||
- git clone --depth 1 --branch "${SINQMOTOR_VERSION}" https://gitlab-ci-token:${CI_JOB_TOKEN}@git.psi.ch/sinq-epics-modules/sinqmotor.git
|
|
||||||
- pushd sinqmotor
|
|
||||||
- sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
|
||||||
- echo "LIBVERSION=${SINQMOTOR_VERSION}" >> Makefile
|
|
||||||
- make install
|
|
||||||
- popd
|
|
||||||
- sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
|
||||||
- echo "LIBVERSION=${CI_COMMIT_TAG:-0.0.1}" >> Makefile
|
|
||||||
- make install
|
|
||||||
- cp -rT "/ioc/modules/seleneLift/$(ls -U /ioc/modules/seleneLift/ | head -1)" "./seleneLift-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
artifacts:
|
|
||||||
name: "seleneLift-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
paths:
|
|
||||||
- "seleneLift-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}/*"
|
|
||||||
expire_in: 1 week
|
|
||||||
when: always
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
3
Makefile
3
Makefile
@@ -42,4 +42,5 @@ DBDS += turboPmac/sinqMotor/src/sinqMotor.dbd
|
|||||||
DBDS += turboPmac/src/turboPmac.dbd
|
DBDS += turboPmac/src/turboPmac.dbd
|
||||||
DBDS += src/seleneGuide.dbd
|
DBDS += src/seleneGuide.dbd
|
||||||
|
|
||||||
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
|
USR_CFLAGS += -Wall -Wextra -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
|
||||||
|
USR_CXXFLAGS += -Wall -Wextra -Wunused-result -Wextra -Werror
|
||||||
@@ -50,8 +50,15 @@ asynStatus seleneAngleAxis::stop(double acceleration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneAngleAxis::doMove(double position, int relative,
|
asynStatus seleneAngleAxis::doMove(double position, int relative,
|
||||||
double min_velocity, double max_velocity,
|
double minVelocity, double maxVelocity,
|
||||||
double acceleration) {
|
double acceleration) {
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)relative;
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
|
|
||||||
double motorRecResolution = 0.0;
|
double motorRecResolution = 0.0;
|
||||||
|
|
||||||
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
// Forward declaration of the seleneLiftAxis class to resolve the cyclic
|
// Forward declaration of the seleneLiftAxis class to resolve the cyclic
|
||||||
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
||||||
// See https://en.cppreference.com/w/cpp/language/class.
|
// See https://en.cppreference.com/w/cpp/language/class.
|
||||||
class seleneLiftAxis;
|
class HIDDEN seleneLiftAxis;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Virtual axis for setting the angle of the Selene guide
|
* @brief Virtual axis for setting the angle of the Selene guide
|
||||||
*
|
*
|
||||||
* Please see README.md for a detailed explanation.
|
* Please see README.md for a detailed explanation.
|
||||||
*/
|
*/
|
||||||
class seleneAngleAxis : public turboPmacAxis {
|
class HIDDEN seleneAngleAxis : public turboPmacAxis {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new seleneAngleAxis.
|
* @brief Construct a new seleneAngleAxis.
|
||||||
@@ -48,12 +48,12 @@ class seleneAngleAxis : public turboPmacAxis {
|
|||||||
*
|
*
|
||||||
* @param position
|
* @param position
|
||||||
* @param relative
|
* @param relative
|
||||||
* @param min_velocity
|
* @param minVelocity
|
||||||
* @param maxOffset_velocity
|
* @param maxOffset_velocity
|
||||||
* @param acceleration
|
* @param acceleration
|
||||||
* @return asynStatus
|
* @return asynStatus
|
||||||
*/
|
*/
|
||||||
asynStatus doMove(double position, int relative, double min_velocity,
|
asynStatus doMove(double position, int relative, double minVelocity,
|
||||||
double maxOffset_velocity, double acceleration);
|
double maxOffset_velocity, double acceleration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ seleneGuideController::seleneGuideController(
|
|||||||
const char *portName, const char *ipPortConfigName, int numAxes,
|
const char *portName, const char *ipPortConfigName, int numAxes,
|
||||||
double movingPollPeriod, double idlePollPeriod, double comTimeout)
|
double movingPollPeriod, double idlePollPeriod, double comTimeout)
|
||||||
: turboPmacController(portName, ipPortConfigName, numAxes, movingPollPeriod,
|
: turboPmacController(portName, ipPortConfigName, numAxes, movingPollPeriod,
|
||||||
idlePollPeriod, NUM_seleneGuide_DRIVER_PARAMS)
|
idlePollPeriod, comTimeout,
|
||||||
|
NUM_seleneGuide_DRIVER_PARAMS)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -145,7 +146,8 @@ static const iocshArg *const CreateControllerArgs[] = {
|
|||||||
&CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2,
|
&CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2,
|
||||||
&CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5};
|
&CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5};
|
||||||
static const iocshFuncDef configSeleneGuideCreateController = {
|
static const iocshFuncDef configSeleneGuideCreateController = {
|
||||||
"seleneGuideController", 6, CreateControllerArgs};
|
"seleneGuideController", 6, CreateControllerArgs,
|
||||||
|
"Create a new instance of a Selene controller."};
|
||||||
static void configSeleneGuideCreateControllerCallFunc(const iocshArgBuf *args) {
|
static void configSeleneGuideCreateControllerCallFunc(const iocshArgBuf *args) {
|
||||||
seleneGuideCreateController(args[0].sval, args[1].sval, args[2].ival,
|
seleneGuideCreateController(args[0].sval, args[1].sval, args[2].ival,
|
||||||
args[3].dval, args[4].dval, args[5].dval);
|
args[3].dval, args[4].dval, args[5].dval);
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
// Forward declaration of the axis classes to resolve the cyclic
|
// Forward declaration of the axis classes to resolve the cyclic
|
||||||
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
||||||
// See https://en.cppreference.com/w/cpp/language/class.
|
// See https://en.cppreference.com/w/cpp/language/class.
|
||||||
class seleneAngleAxis;
|
class HIDDEN seleneAngleAxis;
|
||||||
class seleneLiftAxis;
|
class HIDDEN seleneLiftAxis;
|
||||||
class seleneOffsetAxis;
|
class HIDDEN seleneOffsetAxis;
|
||||||
|
|
||||||
class seleneGuideController : public turboPmacController {
|
class HIDDEN seleneGuideController : public turboPmacController {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -381,8 +381,15 @@ asynStatus seleneLiftAxis::doPoll(bool *moving) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneLiftAxis::doMove(double position, int relative,
|
asynStatus seleneLiftAxis::doMove(double position, int relative,
|
||||||
double min_velocity, double max_velocity,
|
double minVelocity, double maxVelocity,
|
||||||
double acceleration) {
|
double acceleration) {
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)relative;
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
|
|
||||||
double motorRecResolution = 0.0;
|
double motorRecResolution = 0.0;
|
||||||
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
||||||
setTargetPosition(position * motorRecResolution);
|
setTargetPosition(position * motorRecResolution);
|
||||||
@@ -440,6 +447,9 @@ asynStatus seleneLiftAxis::stop(double acceleration) {
|
|||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)acceleration;
|
||||||
|
|
||||||
// Stop all axes
|
// Stop all axes
|
||||||
status = pC_->writeRead(axisNo_, "P150=8", response, 0);
|
status = pC_->writeRead(axisNo_, "P150=8", response, 0);
|
||||||
|
|
||||||
@@ -466,6 +476,10 @@ asynStatus seleneLiftAxis::doReset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneLiftAxis::enable(bool on) {
|
asynStatus seleneLiftAxis::enable(bool on) {
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)on;
|
||||||
|
|
||||||
setAxisParamChecked(this, motorMessageText,
|
setAxisParamChecked(this, motorMessageText,
|
||||||
"Axis cannot be enabled / disabled");
|
"Axis cannot be enabled / disabled");
|
||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
@@ -479,6 +493,12 @@ asynStatus seleneLiftAxis::readEncoderType() {
|
|||||||
asynStatus seleneLiftAxis::doHome(double minVelocity, double maxVelocity,
|
asynStatus seleneLiftAxis::doHome(double minVelocity, double maxVelocity,
|
||||||
double acceleration, int forwards) {
|
double acceleration, int forwards) {
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
|
(void)forwards;
|
||||||
|
|
||||||
char response[pC_->MAXBUF_] = {0};
|
char response[pC_->MAXBUF_] = {0};
|
||||||
|
|
||||||
// No answer expected
|
// No answer expected
|
||||||
@@ -636,8 +656,9 @@ static const iocshArg *const CreateAxisArgs[] = {
|
|||||||
&CreateAxisArg3, &CreateAxisArg4, &CreateAxisArg5,
|
&CreateAxisArg3, &CreateAxisArg4, &CreateAxisArg5,
|
||||||
&CreateAxisArg6, &CreateAxisArg7, &CreateAxisArg8,
|
&CreateAxisArg6, &CreateAxisArg7, &CreateAxisArg8,
|
||||||
};
|
};
|
||||||
static const iocshFuncDef configSeleneVirtualCreateAxes = {"seleneVirtualAxes",
|
static const iocshFuncDef configSeleneVirtualCreateAxes = {
|
||||||
9, CreateAxisArgs};
|
"seleneVirtualAxes", 9, CreateAxisArgs,
|
||||||
|
"Creates instances of Selene axes."};
|
||||||
static void configSeleneVirtualCreateAxesCallFunc(const iocshArgBuf *args) {
|
static void configSeleneVirtualCreateAxesCallFunc(const iocshArgBuf *args) {
|
||||||
seleneVirtualCreateAxes(args[0].sval, args[1].ival, args[2].ival,
|
seleneVirtualCreateAxes(args[0].sval, args[1].ival, args[2].ival,
|
||||||
args[3].ival, args[4].ival, args[5].ival,
|
args[3].ival, args[4].ival, args[5].ival,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Please see README.md for a detailed explanation.
|
* Please see README.md for a detailed explanation.
|
||||||
*/
|
*/
|
||||||
class seleneLiftAxis : public turboPmacAxis {
|
class HIDDEN seleneLiftAxis : public turboPmacAxis {
|
||||||
public:
|
public:
|
||||||
static const int numAxes_ = 6;
|
static const int numAxes_ = 6;
|
||||||
|
|
||||||
@@ -65,12 +65,12 @@ class seleneLiftAxis : public turboPmacAxis {
|
|||||||
*
|
*
|
||||||
* @param position
|
* @param position
|
||||||
* @param relative
|
* @param relative
|
||||||
* @param min_velocity
|
* @param minVelocity
|
||||||
* @param maxOffset_velocity
|
* @param maxOffset_velocity
|
||||||
* @param acceleration
|
* @param acceleration
|
||||||
* @return asynStatus
|
* @return asynStatus
|
||||||
*/
|
*/
|
||||||
asynStatus doMove(double position, int relative, double min_velocity,
|
asynStatus doMove(double position, int relative, double minVelocity,
|
||||||
double maxOffset_velocity, double acceleration);
|
double maxOffset_velocity, double acceleration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -283,10 +283,15 @@ seleneOffsetAxis::setPositionsFromEncoderPosition(double encoderPosition) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneOffsetAxis::doMove(double position, int relative,
|
asynStatus seleneOffsetAxis::doMove(double position, int relative,
|
||||||
double min_velocity,
|
double minVelocity, double maxVelocity,
|
||||||
double maxOffset_velocity,
|
|
||||||
double acceleration) {
|
double acceleration) {
|
||||||
|
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)relative;
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
|
|
||||||
double motorRecResolution = 0.0;
|
double motorRecResolution = 0.0;
|
||||||
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
|
||||||
|
|
||||||
@@ -299,6 +304,9 @@ asynStatus seleneOffsetAxis::doMove(double position, int relative,
|
|||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneOffsetAxis::enable(bool on) {
|
asynStatus seleneOffsetAxis::enable(bool on) {
|
||||||
|
// Suppress unused variable warnings
|
||||||
|
(void)on;
|
||||||
|
|
||||||
setAxisParamChecked(this, motorMessageText,
|
setAxisParamChecked(this, motorMessageText,
|
||||||
"Axis cannot be enabled / disabled");
|
"Axis cannot be enabled / disabled");
|
||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
@@ -384,7 +392,8 @@ static const iocshArg *const CreateAxisArgs[] = {
|
|||||||
&CreateAxisArg3,
|
&CreateAxisArg3,
|
||||||
};
|
};
|
||||||
static const iocshFuncDef configSeleneOffsetAxisCreateAxis = {
|
static const iocshFuncDef configSeleneOffsetAxisCreateAxis = {
|
||||||
"seleneOffsetAxis", 4, CreateAxisArgs};
|
"seleneOffsetAxis", 4, CreateAxisArgs,
|
||||||
|
"Creates a new instance of a Selene offset axis."};
|
||||||
static void configSeleneOffsetAxisCreateAxisCallFunc(const iocshArgBuf *args) {
|
static void configSeleneOffsetAxisCreateAxisCallFunc(const iocshArgBuf *args) {
|
||||||
seleneOffsetAxisCreateAxis(args[0].sval, args[1].ival, args[2].dval,
|
seleneOffsetAxisCreateAxis(args[0].sval, args[1].ival, args[2].dval,
|
||||||
args[3].dval);
|
args[3].dval);
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
// Forward declaration of the seleneLiftAxis class to resolve the cyclic
|
// Forward declaration of the seleneLiftAxis class to resolve the cyclic
|
||||||
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
// dependency between the seleneLiftAxis and the seleneAngleAxis .h-file.
|
||||||
// See https://en.cppreference.com/w/cpp/language/class.
|
// See https://en.cppreference.com/w/cpp/language/class.
|
||||||
class seleneLiftAxis;
|
class HIDDEN seleneLiftAxis;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Virtual axis for setting the offset of a motor of the Selene guide
|
* @brief Virtual axis for setting the offset of a motor of the Selene guide
|
||||||
*
|
*
|
||||||
* Please see README.md for a detailed explanation.
|
* Please see README.md for a detailed explanation.
|
||||||
*/
|
*/
|
||||||
class seleneOffsetAxis : public turboPmacAxis {
|
class HIDDEN seleneOffsetAxis : public turboPmacAxis {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new selene Offset Axis object
|
* @brief Construct a new selene Offset Axis object
|
||||||
@@ -51,12 +51,12 @@ class seleneOffsetAxis : public turboPmacAxis {
|
|||||||
*
|
*
|
||||||
* @param position
|
* @param position
|
||||||
* @param relative
|
* @param relative
|
||||||
* @param min_velocity
|
* @param minVelocity
|
||||||
* @param maxOffset_velocity
|
* @param maxOffset_velocity
|
||||||
* @param acceleration
|
* @param acceleration
|
||||||
* @return asynStatus
|
* @return asynStatus
|
||||||
*/
|
*/
|
||||||
asynStatus doMove(double position, int relative, double min_velocity,
|
asynStatus doMove(double position, int relative, double minVelocity,
|
||||||
double maxOffset_velocity, double acceleration);
|
double maxOffset_velocity, double acceleration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Submodule turboPmac updated: f423002d23...62ccf046fd
Reference in New Issue
Block a user