Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c32708e49c | |||
| 14a733fb67 |
24
.gitea/workflows/action.yaml
Normal file
24
.gitea/workflows/action.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
Build:
|
||||||
|
runs-on: linepics
|
||||||
|
steps:
|
||||||
|
- name: checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- run: |
|
||||||
|
sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
||||||
|
echo -e "\nIGNORE_SUBMODULES += sinqmotor" >> Makefile
|
||||||
|
make install
|
||||||
@@ -1,48 +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 --suppress=cert-STR07-C --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
|
|
||||||
|
|
||||||
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/masterMacs/$(ls -U /ioc/modules/masterMacs/ | head -1)" "./masterMacs-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
artifacts:
|
|
||||||
name: "masterMacs-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
paths:
|
|
||||||
- "masterMacs-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}/*"
|
|
||||||
expire_in: 1 week
|
|
||||||
when: always
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
@@ -19,7 +19,6 @@ struct masterMacsAxisImpl {
|
|||||||
std::bitset<16> axisStatus;
|
std::bitset<16> axisStatus;
|
||||||
std::bitset<16> axisError;
|
std::bitset<16> axisError;
|
||||||
|
|
||||||
double lastSetSpeed;
|
|
||||||
bool waitForHandshake;
|
bool waitForHandshake;
|
||||||
time_t timeAtHandshake;
|
time_t timeAtHandshake;
|
||||||
bool needInit = true;
|
bool needInit = true;
|
||||||
@@ -122,7 +121,6 @@ masterMacsAxis::masterMacsAxis(masterMacsController *pC, int axisNo)
|
|||||||
pMasterMacsA_ = std::make_unique<masterMacsAxisImpl>((masterMacsAxisImpl){
|
pMasterMacsA_ = std::make_unique<masterMacsAxisImpl>((masterMacsAxisImpl){
|
||||||
.axisStatus = std::bitset<16>(0),
|
.axisStatus = std::bitset<16>(0),
|
||||||
.axisError = std::bitset<16>(0),
|
.axisError = std::bitset<16>(0),
|
||||||
.lastSetSpeed = 0.0,
|
|
||||||
.waitForHandshake = false,
|
.waitForHandshake = false,
|
||||||
.timeAtHandshake = 0,
|
.timeAtHandshake = 0,
|
||||||
.targetReachedUninitialized = true,
|
.targetReachedUninitialized = true,
|
||||||
@@ -262,11 +260,6 @@ asynStatus masterMacsAxis::init() {
|
|||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache the motor speed. If this value differs from the one in the motor
|
|
||||||
// record at the start of a movement, the motor record value is sent to
|
|
||||||
// MasterMACS.
|
|
||||||
pMasterMacsA_->lastSetSpeed = motorVelocity;
|
|
||||||
|
|
||||||
// Store the motor position in the parameter library
|
// Store the motor position in the parameter library
|
||||||
pl_status = setMotorPosition(motorPosition);
|
pl_status = setMotorPosition(motorPosition);
|
||||||
if (pl_status != asynSuccess) {
|
if (pl_status != asynSuccess) {
|
||||||
@@ -741,9 +734,7 @@ asynStatus masterMacsAxis::doMove(double position, int relative,
|
|||||||
|
|
||||||
// Set the new motor speed, if the user is allowed to do so and if the
|
// Set the new motor speed, if the user is allowed to do so and if the
|
||||||
// motor speed changed since the last move command.
|
// motor speed changed since the last move command.
|
||||||
if (motorCanSetSpeed != 0 && pMasterMacsA_->lastSetSpeed != motorVelocity) {
|
if (motorCanSetSpeed != 0) {
|
||||||
|
|
||||||
pMasterMacsA_->lastSetSpeed = motorVelocity;
|
|
||||||
|
|
||||||
snprintf(value, sizeof(value), "%lf", motorVelocity);
|
snprintf(value, sizeof(value), "%lf", motorVelocity);
|
||||||
status = pC_->write(axisNo_, 05, value);
|
status = pC_->write(axisNo_, 05, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user