Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simuDAtor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
simuDAtor
Commits
c6d3f374
Commit
c6d3f374
authored
11 months ago
by
Johannes Kung
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug where the tick buttons are not enabled after stepping some ticks
parent
454ce0a7
No related branches found
No related tags found
1 merge request
!6
Resolve "Count clock cycles"
Pipeline
#131474
passed
11 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/simudator/gui/gui.py
+6
-6
6 additions, 6 deletions
src/simudator/gui/gui.py
src/simudator/gui/run_continuously_thread.py
+4
-1
4 additions, 1 deletion
src/simudator/gui/run_continuously_thread.py
with
10 additions
and
7 deletions
src/simudator/gui/gui.py
+
6
−
6
View file @
c6d3f374
...
@@ -470,20 +470,20 @@ class GUI(QMainWindow):
...
@@ -470,20 +470,20 @@ class GUI(QMainWindow):
if
self
.
cpu
.
breakpoint_reached
:
if
self
.
cpu
.
breakpoint_reached
:
self
.
messageBox
(
"
Reached breakpoint:
"
+
self
.
cpu
.
last_breakpoint
.
__str__
())
self
.
messageBox
(
"
Reached breakpoint:
"
+
self
.
cpu
.
last_breakpoint
.
__str__
())
self
.
updateCpuListeners
()
self
.
updateCpuListeners
()
self
.
cpu_running
=
False
self
.
setDisabledWhenRunning
(
False
)
# When the
cpu
is done we want to inform the user and update visuals
# When the
CPU
is done we want to inform the user and update visuals
if
self
.
cpu
.
should_halt
():
if
self
.
cpu
.
should_halt
():
# Only show halted message for larger steps that take time
# Only show halted message for larger steps that take time
# This is done so a user dosent have to close
# This is done so a user dosent have to close
# the message box after every small step
# the message box after every small step
if
steps
>
self
.
HALT_MESSAGE_THRESHOLD
:
if
steps
>
self
.
HALT_MESSAGE_THRESHOLD
:
self
.
messageBox
(
"
The processor halted.
"
)
self
.
messageBox
(
"
The processor halted.
"
)
self
.
updateCpuListeners
()
self
.
updateCpuListeners
()
# 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
if
steps
==
0
:
self
.
cpu_running
=
False
self
.
cpu_running
=
False
self
.
setDisabledWhenRunning
(
False
)
self
.
setDisabledWhenRunning
(
False
)
...
...
This diff is collapsed.
Click to expand it.
src/simudator/gui/run_continuously_thread.py
+
4
−
1
View file @
c6d3f374
...
@@ -24,7 +24,7 @@ class RunThread(QRunnable):
...
@@ -24,7 +24,7 @@ class RunThread(QRunnable):
def
run
(
self
):
def
run
(
self
):
if
self
.
run_continuously
:
if
self
.
run_continuously
:
while
not
self
.
cpu
.
should_halt
():
while
not
self
.
cpu
.
should_halt
()
and
not
self
.
cpu
.
is_stopped
:
self
.
cpu
.
do_tick
()
self
.
cpu
.
do_tick
()
self
.
signal
.
emit
(
1
)
self
.
signal
.
emit
(
1
)
time
.
sleep
(
CPU_TICK_DELAY
)
time
.
sleep
(
CPU_TICK_DELAY
)
...
@@ -34,3 +34,6 @@ class RunThread(QRunnable):
...
@@ -34,3 +34,6 @@ class RunThread(QRunnable):
self
.
cpu
.
do_tick
()
self
.
cpu
.
do_tick
()
self
.
signal
.
emit
(
1
)
self
.
signal
.
emit
(
1
)
time
.
sleep
(
CPU_TICK_DELAY
)
time
.
sleep
(
CPU_TICK_DELAY
)
# Signal end of execution as having run 0 ticks
self
.
signal
.
emit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment