diff --git a/bin/GUIWindows.py b/bin/GUIWindows.py index d93c3e8..8e6fd27 100644 --- a/bin/GUIWindows.py +++ b/bin/GUIWindows.py @@ -51,7 +51,9 @@ class Window(formType, baseType): self.start_thread() else: self.start_run_db() - + # 按钮置灰 + self.startButton.setEnabled(not self.startButton.isEnabled()) + @Slot() def stop(self): @@ -61,6 +63,8 @@ class Window(formType, baseType): self.stop_run_file() else: self.stop_run_db() + # 按钮恢复 + self.startButton.setEnabled(not self.startButton.isEnabled()) @Slot() def conntest(self): @@ -104,9 +108,11 @@ class Window(formType, baseType): def stop_run_file(self): + # 终止线程的事件循环 global_var.set_value('start_flag',False) - self.thread.quit() # 终止线程的事件循环 - self.thread_running = False # 标记线程停止 + self.thread.quit() + # 标记线程停止 + self.thread_running = global_var.get_value('start_flag')