fix: implement simulated flux
CI / lint (push) Successful in 34s
CI / test (3.12) (push) Canceled after 37s
CI / test (3.13) (push) Canceled after 33s
CI / test (3.14) (push) Canceled after 32s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 28s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 27s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 23s
CI / test-with-coverage (push) Canceled after 22s
CI / coverage-analysis (push) Canceled after 0s
Docs build and publish / docker (push) Successful in 18s
Build and Publish / release (push) Successful in 22s

This commit was merged in pull request #211.
This commit is contained in:
David Perl
2026-09-09 22:56:21 +02:00
committed by perl_d
parent 477d72a46c
commit 06c66c1944
3 changed files with 7 additions and 4 deletions
@@ -17,8 +17,8 @@ class SimulatedBecMacros(BecMacros):
@staticmethod
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
@staticmethod
def init_beamline_environment() -> tuple[Any, Any, Any]:
return (None, None, None)
def init_beamline_environment() -> tuple[Any, Any]:
return (None, None)
@staticmethod
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
@@ -28,6 +28,9 @@ class SimulatedBecMacros(BecMacros):
def mono_pitch_scan(plot=True): ...
@staticmethod
def auto_exposure(): ...
@staticmethod
def full_flux_ph_per_s() -> float:
return 42
class SimulatedDispatch(DefaultDispatch):
+1 -1
View File
@@ -214,7 +214,7 @@ class BeamlineDevices:
try:
with suppress_output():
return self._dispatch.bec_macros.full_flux_ph_per_s()
except Exception as e: #noqa
except Exception as e: # noqa
logger.error(f"Could not get flux from BEC macro {e}")
return 9.99e12
+1 -1
View File
@@ -176,7 +176,7 @@ class StatusBar(QStatusBar):
num = f"{(status.bl.flux_ph_s / status.bl.transmission):.2E}"
mod, exp = num.split("E")
self.flux.set_value(f"{mod} x 10<sup>{int(exp)}</sup>")
except Exception as e: #noqa
except Exception as e: # noqa
logger.error(f"Error parsing flux result: {e}")
self.flux.set_value(f"{status.bl.flux_ph_s:.2E}")