astrodatagui: use new thread for count all flairs
This commit is contained in:
@@ -9,6 +9,8 @@ import numpy as np
|
||||
from .db.StarsDB import StarDB
|
||||
from .ui.NewStarDialog import NewStarDialog
|
||||
|
||||
from .CalcAllFlaresThread import CalcAllFlaresThread
|
||||
|
||||
DEFAULT_DB = "stars.db"
|
||||
|
||||
class AstrodataGUI(QtWidgets.QMainWindow):
|
||||
@@ -61,6 +63,8 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
||||
self.loadDB()
|
||||
self.updateStarList()
|
||||
|
||||
self.calcAllFlaresThread = None
|
||||
|
||||
def setupCustomSimbadQueries(self):
|
||||
self.simbad = Simbad()
|
||||
self.simbad.add_votable_fields("sptype")
|
||||
@@ -344,7 +348,12 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
||||
view = self.comboPlotPeriodogramView.currentText()
|
||||
self.flaredetectorPreview.setPeriodogramState(periodogramEnabled, method, view)
|
||||
|
||||
def btCountAllFlaresClickedDone(self, allFlaresDictList):
|
||||
print(allFlaresDictList)
|
||||
self.calcAllFlaresThread = None
|
||||
|
||||
def btCountAllFlaresClicked(self):
|
||||
if(self.calcAllFlaresThread is None):
|
||||
allStarsDictList = []
|
||||
|
||||
for starName in self.starDB.getAllStars():
|
||||
@@ -363,3 +372,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
||||
"Source": source,
|
||||
"Sequence": seq,
|
||||
"FilePath": filePath})
|
||||
|
||||
self.calcAllFlaresThread = CalcAllFlaresThread(allStarsDictList)
|
||||
self.calcAllFlaresThread.finished.connect(self.btCountAllFlaresClickedDone)
|
||||
self.calcAllFlaresThread.start()
|
||||
Reference in New Issue
Block a user