Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
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
CST
labcode
Commits
34a7c63b
Commit
34a7c63b
authored
1 month ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
Retrieving Parameters from Interface Part 1
parent
c9384d5e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hp4155/Custom_SMU/interface.py
+14
-4
14 additions, 4 deletions
hp4155/Custom_SMU/interface.py
hp4155/Custom_SMU/main.py
+52
-2
52 additions, 2 deletions
hp4155/Custom_SMU/main.py
hp4155/Custom_SMU/test_interface.ipynb
+30
-2
30 additions, 2 deletions
hp4155/Custom_SMU/test_interface.ipynb
with
96 additions
and
8 deletions
hp4155/Custom_SMU/interface.py
+
14
−
4
View file @
34a7c63b
...
...
@@ -2,6 +2,10 @@ import ipywidgets as widgets
from
IPython.display
import
clear_output
from
ipywidgets
import
GridspecLayout
,
Layout
def
create_dict
(
**
widgets
):
return
widgets
# The smu configuration page
def
page_1
():
first_page
=
GridspecLayout
(
5
,
6
)
...
...
@@ -116,7 +120,7 @@ def page_3():
## Sampling Parameters
third_page
[
11
,:]
=
widgets
.
Label
(
"
SAMPLING PARAMETERS
"
)
third_page
[
12
,
0
]
=
widgets
.
Dropdown
(
options
=
[
"
LIN
EAR
"
,
"
L
OG
10
"
,
"
L
OG
25
"
,
"
L
OG
50
"
,
"
THIN
NED-OUT
"
],
value
=
'
LIN
EAR
'
,
description
=
'
MODE
'
,
style
=
{
'
description_width
'
:
'
initial
'
},
layout
=
Layout
(
height
=
'
auto
'
,
width
=
'
auto
'
))
third_page
[
12
,
0
]
=
widgets
.
Dropdown
(
options
=
[
"
LIN
ear
"
,
"
L10
"
,
"
L25
"
,
"
L50
"
,
"
THIN
nedout
"
],
value
=
'
LIN
ear
'
,
description
=
'
MODE
'
,
style
=
{
'
description_width
'
:
'
initial
'
},
layout
=
Layout
(
height
=
'
auto
'
,
width
=
'
auto
'
))
third_page
[
13
,
0
]
=
widgets
.
FloatText
(
1e-3
,
description
=
"
INITIAL INTERVAL
"
,
style
=
{
'
description_width
'
:
'
initial
'
},
layout
=
Layout
(
height
=
'
auto
'
,
width
=
'
auto
'
))
third_page
[
14
,
0
]
=
widgets
.
IntText
(
1001
,
description
=
"
NO. OF SAMPLES
"
,
style
=
{
'
description_width
'
:
'
initial
'
},
layout
=
Layout
(
height
=
'
auto
'
,
width
=
'
auto
'
))
third_page
[
15
,
0
]
=
widgets
.
FloatText
(
0
,
description
=
"
TOTAL SAMP. TIME
"
,
style
=
{
'
description_width
'
:
'
initial
'
},
layout
=
Layout
(
height
=
'
auto
'
,
width
=
'
auto
'
))
...
...
@@ -195,8 +199,14 @@ def page_5():
return
fifth_page
#change state off the grid
def
change_state
(
*
grids
):
for
grid
in
grids
:
for
i
in
range
(
grid
.
n_rows
):
for
j
in
range
(
grid
.
n_columns
):
try
:
grid
[
i
,
j
].
disabled
=
not
grid
[
i
,
j
].
disabled
except
:
pass
This diff is collapsed.
Click to expand it.
hp4155/Custom_SMU/main.py
+
52
−
2
View file @
34a7c63b
from
interface
import
*
first_page
=
page_1
()
second_page
=
page_2
()
third_page
=
page_3
()
...
...
@@ -13,4 +12,55 @@ tab = widgets.Tab()
tab
.
children
=
children
tab
.
titles
=
titles
display
(
tab
)
\ No newline at end of file
display
(
tab
)
start
=
widgets
.
Button
(
description
=
'
Start Measurement
'
)
output
=
widgets
.
Output
()
display
(
start
,
output
)
def
on_start_clicked
(
b
):
with
output
:
change_state
(
first_page
,
second_page
,
third_page
,
fourth_page
,
fifth_page
)
# Step 1 create the dictionaries
#first page
smus
=
[]
#iterate over the rows
for
i
in
range
(
1
,
5
):
smus
.
append
(
create_dict
(
vname
=
first_page
[
i
,
1
].
value
,
iname
=
first_page
[
i
,
2
].
value
,
mode
=
first_page
[
i
,
3
].
value
,
func
=
first_page
[
i
,
4
].
value
,
disabled
=
first_page
[
i
,
5
].
value
))
# second page
user_functions
=
[]
#iterate over the rows
for
i
in
range
(
1
,
7
):
user_functions
.
append
(
create_dict
(
name
=
second_page
[
i
,
1
].
value
,
unit
=
second_page
[
i
,
2
].
value
,
expression
=
second_page
[
i
,
3
].
value
))
# third_page
measurement_mode
=
third_page
[
0
,
0
].
value
integration
=
third_page
[
0
,
1
].
value
stress_duration
=
third_page
[
0
,
2
].
value
#match hysteris checkbox with the command forwarded to the tool
if
third_page
[
9
,
0
].
value
==
True
:
hyst
=
'
DOUB
'
else
:
hyst
=
'
SING
'
var1
=
create_dict
(
start
=
third_page
[
4
,
0
].
value
,
stop
=
third_page
[
5
,
0
].
value
,
step
=
third_page
[
6
,
0
].
value
,
comp
=
third_page
[
7
,
0
].
value
,
pcomp
=
third_page
[
8
,
0
].
value
,
mode
=
hyst
)
var2
=
create_dict
(
start
=
third_page
[
4
,
1
].
value
,
stop
=
third_page
[
5
,
1
].
value
,
points
=
third_page
[
6
,
1
].
value
,
comp
=
third_page
[
7
,
1
].
value
,
pcomp
=
third_page
[
8
,
1
])
vard
=
create_dict
(
offset
=
third_page
[
4
,
2
].
value
,
ratio
=
third_page
[
5
,
2
].
value
,
comp
=
third_page
[
7
,
2
].
value
,
third_page
=
[
8
,
2
].
value
)
pulse
=
create_dict
(
period
=
third_page
[
4
,
3
].
value
,
width
=
third_page
[
5
,
3
].
value
,
base
=
third_page
[
6
,
3
].
value
)
#sampling parameters
sampling_parameters
=
create_dict
(
mode
=
third_page
[
12
,
0
].
value
,
interval
=
third_page
[
13
,
0
].
value
,
hold
=
third_page
[
16
,
0
].
value
,
points
=
third_page
[
14
,
0
].
value
,
filter
=
third_page
[
17
,
0
].
value
)
total_samp_time
=
third_page
[
13
,
0
].
value
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hp4155/Custom_SMU/test_interface.ipynb
+
30
−
2
View file @
34a7c63b
...
...
@@ -9,7 +9,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3
7c4759189624fdca2f917ff3e104299
",
"model_id": "3
d4de39d4bf44f6fb89d0b7a80fa7b9a
",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -19,6 +19,34 @@
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9115684453914020870eba358d19392e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Button(description='Start Measurement', style=ButtonStyle())"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c0511d9c28a24352b0bdc6e97c07c9d1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
...
...
@@ -28,7 +56,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "
ee4e90d9-5655-4096-b777-0b617b75d897
",
"id": "
1af33368-917d-4a4d-b8dd-c89b655a5419
",
"metadata": {},
"outputs": [],
"source": []
...
...
%% Cell type:code id:a40693da-961a-434d-89f5-6443c0acb517 tags:
```
python
%
run
main
.
py
```
%% Output
%% Cell type:code id:ee4e90d9-5655-4096-b777-0b617b75d897 tags:
%% Cell type:code id:1af33368-917d-4a4d-b8dd-c89b655a5419 tags:
```
python
```
...
...
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