Skip to content

Commit

Permalink
added new structure to blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Oct 7, 2024
1 parent c4dea92 commit 38c21f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 18 additions & 3 deletions src/pandablocks_ioc/_pvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ def add_pvi_info_to_record(
access: str,
):
block, field = record_name.split(":", maxsplit=1)
block_name_suffixed = f"pvi.{field.lower().replace(':', '_')}.{access}"
pvi_pv = RecordName(f"{block}:PVI")
block_name_suffixed = f"value.{field.lower().replace(':', '_')}.{access}"
record.add_info(
"Q:group",
{
RecordName(f"{block}:PVI"): {
pvi_pv: {
block_name_suffixed: {
"+channel": "NAME",
"+type": "plain",
Expand Down Expand Up @@ -328,11 +329,25 @@ def create_pvi_records(record_prefix: str):
# in the database, so have to make an extra record here just to hold the
# PVI PV name
pvi_record_name = block_name + ":PVI"
description = builder.longStringIn(
f"{pvi_record_name}:DESCRIPTION",
initial_value=f"PVs making up Interface for {block_name}",
)
description.add_info(
"Q:group",
{
RecordName(pvi_record_name): {
"+id": "epics:nt/NTPVI:1.0",
"display.description": {"+type": "plain", "+channel": "VAL"},
"": {"+type": "meta", "+channel": "VAL"},
}
},
)
block_pvi = builder.longStringIn(
pvi_record_name + "_PV",
initial_value=RecordName(pvi_record_name),
)
block_name_suffixed = f"pvi.{block_name.lower()}.d"
block_name_suffixed = f"value.{block_name.lower()}.d"
block_pvi.add_info(
"Q:group",
{
Expand Down
4 changes: 2 additions & 2 deletions src/pandablocks_ioc/_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(
"Q:group",
{
RecordName(f"{block}:PVI"): {
f"pvi.{field.lower().replace(':', '_')}.r": {
f"value.{field.lower().replace(':', '_')}.r": {
"+channel": "VAL",
"+type": "plain",
}
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(
"Q:group",
{
RecordName(f"{block}:PVI"): {
f"pvi.{field.lower().replace(':', '_')}.rw": {
f"value.{field.lower().replace(':', '_')}.rw": {
"+channel": "VAL",
"+type": "plain",
}
Expand Down

0 comments on commit 38c21f6

Please sign in to comment.