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
3c537e7b
Commit
3c537e7b
authored
11 months ago
by
Martin Högstedt
Browse files
Options
Downloads
Patches
Plain Diff
fixed merge comments
parent
126cfecc
No related branches found
No related tags found
1 merge request
!24
Fixed save_state_to_file
Pipeline
#132139
failed
11 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/simudator/core/module.py
+1
-2
1 addition, 2 deletions
src/simudator/core/module.py
src/simudator/core/modules/demux.py
+4
-4
4 additions, 4 deletions
src/simudator/core/modules/demux.py
src/simudator/core/modules/mux.py
+2
-0
2 additions, 0 deletions
src/simudator/core/modules/mux.py
with
7 additions
and
6 deletions
src/simudator/core/module.py
+
1
−
2
View file @
3c537e7b
...
@@ -123,7 +123,7 @@ class Module:
...
@@ -123,7 +123,7 @@ class Module:
----------
----------
file_path : str
file_path : str
Path to file to save to.
Path to file to save to.
content : str
content : str
Content to save to file.
Content to save to file.
Returns
Returns
...
@@ -133,7 +133,6 @@ class Module:
...
@@ -133,7 +133,6 @@ class Module:
try
:
try
:
with
open
(
file_path
,
"
a
"
)
as
file
:
with
open
(
file_path
,
"
a
"
)
as
file
:
file
.
write
(
content
)
file
.
write
(
content
)
file
.
close
()
except
OSError
:
except
OSError
:
return
False
return
False
return
True
return
True
...
...
This diff is collapsed.
Click to expand it.
src/simudator/core/modules/demux.py
+
4
−
4
View file @
3c537e7b
...
@@ -56,6 +56,8 @@ class Demux(Module):
...
@@ -56,6 +56,8 @@ class Demux(Module):
def
update_logic
(
self
):
def
update_logic
(
self
):
"""
"""
Do nothing.
The demux has no logic
The demux has no logic
"""
"""
pass
pass
...
@@ -72,10 +74,8 @@ class Demux(Module):
...
@@ -72,10 +74,8 @@ class Demux(Module):
return
state
return
state
def
save_state_to_file
(
self
,
file_path
:
str
)
->
bool
:
def
save_state_to_file
(
self
,
file_path
:
str
)
->
bool
:
"""
content
=
self
.
name
+
"
:
\n
value:
"
+
str
(
self
.
value
)
+
"
\n\n
"
The demux has no state to save.
return
super
().
_helper_save_state_to_file
(
file_path
,
content
)
"""
return
True
def
set_state
(
self
,
state
:
dict
)
->
None
:
def
set_state
(
self
,
state
:
dict
)
->
None
:
"""
"""
...
...
This diff is collapsed.
Click to expand it.
src/simudator/core/modules/mux.py
+
2
−
0
View file @
3c537e7b
...
@@ -57,6 +57,8 @@ class Mux(Module):
...
@@ -57,6 +57,8 @@ class Mux(Module):
def
update_logic
(
self
):
def
update_logic
(
self
):
"""
"""
Do nothing.
The mux has no logic.
The mux has no logic.
"""
"""
pass
pass
...
...
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