diff --git a/hp4194/interface.py b/hp4194/interface.py index d81e02a824cc8b08597249dcfce900753096d19c..56c8b286621e2952e31459a6d8fd61fc5d95cb64 100644 --- a/hp4194/interface.py +++ b/hp4194/interface.py @@ -1,123 +1,160 @@ import ipywidgets as widgets -from ipywidgets import GridspecLayout,Layout +from ipywidgets import GridspecLayout,Layout, AppLayout,TwoByTwoLayout import sys +from IPython.display import clear_output def probendaten(): - width = '50%' - probendaten = GridspecLayout(7,2) - - probendaten[0,:] = widgets.Label('Probendaten',layout=Layout(height='auto', width = width)) - probendaten[0,:].style.font_weight='bold' - probendaten[1,0] = widgets.Label('Wafer',layout=Layout(height='auto', width = width)) - probendaten[1,1] = widgets.Label('Bemerkung',layout=Layout(height='auto', width = width)) - probendaten[2,0] = widgets.Text(layout=Layout(height='auto', width = width)) # wafer value - probendaten[2,1] = widgets.Text(layout=Layout(height='auto', width = width)) # Bemerkung value - probendaten[3,0] = widgets.Label('Probe',layout=Layout(height='auto', width = width)) - probendaten[4,0] = widgets.Text(layout=Layout(height='auto', width = width)) #probe value - probendaten[5,0] = widgets.Label('Feld',layout=Layout(height='auto', width = width)) - probendaten[5,1] = widgets.Label('Temeperatur (K)',layout=Layout(height='auto', width = width)) - probendaten[6,0] = widgets.Text(layout=Layout(height='auto', width = width)) # Feld value - probendaten[6,1] = widgets.BoundedFloatText(value = 295,min = 0 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #Temperatur value - - probendaten_dict = { - 'wafer': probendaten[2,0], - 'bemerkung':probendaten[2,1], - 'probe':probendaten[4,0], - 'feld':probendaten[6,0], - 'temperatur':probendaten[6,1] + width = 'auto' + probendaten = GridspecLayout(6,2) + + probendaten[0,0] = widgets.Label('Wafer',layout=Layout(height='auto', width = width)) + probendaten[0,1] = widgets.Label('Bemerkung',layout=Layout(height='auto', width = width)) + probendaten[1,0] = widgets.Text(layout=Layout(height='auto', width = width)) # wafer value + probendaten[1,1] = widgets.Text(layout=Layout(height='auto', width = width)) # Bemerkung value + probendaten[2,0] = widgets.Label('Probe',layout=Layout(height='auto', width = width)) + probendaten[3,0] = widgets.Text(layout=Layout(height='auto', width = width)) #probe value + probendaten[4,0] = widgets.Label('Feld',layout=Layout(height='auto', width = width)) + probendaten[4,1] = widgets.Label('Temeperatur (K)',layout=Layout(height='auto', width = width)) + probendaten[5,0] = widgets.Text(layout=Layout(height='auto', width = width)) # Feld value + probendaten[5,1] = widgets.BoundedFloatText(value = 295,min = 0 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #Temperatur value + + dict = { + 'wafer': probendaten[1,0], + 'bemerkung':probendaten[1,1], + 'probe':probendaten[3,0], + 'feld':probendaten[5,0], + 'temperatur':probendaten[5,1] } + + tab = widgets.Tab() + tab.children = [probendaten] + tab.set_title(0,'Probendaten') - return probendaten,probendaten_dict + return tab,dict def messparameter(): width = 'auto' - messparameter = GridspecLayout(16,1) - - messparameter[0,0] = widgets.Label('Messparameter',layout=Layout(height='auto', width = width)) - messparameter[0,0].style.font_weight='bold' - messparameter[1,0] = widgets.Label('U_start (V)',layout=Layout(height='auto', width = width)) - messparameter[2,0] = widgets.BoundedFloatText(value = 1,min =-40 ,max = 40,step = 1,layout=Layout(height='auto', width = width)) # Start value - messparameter[3,0] = widgets.Label('U_stop (V)',layout=Layout(height='auto', width = width)) - messparameter[4,0] = widgets.BoundedFloatText(value = -3,min =-40 ,max = 40,step = 1,layout=Layout(height='auto', width = width)) #stop value - messparameter[5,0] = widgets.Label('Spannungsschritt (V)',layout=Layout(height='auto', width = width)) - messparameter[6,0] = widgets.BoundedFloatText(value = 0.05,min =0.01 ,max = 80,step = 0.01,layout=Layout(height='auto', width = width)) #step value - messparameter[7,0] = widgets.Label('Warten im Spannungsschritt (s)',layout=Layout(height='auto', width = width)) - messparameter[8,0] = widgets.BoundedFloatText(value = 0,min = 0 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #sleep value - messparameter[9,0] = widgets.Label('Radius der Teststruktur (um)',layout=Layout(height='auto', width = width)) - messparameter[10,0] = widgets.BoundedIntText(value = 50,min = 1 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #radius value - messparameter[11,0] = widgets.Label('Beobachteter Frequenzpunkt',layout=Layout(height='auto', width = width)) - messparameter[12,0] = widgets.BoundedIntText(value = 2,min = 1 ,max = sys.maxsize,step = 1,layout=Layout(height='auto', width = width)) #Frequenzpunkt value - messparameter[13,0] = widgets.Label('Beobachteter Spannungspunkt',layout=Layout(height='auto', width = width)) - messparameter[14,0] = widgets.BoundedIntText(value = 20,min = 1 ,max = sys.maxsize,step = 1,layout=Layout(height='auto', width = width)) #Spannungspunkt value - messparameter[15,0] = widgets.Checkbox(description = 'Hysterese messen',value = True, indent = True, style = {'description_width': 'initial'},layout=Layout(height='auto', width = width)) #hysterisis value - - messparameter_dict={ - 'start':messparameter[2,0], - 'stop':messparameter[4,0], - 'step':messparameter[6,0], - 'sleep':messparameter[8,0], - 'radius':messparameter[10,0], - 'frequenzpunkt':messparameter[12,0], - 'spannungspunkt':messparameter[14,0], - 'hysterese':messparameter[15,0] + messparameter = GridspecLayout(15,1) + + messparameter[0,0] = widgets.Label('U_start (V)',layout=Layout(height='auto', width = width)) + messparameter[1,0] = widgets.BoundedFloatText(value = 1,min =-40 ,max = 40,step = 1,layout=Layout(height='auto', width = width)) # Start value + messparameter[2,0] = widgets.Label('U_stop (V)',layout=Layout(height='auto', width = width)) + messparameter[3,0] = widgets.BoundedFloatText(value = -3,min =-40 ,max = 40,step = 1,layout=Layout(height='auto', width = width)) #stop value + messparameter[4,0] = widgets.Label('Spannungsschritt (V)',layout=Layout(height='auto', width = width)) + messparameter[5,0] = widgets.BoundedFloatText(value = 0.05,min =0.01 ,max = 80,step = 0.01,layout=Layout(height='auto', width = width)) #step value + messparameter[6,0] = widgets.Label('Warten im Spannungsschritt (s)',layout=Layout(height='auto', width = width)) + messparameter[7,0] = widgets.BoundedFloatText(value = 0,min = 0 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #sleep value + messparameter[8,0] = widgets.Label('Radius der Teststruktur (um)',layout=Layout(height='auto', width = width)) + messparameter[9,0] = widgets.BoundedIntText(value = 50,min = 1 ,max = sys.float_info.max,step = 1,layout=Layout(height='auto', width = width)) #radius value + messparameter[10,0] = widgets.Label('Beobachteter Frequenzpunkt',layout=Layout(height='auto', width = width)) + messparameter[11,0] = widgets.BoundedIntText(value = 2,min = 1 ,max = sys.maxsize,step = 1,layout=Layout(height='auto', width = width)) #Frequenzpunkt value + messparameter[12,0] = widgets.Label('Beobachteter Spannungspunkt',layout=Layout(height='auto', width = width)) + messparameter[13,0] = widgets.BoundedIntText(value = 20,min = 1 ,max = sys.maxsize,step = 1,layout=Layout(height='auto', width = width)) #Spannungspunkt value + messparameter[14,0] = widgets.Checkbox(description = 'Hysterese messen',value = True, indent = True, style = {'description_width': 'initial'},layout=Layout(height='auto', width = width)) #hysterisis value + + dict={ + 'start':messparameter[1,0], + 'stop':messparameter[3,0], + 'step':messparameter[5,0], + 'sleep':messparameter[7,0], + 'radius':messparameter[9,0], + 'frequenzpunkt':messparameter[11,0], + 'spannungspunkt':messparameter[13,0], + 'hysterese':messparameter[14,0] } + + tab = widgets.Tab() + tab.children = [messparameter] + tab.set_title(0,'Messparameter') + - return messparameter,messparameter_dict + return tab,dict def sweep_parameter(): - width = '60%' + width = 'auto' - sweep_parameter= GridspecLayout(16,2) + sweep_parameter= GridspecLayout(12,2) #title - sweep_parameter[0,:] = widgets.Label('Sweep Parameter',layout=Layout(height='auto', width = width)) - sweep_parameter[0,:].style.font_weight='bold' #first column - sweep_parameter[1,0] = widgets.Label('Anzahl Frequenzpunkte',layout=Layout(height='auto', width = width)) - sweep_parameter[2,0] = widgets.BoundedFloatText(value = 4,min =1 ,max = 401,step = 1,layout=Layout(height='auto', width = width)) # Anzahl Frequenzpunkte - sweep_parameter[3,0] = widgets.Label('f_start (Hz)',layout=Layout(height='auto', width = width)) - sweep_parameter[4,0] = widgets.BoundedFloatText(value=100000,min = 100, max = 40e6,step = 100,layout=Layout(height='auto', width = width)) #start frequency - sweep_parameter[5,0] = widgets.Label('f_stop (Hz)',layout=Layout(height='auto', width = width)) - sweep_parameter[6,0] = widgets.BoundedFloatText(value=1000000,min = 100, max = 40e6,step = 100,layout=Layout(height='auto', width = width)) #stop frequency - sweep_parameter[7,0] = widgets.Label('OSC Level (V)',layout=Layout(height='auto', width = width)) - sweep_parameter[8,0] = widgets.BoundedFloatText(value=0.05,min = 10e-3, max = 1,step = 1e-3,layout=Layout(height='auto', width = width)) # Osc level - sweep_parameter[9,0] = widgets.Label('Sweep Type',layout=Layout(height='auto', width = width)) - sweep_parameter[10,0] = widgets.RadioButtons(options = ['Logarithmic','Linear'],value = 'Linear',layout = Layout(height='auto', width = width)) #sweep type - sweep_parameter[11,0] = widgets.Label('Integration Time',layout=Layout(height='auto', width = width)) - sweep_parameter[12,0] = widgets.Dropdown(options = ['Short','Medium','Long'],value = 'Medium',layout = Layout(height='auto', width = width)) # Integration time + sweep_parameter[0,0] = widgets.Label('Anzahl Frequenzpunkte',layout=Layout(height='auto', width = width)) + sweep_parameter[1,0] = widgets.BoundedFloatText(value = 4,min =1 ,max = 401,step = 1,layout=Layout(height='auto', width = width)) # Anzahl Frequenzpunkte + sweep_parameter[2,0] = widgets.Label('f_start (Hz)',layout=Layout(height='auto', width = width)) + sweep_parameter[3,0] = widgets.BoundedFloatText(value=100000,min = 100, max = 40e6,step = 100,layout=Layout(height='auto', width = width)) #start frequency + sweep_parameter[4,0] = widgets.Label('f_stop (Hz)',layout=Layout(height='auto', width = width)) + sweep_parameter[5,0] = widgets.BoundedFloatText(value=1000000,min = 100, max = 40e6,step = 100,layout=Layout(height='auto', width = width)) #stop frequency + sweep_parameter[6,0] = widgets.Label('OSC Level (V)',layout=Layout(height='auto', width = width)) + sweep_parameter[7,0] = widgets.BoundedFloatText(value=0.05,min = 10e-3, max = 1,step = 1e-3,layout=Layout(height='auto', width = width)) # Osc level + sweep_parameter[8,0] = widgets.Label('Sweep Type',layout=Layout(height='auto', width = width)) + sweep_parameter[9,0] = widgets.RadioButtons(options = ['Logarithmic','Linear'],value = 'Linear',layout = Layout(height='auto', width = width)) #sweep type + sweep_parameter[10,0] = widgets.Label('Integration Time',layout=Layout(height='auto', width = width)) + sweep_parameter[11,0] = widgets.Dropdown(options = ['Short','Medium','Long'],value = 'Medium',layout = Layout(height='auto', width = width)) # Integration time #second column - sweep_parameter[1,1] = widgets.Label('Delay Time (ms)',layout=Layout(height='auto', width = width)) - sweep_parameter[2,1] = widgets.BoundedFloatText(value = 0,min =0 ,max = 3.6e6,step = 1,layout=Layout(height='auto', width = width)) # delay time - sweep_parameter[3,1] = widgets.Label('Delay Aperture (%)',layout=Layout(height='auto', width = width)) - sweep_parameter[4,1] = widgets.BoundedFloatText(value=0.5,min = 0.5, max = 100,step = 0.1,layout=Layout(height='auto', width = width)) #delay aperture + sweep_parameter[0,1] = widgets.Label('Delay Time (ms)',layout=Layout(height='auto', width = width)) + sweep_parameter[1,1] = widgets.BoundedFloatText(value = 0,min =0 ,max = 3.6e6,step = 1,layout=Layout(height='auto', width = width)) # delay time + sweep_parameter[2,1] = widgets.Label('Delay Aperture (%)',layout=Layout(height='auto', width = width)) + sweep_parameter[3,1] = widgets.BoundedFloatText(value=0.5,min = 0.5, max = 100,step = 0.1,layout=Layout(height='auto', width = width)) #delay aperture # Now continue next to sweep type - sweep_parameter[9,1] = widgets.Label('Sweep Direction',layout=Layout(height='auto', width = width)) - sweep_parameter[10,1] = widgets.RadioButtons(options = ['Up','Down'],value = 'Up',layout = Layout(height='auto', width = width)) #sweep direction - sweep_parameter[11,1] = widgets.Label('Averaging Number',layout=Layout(height='auto', width = width)) - sweep_parameter[12,1] = widgets.FloatLogSlider(value=4,base=2,min=0,max=8, step=1)# Averaging - - sweep_parameter_dict = { - 'nop': sweep_parameter[2,0], - 'start': sweep_parameter[4,0], - 'stop': sweep_parameter[6,0], - 'osc': sweep_parameter[8,0], - 'type': sweep_parameter[10,0], - 'integration': sweep_parameter[12,0], - 'd_time': sweep_parameter[2,1], - 'd_apperture': sweep_parameter[4,1], - 'direction': sweep_parameter[10,1], - 'averaging': sweep_parameter[12,1] + sweep_parameter[8,1] = widgets.Label('Sweep Direction',layout=Layout(height='auto', width = width)) + sweep_parameter[9,1] = widgets.RadioButtons(options = ['Up','Down'],value = 'Up',layout = Layout(height='auto', width = width)) #sweep direction + sweep_parameter[10,1] = widgets.Label('Averaging Number',layout=Layout(height='auto', width = width)) + sweep_parameter[11,1] = widgets.FloatLogSlider(value=4,base=2,min=0,max=8, step=1,layout = Layout(height='auto', width = width))# Averaging + + dict = { + 'nop': sweep_parameter[1,0], + 'start': sweep_parameter[3,0], + 'stop': sweep_parameter[5,0], + 'osc': sweep_parameter[7,0], + 'type': sweep_parameter[9,0], + 'integration': sweep_parameter[11,0], + 'd_time': sweep_parameter[1,1], + 'd_apperture': sweep_parameter[3,1], + 'direction': sweep_parameter[9,1], + 'averaging': sweep_parameter[11,1] } + tab = widgets.Tab() + tab.children = [sweep_parameter] + tab.set_title(0,'Sweep Parameter') - return sweep_parameter,sweep_parameter_dict + return tab,dict +def control_panel(): + width = 'auto' + control_panel = GridspecLayout(6,2) + + control_panel[0,0] = widgets.Button(description = "Start Measurement",layout=Layout(height='auto', width = width)) + control_panel[0,1] = widgets.Button(description = "Start Calibration",layout=Layout(height='auto', width = width)) + control_panel[1,0] = widgets.Label("U-Punkt",layout=Layout(height='auto', width = width)) + control_panel[1,1] = widgets.Label("f-Punkt",layout=Layout(height='auto', width = width)) + + for j in range(2): + control_panel[2,j]= widgets.Text(disabled = True,layout=Layout(height='auto', width = width)) + + control_panel[3,0] = widgets.Label("Aktuelle Spannung",layout=Layout(height='auto', width = width)) + control_panel[4,0] = widgets.Text(disabled = True,layout=Layout(height='auto', width = width)) + control_panel[4,1] = widgets.Checkbox(description = 'Clear Graphs',value = True,indent = False,layout=Layout(height='auto', width = width)) + + measure = control_panel[0,0] + calibrate = control_panel[0,1] + clear_graphs = control_panel[4,1] + + view = { + 'u-point': control_panel[2,0], + 'f-point': control_panel[2,1], + 'u-value':control_panel[4,0] + } + + return control_panel,measure,calibrate,clear_graphs,view + + + diff --git a/hp4194/test_interface.ipynb b/hp4194/test_interface.ipynb index 60b6db390153205e6c13f4ac56e9f90ef2c1a42d..bd1af7e45618a556d84bb857e721676fe47bb447 100644 --- a/hp4194/test_interface.ipynb +++ b/hp4194/test_interface.ipynb @@ -7,7 +7,8 @@ "metadata": {}, "outputs": [], "source": [ - "from interface import *" + "from interface import *\n", + "import matplotlib.pyplot as plt " ] }, { @@ -43,47 +44,66 @@ { "cell_type": "code", "execution_count": 5, - "id": "61d429a5-3be8-41e2-84af-7fd69862d936", + "id": "f1f412ce-73c2-4a73-8f22-b69f58681ffa", + "metadata": {}, + "outputs": [], + "source": [ + "control_panel,measure,calibrate,clear_graphs,view=control_panel()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "dcfbf35d-fcfa-48d4-a1f5-583ea1256618", + "metadata": {}, + "outputs": [], + "source": [ + "out = widgets.Output()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "65fd57be-5b4a-4247-9e71-8c799c05ff24", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "2f70ab8cc84b418ba27976417af31dac", + "model_id": "120906e794764ff79faaccff0862a3f6", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "Tab(children=(VBox(children=(GridspecLayout(children=(Label(value='Probendaten', layout=Layout(grid_area='widg…" + "HBox(children=(Tab(children=(GridspecLayout(children=(Label(value='Wafer', layout=Layout(grid_area='widget001'…" ] }, "metadata": {}, "output_type": "display_data" - } - ], - "source": [ - "tab = widgets.Tab()\n", - "children = [widgets.VBox([sample,widgets.HBox([sweep_parameter,messparameter])])]\n", - "tab.children = children\n", - "tab.set_title(0,'CV-measurement')\n", - "display(tab)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "81c3319b-4581-44c5-9849-89dd97714d22", - "metadata": {}, - "outputs": [ + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f38bc4fc21534db69a6b078cf3103675", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Tab(children=(GridspecLayout(children=(Label(value='U_start (V)', layout=Layout(grid_area='widg…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "174105988c5c4b568167af0f9ec57080", + "model_id": "e2579565f9454a22bd0be3ec6862305a", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "HBox(children=(Button(description='Start Measurement', style=ButtonStyle()), Button(description='Start Calibra…" + "Output()" ] }, "metadata": {}, @@ -91,19 +111,15 @@ } ], "source": [ - "measure = widgets.Button(description = 'Start Measurement')\n", - "calibrate = widgets.Button(description = 'Start Calibration')\n", + "hbox1 = widgets.HBox([sample,control_panel])\n", + "display(hbox1)\n", + "hbox2=widgets.HBox([messparameter,sweep_parameter])\n", + "display(hbox2)\n", + "display(out)\n", "\n", - "display(widgets.HBox([measure,calibrate]))\n" + "with out:\n", + " print(\"Hello World!\")" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7f308fc0-43e6-4794-b6fd-15e47079c5cb", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {