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
627639cb
Commit
627639cb
authored
11 months ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
added error msg box to grx and it now handles incorrect input instead of crashing
parent
659d0545
No related branches found
No related tags found
1 merge request
!36
Grx displays error message instead of crashing
Pipeline
#133051
failed
11 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/simudator/gui/module_graphics_item/module_graphics_item.py
+4
-0
4 additions, 0 deletions
...imudator/gui/module_graphics_item/module_graphics_item.py
src/simudator/processor/mia/gui/mia_grx_graphic.py
+8
-2
8 additions, 2 deletions
src/simudator/processor/mia/gui/mia_grx_graphic.py
with
12 additions
and
2 deletions
src/simudator/gui/module_graphics_item/module_graphics_item.py
+
4
−
0
View file @
627639cb
...
...
@@ -185,6 +185,10 @@ class ModuleGraphicsItem(QGraphicsObject, QGraphicsItem):
parsed_value
=
ast
.
literal_eval
(
value
)
except
SyntaxError
as
e
:
self
.
errorMessageWidget
.
showMessage
(
str
(
e
))
except
ValueError
as
e
:
self
.
errorMessageWidget
.
showMessage
(
"
Value Error. Unable to parse input. Make sure it is in the correct base.
"
)
else
:
module_state
=
self
.
module
.
get_state
()
module_state
[
state
]
=
parsed_value
...
...
This diff is collapsed.
Click to expand it.
src/simudator/processor/mia/gui/mia_grx_graphic.py
+
8
−
2
View file @
627639cb
...
...
@@ -3,6 +3,7 @@ import math
from
qtpy.QtCore
import
QPointF
from
qtpy.QtGui
import
QPolygonF
from
qtpy.QtWidgets
import
(
QErrorMessage
,
QGraphicsLineItem
,
QGraphicsPolygonItem
,
QGraphicsRectItem
,
...
...
@@ -32,6 +33,7 @@ class GrxGraphicsItem(ModuleGraphicsItem):
def
__init__
(
self
,
module
:
GRX
):
self
.
register_text_labels
=
[]
self
.
errorMessageWidget
=
QErrorMessage
()
super
().
__init__
(
module
)
def
draw_graphics_item
(
self
):
...
...
@@ -126,14 +128,18 @@ class GrxGraphicsItem(ModuleGraphicsItem):
)
# Add ports to and from bus
from_bus_port
=
PortGraphicsItem
(
self
.
module
.
signals
[
"
in_input
"
],
Orientation
.
RIGHT
,
self
)
from_bus_port
=
PortGraphicsItem
(
self
.
module
.
signals
[
"
in_input
"
],
Orientation
.
RIGHT
,
self
)
from_bus_port
.
setPos
(
rect_width
+
self
.
LINE_LENGTH
+
self
.
MUX_WIDTH
,
# Use the buses port margins so the ports align nicely
mux_height
/
2
-
BusGraphicsItem
.
PORT_MARGIN
/
2
,
)
to_bus_port
=
PortGraphicsItem
(
self
.
module
.
signals
[
"
out_content
"
],
Orientation
.
RIGHT
,
self
)
to_bus_port
=
PortGraphicsItem
(
self
.
module
.
signals
[
"
out_content
"
],
Orientation
.
RIGHT
,
self
)
to_bus_port
.
setPos
(
rect_width
+
self
.
LINE_LENGTH
+
self
.
MUX_WIDTH
,
# Use the buses port margins so the ports align nicely
...
...
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