diff --git a/src/simudator/gui/gui.py b/src/simudator/gui/gui.py index 8e2348a1000667f881156678be9716ac2c8b0589..3169e88b13e841b555bd6aa128217cb01639e44f 100644 --- a/src/simudator/gui/gui.py +++ b/src/simudator/gui/gui.py @@ -487,19 +487,6 @@ class GUI(QMainWindow): if self.update_all_values: self.updateCpuListeners() - # If a breakpoint halted the program, inform the user - # Update other visuals and set the cpu to the correct state (not running) - if self.cpu.breakpoint_reached: - self.messageBox("Reached breakpoint: " + self.cpu.last_breakpoint.__str__()) - - # When the CPU is done we want to inform the user and update visuals - if self.cpu.should_halt(): - # Only show halted message for larger steps that take time - # This is done so a user dosent have to close - # the message box after every small step - if steps > self.HALT_MESSAGE_THRESHOLD: - self.messageBox("The processor halted.") - # A signal of 0 steps signifies end of execution, i.e. the CPU has # halted or run the specified amount of ticks # => Enable the relevant parts of the GUI again @@ -508,6 +495,14 @@ class GUI(QMainWindow): self.setDisabledWhenRunning(False) self.updateCpuListeners() + # Inform user of reached break point + if self.cpu.breakpoint_reached: + self.messageBox("Reached breakpoint: " + self.cpu.last_breakpoint.__str__()) + + # Inform user of halt + if self.cpu.should_halt(): + self.messageBox("The processor halted.") + def stopToolBarButtonClick(self) -> None: """ Tells the cpu to stop. It will then stop at an appropriate in its own thread.