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["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): | ||||
|     dl_thread = None | ||||
|  | @ -376,7 +385,7 @@ class ED_LRR(Ui_ED_LRR): | |||
|             path, | ||||
|             precomp, | ||||
|         ) | ||||
|         if self.current_job is None: | ||||
|         if (self.current_job is None) or self.current_job.done(): | ||||
|             self.current_job = RouterJob( | ||||
|                 self.app, | ||||
|                 self.main_window, | ||||
|  | @ -392,15 +401,8 @@ class ED_LRR(Ui_ED_LRR): | |||
|             precomp, | ||||
|             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: | ||||
|             self.error("Another route job is already running!") | ||||
|             self.error("there is already a job running!") | ||||
| 
 | ||||
|     def find_sys_by_names(self, names): | ||||
|         t_s = datetime.today() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue