refactor: cleanup and renaming according to MR comments
This commit is contained in:
parent
87ff92796f
commit
8cc7e408a5
@ -14,7 +14,7 @@ from ophyd.sim import SynSignal
|
|||||||
from ophyd.utils import LimitError
|
from ophyd.utils import LimitError
|
||||||
from ophyd_devices.utils.bec_scaninfo_mixin import BecScaninfoMixin
|
from ophyd_devices.utils.bec_scaninfo_mixin import BecScaninfoMixin
|
||||||
from ophyd_devices.sim.sim_data import SimulatedDataBase, SimulatedDataCamera, SimulatedDataMonitor
|
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
|
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:
|
if self._stopped is True or not self._staged:
|
||||||
return super().unstage()
|
return super().unstage()
|
||||||
self._send_data_to_bec()
|
# self._send_data_to_bec()
|
||||||
|
|
||||||
return super().unstage()
|
return super().unstage()
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
class BECDeviceBase:
|
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):
|
def __init__(self, name: str, *args, **kwargs):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
@ -102,11 +102,12 @@ class BecScaninfoMixin:
|
|||||||
|
|
||||||
def get_username(self) -> str:
|
def get_username(self) -> str:
|
||||||
"""Get username"""
|
"""Get username"""
|
||||||
if not self.sim_mode:
|
if self.sim_mode:
|
||||||
msg = self.device_manager.producer.get(MessageEndpoints.account())
|
return os.getlogin()
|
||||||
if not isinstance(msg, str):
|
|
||||||
return os.getlogin()
|
msg = self.device_manager.producer.get(MessageEndpoints.account())
|
||||||
return self.device_manager.producer.get(MessageEndpoints.account())
|
if msg:
|
||||||
|
return msg
|
||||||
return os.getlogin()
|
return os.getlogin()
|
||||||
|
|
||||||
def load_scan_metadata(self) -> None:
|
def load_scan_metadata(self) -> None:
|
||||||
|
@ -154,35 +154,6 @@ class DMMock:
|
|||||||
self.devices[name] = DeviceMock(name, value)
|
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):
|
class ConfigSignal(Signal):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user