Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climate Lab Test Stand
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Low-Level Radio Frequency
Climate Lab
Climate Lab Test Stand
Commits
c8c1d5dc
Commit
c8c1d5dc
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
introduce communication delays for more realisitc simulation
parent
a75b31a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Python_script/VNA_dummy.py
+3
-0
3 additions, 0 deletions
Python_script/VNA_dummy.py
Python_script/climate_chamber_dummy.py
+7
-0
7 additions, 0 deletions
Python_script/climate_chamber_dummy.py
with
10 additions
and
0 deletions
Python_script/VNA_dummy.py
+
3
−
0
View file @
c8c1d5dc
...
...
@@ -35,6 +35,7 @@ class VnaDummy:
self
.
reference_temp
=
25
self
.
magnitude_slope
=
0.2
self
.
phase_slope
=
0.1
self
.
communication_delay
=
0.2
def
run_simulation
(
self
):
self
.
simulate_magnitude
()
...
...
@@ -104,6 +105,8 @@ class VnaDummy:
measurment_string
=
'
'
for
i
in
range
(
50
):
measurment_string
+=
str
(
real_val
)
+
'
,
'
+
str
(
imaginary_val
)
+
'
,
'
# doing the measurement and reading out some time
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
# removed last comma by adding slicing([:-1])
return
measurment_string
[:
-
1
]
...
...
This diff is collapsed.
Click to expand it.
Python_script/climate_chamber_dummy.py
+
7
−
0
View file @
c8c1d5dc
...
...
@@ -28,6 +28,7 @@ class ClimateChamberDummy:
self
.
target_humidity
=
35
self
.
temperature_slope
=
0.1
# 0.1 degrees/second
self
.
humidity_slope
=
0.5
# degrees/second
self
.
communication_delay
=
0.3
def
run_simulation
(
self
):
self
.
simulate_temp
()
...
...
@@ -72,11 +73,13 @@ class ClimateChamberDummy:
def
read_temperature
(
self
):
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
# data format: [current temp, set temp, upper limit, lower limit]
return
[
self
.
simulated_state
.
simulated_temperature
,
self
.
target_temperature
,
0.
,
100.
]
def
read_humidity
(
self
):
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
# data format: [current temp, set temp, upper limit, lower limit]
return
[
self
.
simulated_state
.
simulated_humidity
,
self
.
target_humidity
,
0.
,
100.
]
...
...
@@ -86,6 +89,7 @@ class ClimateChamberDummy:
self
.
target_temperature
=
temperature
print
(
'
ChamberDummy: target temperature now is
'
+
str
(
self
.
target_temperature
))
response
=
'
OK: TEMP, S30
\r\n
'
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
return
response
def
set_humidity
(
self
,
humidity
):
...
...
@@ -95,6 +99,7 @@ class ClimateChamberDummy:
self
.
target_humidity
=
humidity
print
(
'
ChamberDummy: target humidity now is
'
+
str
(
self
.
target_humidity
))
response
=
'
OK: HUMI, S30
\r\n
'
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
return
response
def
close
(
self
):
...
...
@@ -105,6 +110,7 @@ class ClimateChamberDummy:
def
set_mode
(
self
,
mode
):
self
.
simulated_mode
=
mode
response
=
'
FIXME!!!
'
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
return
response
def
get_const
(
self
):
...
...
@@ -133,6 +139,7 @@ class ClimateChamberDummy:
self
.
set_humidity
(
setPoint
[
1
])
def
read_mode
(
self
):
self
.
simulated_state
.
simulated_time
+=
self
.
communication_delay
return
self
.
simulated_mode
# deprecated. Use read_humidity etc. instead
...
...
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