refactor: cleanup and renaming according to MR comments

This commit is contained in:
appel_c 2024-02-13 11:01:41 +01:00
parent 87ff92796f
commit 8cc7e408a5
5 changed files with 9 additions and 37 deletions

View File

@ -14,7 +14,7 @@ from ophyd.sim import SynSignal
from ophyd.utils import LimitError
from ophyd_devices.utils.bec_scaninfo_mixin import BecScaninfoMixin
from ophyd_devices.sim.sim_data import SimulatedDataBase, SimulatedDataCamera, SimulatedDataMonitor
from ophyd_devices.sim.sim_additional_devices import DummyController
from ophyd_devices.sim.sim_test_devices import DummyController
from ophyd_devices.sim.sim_signals import SetableSignal, ReadOnlySignal, ComputedReadOnlySignal
@ -215,7 +215,7 @@ class SimCamera(Device):
"""
if self._stopped is True or not self._staged:
return super().unstage()
self._send_data_to_bec()
# self._send_data_to_bec()
return super().unstage()

View File

@ -1,5 +1,5 @@
class BECDeviceBase:
"""Base class for BEC devices with minimal functionality."""
"""Base class for BEC devices with zero functionality."""
def __init__(self, name: str, *args, **kwargs):
self.name = name

View File

@ -102,11 +102,12 @@ class BecScaninfoMixin:
def get_username(self) -> str:
"""Get username"""
if not self.sim_mode:
msg = self.device_manager.producer.get(MessageEndpoints.account())
if not isinstance(msg, str):
if self.sim_mode:
return os.getlogin()
return self.device_manager.producer.get(MessageEndpoints.account())
msg = self.device_manager.producer.get(MessageEndpoints.account())
if msg:
return msg
return os.getlogin()
def load_scan_metadata(self) -> None:

View File

@ -154,35 +154,6 @@ class DMMock:
self.devices[name] = DeviceMock(name, value)
# class MockProducer:
# def set_and_publish(self, endpoint: str, msgdump: str):
# logger.info(f"BECMessage to {endpoint} with msg dump {msgdump}")
# class MockDeviceManager:
# def __init__(self) -> None:
# self.devices = devices()
# class OphydObject:
# def __init__(self) -> None:
# self.name = "mock_mokev"
# self.obj = mokev()
# class devices:
# def __init__(self):
# self.mokev = OphydObject()
# class mokev:
# def __init__(self):
# self.name = "mock_mokev"
# def read(self):
# return {self.name: {"value": 16.0, "timestamp": time.time()}}
class ConfigSignal(Signal):
def __init__(
self,