Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable custom autosave configuration #1

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions iocBoot/iocCamera/st.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env Camera
# -*- container-image: ghcr.io/cnpem/ad-aravis-epics-ioc

cd /opt/ad-aravis-epics-ioc/iocBoot/iocCamera

< envPaths
< /usr/local/share/misc/envPaths
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if camera-envPaths or envPathsCamera wouldn't be a better name... For namespacing reasons.

(I prefer the second one)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To namespace it, I'd rather move it to a dedicated folder under share. Maybe /usr/local/share/ad-aravis{,-epics-ioc}/envPaths. Other installed template scripts and configuration files could share the namespace this way.

But then I fear we are losing the benefit of defining a (copy-and-paste) standard for different IOCs. Do we want to namespace to support different IOCs in the same container?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then I fear we are losing the benefit of defining a (copy-and-paste) standard for different IOCs.

I don't think things are strictly copy and paste now, since the binary has a specific name...

Do we want to namespace to support different IOCs in the same container?

For most cases, I don't think so. But I feel like using a file in the same path for every container, which has different contents based on the container, can be a bit confusing; if the path is namespaced, then it's clear it's specific to this application.

Otherwise, for consistency, there should be a dynamic link to the Camera binary with a generic name (and we should document such a standard). I might be in favor of it if we go the whole way, but we can discuss more in person.

epicsEnvSet("IOC_CONFIG", "$(TOP)/iocBoot/$(IOC)")

# IOC and device specific configuration
epicsEnvSet("PREFIX", "BL:H:BASLER01:")
Expand All @@ -12,7 +11,7 @@ epicsEnvSet("DEVICE_MANUFACTURER", "Basler")
epicsEnvSet("DEVICE_MODEL", "acA1300-75gm")
epicsEnvSet("DEVICE_VERSION", "106755-13")

< device.cmd
< $(IOC_CONFIG)/device.cmd

# Configure Area Detector plugins
epicsEnvSet("MAX_IMAGE_WIDTH", 1280)
Expand All @@ -21,15 +20,15 @@ epicsEnvSet("MAX_IMAGE_PIXELS", 1310720)
epicsEnvSet("QSIZE", 20)
epicsEnvSet("QSIZE_HDF5", 50)

< plugins.cmd
< $(IOC_CONFIG)/plugins.cmd

# Restrict camera features
epicsEnvSet("ACQUIRE_PERIOD_LOW_LIMIT", 0.1)

< limits.cmd
< $(IOC_CONFIG)/limits.cmd

< autosave.cmd
< $(IOC_CONFIG)/autosave.cmd

iocInit()

< post-init.cmd
< $(IOC_CONFIG)/post-init.cmd
2 changes: 2 additions & 0 deletions postinstall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ TOP=..
include $(TOP)/configure/CONFIG

install:
mkdir -p /usr/local/share/misc
ln -s $(shell realpath $(TOP))/iocBoot/iocCamera/envPaths /usr/local/share/misc/
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could accept a PREFIX argument here, I think. Just a tad cleaner :)

Could you also add a comment to the commit message that envPaths is arch-independent because it only lists the root directory for each module, not any internal build directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could accept a PREFIX argument here, I think. Just a tad cleaner :)

Seems nice. Would PREFIX ?= /usr/local do a good job here or is there a better way to parameterize this?

Could you also add a comment to the commit message that envPaths is arch-independent because it only lists the root directory for each module, not any internal build directory?

Sure. Will do.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PREFIX ?= /usr/local

Good enough. If you want to go further you can define bindir and sharedir based on PREFIX so even those specific directories can be overridden, but I think that's unnecessary.

ln -s $(shell realpath $(INSTALL_HOST_BIN))/Camera /usr/local/bin/

include $(CONFIG)/RULES_DIRS