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

database: add accelerator standard PV behavior and naming. #3

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

henriquesimoes
Copy link
Collaborator

@henriquesimoes henriquesimoes commented Feb 20, 2024

Both the behavior and naming come from the previous implementation for the Basler acA1300-75gm used at the Sirius accelerator. This implementation was obtained from commit lnls-dig/basler-acA1300-75gm-epics-ioc@9671765.

Both the behavior and naming come from the previous implementation for
the Basler acA1300-75gm used at the Sirius accelerator. This
implementation was obtained from commit 967176553fe (latest one in any
branch available as of now) of the following repository

https://github.com/lnls-dig/basler-acA1300-75gm-epics-ioc

The basleracA130075gmApp/Db/BaslerSiriusStandard.db was renamed to
`accelerator.db` here. High level aliasing has not been included, since
it shall be verified whether it is really useful in practice.

Some records in the database use `sseq`, which is provided by the EPICS
Calc module. Thus, it has been added as a dependency in the IOC.
The description has been updated to match the way the low-level database
has been generated. Moreover, some minor changes in styling have been
made.
From aravisGigE areaDetector module to the newest ADGenICam, naming
convention for generated records have been changed. Now, they are
prefixed by `GC_` to avoid conflicts in areaDetector, and the policy to
shorten the name trims inner words to its first 3 chars instead of
replacing the last words with a numeric identifier. Therefore, all
references made in the previous high-level PV database need to be
updated. In order to prevent mistakes, this has been done by a simple
script

```
diff -y $previous $current | grep record > changes.txt
cat changes.txt | cut -d'|' -f 1 | cut -d')' -f 3 | cut -d'"' -f 1 > prev.pv
cat changes.txt | cut -d'|' -f 2 | cut -d')' -f 3 | cut -d'"' -f 1 > curr.pv

paste prev.pv curr.pv | xargs -L1 \
    bash -c "sed -i -e \"s|Cam1\$0|Cam1\$1|\" $standard"
```

in which

- `$previous` points to the previously generated database
file
- `$current` points to `acA1300-75gm.db`; and
- `$standard` points to `standard.db` file.

Basically we generate the diff from the two auto generated DBs and
generate two files for the previous and new names. This file is than
concatenated line-by-line by `paste` and a substitution is performed for
occurrences prefixed by Cam1. Cam1 was defined in the previous
implementation as the `R` macro for the auto generated DB file. This
way, we only substitute where it is indeed needed.
It is a pattern in areaDetector to use the plugins and driver names
suffixed by a colon, for instance `Cam1:` instead of simply `Cam1`. Such
names only impact the aliases and forward links made in the database for
accelerator PV naming standard.
Copy link
Collaborator Author

@henriquesimoes henriquesimoes left a comment

Choose a reason for hiding this comment

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

It is still missing the high level aliases defined in the original repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant