From efd0ae17edd394c84e4bbc2edcad71f66e7ea63f Mon Sep 17 00:00:00 2001 From: Shekar V Date: Tue, 5 Mar 2024 17:54:37 -0500 Subject: [PATCH 1/2] Updated cryostream signal for AMX --- config_params.py | 2 +- gui/control_main.py | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/config_params.py b/config_params.py index b94d0425..1bf7be5b 100644 --- a/config_params.py +++ b/config_params.py @@ -83,7 +83,7 @@ class RasterStatus(Enum): DEWAR_SECTORS = {"amx": 8, "fmx": 8, "nyx": 5} PUCKS_PER_DEWAR_SECTOR = {"amx": 3, "fmx": 3, "nyx": 3} -cryostreamTempPV = {"amx": "AMX:cs700:gasT-I", "fmx": "FMX:cs700:gasT-I"} +cryostreamTempPV = {"amx": "XF:17IDB-ES:AMX{CS:1}SAMPLE_TEMP_RBV", "fmx": "FMX:cs700:gasT-I"} VALID_EXP_TIMES = { "amx": {"min": 0.005, "max": 1, "digits": 3}, diff --git a/gui/control_main.py b/gui/control_main.py index cf49b7e0..bcb9de38 100644 --- a/gui/control_main.py +++ b/gui/control_main.py @@ -142,7 +142,7 @@ class ControlMain(QtWidgets.QMainWindow): roiChangeSignal = QtCore.Signal(int, str) highMagCursorChangeSignal = QtCore.Signal(int, str) lowMagCursorChangeSignal = QtCore.Signal(int, str) - cryostreamTempSignal = QtCore.Signal(str) + cryostreamTempSignal = QtCore.Signal(object) sampleZoomChangeSignal = QtCore.Signal(object) def __init__(self): @@ -1333,7 +1333,7 @@ def createSampleTab(self): 140, highlight_on_change=False, ) - ringCurrentMessageLabel = QtWidgets.QLabel("Ring(mA):") + ringCurrentMessageLabel = QtWidgets.QLabel("Ring (mA):") self.ringCurrentMessage = QtWidgets.QLabel(str(self.ringCurrent_pv.get())) beamAvailable = self.beamAvailable_pv.get() if beamAvailable: @@ -1349,12 +1349,12 @@ def createSampleTab(self): else: self.sampleExposedLabel = QtWidgets.QLabel("Sample Not Exposed") self.sampleExposedLabel.setStyleSheet("background-color: #99FF66;") - gripperLabel = QtWidgets.QLabel("Gripper Temp:") + gripperLabel = QtWidgets.QLabel("Gripper Temp (K):") if daq_utils.beamline == "nyx": self.gripperTempLabel = QtWidgets.QLabel("N/A") else: self.gripperTempLabel = QtWidgets.QLabel("%.1f" % self.gripTemp_pv.get()) - cryostreamLabel = QtWidgets.QLabel("Cryostream Temp:") + cryostreamLabel = QtWidgets.QLabel("Cryostream Temp (K):") if getBlConfig(CRYOSTREAM_ONLINE): self.cryostreamTempLabel = QtWidgets.QLabel( str(self.cryostreamTemp_pv.get()) @@ -2073,14 +2073,21 @@ def processFastShutter(self, shutterVal): self.shutterStateLabel.setStyleSheet("background-color: #99FF66;") def processGripTemp(self, gripVal): - self.gripperTempLabel.setText("%.1f" % gripVal) - if int(gripVal) > -170: + gripValKelvin = gripVal + 273.15 + gripValMaxKelvin = 103.15 # -170 in degC + self.gripperTempLabel.setText("%.1f" % gripValKelvin) + if int(gripVal) > gripValMaxKelvin: self.gripperTempLabel.setStyleSheet("background-color: red;") else: self.gripperTempLabel.setStyleSheet("background-color: #99FF66;") def processCryostreamTemp(self, cryostreamVal): - self.cryostreamTempLabel.setText(str(cryostreamVal)) + self.cryostreamTempLabel.setText(f"{cryostreamVal:.2f}") + if cryostreamVal is not None: + if 99 < cryostreamVal < 102: + self.cryostreamTempLabel.setStyleSheet("background-color: #99FF66;") + else: + self.cryostreamTempLabel.setStyleSheet("background-color: red;") def processRingCurrent(self, ringCurrentVal): self.ringCurrentMessage.setText(str(int(ringCurrentVal))) From 18c65b72990f7ebcc771e746af0a5478ece430af Mon Sep 17 00:00:00 2001 From: Shekar V Date: Thu, 7 Mar 2024 13:43:03 -0500 Subject: [PATCH 2/2] Fixed typo --- gui/control_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/control_main.py b/gui/control_main.py index bcb9de38..404c5f71 100644 --- a/gui/control_main.py +++ b/gui/control_main.py @@ -2076,7 +2076,7 @@ def processGripTemp(self, gripVal): gripValKelvin = gripVal + 273.15 gripValMaxKelvin = 103.15 # -170 in degC self.gripperTempLabel.setText("%.1f" % gripValKelvin) - if int(gripVal) > gripValMaxKelvin: + if gripValKelvin > gripValMaxKelvin: self.gripperTempLabel.setStyleSheet("background-color: red;") else: self.gripperTempLabel.setStyleSheet("background-color: #99FF66;")