Skip to content

Commit

Permalink
Merge pull request #5 from epics-containers/dev
Browse files Browse the repository at this point in the history
Major refactor - use of new ibek commands in installer scripts
  • Loading branch information
gilesknap authored Oct 2, 2023
2 parents faa4262 + 2fae8db commit ae0d69d
Show file tree
Hide file tree
Showing 40 changed files with 9,018 additions and 1,382 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/buiild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ jobs:
# ioc folder is found in the super module usually so for testing
# on github we need to copy it above the root of the repo
cp -r ioc ..
for test in tests/test*.sh; do
echo "RUNNING TEST SCRIPT ${test}"
${test}
done
tests/_test_support_build.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.coverage
# generate schemas for tests but don't commit them
schemas/
154 changes: 88 additions & 66 deletions ADAravis/ADAravis.ibek.support.yaml
Original file line number Diff line number Diff line change
@@ -1,95 +1,117 @@
# yaml-language-server: $schema=../_global/ibek.defs.schema.json
# yaml-language-server: $schema=https://github.com/epics-containers/ibek/releases/download/1.2.0/ibek.support.schema.json

module: ADAravis

defs:
- name: ADAravis
description: Defines an ADAravis camera (requires associated ADGenicam instance)
- name: aravisCamera
description: |-
Creates a aravisCamera camera areaDetector driver
args:
- type: id
name: PORT
description: Port Name for teh camera

- type: str
name: P
description: The PV prefix
description: |-
PV Prefix
- type: str
name: R
description: The PV suffix
description: |-
PV Suffix
- type: id
name: PORT
description: |-
Port name for the camera
- type: str
name: ID
description: |
Cam ip address, hostname, MAC address, or ID <manufacturer>-<serial>,
(e.g. Prosilica-02-2166A-06844)
description: |-
Cam ip address, hostname, MAC address, or ID <manufacturer>-<serial>, (e.g. Prosilica-02-2166A-06844)
- type: enum
name: CLASS
description: |-
Camera class for custom commands
values:
Basler_piA640_210gm:
AVT_Manta_G319B:
AVT_Manta_G2460C:
AVT_Mako_G125B:
AVT_Mako_G125C:
AVT_Prosilica_GC1280M:
AVT_Mako_1_52:
AVT_Manta_G507B:
AVT_Manta_G145B:
AVT_Mako_G507B:
AVT_Mako_G507C:
AVT_Prosilica_GT5120:
AVT_Mako_G319C:
AVT_Manta_G419C:
AVT_Prosilica_GC1020C:
AVT_Prosilica_GC655C:
Prosilica_GC:
AVT_Manta_G125B:
AVT_Manta_G125C:
AVT_Manta_G040B:
AVT_Manta_G895B:
AVT_Mako_G158B:
AVT_Mako_G158C:
AVT_Manta_G235B:
AVT_Manta_G235C:
AVT_Manta_1_44:
AVT_Mako_G234C:
AVT_Mako_G234B:
AVT_Manta_G609B:

- type: enum
name: PV_ALIAS
description: |-
Use alias template to keep some key PV names the same
values:
"1":
"0":

- type: int
name: BUFFERS
description: Max NDArray buffers to be created for plugin callbacks
description: |-
Maximum number of NDArray buffers to be created for plugin callbacks
default: 50

- type: int
name: MEMORY
description: |
Max memory to allocate, should be maxw*maxh*nbuffer
for driver and all attached plugins or -1 for unlimited
description: |-
Max memory to allocate, should be maxw*maxh*nbuffer for driver and all attached plugins
default: -1

- type: int
- type: str
name: TIMEOUT
description: timeout for communication with camera
default: 1
description: |-
Timeout, default 1
default: "1"

- type: str
name: PV_ALIAS
description: |
TODO this need to look into the purpose of this in builder.py
determine its function and see if we can do the equivalent in ibek
default: ""

pre_init:
- type: function
name: aravisConfig
args:
AsynPortName: "{{ PORT }}"
IpAddressOrName: "{{ ID }}"
MaxMemory: "{{ MEMORY }}"
Priority: 0
StackSize: 1

databases:
- file: aravisCamera.template
args: { P, R, PORT, TIMEOUT, CHANNEL: "0" }

- name: MantaG235B
description: Defines a Manta G-235B camera instance
args:
- type: object
name: camera
description: reference to ADAravis.ADAravis instance
name: ADDR
description: |-
Asyn Port address, default 0
default: "0"

databases:
- file: AVT_Manta_G235B.template
- file: $(ADARAVIS)/db/aravisCamera.template
args:
P: "{{ camera.P }}"
R: "{{ camera.R }}"
PORT: "{{ camera.PORT }}"
TIMEOUT: "{{ camera.TIMEOUT }}"
ADDR: "0"

- name: Mako_G234B
description: Defines a Mako G-234B camera instance
args:
- type: object
name: camera
description: reference to ADAravis.ADAravis instance

databases:
- file: AVT_Mako_G234B.template
P:
R:
PORT:
TIMEOUT:
ADDR:
# TODO replace AVT_Mako_G234B and make is so ibek will substitue CLASS in
- file: $(ADGENICAM)/db/AVT_Mako_G234B.template
args:
P: "{{ camera.P }}"
R: "{{ camera.R }}"
PORT: "{{ camera.PORT }}"
TIMEOUT: "{{ camera.TIMEOUT }}"
ADDR: "0"
P:
R:
PORT:
TIMEOUT:
ADDR:

pre_init:
- value: |
aravisConfig(const char *portName, const char *cameraName, size_t maxMemory, int priority, int stackSize)
aravisConfig("{{PORT}}", "{{ID}}", {{MEMORY}}, 0, 1)
22 changes: 10 additions & 12 deletions ADAravis/ADAravis.sh → ADAravis/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ set -xe

# install required system dependencies
ibek support apt-install --only=dev \
libboost-all-dev \
libxext-dev \
libglib2.0-dev \
libusb-1.0 \
Expand All @@ -31,21 +30,22 @@ ibek support apt-install --only=run libglib2.0-bin libusb-1.0 libxml2
# build aravis library
(
cd /usr/local &&
git clone -b ARAVIS_0_8_1 --depth 1 https://github.com/AravisProject/aravis &&
git clone -b "0.8.29" --depth 1 https://github.com/AravisProject/aravis &&
cd aravis &&
meson build &&
cd build &&
ninja &&
ninja install &&
rm -fr /usr/local/aravis
echo /usr/local/lib64 > /etc/ld.so.conf.d/usr.conf &&
cd &&
ldconfig
# is this necessary?
pip install telnetlib3
)

# get the source and fix up the configure/RELEASE files
ibek support git-clone ${NAME} ${VERSION}
ibek support git-clone ADGenICam R1-9 --org http://github.com/areaDetector/
ibek support register ADGenICam
ibek support git-clone ${NAME} ${VERSION} --org http://github.com/areaDetector/
ibek support register ${NAME}

# declare the libs and DBDs that are required in ioc/iocApp/src/Makefile
Expand All @@ -54,7 +54,8 @@ ibek support add-dbds ADAravisSupport.dbd

# add any required changes to CONFIG_SITE
CONFIG='
AREA_DETECTOR=$(SUPPORT)
CHECK_RELEASE=WARN
AREA_DETECTOR=/epics/support
CROSS_COMPILER_TARGET_ARCHS =
GLIBPREFIX=/usr
USR_INCLUDES += -I$(GLIBPREFIX)/include/glib-2.0
Expand All @@ -64,14 +65,11 @@ ARAVIS_INCLUDE = /usr/local/include/aravis-0.8/
'

ibek support add-to-config-site ${NAME} "${CONFIG}"

# TODO may need
# ioc_SYS_LIBS += aravis-0.8
# in the Makefile
ibek support add-to-config-site ADGenICam "${CONFIG}"

# compile the support module
ibek support compile ADGenICam
ibek support compile ${NAME}

# prepare *.bob, *.pvi, *.ibek.support.yaml for access outside the container.
ibek support generate-links ${NAME}

ibek support generate-links
Loading

0 comments on commit ae0d69d

Please sign in to comment.