fix(widgets) due to new AcsSignals
This commit is contained in:
@@ -939,11 +939,11 @@ class DigitalTwin(BECWidget, QWidget):
|
||||
Calculates bragg angle in rad
|
||||
"""
|
||||
xtal = self.input.mo1_xtal.currentText()
|
||||
if xtal == "Si(111)":
|
||||
if xtal == "Si111":
|
||||
d_spacing = self.dev.mo1_bragg.crystal.d_spacing_si111.read(cached=True)[
|
||||
"mo1_bragg_crystal_d_spacing_si111"
|
||||
]["value"]
|
||||
elif xtal == "Si(311)":
|
||||
elif xtal == "Si311":
|
||||
d_spacing = self.dev.mo1_bragg.crystal.d_spacing_si311.read(cached=True)[
|
||||
"mo1_bragg_crystal_d_spacing_si311"
|
||||
]["value"]
|
||||
|
||||
@@ -110,7 +110,7 @@ class InputPanel(QWidget):
|
||||
|
||||
# Monochromator
|
||||
self.mo1_mode = ComboBox("mo1_mode", "Mode", ["Monochromatic", "Pinkbeam"])
|
||||
self.mo1_xtal = ComboBox("mo1_xtal", "Crystal", ["Si(111)", "Si(311)"])
|
||||
self.mo1_xtal = ComboBox("mo1_xtal", "Crystal", ["Si111", "Si311"])
|
||||
self.mo1_bragg_angle = NumberIndicator("Bragg Angle", "deg", decimals=1)
|
||||
self.mo1_eres = NumberIndicator("Energy Resolution", "eV", decimals=2)
|
||||
self.mo1_ass_group = Group(
|
||||
|
||||
@@ -77,6 +77,15 @@ class ScanControlXAS(ScanControl):
|
||||
self._update_d_spacing, MessageEndpoints.device_readback("mo1_bragg")
|
||||
)
|
||||
|
||||
# Read once manually to get a first value
|
||||
if "mo1_bragg" in self.dev:
|
||||
self.d_spacing = self.dev.mo1_bragg.crystal.d_spacing_si111.read(cached=True)[
|
||||
"mo1_bragg_crystal_d_spacing_si111"
|
||||
]["value"]
|
||||
self.xas_scans_helper_widget.update_plot(d_spacing=self.d_spacing)
|
||||
else:
|
||||
logger.warning("mo1_bragg not in config, widget will not plot anything!")
|
||||
|
||||
@SafeSlot(dict, dict)
|
||||
def _update_d_spacing(self, msg: dict, _: dict):
|
||||
d_spacing = msg["signals"].get("mo1_bragg_crystal_current_d_spacing")["value"]
|
||||
@@ -293,6 +302,7 @@ class XASScansHelper(QWidget):
|
||||
if self.d_spacing is None:
|
||||
return
|
||||
if d_spacing == 0:
|
||||
logger.warning("self.d_spacing is 0")
|
||||
return
|
||||
|
||||
x_time = np.linspace(0, self.scan_parameters["scan_time"], PLOT_RESOLUTION)
|
||||
|
||||
Reference in New Issue
Block a user