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
9ca9ab09
Commit
9ca9ab09
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
implement measurement file and auto name in GUI
parent
cf58c731
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/climate-lab-gui.py
+38
-15
38 additions, 15 deletions
Python_script/climate-lab-gui.py
Python_script/climate-lab-main.ui
+4
-4
4 additions, 4 deletions
Python_script/climate-lab-main.ui
with
42 additions
and
19 deletions
Python_script/climate-lab-gui.py
100644 → 100755
+
38
−
15
View file @
9ca9ab09
#!/usr/bin/python3
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
import
prototype
import
prototype
import
json
import
json
import
time
class
TestStandMainWindow
(
QMainWindow
):
class
TestStandMainWindow
(
QMainWindow
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
qt_app
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
uic
.
loadUi
(
'
climate-lab-main.ui
'
,
self
)
uic
.
loadUi
(
'
climate-lab-main.ui
'
,
self
)
self
.
qt_app
=
qt_app
self
.
startButton
.
clicked
.
connect
(
lambda
:
self
.
doMeasurement
())
self
.
startButton
.
clicked
.
connect
(
lambda
:
self
.
do_measurement
())
def
do_measurement
(
self
):
if
self
.
humSweepButton
.
isChecked
():
QtWidgets
.
QMessageBox
.
information
(
self
,
'
Information
'
,
'
Humidity sweep is not implemented yet!
'
)
return
def
doMeasurement
(
self
):
self
.
setEnabled
(
False
)
self
.
setEnabled
(
False
)
self
.
qt_app
.
processEvents
();
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
)
output_basename
=
self
.
baseName
.
text
()
if
self
.
autoNameCheckbox
.
isChecked
():
output_basename
=
time
.
strftime
(
"
%Y_%m_%d-%H_%M_%S
"
)
+
"
_results
"
else
:
output_basename
=
self
.
baseName
.
text
()
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
:
temperatures
=
meas
.
perform_temperature_sweep
(
self
.
startParameter
.
value
(),
self
.
stopParameter
.
value
(),
if
self
.
tempSweepButton
.
isChecked
():
self
.
stepParameter
.
value
(),
temperatures
=
meas
.
perform_temperature_sweep
(
self
.
startParameter
.
value
(),
self
.
stopParameter
.
value
(),
self
.
fixedParameter
.
value
(),
self
.
soakingTime
.
value
(),
self
.
stepParameter
.
value
(),
self
.
stableReads
.
value
())
self
.
fixedParameter
.
value
(),
self
.
soakingTime
.
value
(),
temp_extensions
=
[]
self
.
stableReads
.
value
())
for
t
in
temperatures
:
temp_extensions
=
[]
temp_extensions
.
append
(
str
(
t
)
+
'
deg_
'
+
str
(
self
.
fixedParameter
.
value
())
+
'
rh
'
)
for
t
in
temperatures
:
prototype
.
plot_output
(
output_basename
,
temp_extensions
,
True
,
output_basename
+
temp_extensions
.
append
(
str
(
t
)
+
'
deg_
'
+
str
(
self
.
fixedParameter
.
value
())
+
'
rh
'
)
'
: Temperature sweep
'
+
str
(
temperatures
[
0
])
+
'
degC to
'
+
prototype
.
plot_output
(
output_basename
,
temp_extensions
,
True
,
output_basename
+
str
(
temperatures
[
-
1
])
+
'
degC
'
)
'
: Temperature sweep
'
+
str
(
temperatures
[
0
])
+
'
--
'
+
str
(
temperatures
[
-
1
])
+
'
degC @
'
+
str
(
self
.
fixedParameter
.
value
())
+
'
% r.h.
'
)
elif
self
.
measurementFileButton
.
isChecked
():
try
:
n_measurements
=
meas
.
perform_measurements
(
self
.
measurementFile
.
text
())
prototype
.
plot_output
(
output_basename
,
range
(
n_measurements
),
True
,
output_basename
)
except
FileNotFoundError
as
e
:
QtWidgets
.
QMessageBox
.
warning
(
self
,
'
Warning
'
,
str
(
e
))
finally
:
finally
:
meas
.
chamber
.
close
()
meas
.
chamber
.
close
()
self
.
setEnabled
(
True
)
self
.
setEnabled
(
True
)
...
@@ -37,6 +59,7 @@ class TestStandMainWindow(QMainWindow):
...
@@ -37,6 +59,7 @@ class TestStandMainWindow(QMainWindow):
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
QApplication
(
sys
.
argv
)
app
=
QApplication
(
sys
.
argv
)
mainWindow
=
TestStandMainWindow
()
mainWindow
=
TestStandMainWindow
(
app
)
mainWindow
.
show
()
mainWindow
.
show
()
app
.
exec_
()
app
.
exec_
()
This diff is collapsed.
Click to expand it.
Python_script/climate-lab-main.ui
+
4
−
4
View file @
9ca9ab09
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
</widget>
</widget>
</item>
</item>
<item
row=
"2"
column=
"1"
>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"measuementFile"
>
<widget
class=
"QLineEdit"
name=
"measu
r
ementFile"
>
<property
name=
"enabled"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
<bool>
false
</bool>
</property>
</property>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
<item
row=
"2"
column=
"0"
>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QGroupBox"
name=
"parametersGroupBox"
>
<widget
class=
"QGroupBox"
name=
"parametersGroupBox"
>
<property
name=
"title"
>
<property
name=
"title"
>
<string>
P
arameters
</string>
<string>
Sweep p
arameters
</string>
</property>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<item
row=
"0"
column=
"0"
>
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
<number>
1
</number>
<number>
1
</number>
</property>
</property>
<property
name=
"value"
>
<property
name=
"value"
>
<double>
3
2.000000000000000
</double>
<double>
2
2.000000000000000
</double>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
@@ -360,7 +360,7 @@
...
@@ -360,7 +360,7 @@
<connection>
<connection>
<sender>
measurementFileButton
</sender>
<sender>
measurementFileButton
</sender>
<signal>
toggled(bool)
</signal>
<signal>
toggled(bool)
</signal>
<receiver>
measuementFile
</receiver>
<receiver>
measu
r
ementFile
</receiver>
<slot>
setEnabled(bool)
</slot>
<slot>
setEnabled(bool)
</slot>
<hints>
<hints>
<hint
type=
"sourcelabel"
>
<hint
type=
"sourcelabel"
>
...
...
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