astrodatagui: support opening saved calculated files and fix a typo
This commit is contained in:
@@ -59,6 +59,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
self.cbPlotShowQuality.stateChanged.connect(self.plotOptionsShowQuality)
|
self.cbPlotShowQuality.stateChanged.connect(self.plotOptionsShowQuality)
|
||||||
|
|
||||||
self.btCountAllFlares.clicked.connect(self.btCountAllFlaresClicked)
|
self.btCountAllFlares.clicked.connect(self.btCountAllFlaresClicked)
|
||||||
|
self.btOpenSavedFlareCountFile.clicked.connect(self.btOpenSavedFlareCountFileClicked)
|
||||||
|
|
||||||
self.setupCustomSimbadQueries()
|
self.setupCustomSimbadQueries()
|
||||||
self.show()
|
self.show()
|
||||||
@@ -354,13 +355,13 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
def btCountAllFlaresClickedDone(self, allFlaresDictList):
|
def btCountAllFlaresClickedDone(self, allFlaresDictList):
|
||||||
self.calcAllFlaresThread = None
|
self.calcAllFlaresThread = None
|
||||||
self.btCountAllFlaresClicked.setEnabled(True)
|
self.btCountAllFlares.setEnabled(True)
|
||||||
self.AllFlaresWindow = FlareSummaryPlotGUI(allFlaresDictList)
|
self.AllFlaresWindow = FlareSummaryPlotGUI(allFlaresDictList)
|
||||||
self.AllFlaresWindow.show()
|
self.AllFlaresWindow.show()
|
||||||
|
|
||||||
def btCountAllFlaresClicked(self):
|
def btCountAllFlaresClicked(self):
|
||||||
if(self.calcAllFlaresThread is None):
|
if(self.calcAllFlaresThread is None):
|
||||||
self.btCountAllFlaresClicked.setEnabled(False)
|
self.btCountAllFlares.setEnabled(False)
|
||||||
allStarsDictList = pd.DataFrame(columns=["StarName",
|
allStarsDictList = pd.DataFrame(columns=["StarName",
|
||||||
"SpType",
|
"SpType",
|
||||||
"RotVel",
|
"RotVel",
|
||||||
@@ -385,3 +386,9 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
self.calcAllFlaresThread = CalcAllFlaresThread(allStarsDictList)
|
self.calcAllFlaresThread = CalcAllFlaresThread(allStarsDictList)
|
||||||
self.calcAllFlaresThread.finished.connect(self.btCountAllFlaresClickedDone)
|
self.calcAllFlaresThread.finished.connect(self.btCountAllFlaresClickedDone)
|
||||||
self.calcAllFlaresThread.start()
|
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()
|
||||||
Reference in New Issue
Block a user