feat(GUI): Integrate route computation Job
This commit is contained in:
parent
22ca2d26a8
commit
f4e6bd39ee
1 changed files with 11 additions and 9 deletions
|
@ -212,6 +212,15 @@ class App(QApplication):
|
||||||
self.styles[style] = palette
|
self.styles[style] = palette
|
||||||
self.styles["Light"] = self.style().standardPalette()
|
self.styles["Light"] = self.style().standardPalette()
|
||||||
|
|
||||||
|
class WRoute(Ui_Route):
|
||||||
|
def __init__(self,hops):
|
||||||
|
super().__init__()
|
||||||
|
dialog=QDialog()
|
||||||
|
self.setupUi(dialog)
|
||||||
|
for n,item in enumerate(hops):
|
||||||
|
item = QTreeWidgetItem(self.lst_route, [str(n+1),item['system'],"{body} ({star_type})".format(**item),str(item['distance']), None])
|
||||||
|
item.setFlags(item.flags() & ~Qt.ItemIsDropEnabled)
|
||||||
|
dialog.show()
|
||||||
|
|
||||||
class ED_LRR(Ui_ED_LRR):
|
class ED_LRR(Ui_ED_LRR):
|
||||||
dl_thread = None
|
dl_thread = None
|
||||||
|
@ -376,7 +385,7 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
path,
|
path,
|
||||||
precomp,
|
precomp,
|
||||||
)
|
)
|
||||||
if self.current_job is None:
|
if (self.current_job is None) or self.current_job.done():
|
||||||
self.current_job = RouterJob(
|
self.current_job = RouterJob(
|
||||||
self.app,
|
self.app,
|
||||||
self.main_window,
|
self.main_window,
|
||||||
|
@ -392,15 +401,8 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
precomp,
|
precomp,
|
||||||
path,
|
path,
|
||||||
)
|
)
|
||||||
if route_job:
|
|
||||||
self.route_progress_dialog = ProgressDialog(
|
|
||||||
"Computing route...", "Cancel", 0, 100, self.main_window
|
|
||||||
)
|
|
||||||
self.route_progress_dialog.canceled.connect(route_job.cancel)
|
|
||||||
route_job.start()
|
|
||||||
self.route_progress_dialog.show()
|
|
||||||
else:
|
else:
|
||||||
self.error("Another route job is already running!")
|
self.error("there is already a job running!")
|
||||||
|
|
||||||
def find_sys_by_names(self, names):
|
def find_sys_by_names(self, names):
|
||||||
t_s = datetime.today()
|
t_s = datetime.today()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue