Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae20111e42 | |||
6e88505799 | |||
7764e2184e | |||
4ebe12da29 | |||
8f16888b68 | |||
2a75f9ec3c | |||
0d09282c9a | |||
47228b0b5b | |||
c44056176f | |||
c0ac01b3d6 | |||
44d4b83a80 | |||
653d3e238d | |||
2770cd80da |
27
.gitea/workflows/action.yaml
Normal file
27
.gitea/workflows/action.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Example Action
|
||||||
|
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
|
||||||
|
BuildAndTest:
|
||||||
|
runs-on: linepics
|
||||||
|
steps:
|
||||||
|
- name: checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
||||||
|
echo "LIBVERSION=${CI_COMMIT_TAG:-0.0.1}" >> Makefile
|
||||||
|
make install
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
cd test
|
||||||
|
python3 test.py
|
@ -1,61 +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:
|
|
||||||
- sed -i 's/ARCH_FILTER=.*/ARCH_FILTER=linux%/' Makefile
|
|
||||||
- echo "LIBVERSION=${CI_COMMIT_TAG:-0.0.1}" >> Makefile
|
|
||||||
- make install
|
|
||||||
- cp -rT "/ioc/modules/counterbox/$(ls -U /ioc/modules/counterbox/ | head -1)" "./counterbox-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
artifacts:
|
|
||||||
name: "counterbox-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
|
||||||
paths:
|
|
||||||
- "counterbox-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}/*"
|
|
||||||
expire_in: 1 week
|
|
||||||
when: always
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
||||||
|
|
||||||
test_module:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- mkdir -p "/ioc/modules/counterbox"
|
|
||||||
- cp -rT "./counterbox-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}" "/ioc/modules/counterbox/${CI_COMMIT_TAG:-0.0.1}"
|
|
||||||
- python3 test/test.py
|
|
||||||
when: always
|
|
||||||
tags:
|
|
||||||
- sinq
|
|
@ -50,7 +50,7 @@ record(longout, "$(INSTR)$(NAME):C$(CHANNEL)")
|
|||||||
|
|
||||||
record(ao,"$(INSTR)$(NAME):THRESH$(CHANNEL)")
|
record(ao,"$(INSTR)$(NAME):THRESH$(CHANNEL)")
|
||||||
{
|
{
|
||||||
field(DESC, "Sets minimum rate for counting to proceed")
|
field(DESC, "Sets min rate for counting to proceed")
|
||||||
field(OMSL, "supervisory")
|
field(OMSL, "supervisory")
|
||||||
field(OROC, "0")
|
field(OROC, "0")
|
||||||
field(OUT, "@$(PROTO) setMinRate($(INSTR)$(NAME):, $(CHANNEL)) $(ASYN_PORT)")
|
field(OUT, "@$(PROTO) setMinRate($(INSTR)$(NAME):, $(CHANNEL)) $(ASYN_PORT)")
|
||||||
|
@ -13,9 +13,10 @@ initialise {
|
|||||||
in;
|
in;
|
||||||
out "ECHO 2"; # Ask for reponses
|
out "ECHO 2"; # Ask for reponses
|
||||||
in "%(\$1MsgTxt)s"; # Clear MsgTxt on Init
|
in "%(\$1MsgTxt)s"; # Clear MsgTxt on Init
|
||||||
@mismatch{
|
# Probably should cause the ioc to just exit
|
||||||
exec 'echo "Failed to configure DAQ" && exit(1)';
|
# @mismatch{
|
||||||
}
|
# exec 'echo "Failed to configure DAQ" && exit(1)';
|
||||||
|
# }
|
||||||
}
|
}
|
||||||
|
|
||||||
fullReset {
|
fullReset {
|
||||||
|
@ -35,7 +35,7 @@ class DAQ:
|
|||||||
self.monitor = 0
|
self.monitor = 0
|
||||||
|
|
||||||
self.minratechannel = 0
|
self.minratechannel = 0
|
||||||
self.minrates = [2] * self.total_channels
|
self.minrates = [2] * (self.total_channels + 1)
|
||||||
|
|
||||||
self.gate_config = [
|
self.gate_config = [
|
||||||
#(enabled, count high/low),
|
#(enabled, count high/low),
|
||||||
@ -92,7 +92,7 @@ class DAQ:
|
|||||||
if self.countmode == 'time':
|
if self.countmode == 'time':
|
||||||
if elapsed < self.presettime:
|
if elapsed < self.presettime:
|
||||||
|
|
||||||
if self.minratechannel >= 0 and self.rates[self.minratechannel] < self.minrates[self.minratechannel]:
|
if self.minratechannel > 0 and self.rates[self.minratechannel - 1] < self.minrates[self.minratechannel]:
|
||||||
# adjust the starttime, so that it is as if this polling period didn't happen
|
# adjust the starttime, so that it is as if this polling period didn't happen
|
||||||
self.starttime += elapsed - self.elapsed
|
self.starttime += elapsed - self.elapsed
|
||||||
self.status = 5
|
self.status = 5
|
||||||
@ -115,7 +115,7 @@ class DAQ:
|
|||||||
elif self.countmode == 'count':
|
elif self.countmode == 'count':
|
||||||
if self.getMonitorCount() < self.presetcount:
|
if self.getMonitorCount() < self.presetcount:
|
||||||
|
|
||||||
if self.minratechannel >= 0 and self.rates[self.minratechannel] < self.minrates[self.minratechannel]:
|
if self.minratechannel > 0 and self.rates[self.minratechannel - 1] < self.minrates[self.minratechannel]:
|
||||||
# adjust the starttime, so that it is as if this polling period didn't happen
|
# adjust the starttime, so that it is as if this polling period didn't happen
|
||||||
self.starttime += elapsed - self.elapsed
|
self.starttime += elapsed - self.elapsed
|
||||||
self.status = 5
|
self.status = 5
|
||||||
@ -171,16 +171,16 @@ class DAQ:
|
|||||||
return float(self.rates[channel - 1])
|
return float(self.rates[channel - 1])
|
||||||
|
|
||||||
def getMinRateChannel(self):
|
def getMinRateChannel(self):
|
||||||
return self.minratechannel + 1
|
return self.minratechannel
|
||||||
|
|
||||||
def setMinRateChannel(self, channel):
|
def setMinRateChannel(self, channel):
|
||||||
self.minratechannel = channel - 1
|
self.minratechannel = channel
|
||||||
|
|
||||||
def getMinRate(self, channel):
|
def getMinRate(self, channel):
|
||||||
return self.minrates[channel - 1]
|
return self.minrates[channel]
|
||||||
|
|
||||||
def setMinRate(self, channel, rate):
|
def setMinRate(self, channel, rate):
|
||||||
self.minrates[channel - 1] = rate
|
self.minrates[channel] = rate
|
||||||
|
|
||||||
def getGateStatus(self, channel):
|
def getGateStatus(self, channel):
|
||||||
return self.gate_config[channel - 1]
|
return self.gate_config[channel - 1]
|
||||||
|
@ -6,9 +6,8 @@ require sinqDAQ
|
|||||||
|
|
||||||
epicsEnvSet("STREAM_PROTOCOL_PATH","./db")
|
epicsEnvSet("STREAM_PROTOCOL_PATH","./db")
|
||||||
epicsEnvSet("INSTR","SQ:TEST:")
|
epicsEnvSet("INSTR","SQ:TEST:")
|
||||||
epicsEnvSet("NAME","CB_TEST")
|
|
||||||
|
|
||||||
epicsEnvSet("SET_SIM_MODE","") # Run Simulation Instead of Actual Interface
|
epicsEnvSet("SET_SIM_MODE","") # Run Simulation Instead of Actual Interface
|
||||||
runScript "$(sinqDAQ_DIR)daq_2nd_gen.cmd" "DAQ_IP=127.0.0.1, DAQ_PORT=2000"
|
runScript "$(sinqDAQ_DIR)daq_2nd_gen.cmd" "NAME=CB_TEST, DAQ_IP=127.0.0.1, DAQ_PORT=2000"
|
||||||
|
|
||||||
iocInit()
|
iocInit()
|
||||||
|
Reference in New Issue
Block a user