Skip to content

Commit

Permalink
WIP: added :DATASET to ext_out
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Jun 11, 2024
1 parent ae4b0cc commit 4cb1372
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/pandablocks_ioc/ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,26 @@ def _make_ext_out(
# The field itself has no value.

capture_record_name = EpicsName(record_name + ":CAPTURE")
dataset_record_name = EpicsName(record_name + ":DATASET")
labels, capture_index = self._process_labels(
field_info.capture_labels, values[capture_record_name]
)
record_dict[dataset_record_name] = self._create_record_info(
dataset_record_name,
"Used to adjust the dataset name to one more scientifically relevant",
builder.stringOut,
str,
PviGroup.OUTPUTS,
initial_value="",
on_update=lambda new_dataset_name: (
self._dataset_name_cache.update_cache(
record_name,
new_dataset_name,
labels[record_dict[capture_record_name].record.get()],
)
),
)

# TODO :DATASET on ext out, you don't need to add this to all
# position capture table, though we want it in `DATA:DATASETS`
record_dict[capture_record_name] = self._create_record_info(
capture_record_name,
field_info.description,
Expand All @@ -1080,6 +1094,13 @@ def _make_ext_out(
PviGroup.OUTPUTS,
labels=labels,
initial_value=capture_index,
on_update=lambda new_capture_mode: (
self._dataset_name_cache.update_cache(
record_name,
record_dict[dataset_record_name].record.get(),
labels[new_capture_mode],
)
),
)

return record_dict
Expand Down

0 comments on commit 4cb1372

Please sign in to comment.