fix: energy tolerance to 0.001 instead of 0.01
This commit is contained in:
1 parent
a7bd46c14b
commit
789b2ae6e2
1 file changed
+3
-9
@@ -13,7 +13,7 @@ ENERGY_MIN_KEV = 4.0
|
||||
ENERGY_MAX_KEV = 20.0
|
||||
# "arrived" window for the moving->neutral transition; per-hardware knob like
|
||||
# MotorMoveGroup's tol (the mono never lands exactly on the setpoint)
|
||||
ENERGY_AT_TARGET_TOL_KEV = 0.01
|
||||
ENERGY_AT_TARGET_TOL_KEV = 0.001
|
||||
ENERGY_RANGE_TIP = (
|
||||
f"Minimum: {ENERGY_MIN_KEV:.3f} keV\nMaximum: {ENERGY_MAX_KEV:.3f} keV\n"
|
||||
"Range to be confirmed with Beamline Scientist"
|
||||
@@ -129,14 +129,8 @@ class MonochromatorPanel(QWidget):
|
||||
@Slot(DAQStatusModel)
|
||||
def update_daq_status(self, status: DAQStatusModel):
|
||||
energy = status.diffraction.energy_keV
|
||||
# 0.0 is the server's detector-unavailable fallback, and the
|
||||
# wavelength property divides by it — guard before touching it.
|
||||
if not energy:
|
||||
text = "— / —"
|
||||
else:
|
||||
text = f"{energy:.3f} keV / {status.diffraction.wavelength_angstrom:.4f} Å"
|
||||
# 0.0 stays out: syncing the fallback would clamp the spin to min
|
||||
self._energy_state.update_actual(energy)
|
||||
text = f"{energy:.3f} keV / {status.diffraction.wavelength_angstrom:.4f} Å"
|
||||
self._energy_state.update_actual(energy)
|
||||
# Guarded: runs per DAQ tick (2 Hz), skip the repaint when unchanged.
|
||||
if self.current_energy_label.text() != text:
|
||||
self.current_energy_label.setText(text)
|
||||
|
||||
Reference in new issue
Block a user