diff --git a/src/aare/daq/daq.py b/src/aare/daq/daq.py index 24301e54..a3839616 100644 --- a/src/aare/daq/daq.py +++ b/src/aare/daq/daq.py @@ -1827,15 +1827,11 @@ class AareDAQ: def _execute_dry(self, park: bool = True, unmount: bool = False): self._create_mounting_service().dry(park=park, unmount=unmount) - def park_and_dry(self, park=True, unmount: bool = False): + def park_and_dry(self, park=True): + """External API for dry and park only""" self._cfg.try_set_busy(timeout=360) try: - self._set_state(BeamlineStateEnum.RobotSampleExchange) - except TransformationInvalidException as e: - logger.error(f"Failed to go to robot sample exchange: {e}") - logger.warning("trying to day and park without unmounting first") - try: - self._execute_dry(park=park, unmount=unmount) + self._execute_dry(park=park, unmount=False) self._cfg.state_busy = False except Exception as e: self._cfg.state_busy = False diff --git a/src/aare/daq/server.py b/src/aare/daq/server.py index 8cf15fda..70c883de 100644 --- a/src/aare/daq/server.py +++ b/src/aare/daq/server.py @@ -1081,31 +1081,12 @@ async def park_and_dry(token: str = Depends(oauth2_scheme)): Returns: Dictionary with status and message. """ - # TODO: add unmount toggle, and combine aprk_and_dry and tell_dry to one command that takes park and unmount as signals auth.check_jwt_rw(cfg, auth.parse_token(token)) - logger.debug("Executing unmount, dry and park") - daq.park_and_dry(park=True, unmount=True) + logger.debug("Executing dry and park") + daq.park_and_dry(park=True) return {"ok": True, "message": "TELL has been dried and parked"} -@app.post("/tell/dry") -async def tell_dry(token: str = Depends(oauth2_scheme)) -> dict: - """ - Execute a TELL dry cycle. Staff only. - - Args: - token: OAuth2 access token. - - Returns: - Dictionary with status and message. - """ - data = auth.parse_token(token) - auth.check_jwt_rw(data) - logger.debug("Executing dry and return to dewar") - daq.park_and_dry(park=False, unmount=False) - return {"ok": True, "message": "TELL dry cycle completed."} - - @app.post("/tell/toggle_blower") async def tell_toggle_blower(token: str = Depends(oauth2_scheme)) -> dict: """ diff --git a/src/aare/gui/panels/local_contact_panel.py b/src/aare/gui/panels/local_contact_panel.py index 600cd2cf..3361d978 100644 --- a/src/aare/gui/panels/local_contact_panel.py +++ b/src/aare/gui/panels/local_contact_panel.py @@ -298,29 +298,24 @@ class LocalContactPanel(QFrame): grid = QGridLayout() grid.setHorizontalSpacing(8) grid.setVerticalSpacing(8) - row = 0 - row += 1 grid.addWidget( - self._make_button("Unmount", self._daq.unmount, "Requesting sample unmount."), row, 0 + self._make_button("Unmount", self._daq.unmount, "Requesting sample unmount."), 0, 0 ) - grid.addWidget(self._make_button("Dry", self._daq.tell_dry, "Requesting TELL dry."), row, 1) - row += 1 grid.addWidget( self._make_button("Park and dry", self._daq.park_and_dry, "Requesting park and dry."), - row, 0, + 1, ) grid.addWidget( self._make_button("Toggle blower", self._daq.tell_toggle_blower, "Toggling blower."), - row, 1, + 0, ) - row += 1 - grid.addWidget(self._make_button("Anneal", self._anneal_from_dialog), row, 0) - grid.addWidget(self._make_button("TELL access info", self._show_tell_access_info), row, 1) + grid.addWidget(self._make_button("Anneal", self._anneal_from_dialog), 1, 1) + grid.addWidget(self._make_button("TELL access info", self._show_tell_access_info), 2, 0) wrapper = QGroupBox("TELL actions", tab) wrapper_layout = QVBoxLayout(wrapper)