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
50f3b25b
Commit
50f3b25b
authored
8 months ago
by
Johannes Kung
Browse files
Options
Downloads
Patches
Plain Diff
Fixed f-string syntax that is invalid in python 3.10
parent
9de3f1e1
No related branches found
No related tags found
1 merge request
!45
General gui module
Pipeline
#134569
failed
8 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/simudator/gui/formatting.py
+2
-3
2 additions, 3 deletions
src/simudator/gui/formatting.py
src/simudator/gui/module_graphics_item/module_widget.py
+1
-1
1 addition, 1 deletion
src/simudator/gui/module_graphics_item/module_widget.py
with
3 additions
and
4 deletions
src/simudator/gui/formatting.py
+
2
−
3
View file @
50f3b25b
...
@@ -86,9 +86,9 @@ def format_to_str(format_info: FormatInfo, value: Any) -> str:
...
@@ -86,9 +86,9 @@ def format_to_str(format_info: FormatInfo, value: Any) -> str:
case
Format
.
Str
:
case
Format
.
Str
:
pass
pass
case
Format
.
Bin
:
case
Format
.
Bin
:
return
f
"
{
value
:
0
{
format_info
.
kwargs
[
"
bit_length
"
]
}
b
}
"
return
f
"
{
value
:
0
{
format_info
.
kwargs
[
'
bit_length
'
]
}
b
}
"
case
Format
.
Hex
:
case
Format
.
Hex
:
return
f
"
{
value
:
0
{
math
.
ceil
(
format_info
.
kwargs
[
"
bit_length
"
]
/
4
)
}
x
}
"
return
f
"
{
value
:
0
{
math
.
ceil
(
format_info
.
kwargs
[
'
bit_length
'
]
/
4
)
}
x
}
"
case
Format
.
Decimal
:
case
Format
.
Decimal
:
pass
pass
case
Format
.
DecimalSigned
:
case
Format
.
DecimalSigned
:
...
@@ -116,4 +116,3 @@ def parse_str(format_info: FormatInfo, value: str) -> Any:
...
@@ -116,4 +116,3 @@ def parse_str(format_info: FormatInfo, value: str) -> Any:
return
int
(
value
)
return
int
(
value
)
case
Format
.
Hex
:
case
Format
.
Hex
:
return
int
(
value
,
base
=
16
)
return
int
(
value
,
base
=
16
)
This diff is collapsed.
Click to expand it.
src/simudator/gui/module_graphics_item/module_widget.py
+
1
−
1
View file @
50f3b25b
...
@@ -117,7 +117,7 @@ class ModuleWidget(QGraphicsWidget):
...
@@ -117,7 +117,7 @@ class ModuleWidget(QGraphicsWidget):
format_info
=
self
.
_state_vars
[
state_var
]
format_info
=
self
.
_state_vars
[
state_var
]
value
=
format_to_str
(
format_info
,
self
.
_module
.
get_state
()[
state_var
])
value
=
format_to_str
(
format_info
,
self
.
_module
.
get_state
()[
state_var
])
painter
.
drawText
(
painter
.
drawText
(
text_rect
,
text_flags
,
f
"
{
self
.
_module
.
get_state
()[
"
name
"
]
}
:
{
value
}
"
text_rect
,
text_flags
,
f
"
{
self
.
_module
.
get_state
()[
'
name
'
]
}
:
{
value
}
"
)
)
# Draw the name of the module and each state variable with its value on one row each
# Draw the name of the module and each state variable with its value on one row each
...
...
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