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
31f95c4b
Commit
31f95c4b
authored
11 months ago
by
Martin Högstedt
Browse files
Options
Downloads
Plain Diff
Merge branch '51-tell-user-if-saving-goes-wrong' into 'main'
Tell user if unable/able to save Closes
#51
See merge request
!25
parents
e6845316
beda43b0
No related branches found
No related tags found
1 merge request
!25
Tell user if unable/able to save
Pipeline
#132178
passed
11 months ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/simudator/core/module.py
+1
-0
1 addition, 0 deletions
src/simudator/core/module.py
src/simudator/core/processor.py
+7
-2
7 additions, 2 deletions
src/simudator/core/processor.py
src/simudator/gui/gui.py
+6
-1
6 additions, 1 deletion
src/simudator/gui/gui.py
with
14 additions
and
3 deletions
src/simudator/core/module.py
+
1
−
0
View file @
31f95c4b
from
__future__
import
annotations
from
os
import
error
from
simudator.core.signal
import
Signal
...
...
This diff is collapsed.
Click to expand it.
src/simudator/core/processor.py
+
7
−
2
View file @
31f95c4b
...
...
@@ -497,7 +497,7 @@ class Processor:
module
=
self
.
get_module
(
module_name
)
module
.
load_from_str
(
module_str
)
def
save_state_to_file
(
self
,
file_path
:
str
)
->
None
:
def
save_state_to_file
(
self
,
file_path
:
str
)
->
bool
:
"""
Save the current state of the cpu to file.
Will overwrite the given file.
...
...
@@ -512,7 +512,12 @@ class Processor:
file
.
close
()
for
module
in
self
.
modules
.
values
():
module
.
save_state_to_file
(
file_path
)
res
=
module
.
save_state_to_file
(
file_path
)
if
not
res
:
return
False
return
True
def
pretty_print
(
self
)
->
None
:
"""
Print the processor state in a readable and compact format.
"""
...
...
This diff is collapsed.
Click to expand it.
src/simudator/gui/gui.py
+
6
−
1
View file @
31f95c4b
...
...
@@ -848,7 +848,12 @@ class GUI(QMainWindow):
if
path
==
''
:
return
self
.
cpu
.
save_state_to_file
(
path
)
res
=
self
.
cpu
.
save_state_to_file
(
path
)
if
res
:
self
.
messageBox
(
"
File saved.
"
)
else
:
self
.
errorBox
(
"
Unable to save.
"
)
def
openBreakpointWindow
(
self
)
->
None
:
"""
...
...
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