Skip to content

Commit

Permalink
Update meta adapter to work with new OdinDataAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed Aug 29, 2024
1 parent 13e0784 commit 1d19d16
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/src/odin_data/control/meta_listener_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self, **kwargs):

# Parameters must be created before base init called
super(MetaListenerAdapter, self).__init__(**kwargs)
self._client = self._clients[0] # We only have one client
self._client = self._controller._clients[0] # We only have one client
self._controller.process_updates = self.process_updates

def _set_defaults(self):
self._status_parameters = {
Expand Down Expand Up @@ -70,22 +71,22 @@ def get(self, path, request):
logging.debug("GET request: %s", request)

if path == "config/acquisition_id":
response["value"] = self.acquisition_id
response["acquisition_id"] = self.acquisition_id
elif path == "status/acquisition_active":
response["value"] = self.acquisition_active
response["acquisition_active"] = self.acquisition_active
elif path == "config/acquisitions":
acquisition_tree = self.traverse_parameters(
self._clients[0].parameters,
["config", "acquisitions"]
)
if acquisition_tree is not None:
response["value"] = "," .join(acquisition_tree.keys())
response["acquisitions"] = "," .join(acquisition_tree.keys())
else:
response["value"] = None
response["acquisitions"] = None
elif path in self._status_parameters:
response["value"] = self._status_parameters[path]
response[path.split("/")[-1]] = self._status_parameters[path]
elif path in self._config_parameters:
response["value"] = self._config_parameters[path]
response[path.split("/")[-1]] = self._config_parameters[path]
else:
return super(MetaListenerAdapter, self).get(path, request)

Expand Down

0 comments on commit 1d19d16

Please sign in to comment.