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
88d9dc39
Commit
88d9dc39
authored
10 months ago
by
Martin Högstedt
Browse files
Options
Downloads
Plain Diff
Merge branch '68-opening-a-memory-window-for-the-mia-micro-memory-crashes-the-program' into 'main'
fixed index out of range error in the memory graphic module Closes
#68
See merge request
!41
parents
ed01d7e4
813ab817
No related branches found
No related tags found
1 merge request
!41
fixed index out of range error in the memory graphic module
Pipeline
#133275
failed
10 months ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/simudator/gui/module_graphics_item/integer_memory_graphic.py
+1
-1
1 addition, 1 deletion
...udator/gui/module_graphics_item/integer_memory_graphic.py
src/simudator/gui/module_graphics_item/memory_graphic.py
+2
-2
2 additions, 2 deletions
src/simudator/gui/module_graphics_item/memory_graphic.py
with
3 additions
and
3 deletions
src/simudator/gui/module_graphics_item/integer_memory_graphic.py
+
1
−
1
View file @
88d9dc39
...
@@ -248,6 +248,6 @@ class IntegerMemoryTable(MemoryTable):
...
@@ -248,6 +248,6 @@ class IntegerMemoryTable(MemoryTable):
# -7 + 16 % 16 = 9 = 1001 = -7
# -7 + 16 % 16 = 9 = 1001 = -7
value
=
(
value
+
max_value
)
%
max_value
value
=
(
value
+
max_value
)
%
max_value
index
=
row
*
4
+
col
index
=
row
*
self
.
_column_size
+
col
state
[
'
memory
'
][
index
]
=
value
state
[
'
memory
'
][
index
]
=
value
self
.
_memory
.
set_state
(
state
)
self
.
_memory
.
set_state
(
state
)
This diff is collapsed.
Click to expand it.
src/simudator/gui/module_graphics_item/memory_graphic.py
+
2
−
2
View file @
88d9dc39
...
@@ -35,7 +35,7 @@ class MemoryWindow(QWidget):
...
@@ -35,7 +35,7 @@ class MemoryWindow(QWidget):
An instance of the Memory base class.
An instance of the Memory base class.
edit_buttons: bool
edit_buttons: bool
A bool deciding whether or not to add buttons to the widget
A bool deciding whether or not to add buttons to the widget
for toggling between setting the memory contents to
for toggling between setting the memory contents to
editable or not.
editable or not.
"""
"""
...
@@ -196,7 +196,7 @@ class MemoryTable(QTableWidget):
...
@@ -196,7 +196,7 @@ class MemoryTable(QTableWidget):
value
=
item
.
text
()
value
=
item
.
text
()
if
value
==
""
:
if
value
==
""
:
return
return
index
=
row
*
4
+
col
index
=
row
*
self
.
_column_size
+
col
state
[
'
memory
'
][
index
]
=
value
state
[
'
memory
'
][
index
]
=
value
self
.
_memory
.
set_state
(
state
)
self
.
_memory
.
set_state
(
state
)
...
...
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