Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion daq_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def unmountCold():
set_mounted_pin_data(currentMountedSampleID, mount_state=MountState.CURRENTLY_UNMOUNTING.value)
if robot_lib.unmountRobotSample(gov_robot, puckPos,pinPos,currentMountedSampleID):
db_lib.deleteCompletedRequestsforSample(currentMountedSampleID)
if getBlConfig("robot_online"):
if getBlConfig("robot_online") and not getBlConfig("special_mount_enabled"):
robot_lib.parkGripper()
clearMountedSample()
setPvDesc("robotGovActive",1)
Expand Down
24 changes: 24 additions & 0 deletions gui/control_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,30 @@ def createSampleTab(self):
self.dewarViewRadio.toggled.connect(
functools.partial(self.dewarViewToggledCB, "dewarView")
)
self.puck_type_radio_group = QtWidgets.QButtonGroup()
self.special_puck_radio = QtWidgets.QRadioButton("Special Puck")
self.dewar_puck_radio = QtWidgets.QRadioButton("Dewar Puck")
self.puck_type_radio_group.addButton(self.special_puck_radio)
self.puck_type_radio_group.addButton(self.dewar_puck_radio)
puck_type_radio_layout = QtWidgets.QHBoxLayout()
puck_type_radio_layout.addWidget(self.dewar_puck_radio)
puck_type_radio_layout.addWidget(self.special_puck_radio)
if getBlConfig("special_mount_enabled"):
self.special_puck_radio.setChecked(True)
else:
self.dewar_puck_radio.setChecked(True)
self.dewar_puck_radio.toggled.connect(
lambda checked: self.toggle_special_puck(False) if checked else None
)
self.special_puck_radio.toggled.connect(
lambda checked: self.toggle_special_puck(True) if checked else None
)

hBoxRadioLayout1.addWidget(self.dewarViewRadio)
hBoxRadioLayout1.addWidget(self.priorityViewRadio)
self.viewRadioGroup.addButton(self.dewarViewRadio)
vBoxDFlayout.addLayout(hBoxRadioLayout1)
vBoxDFlayout.addLayout(puck_type_radio_layout)
vBoxDFlayout.addWidget(self.dewarTree)
vBoxDFlayout.addWidget(self.follow_current_request_checkbox)
queueSelectedButton = QtWidgets.QPushButton("Queue All Selected")
Expand Down Expand Up @@ -1590,6 +1610,10 @@ def createSampleTab(self):
serverCheckThread.visit_dir_changed.connect(QApplication.instance().quit)
serverCheckThread.start()

def toggle_special_puck(self, activate_special: bool):
setBlConfig("special_mount_enabled", activate_special)
self.dewarTree.refreshTreeDewarView(hard_refresh=True)

def updateCam(self, pixmapItem: "QGraphicsPixmapItem", frame):
if pixmapItem == self.pixmap_item:
with QMutexLocker(self.sampleCameraMutex):
Expand Down
13 changes: 11 additions & 2 deletions gui/dewar_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,16 @@ def set_mounted_sample(self, item, sample_name=None):
sample_name = item.text()
item.setText(sample_name + MountState.get_text(mount_state))

def refreshTreeDewarView(self, get_latest_pucks=False):
def refreshTreeDewarView(self, get_latest_pucks=False, hard_refresh=False):
puck = ""
#self.model.clear()
# self.model.clear()
# We only want to show 1 puck when special mount is enabled
if daq_utils.getBlConfig("special_mount_enabled"):
self.pucksPerDewarSector = 1
self.dewarSectors = 1
else:
self.pucksPerDewarSector = PUCKS_PER_DEWAR_SECTOR[daq_utils.beamline]
self.dewarSectors = DEWAR_SECTORS[daq_utils.beamline]
dewar_data, puck_data, sample_data, request_data = db_lib.get_dewar_tree_data(
daq_utils.primaryDewarName, daq_utils.beamline, get_latest_pucks
)
Expand All @@ -223,6 +230,8 @@ def refreshTreeDewarView(self, get_latest_pucks=False):
"sample_data": sample_data,
"request_data": request_data,
}
if hard_refresh:
self.model.clear()
self.update_model(data)

def update_model(self, data):
Expand Down