diff --git a/hp4155/Custom_SMU/interface.py b/hp4155/Custom_SMU/interface.py index f4ca99ccb041f6208e35d79df3f40aa24c94f7bd..22a0dc88250c2b4f19ee9eb883575c82e8e51525 100644 --- a/hp4155/Custom_SMU/interface.py +++ b/hp4155/Custom_SMU/interface.py @@ -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 diff --git a/hp4155/Custom_SMU/main.py b/hp4155/Custom_SMU/main.py index cddb600f1dd3fdfaeae5003c88b886f8aafbb125..6ebd10817828e8dc6376ca981feb6ba109fb88df 100644 --- a/hp4155/Custom_SMU/main.py +++ b/hp4155/Custom_SMU/main.py @@ -1,6 +1,5 @@ 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 diff --git a/hp4155/Custom_SMU/test_interface.ipynb b/hp4155/Custom_SMU/test_interface.ipynb index af848efcfa7739d035f65fa82f3f18dc874dca18..567937c6291656ea6a17950480b142879696aa7d 100644 --- a/hp4155/Custom_SMU/test_interface.ipynb +++ b/hp4155/Custom_SMU/test_interface.ipynb @@ -9,7 +9,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "37c4759189624fdca2f917ff3e104299", + "model_id": "3d4de39d4bf44f6fb89d0b7a80fa7b9a", "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": []