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
eb699a4f
Commit
eb699a4f
authored
11 months ago
by
Martin Högstedt
Browse files
Options
Downloads
Patches
Plain Diff
removed old class, fixed typo
parent
f6e629c5
No related branches found
No related tags found
1 merge request
!21
Changed how memory related content is display into QTables
Pipeline
#131752
passed
11 months ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/simudator/gui/module_graphics_item/memory_graphic.py
+1
-36
1 addition, 36 deletions
src/simudator/gui/module_graphics_item/memory_graphic.py
with
1 addition
and
36 deletions
src/simudator/gui/module_graphics_item/memory_graphic.py
+
1
−
36
View file @
eb699a4f
...
@@ -9,9 +9,6 @@ from qtpy.QtWidgets import (
...
@@ -9,9 +9,6 @@ from qtpy.QtWidgets import (
QGraphicsSimpleTextItem
,
QGraphicsSimpleTextItem
,
QTableWidget
,
QTableWidget
,
QTableWidgetItem
,
QTableWidgetItem
,
QTextEdit
,
QVBoxLayout
,
QWidget
,
)
)
from
simudator.core.modules
import
Memory
from
simudator.core.modules
import
Memory
...
@@ -33,7 +30,7 @@ class MemoryWindow(QTableWidget):
...
@@ -33,7 +30,7 @@ class MemoryWindow(QTableWidget):
self
.
memory
=
memory_module
self
.
memory
=
memory_module
self
.
column_size
=
column_size
self
.
column_size
=
column_size
self
.
memory_size
=
len
(
self
.
memory
.
get_state
()[
"
memory
"
])
self
.
memory_size
=
len
(
self
.
memory
.
get_state
()[
"
memory
"
])
self
.
set_colum_size
()
self
.
set_colum
n
_size
()
self
.
setColumnCount
(
self
.
column_size
)
self
.
setColumnCount
(
self
.
column_size
)
self
.
setRowCount
(
ceil
(
self
.
memory_size
/
self
.
column_size
))
self
.
setRowCount
(
ceil
(
self
.
memory_size
/
self
.
column_size
))
self
.
setHorizontalHeaderLabels
([
"
+
"
+
str
(
i
)
for
i
in
range
(
4
)])
self
.
setHorizontalHeaderLabels
([
"
+
"
+
str
(
i
)
for
i
in
range
(
4
)])
...
@@ -85,38 +82,6 @@ class MemoryWindow(QTableWidget):
...
@@ -85,38 +82,6 @@ class MemoryWindow(QTableWidget):
return
return
class
OldMemoryWindow
(
QWidget
):
"""
Widget for showing content of memory
"""
_ROW_LENGTH
=
5
def
__init__
(
self
,
memory_module
:
Memory
):
super
().
__init__
()
self
.
module
=
memory_module
self
.
text
=
QTextEdit
(
""
)
layout
=
QVBoxLayout
()
layout
.
addWidget
(
self
.
text
)
self
.
setLayout
(
layout
)
self
.
update
()
def
update
(
self
):
memory_str
=
""
for
address
,
value
in
enumerate
(
self
.
module
.
memory
):
# Add address and content to string
# Make sure its unifrom length so rows are consistent
memory_str
+=
f
"
{
address
}
"
+
"
:
"
+
f
"
{
value
}
"
+
"
"
+
"
\t
"
# Make new line when we reach end of row
if
address
%
self
.
_ROW_LENGTH
==
self
.
_ROW_LENGTH
-
1
:
memory_str
+=
"
\n
"
self
.
text
.
setText
(
memory_str
)
class
MemoryGraphicsItem
(
ModuleGraphicsItem
):
class
MemoryGraphicsItem
(
ModuleGraphicsItem
):
"""
"""
Graphics module for a Memory module.
Graphics module for a Memory module.
...
...
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