Skip to content
Snippets Groups Projects
Commit 7bb78f18 authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

manager: Add slot to (re-)apply managed values

parent afdb4806
No related branches found
No related tags found
2 merge requests!12Snapshot: field test deployed version as of end of run 202201,!3Base correction device, CalCat interaction, DSSC and AGIPD devices
......@@ -413,6 +413,13 @@ class CalibrationManager(DeviceClientBase, Device):
self.state = State.CHANGING
background(self._instantiate_pipeline())
@Slot(
displayedName='Apply managed values',
description='Set all managed keys to the values currently active on '
'the manager, replacing any manual change.',
allowedStates=[State.ACTIVE])
async def applyManagedValues(self):
background(self._apply_managed_values())
managed = Node(
ManagedKeysNode,
......@@ -1228,6 +1235,18 @@ class CalibrationManager(DeviceClientBase, Device):
self._set_status('All devices instantiated')
self.state = State.ACTIVE
async def _apply_managed_values(self):
"""Apply all managed keys to local values."""
for daq_key, local_key in ManagedKeysNode.DAQ_KEYS.items():
await self._set_on_daq(
daq_key, get_property(self, f'managed.{local_key}'))
for key in self._managed_keys:
value = get_property(self, f'managed.{key}')
if not ismethod(value):
await self._set_on_corrections(key, value)
def _call(self, device_ids, slot, *args):
"""Call the same slot on a list of devices."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment