Compare commits
7 Commits
AxisParamC
...
ed77125378
| Author | SHA1 | Date | |
|---|---|---|---|
| ed77125378 | |||
| 4a0c09bd7f | |||
| 1fe21ec192 | |||
| 2fd4851313 | |||
| 55a9fe6f3e | |||
| e618b39687 | |||
| 41dfd1de5a |
23
.gitea/workflows/action.yaml
Normal file
23
.gitea/workflows/action.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
make install
|
||||||
@@ -1,41 +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
|
|
||||||
|
|
||||||
build_module:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
|
||||||
- echo "LIBVERSION=${CI_COMMIT_TAG:-0.0.1}" >> Makefile
|
|
||||||
- make install
|
|
||||||
- cp -rT "/ioc/modules/sinqMotor/$(ls -U /ioc/modules/sinqMotor/ | head -1)" "./sinqMotor-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
artifacts:
|
|
||||||
name: "sinqMotor-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
paths:
|
|
||||||
- "sinqMotor-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}/*"
|
|
||||||
expire_in: 1 week
|
|
||||||
when: always
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
20
README.md
20
README.md
@@ -277,18 +277,28 @@ To use the library when writing a concrete motor driver, include it in the makef
|
|||||||
|
|
||||||
### Usage as static dependency
|
### Usage as static dependency
|
||||||
|
|
||||||
This repository is included as a git submodule in some of the driver repositories depending upon sinqMotor. When installing via a Makefile (`make install`) using the PSI build system, the following git command is executed within `/ioc/tools/driver.makefile`:
|
This repository is included as a git submodule in the driver repositories depending upon sinqMotor. When installing via a Makefile (`make install`) using the PSI build system, the following git command is executed within `/ioc/tools/driver.makefile`:
|
||||||
|
|
||||||
`git submodule update --init --recursive`
|
`git submodule update --init --recursive`
|
||||||
|
|
||||||
This forces each submodule to be checked out at the latest commit hash stored in the remote repository. However, this is usually unwanted behaviour, since the higher-level drivers are usually designed to be compiled against a specific version of sinqMotor. In order to set the submodule to a specific version, the following steps need to be done BEFORE calling `make install`:
|
This forces each submodule to be checked out at the latest commit hash stored in the remote repository. However, this is usually unwanted behaviour, since the higher-level drivers are usually designed to be compiled against a specific version of sinqMotor. In order to set the submodule to a specific version, the following steps need to be done BEFORE calling `make install`:
|
||||||
|
|
||||||
- `cd sinqMotor`
|
- `cd sinqMotor`
|
||||||
- `git checkout 0.1`
|
- `git checkout 1.0`
|
||||||
- `cd ..`
|
- `cd ..`
|
||||||
|
|
||||||
Then, the fixation of the version to 0.1 needs to be committed in the parent repository:
|
Then, the fixation of the version to 1.0 needs to be committed in the parent repository:
|
||||||
|
|
||||||
- `git commit -m "Update sinqMotor to 0.1"`
|
- `git commit -m "Update sinqMotor to 1.0"`
|
||||||
|
|
||||||
After this commit, running `make install` will use the correct driver version for compilation.
|
After this commit, running `make install` will use the correct driver version for compilation.
|
||||||
|
|
||||||
|
If your driver uses another driver as a static dependency via git submodule which in turn includes a sinqMotor submodule, it is not necessary to specify the version of sinqMotor. Instead, specify the desired commit of the direct dependency, commit this change and then update all submodules:
|
||||||
|
|
||||||
|
- `cd turboPmac`
|
||||||
|
- `git checkout 1.0`
|
||||||
|
- `cd ..`
|
||||||
|
- `git commit -m "Update turboPmac to 1.0"`
|
||||||
|
- `git submodule update --init --recursive`
|
||||||
|
|
||||||
|
This will update sinqMotor to the version specified in the 1.0 commit of turboPmac.
|
||||||
@@ -231,11 +231,12 @@ record(ai, "$(INSTR)$(M):DLLM_RBV")
|
|||||||
field(FLNK, "$(INSTR)$(M):PushDLLM2Field")
|
field(FLNK, "$(INSTR)$(M):PushDLLM2Field")
|
||||||
field(PINI, "NO")
|
field(PINI, "NO")
|
||||||
}
|
}
|
||||||
record(ao, "$(INSTR)$(M):PushDLLM2Field") {
|
record(calcout, "$(INSTR)$(M):PushDLLM2Field") {
|
||||||
field(DOL, "$(INSTR)$(M):DLLM_RBV NPP")
|
field(INPA, "$(INSTR)$(M):DLLM_RBV")
|
||||||
field(OUT, "$(INSTR)$(M).DLLM")
|
field(PREC, "3")
|
||||||
field(OMSL, "closed_loop")
|
field(CALC, "A")
|
||||||
field(PINI, "NO")
|
field(OUT, "$(INSTR)$(M).DLLM")
|
||||||
|
field(OOPT, "Every Time")
|
||||||
}
|
}
|
||||||
|
|
||||||
# This record pair reads the parameter library value for "motorVeloFromDriver_"
|
# This record pair reads the parameter library value for "motorVeloFromDriver_"
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -599,9 +601,9 @@ asynStatus getAxisParamImpl(A *axis, C *controller, const char *indexName,
|
|||||||
const char *callerFunctionName, int lineNumber,
|
const char *callerFunctionName, int lineNumber,
|
||||||
size_t msgSize, TypeTag<bool>) {
|
size_t msgSize, TypeTag<bool>) {
|
||||||
int readValueInt = 0;
|
int readValueInt = 0;
|
||||||
asynStatus status =
|
asynStatus status = getAxisParamImpl(axis, controller, indexName, func,
|
||||||
getAxisParamImpl(axis, indexName, func, &readValueInt,
|
&readValueInt, callerFunctionName,
|
||||||
callerFunctionName, lineNumber, msgSize);
|
lineNumber, msgSize, TypeTag<int>{});
|
||||||
*readValue = readValueInt != 0;
|
*readValue = readValueInt != 0;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user