Skip to content
Snippets Groups Projects
Commit 34a7c63b authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

Retrieving Parameters from Interface Part 1

parent c9384d5e
No related branches found
No related tags found
No related merge requests found
......@@ -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=["LINEAR","LOG10","LOG25","LOG50","THINNED-OUT"], value = 'LINEAR',description = 'MODE',style = {'description_width': 'initial'},layout=Layout(height='auto', width='auto'))
third_page[12,0] = widgets.Dropdown(options=["LINear","L10","L25","L50","THINnedout"], value = 'LINear',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
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
%% 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
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment