astrodatagui: support opening saved calculated files and fix a typo

This commit is contained in:
2024-06-07 15:06:30 +02:00
parent 1bdb552152
commit 9a80bf021d
+9 -2
View File
@@ -59,6 +59,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
self.cbPlotShowQuality.stateChanged.connect(self.plotOptionsShowQuality)
self.btCountAllFlares.clicked.connect(self.btCountAllFlaresClicked)
self.btOpenSavedFlareCountFile.clicked.connect(self.btOpenSavedFlareCountFileClicked)
self.setupCustomSimbadQueries()
self.show()
@@ -354,13 +355,13 @@ class AstrodataGUI(QtWidgets.QMainWindow):
def btCountAllFlaresClickedDone(self, allFlaresDictList):
self.calcAllFlaresThread = None
self.btCountAllFlaresClicked.setEnabled(True)
self.btCountAllFlares.setEnabled(True)
self.AllFlaresWindow = FlareSummaryPlotGUI(allFlaresDictList)
self.AllFlaresWindow.show()
def btCountAllFlaresClicked(self):
if(self.calcAllFlaresThread is None):
self.btCountAllFlaresClicked.setEnabled(False)
self.btCountAllFlares.setEnabled(False)
allStarsDictList = pd.DataFrame(columns=["StarName",
"SpType",
"RotVel",
@@ -385,3 +386,9 @@ class AstrodataGUI(QtWidgets.QMainWindow):
self.calcAllFlaresThread = CalcAllFlaresThread(allStarsDictList)
self.calcAllFlaresThread.finished.connect(self.btCountAllFlaresClickedDone)
self.calcAllFlaresThread.start()
def btOpenSavedFlareCountFileClicked(self):
file = QtWidgets.QFileDialog.getOpenFileName(self, "Open saved data", filter="Counted Flares File (*.cff)")[0]
allFlaresList = pd.read_pickle(file)
self.AllFlaresWindow = FlareSummaryPlotGUI(allFlaresList)
self.AllFlaresWindow.show()