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
e0907cc3
Commit
e0907cc3
authored
2 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
Sweep Setup Completed
parent
e4cc738b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
hp4155/Custom_SMU/lib/help.py
+89
-1
89 additions, 1 deletion
hp4155/Custom_SMU/lib/help.py
hp4155/Custom_SMU/main.py
+28
-3
28 additions, 3 deletions
hp4155/Custom_SMU/main.py
with
117 additions
and
4 deletions
hp4155/Custom_SMU/lib/help.py
+
89
−
1
View file @
e0907cc3
import
tkinter
as
tk
import
tkinter.messagebox
# Check the functionalities of smus VAR1,VAR2 and VARD
def
check_sweep_func
(
smus
:
list
,
func
:
str
):
...
...
@@ -29,4 +31,90 @@ def setup_axes(axes_info:list,device):
if
ax_plot
==
'
Y2
'
and
ax_info
[
'
name
'
]
==
""
:
# Y2 axis can be empty
pass
else
:
device
.
display_variable
()
\ No newline at end of file
device
.
display_variable
(
ax_plot
,
ax_info
[
'
name
'
])
device
.
axis_scale
(
ax_plot
,
ax_info
[
'
scale
'
])
device
.
display_variable_min_max
(
ax_plot
,
'
MIN
'
,
ax_info
[
'
min
'
])
device
.
display_variable_min_max
(
ax_plot
,
'
MAX
'
,
ax_info
[
'
max
'
])
# Find unit of a variable
def
find_unit
(
variable
,
smus
,
user_functions
):
#firstly search over the names of the smus
for
smu
in
smus
:
if
variable
==
smu
[
'
vname
'
]:
return
'
V
'
elif
variable
==
smu
[
'
iname
'
]:
return
'
A
'
else
:
pass
# Secondly search over the user functions
for
user_function
in
user_functions
:
if
variable
==
user_function
[
'
name
'
]:
return
user_function
[
'
unit
'
]
return
""
# Setup the variables to be saved
def
save_variables
(
smus
,
user_functions
,
axes
,
variables
,
device
):
# condition number one: the plotted variables need to be saved in the file
# Retrieve the names of the variables
variable_names
=
[]
for
variable
in
variables
:
variable_names
.
append
(
variable
[
'
name
'
])
# Retrieve the axes names (variable)
axes_names
=
[]
for
ax
in
axes
:
axes_names
.
append
(
ax
[
'
name
'
])
# Now Check if axes names are in the variable names
for
ax_name
in
axes_names
:
index
=
7
if
ax_name
not
in
variable_names
:
variables
[
index
][
'
name
'
]
=
ax_name
variables
[
index
][
'
unit
'
]
=
find_unit
(
ax_name
,
smus
,
user_functions
)
index
=
index
-
1
# Now save the variables
variable_names
=
[]
for
variable
in
variables
:
if
variable
[
'
name
'
]
!=
""
:
# Empty
variable_names
.
append
(
variable
[
'
name
'
])
# Send the command to tool
device
.
variables_to_save
(
variable_names
)
# Return the new variables dictionary
return
variables
def
error_box
(
information
):
#open dialog and hide the main window
root
=
tk
.
Tk
()
root
.
withdraw
()
root
.
lift
()
#show window above all other applications
root
.
attributes
(
"
-topmost
"
,
True
)
#window stays above all other applications
#display meaagebox
tkinter
.
messagebox
.
showerror
(
message
=
information
)
root
.
destroy
()
def
information_box
(
information
):
#open dialog and hide the main window
root
=
tk
.
Tk
()
root
.
withdraw
()
root
.
lift
()
#show window above all other applications
root
.
attributes
(
"
-topmost
"
,
True
)
#window stays above all other applications
#display meaagebox
tkinter
.
messagebox
.
showinfo
(
message
=
information
)
root
.
destroy
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hp4155/Custom_SMU/main.py
+
28
−
3
View file @
e0907cc3
...
...
@@ -3,6 +3,7 @@ sys.path.insert(0, './lib')
sys
.
path
.
insert
(
0
,
'
..
'
)
#append parent directory
from
interface
import
*
from
help
import
*
import
hp4155a
first_page
=
page_1
()
...
...
@@ -177,9 +178,33 @@ def on_start_clicked(b):
device
.
setup_cons_smu
(
i
+
1
,
cons_smu
)
# Now set the axes
# Set X-axis
device
.
display_variable
(
'
X
'
,
axes
[
0
][
'
name
'
])
device
.
axis_scale
(
''
)
setup_axes
(
axes
,
device
)
# Set the variables to be saved
variables
=
save_variables
(
smus
,
user_functions
,
axes
,
variables
,
device
)
# Modify the fifth page for user
for
i
in
range
(
8
):
fifth_page
[
6
+
i
,
0
].
value
=
variables
[
i
][
'
name
'
]
fifth_page
[
6
+
i
,
1
].
value
=
variables
[
i
][
'
unit
'
]
# Start the measurement
device
.
single_measurement
()
while
device
.
operation_completed
()
==
False
:
pass
device
.
autoscaling
()
# List all errors occured
counter
,
message
=
device
.
list_all_errors
()
if
counter
>
1
:
error_box
(
message
)
change_state
(
first_page
,
second_page
,
third_page
,
fourth_page
,
fifth_page
)
return
# Sampling Measurement Mode
...
...
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