-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathframe_receiver.py
More file actions
46 lines (37 loc) · 1.52 KB
/
frame_receiver.py
File metadata and controls
46 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from fastcs_odin.controllers.odin_data.odin_data_adapter import (
OdinDataAdapterController,
)
from fastcs_odin.controllers.odin_subcontroller import OdinSubController
from fastcs_odin.util import create_attribute, remove_metadata_fields_paths
class FrameReceiverController(OdinSubController):
"""Controller for a frameReceiver application"""
async def initialise(self):
self.parameters = remove_metadata_fields_paths(self.parameters)
for parameter in self.parameters:
# Remove duplicate index from uri
parameter.uri = parameter.uri[1:]
# Remove redundant status/config from parameter path
parameter.set_path(parameter.uri[1:])
if len(parameter.path) > 1 and "decoder" in parameter.path[0]:
# Combine "decoder" and "decoder_config"
parameter.path[0] = "decoder"
self.add_attribute(
parameter.name,
create_attribute(parameter=parameter, api_prefix=self._api_prefix),
)
class FrameReceiverAdapterController(OdinDataAdapterController):
"""Controller for a frame receiver adapter in an odin control serve."""
_subcontroller_label = "FR"
_subcontroller_cls = FrameReceiverController
_unique_config = [
"rank",
"number",
"ctrl_endpoint",
"fr_ready_cnxn",
"fr_release_cnxn",
"frame_ready_endpoint",
"frame_release_endpoint",
"shared_buffer_name",
"rx_address",
"rx_ports",
]