From 128df481410f60170f2fc4c485c7e89a2c7dff29 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 28 May 2026 08:59:48 +0200 Subject: [PATCH] treat rotation_z correctly for om/a3/dom --- new.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/new.py b/new.py index 316eb75..8c76c9b 100644 --- a/new.py +++ b/new.py @@ -72,10 +72,10 @@ MEANINGS = { 'temperature_regulation': 'T', 'magneticfield': 'B', 'pressure': 'p', - 'rotation_z': 'a3', + 'rotation_z': 'dom', 'stick_rotation': 'dom', } -SKIP_ENV = 'rotation_z', 'dom' +SKIP_ENV = 'rotation_z', 'dom', 'om', 'a3' # meanings and device names not to consider for envlist SETUPDIR = '/home/linse/setups' IDSUB = re.compile('\W+|^(?=\d)') NOT_USED = 'not_used' @@ -153,6 +153,13 @@ def get_meanings(modname, meaning, hastarget): return result +def adjust_rotation_z_meaning(): + if isinstance(session.devices.get('om'), DeviceAlias): + MEANINGS['rotation_z'] = 'om' + elif isinstance(session.devices.get('a3'), DeviceAlias): + MEANINGS['rotation_z'] = 'a3' + + class FrappyManager(Readable): """start/stops to frappy servers or connects to SEC nodes""" @@ -178,6 +185,7 @@ class FrappyManager(Readable): def doInit(self, mode): if SETUPDIR not in session._setup_paths: session.log.error('can not use frappy as %r is not in the setup_subdirs', SETUPDIR) + adjust_rotation_z_meaning() expt = session.experiment if 'persistent_environment' in expt.parameters and mode != SIMULATION: expt.persistent_environment = [v for k, v in MEANINGS.items() if k not in SKIP_ENV] @@ -395,8 +403,6 @@ class FrappyManager(Readable): devname = self._get_device_name(device_mapping, modname) target = MEANINGS.get(meaning_name) alias_config[target] = {devname: importance, NOT_USED: -100} - if target == 'a3' and meaning_name == 'rotation_z': - alias_config['om'] = {devname: importance} if target not in SKIP_ENV: envlist.append(target) return envlist, alias_config, device_mapping @@ -500,6 +506,7 @@ class FrappyNode(SecNodeDevice): def doInit(self, mode): # self._marche = MarcheControl() + adjust_rotation_z_meaning() if mode != SIMULATION and session.sessiontype != POLLER: pass # TODO: