Skip to content

Create records for appending tables #18

@coretl

Description

@coretl

In v4.0 of PandABlocks-server we have MODE and QUEUED_LINES attributes:
https://pandablocks.github.io/PandABlocks-server/master/fields.html

After PandABlocks/PandABlocks-client#107 there will be a has_mode attribute in the TableFieldInfo that tells us we have these fields. This ticket is to add some FastCS attributes when has_mode==True to allow table streaming.

At the moment we create a single Attribute for the table value:

def _make_table_field(
self,
parent_block: BlockController,
panda_name: PandaName,
field_info: TableFieldInfo,
):
structured_datatype = [
(name, self._table_datatypes_from_table_field_details(details))
for name, details in field_info.fields.items()
]
# TODO: Add units handler to update the units field and value of this one PV
# https://github.com/PandABlocks/PandABlocks-ioc/blob/c1e8056abf3f680fa3840493eb4ac6ca2be31313/src/pandablocks_ioc/ioc.py#L750-L769
parent_block.attributes[panda_name.attribute_name] = AttrRW(
Table(structured_datatype),
handler=TableFieldHandler(panda_name),
)

The new list of attributes for a table with has_mode==True is:

  • panda_name + PandaName(sub_field="NEXT_WRITE") a WO enum of Replace / Append / Append Last that says what the next write to the table value will do
  • panda_name is the RW table value as before
  • panda_name + PandaName(sub_field="CLEAR") a command that sends an empty table to PandA
  • panda_name + PandaName(sub_field="MODE") is the RO current table mode, one of INIT / FIXED /STREAMING / STREAMING_LAST whose value is supplied from the PandA field {block_name}.{field_name}.MODE
  • panda_name + PandaName(sub_field="QUEUED_LINES") is the RO current number of table lines not yet processed by the FPGA whose value is supplied from the PandA {block_name}.{field_name}.QUEUED_LINES

Acceptance Criteria

  • The attributes added and tests added

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions