diff --git a/changelog.md b/changelog.md index a51a0db0..fc38b54d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +0.2.69 +- check beamline state before running raster, rotation and automation +- lowered polling rate of daq status to improve GUI performance +- robot drys then parks after repeated mount failures 0.2.68: - added check box to numberlineedits to switch between user input and spreadsheet - re-enabled MLprediction diff --git a/gui/src/aaregui/panels/rotation_data_collection.py b/gui/src/aaregui/panels/rotation_data_collection.py index 3bf05422..5e951ad9 100644 --- a/gui/src/aaregui/panels/rotation_data_collection.py +++ b/gui/src/aaregui/panels/rotation_data_collection.py @@ -5,7 +5,7 @@ from PySide6.QtWidgets import QLabel, QComboBox, QPushButton, QMessageBox from aaredaqlib.diffraction_geometry import DiffractionGeometry from aaredaqlib.logger_config import setup_logger -from aaredaqlib.models import DAQStatusModel +from aaredaqlib.models import DAQStatusModel, BeamlineStateEnum from aaredaqlib.rotation_scan import RotationScanRequest from aaregui.panels.scan_settings_panel import ScanSettingsPanel from aaregui.widgets.number_line_edit import NumberLineEdit, CheckedLineEdit @@ -33,6 +33,7 @@ class RotationDataCollectionPanel(ScanSettingsPanel): default_dtz=default_dtz, default_transmission=default_transmission) + self.__beamline_state = None self.__curr_pgroup = "p11206" self._filename = "" self._previous_sample_was_none_rotation = True @@ -127,6 +128,10 @@ class RotationDataCollectionPanel(ScanSettingsPanel): @Slot() def run_screening(self): + if self.__beamline_state != BeamlineStateEnum.SampleAlignment: + logger.error(f"Beamline state {self.__beamline_state} is not Sample Alignment") + QMessageBox.critical(None, "Error", "Beamline state is not Sample Alignment") + return if not self.check_before_run(scan_kind = "screening"): logger.error("Cannot run measurement because of check") return @@ -146,6 +151,10 @@ class RotationDataCollectionPanel(ScanSettingsPanel): @Slot() def run_measurement(self): + if self.__beamline_state != BeamlineStateEnum.SampleAlignment: + logger.error(f"Beamline state {self.__beamline_state} is not Sample Alignment") + QMessageBox.critical(None, "Error", "Beamline state is not Sample Alignment") + return if not self.check_before_run(scan_kind = "rotation"): logger.error("Cannot run measurement because of check") return @@ -227,6 +236,7 @@ class RotationDataCollectionPanel(ScanSettingsPanel): self.__dose_mgy = (time * s.bl.flux_ph_s * self._transmission) / (beam_area * kdose) self.dose.setText(f"{(self.__dose_mgy / 1e6):.1f}") + self.__beamline_state = s.state @Slot() def update_omega_start(self):