2 Commits
1.2.0 ... 1.2.1

Author SHA1 Message Date
c32708e49c Removed lastSpeed caching
Some checks failed
Test And Build / Lint (push) Failing after 4s
Test And Build / Build (push) Successful in 7s
After discussion with Sven Schlienger, I now send the new speed
unconditionally before each move command. This also means that the
caching of the last speed is no longer needed.
2025-07-16 11:23:37 +02:00
14a733fb67 adds gitea action
Some checks failed
Test And Build / Lint (push) Failing after 4s
Test And Build / Build (push) Successful in 8s
2025-07-04 14:18:44 +02:00
3 changed files with 25 additions and 58 deletions

View 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

View File

@@ -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

View File

@@ -19,7 +19,6 @@ struct masterMacsAxisImpl {
std::bitset<16> axisStatus;
std::bitset<16> axisError;
double lastSetSpeed;
bool waitForHandshake;
time_t timeAtHandshake;
bool needInit = true;
@@ -122,7 +121,6 @@ masterMacsAxis::masterMacsAxis(masterMacsController *pC, int axisNo)
pMasterMacsA_ = std::make_unique<masterMacsAxisImpl>((masterMacsAxisImpl){
.axisStatus = std::bitset<16>(0),
.axisError = std::bitset<16>(0),
.lastSetSpeed = 0.0,
.waitForHandshake = false,
.timeAtHandshake = 0,
.targetReachedUninitialized = true,
@@ -262,11 +260,6 @@ asynStatus masterMacsAxis::init() {
__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
pl_status = setMotorPosition(motorPosition);
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
// motor speed changed since the last move command.
if (motorCanSetSpeed != 0 && pMasterMacsA_->lastSetSpeed != motorVelocity) {
pMasterMacsA_->lastSetSpeed = motorVelocity;
if (motorCanSetSpeed != 0) {
snprintf(value, sizeof(value), "%lf", motorVelocity);
status = pC_->write(axisNo_, 05, value);