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
538a31d5
Commit
538a31d5
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
Put measurements into separate output directory
parent
ce9c4c4d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Python_script/climate-lab-gui.py
+32
-0
32 additions, 0 deletions
Python_script/climate-lab-gui.py
Python_script/test_stand_parameter.json
+1
-1
1 addition, 1 deletion
Python_script/test_stand_parameter.json
with
33 additions
and
1 deletion
Python_script/climate-lab-gui.py
+
32
−
0
View file @
538a31d5
#!/usr/bin/python3
#!/usr/bin/python3
import
os.path
from
PyQt5.QtWidgets
import
QMainWindow
,
QApplication
,
QPushButton
,
QTextEdit
from
PyQt5.QtWidgets
import
QMainWindow
,
QApplication
,
QPushButton
,
QTextEdit
from
PyQt5
import
uic
,
QtCore
,
QtGui
,
QtWidgets
from
PyQt5
import
uic
,
QtCore
,
QtGui
,
QtWidgets
import
sys
import
sys
...
@@ -17,6 +19,8 @@ class TestStandMainWindow(QMainWindow):
...
@@ -17,6 +19,8 @@ class TestStandMainWindow(QMainWindow):
self
.
tempSweepButton
.
clicked
.
connect
(
lambda
:
self
.
set_temp_sweep_labels
())
self
.
tempSweepButton
.
clicked
.
connect
(
lambda
:
self
.
set_temp_sweep_labels
())
self
.
humSweepButton
.
clicked
.
connect
(
lambda
:
self
.
set_hum_sweep_labels
())
self
.
humSweepButton
.
clicked
.
connect
(
lambda
:
self
.
set_hum_sweep_labels
())
self
.
start_dir
=
os
.
getcwd
()
def
set_temp_sweep_labels
(
self
):
def
set_temp_sweep_labels
(
self
):
self
.
parametersGroupBox
.
setEnabled
(
True
)
self
.
parametersGroupBox
.
setEnabled
(
True
)
self
.
startStopStepGroupBox
.
setTitle
(
'
Temperature [degC]
'
)
self
.
startStopStepGroupBox
.
setTitle
(
'
Temperature [degC]
'
)
...
@@ -27,10 +31,33 @@ class TestStandMainWindow(QMainWindow):
...
@@ -27,10 +31,33 @@ class TestStandMainWindow(QMainWindow):
self
.
startStopStepGroupBox
.
setTitle
(
'
Humidity [% r.h.]
'
)
self
.
startStopStepGroupBox
.
setTitle
(
'
Humidity [% r.h.]
'
)
self
.
fixedParameterLabel
.
setText
(
'
Temperature [degC]
'
)
self
.
fixedParameterLabel
.
setText
(
'
Temperature [degC]
'
)
def
check_and_change_dir
(
self
,
data_folder
):
if
os
.
path
.
exists
(
data_folder
):
if
os
.
path
.
isdir
(
data_folder
):
button_reply
=
QtWidgets
.
QMessageBox
.
question
(
self
,
'
Warning:
\'
'
+
data_folder
+
'
\'
already exists
'
,
'
Overwrite data in
\'
'
+
data_folder
+
'
\'
?
'
,
QtWidgets
.
QMessageBox
.
Yes
|
QtWidgets
.
QMessageBox
.
No
,
QtWidgets
.
QMessageBox
.
No
)
if
not
button_reply
==
QtWidgets
.
QMessageBox
.
Yes
:
return
False
else
:
QtWidgets
.
QMessageBox
.
critical
(
self
,
'
Error
'
,
'
\'
'
+
data_folder
+
'
\'
exists but is not a directory!
'
)
return
False
else
:
try
:
os
.
makedirs
(
data_folder
)
except
:
QtWidgets
.
QMessageBox
.
critical
(
self
,
'
Error
'
,
'
Cannot create folder
\'
'
+
data_folder
+
'
\'
!
'
)
return
False
os
.
chdir
(
data_folder
)
print
(
'
changed dir
'
)
return
True
def
do_measurement
(
self
):
def
do_measurement
(
self
):
self
.
setEnabled
(
False
)
self
.
setEnabled
(
False
)
self
.
qt_app
.
processEvents
();
self
.
qt_app
.
processEvents
();
os
.
chdir
(
self
.
start_dir
)
with
open
(
'
test_stand_parameter.json
'
,
'
r
'
)
as
f
:
with
open
(
'
test_stand_parameter.json
'
,
'
r
'
)
as
f
:
config_data
=
json
.
load
(
f
)
config_data
=
json
.
load
(
f
)
...
@@ -38,6 +65,11 @@ class TestStandMainWindow(QMainWindow):
...
@@ -38,6 +65,11 @@ class TestStandMainWindow(QMainWindow):
output_basename
=
time
.
strftime
(
"
%Y_%m_%d-%H_%M_%S
"
)
+
"
_results
"
output_basename
=
time
.
strftime
(
"
%Y_%m_%d-%H_%M_%S
"
)
+
"
_results
"
else
:
else
:
output_basename
=
self
.
baseName
.
text
()
output_basename
=
self
.
baseName
.
text
()
if
not
self
.
check_and_change_dir
(
config_data
[
'
data_folder
'
]
+
'
/
'
+
output_basename
):
self
.
setEnabled
(
True
)
return
meas
=
prototype
.
Measurements
(
config_data
[
'
chamber_ip
'
],
config_data
[
'
vna_ip
'
],
output_basename
,
meas
=
prototype
.
Measurements
(
config_data
[
'
chamber_ip
'
],
config_data
[
'
vna_ip
'
],
output_basename
,
False
,
config_data
)
False
,
config_data
)
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
Python_script/test_stand_parameter.json
+
1
−
1
View file @
538a31d5
{
"delta_temp"
:
0.1
,
"delta_hum"
:
1
,
"delta_mag"
:
0.1
,
"delta_phase"
:
0.02
,
"sleep_time"
:
10.0
,
"frequency"
:
1300000000
,
"vna_config_file"
:
"climate-lab.znxml"
,
"chamber_ip"
:
"localhost"
,
"vna_ip"
:
"localhost"
}
{
"delta_temp"
:
0.1
,
"delta_hum"
:
1
,
"delta_mag"
:
0.1
,
"delta_phase"
:
0.02
,
"sleep_time"
:
10.0
,
"frequency"
:
1300000000
,
"vna_config_file"
:
"climate-lab.znxml"
,
"chamber_ip"
:
"localhost"
,
"vna_ip"
:
"localhost"
,
"data_folder"
:
"measurements"
}
This diff is collapsed.
Click to expand it.
Martin Killenberg
@martin.killenberg
mentioned in commit
8aa6931e
·
2 years ago
mentioned in commit
8aa6931e
mentioned in commit 8aa6931ea857456ca288103ff19197376508fb47
Toggle commit list
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