Skip to content
Snippets Groups Projects
Commit 42981b42 authored by Johannes Kung's avatar Johannes Kung
Browse files

Fixed halt pop up

parent abf397e3
No related branches found
No related tags found
1 merge request!9Tick break points
Pipeline #131495 failed
...@@ -487,19 +487,6 @@ class GUI(QMainWindow): ...@@ -487,19 +487,6 @@ class GUI(QMainWindow):
if self.update_all_values: if self.update_all_values:
self.updateCpuListeners() 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 # A signal of 0 steps signifies end of execution, i.e. the CPU has
# halted or run the specified amount of ticks # halted or run the specified amount of ticks
# => Enable the relevant parts of the GUI again # => Enable the relevant parts of the GUI again
...@@ -508,6 +495,14 @@ class GUI(QMainWindow): ...@@ -508,6 +495,14 @@ class GUI(QMainWindow):
self.setDisabledWhenRunning(False) self.setDisabledWhenRunning(False)
self.updateCpuListeners() 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: def stopToolBarButtonClick(self) -> None:
""" """
Tells the cpu to stop. It will then stop at an appropriate in its own thread. Tells the cpu to stop. It will then stop at an appropriate in its own thread.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment