Skip to content

Commit

Permalink
Merge pull request #356 from vshekar/move-unmount-cold-button
Browse files Browse the repository at this point in the history
Added unmount cold and end visit buttons to main panel
  • Loading branch information
vshekar authored Jan 22, 2024
2 parents d75ebae + 4684518 commit dec7f81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions gui/control_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from qtpy.QtGui import QIntValidator
from qtpy.QtWidgets import QApplication, QCheckBox, QFrame, QGraphicsPixmapItem

from gui.albula.interface import AlbulaInterface
import daq_utils
import db_lib
import lsdcOlog
Expand All @@ -40,6 +39,7 @@
)
from daq_utils import getBlConfig, setBlConfig
from element_info import element_info
from gui.albula.interface import AlbulaInterface
from gui.data_loc_info import DataLocInfo
from gui.dewar_tree import DewarTree
from gui.dialog import (
Expand All @@ -54,7 +54,6 @@
from gui.raster import RasterCell, RasterGroup
from QPeriodicTable import QPeriodicTable
from threads import RaddoseThread, ServerCheckThread, VideoThread
from threads import RaddoseThread, VideoThread, ServerCheckThread
from utils import validation

logger = logging.getLogger()
Expand Down Expand Up @@ -354,6 +353,8 @@ def createSampleTab(self):
)
warmupButton = QtWidgets.QPushButton("Warmup Gripper")
warmupButton.clicked.connect(self.warmupGripperCB)
endVisitButton = QtWidgets.QPushButton("End Visit")
endVisitButton.clicked.connect(self.endVisitCB)
restartServerButton = QtWidgets.QPushButton("Restart Server")
restartServerButton.clicked.connect(self.restartServerCB)
self.openShutterButton = QtWidgets.QPushButton("Open Photon Shutter")
Expand All @@ -376,6 +377,7 @@ def createSampleTab(self):
vBoxTreeButtsLayoutRight.addWidget(unmountSampleButton)
vBoxTreeButtsLayoutRight.addWidget(deQueueSelectedButton)
vBoxTreeButtsLayoutRight.addWidget(emptyQueueButton)
vBoxTreeButtsLayoutRight.addWidget(endVisitButton)
vBoxTreeButtsLayoutRight.addWidget(restartServerButton)
hBoxTreeButtsLayout.addLayout(vBoxTreeButtsLayoutLeft)
hBoxTreeButtsLayout.addLayout(vBoxTreeButtsLayoutRight)
Expand Down Expand Up @@ -4451,6 +4453,10 @@ def mountSampleCB(self):

def unmountSampleCB(self):
logger.info("unmount sample")
self.send_to_server("unmountCold")

def endVisitCB(self):
logger.info('Ending visit')
self.send_to_server("unmountSample")


Expand Down
12 changes: 6 additions & 6 deletions gui/dialog/user_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(self, parent: "ControlMain"):
robotGB = QtWidgets.QGroupBox()
robotGB.setTitle("Robot")

self.unmountColdButton = QtWidgets.QPushButton("Unmount Cold")
self.unmountColdButton.clicked.connect(self.unmountColdCB)
self.unmountWarmButton = QtWidgets.QPushButton("Unmount Warm")
self.unmountWarmButton.clicked.connect(self.unmountWarmCB)
self.testRobotButton = QtWidgets.QPushButton("Test Robot")
self.testRobotButton.clicked.connect(self.testRobotCB)
self.recoverRobotButton = QtWidgets.QPushButton("Recover Robot")
Expand All @@ -67,7 +67,7 @@ def __init__(self, parent: "ControlMain"):
self.checkQueueCollect()
self.queueCollectOnCheckBox.stateChanged.connect(self.queueCollectOnCheckCB)

hBoxColParams3.addWidget(self.unmountColdButton)
hBoxColParams3.addWidget(self.unmountWarmButton)
hBoxColParams3.addWidget(self.testRobotButton)
hBoxColParams3.addWidget(self.recoverRobotButton)
hBoxColParams3.addWidget(self.dryGripperButton)
Expand Down Expand Up @@ -181,7 +181,7 @@ def __init__(self, parent: "ControlMain"):

if daq_utils.beamline == "nyx":
self.openShutterButton.setDisabled(True)
self.unmountColdButton.setDisabled(True)
self.unmountWarmButton.setDisabled(True)
self.testRobotButton.setDisabled(True)
self.recoverRobotButton.setDisabled(True)
self.dryGripperButton.setDisabled(True)
Expand Down Expand Up @@ -211,8 +211,8 @@ def setSlit1XCB(self):
def setSlit1YCB(self):
self.parent.send_to_server("setSlit1Y", [self.slit1YMotor_ledit.text()])

def unmountColdCB(self):
self.parent.send_to_server("unmountCold")
def unmountWarmCB(self):
self.parent.send_to_server("unmountSample")

def testRobotCB(self):
self.parent.send_to_server("testRobot")
Expand Down

0 comments on commit dec7f81

Please sign in to comment.