-
Notifications
You must be signed in to change notification settings - Fork 15
Gui updates fixes #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Shekar V (vshekar)
wants to merge
3
commits into
NSLS2:master
Choose a base branch
from
vshekar:gui-updates-fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gui updates fixes #418
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,14 +8,10 @@ | |
| import time | ||
| from typing import Dict, List, Optional | ||
| from pathlib import Path | ||
| import threading | ||
|
|
||
| from queue import Queue | ||
| import cv2 | ||
| import numpy as np | ||
| import requests | ||
| from epics import PV | ||
| from PyMca5.PyMcaGui.physics.xrf.McaAdvancedFit import McaAdvancedFit | ||
| from PyMca5.PyMcaGui.pymca.McaWindow import McaWindow, ScanWindow | ||
| from PyMca5.PyMcaPhysics.xrf import Elements | ||
| from qt_epics.QtEpicsPVEntry import QtEpicsPVEntry | ||
|
|
@@ -37,7 +33,6 @@ | |
| CRYOSTREAM_ONLINE, | ||
| HUTCH_TIMER_DELAY, | ||
| MINIMUM_RASTER_SIZE, | ||
| RASTER_GUI_XREC_FILL_DELAY, | ||
| SAMPLE_TIMER_DELAY, | ||
| SERVER_CHECK_DELAY, | ||
| SET_ENERGY_CHECK, | ||
|
|
@@ -309,7 +304,15 @@ def parseXRFTable(self): | |
|
|
||
|
|
||
| def closeEvent(self, evnt): | ||
| self.hutchCornerCamThread.stop() | ||
| self.hutchTopCamThread.stop() | ||
| self.hutchCornerCamThread.wait() | ||
| self.hutchTopCamThread.wait() | ||
| self.sampleCameraThread.stop() | ||
| self.sampleCameraThread.wait() | ||
| self.serverCheckThread.stop() | ||
| self.serverCheckThread.wait() | ||
| self.albulaInterface.close() | ||
| evnt.accept() | ||
| sys.exit() # doing this to close any windows left open | ||
|
|
||
|
|
@@ -358,7 +361,6 @@ def createSampleTab(self): | |
| functools.partial(self.dewarViewToggledCB, "dewarView") | ||
| ) | ||
| hBoxRadioLayout1.addWidget(self.dewarViewRadio) | ||
| hBoxRadioLayout1.addWidget(self.priorityViewRadio) | ||
| self.viewRadioGroup.addButton(self.dewarViewRadio) | ||
| vBoxDFlayout.addLayout(hBoxRadioLayout1) | ||
| vBoxDFlayout.addWidget(self.dewarTree) | ||
|
|
@@ -577,7 +579,7 @@ def createSampleTab(self): | |
| self.beamsizeComboBox = QtWidgets.QComboBox(self) | ||
| self.beamsizeComboBox.addItems(beamSizeOptionList) | ||
| self.beamsizeComboBox.setCurrentIndex(current_index) | ||
| self.beamsizeComboBox.activated[str].connect(self.beamsizeComboActivatedCB) | ||
| self.beamsizeComboBox.currentTextChanged.connect(self.beamsizeComboActivatedCB) | ||
| if daq_utils.beamline == "amx" or self.energy_pv.get() < 9000: | ||
| self.beamsizeComboBox.setEnabled(False) | ||
| colEnergyLabel = QtWidgets.QLabel("Energy (eV):") | ||
|
|
@@ -694,7 +696,7 @@ def createSampleTab(self): | |
| protoOptionList = CollectionProtocols.get_beamline_options(daq_utils.beamline) | ||
| self.protoComboBox = QtWidgets.QComboBox(self) | ||
| self.protoComboBox.addItems(protoOptionList) | ||
| self.protoComboBox.activated[str].connect(self.protoComboActivatedCB) | ||
| self.protoComboBox.currentTextChanged.connect(self.protoComboActivatedCB) | ||
|
vshekar marked this conversation as resolved.
|
||
| hBoxColParams6.addWidget(protoLabel) | ||
| hBoxColParams6.addWidget(self.protoStandardRadio) | ||
| hBoxColParams6.addWidget(self.protoRasterRadio) | ||
|
|
@@ -765,7 +767,7 @@ def createSampleTab(self): | |
| self.rasterEvalComboBox.setCurrentIndex( | ||
| db_lib.beamlineInfo(daq_utils.beamline, "rasterScoreFlag")["index"] | ||
| ) | ||
| self.rasterEvalComboBox.activated[str].connect(self.rasterEvalComboActivatedCB) | ||
| self.rasterEvalComboBox.currentTextChanged.connect(self.rasterEvalComboActivatedCB) | ||
|
vshekar marked this conversation as resolved.
|
||
| self.hBoxRasterLayout1.addWidget(rasterStepLabel) | ||
| self.hBoxRasterLayout1.addWidget(self.rasterStepEdit) | ||
| self.hBoxRasterLayout1.addWidget(self.rasterGrainCoarseRadio) | ||
|
|
@@ -1252,6 +1254,8 @@ def createSampleTab(self): | |
| focusMinusButton.clicked.connect(functools.partial(self.focusTweakCB, -5)) | ||
| annealButton = QtWidgets.QPushButton("Anneal") | ||
| annealButton.clicked.connect(self.annealButtonCB) | ||
| if daq_utils.beamline == "amx": | ||
| annealButton.setEnabled(False) | ||
| annealTimeLabel = QtWidgets.QLabel("Time") | ||
| self.annealTime_ledit = QtWidgets.QLineEdit() | ||
| self.annealTime_ledit.setFixedWidth(40) | ||
|
|
@@ -1285,6 +1289,7 @@ def createSampleTab(self): | |
| hBoxSampleAlignLayout = QtWidgets.QHBoxLayout() | ||
| centerLoopButton = QtWidgets.QPushButton("Center\nLoop") | ||
| centerLoopButton.clicked.connect(self.autoCenterLoopCB) | ||
| centerLoopButton.hide() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this is not used, consider removing it and associated code completely |
||
| measureButton = QtWidgets.QPushButton("Measure") | ||
| measureButton.clicked.connect(self.measurePolyCB) | ||
| loopShapeButton = QtWidgets.QPushButton("Add Raster\nto Queue") | ||
|
|
@@ -1586,9 +1591,9 @@ def createSampleTab(self): | |
| lambda frame: self.updateCam(self.pixmap_item_HutchTop, frame) | ||
| ) | ||
| self.hutchTopCamThread.start() | ||
| serverCheckThread = ServerCheckThread(parent=self, delay=SERVER_CHECK_DELAY) | ||
| serverCheckThread.visit_dir_changed.connect(QApplication.instance().quit) | ||
| serverCheckThread.start() | ||
| self.serverCheckThread = ServerCheckThread(parent=self, delay=SERVER_CHECK_DELAY) | ||
| self.serverCheckThread.visit_dir_changed.connect(QApplication.instance().quit) | ||
| self.serverCheckThread.start() | ||
|
|
||
| def updateCam(self, pixmapItem: "QGraphicsPixmapItem", frame): | ||
| if pixmapItem == self.pixmap_item: | ||
|
|
@@ -1671,7 +1676,6 @@ def vidActionToggledCB(self): | |
| if self.protoComboBox.currentText() in (CollectionProtocols.RASTER, | ||
| CollectionProtocols.STEP_RASTER): | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.STANDARD) | ||
| self.protoComboActivatedCB(CollectionProtocols.STANDARD) | ||
| self.showProtParams() | ||
|
|
||
| def adjustGraphics4ZoomChange(self, fov): | ||
|
|
@@ -2380,7 +2384,6 @@ def processChoochResult(self, choochResultFlag): | |
| self.choochF2PrimePeak.setText(str(choochResultObj["f2prime_peak"])) | ||
| self.choochResultFlag_pv.put("0") | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.STANDARD) | ||
| self.protoComboActivatedCB(CollectionProtocols.STANDARD) | ||
| except TypeError as e: | ||
| logger.error( | ||
| "Chooch plotting failed - check whether scan had a strong signal or not: %s" | ||
|
|
@@ -2627,13 +2630,10 @@ def validateFields(self, field_values_dict): | |
| def protoRadioToggledCB(self, text): | ||
| if self.protoStandardRadio.isChecked(): | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.STANDARD) | ||
| self.protoComboActivatedCB(text) | ||
| elif self.protoRasterRadio.isChecked(): | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.RASTER) | ||
| self.protoComboActivatedCB(text) | ||
| elif self.protoVectorRadio.isChecked(): | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.VECTOR) | ||
| self.protoComboActivatedCB(text) | ||
| else: | ||
| pass | ||
|
|
||
|
|
@@ -3270,7 +3270,6 @@ def takeRasterSnapshot(self, rasterReq): | |
| reqID=rasterReq["uid"], | ||
| rasterHeatJpeg=jpegImageFilename, | ||
| ) | ||
| self.send_to_server("insertRasterResult", [str(rasterReq["uid"]), str(visitName)]) | ||
|
|
||
| def reFillPolyRaster(self): | ||
| rasterEvalOption = str(self.rasterEvalComboBox.currentText()) | ||
|
|
@@ -4730,7 +4729,6 @@ def mountSampleCB(self): | |
| self.zoom2Radio.setChecked(True) | ||
| self.zoomLevelToggledCB("Zoom2") | ||
| self.protoComboBox.setCurrentText(CollectionProtocols.STANDARD) | ||
| self.protoComboActivatedCB(CollectionProtocols.STANDARD) | ||
|
|
||
| def unmountSampleCB(self): | ||
| logger.info("unmount sample") | ||
|
|
@@ -5285,10 +5283,6 @@ def popStaffDialogCB(self): | |
| self.popupServerMessage("You don't have control") | ||
|
|
||
| def closeAll(self): | ||
| self.hutchCornerCamThread.stop() | ||
| self.hutchTopCamThread.stop() | ||
| self.hutchCornerCamThread.wait() | ||
| self.hutchTopCamThread.wait() | ||
| QtWidgets.QApplication.instance().quit() | ||
|
|
||
| def initCallbacks(self): | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.