From 9a80bf021d5bd6a47cdc4f3c97ad411d695cb135 Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Fri, 7 Jun 2024 15:06:30 +0200 Subject: [PATCH] astrodatagui: support opening saved calculated files and fix a typo --- main/astrodatagui/AstrodataGUI.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main/astrodatagui/AstrodataGUI.py b/main/astrodatagui/AstrodataGUI.py index 49f27a9..ab16dee 100644 --- a/main/astrodatagui/AstrodataGUI.py +++ b/main/astrodatagui/AstrodataGUI.py @@ -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() \ No newline at end of file