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

Header from memristor measurement removed

parent 92d185d1
Branches
No related tags found
No related merge requests found
......@@ -6,16 +6,6 @@ from keyboard import add_hotkey,remove_hotkey
# pulsed libraries
from help_pulse import *
#additional variables
first = True #first measurement
"""
This is not anymore the first time you start a measurement but the first time you write a header
"""
file = None #complete filename with path
#first_sampling = True #indicates first sampling for set and reset buttons because we cannot add two at each button
#we dont need this variable anymore
#create temporary file to store the results localy
temp_file= os.path.join(os.getcwd(),'tempfile.txt')
......@@ -43,15 +33,14 @@ DUT = widgets.Text(
style = {'description_width': 'initial'},
)
#start new measurement button(new sample)
new=widgets.Button(description='next sample')
#choose a new folder button
new_folder = widgets.Button(description='change folder')
horizontal = widgets.HBox([sample_series,new])
horizontal3= widgets.HBox([DUT,new_folder])
horizontal = widgets.HBox([sample_series,new_folder])
horizontal3= widgets.HBox([DUT,]) #here contact scehmatic
all_text_boxes = widgets.VBox([horizontal,field,horizontal3])
......@@ -168,11 +157,6 @@ all = widgets.VBox([line0,line1,line2,line3,line4])
output = widgets.Output()
#help lists for changing state of the buttons
information = [sample_series,field,DUT]
buttons = [set,reset,full,new,new_folder,retention_button,contact_check,qcc,qcc_select]
parameters = [Vset,CC_vset,Vreset,CC_vreset,step,integration_time,number,sampling,Vretention,period,duration,auto_qcc]
#choose folder directory
folder=choose_folder()
......@@ -198,7 +182,7 @@ tab.titles = titles
display(tab,output)
all_widgets = [sweep_button,cons_button]
all_widgets = [ sweep_button,cons_button,sample_series,field,DUT,set,reset,full,new,new_folder,retention_button,contact_check,qcc,qcc_select,Vset,CC_vset,Vreset,CC_vreset,step,integration_time,number,sampling,Vretention,period,duration,auto_qcc]
add_widgets_to_list(cons_dict,all_widgets)
add_widgets_to_list(sweep_dict,all_widgets)
......@@ -206,22 +190,15 @@ add_widgets_to_list(sweep_dict,all_widgets)
""" the above is what happens when the programm starts all the rest have to be written into button trigger functions"""
def on_contact_check_clicked(b):
global first,folder,file,temp_file
global folder,temp_file
with output:
global first,folder,file,temp_file
clear_output(wait = True)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
#during first button press
if first == True:
change_state(information)#disable all widgets that are relevant about the information of the sample
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#write header to temp_file
write_header(temp_file,sample_series,field,DUT)
first = False
R = regular_contact_check()
......@@ -234,26 +211,15 @@ def on_contact_check_clicked(b):
information_box("Contact Check Completed")
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
def on_qcc_clicked(b):
global first,folder,file,temp_file
global folder,temp_file
with output:
global first,folder,file,temp_file
clear_output(wait = True)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
#during first button press
if first == True:
change_state(information)#disable all widgets that are relevant about the information of the sample
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#write header to temp_file
write_header(temp_file,sample_series,field,DUT)
first = False
if qcc_select.value == 'EBL':
......@@ -270,8 +236,6 @@ def on_qcc_clicked(b):
information_box("Quick Contact Check Completed")
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
def on_set_button_clicked(b):
......@@ -279,8 +243,9 @@ def on_set_button_clicked(b):
with output:
#disable buttons
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
device = setup_memristor()
......@@ -292,14 +257,6 @@ def on_set_button_clicked(b):
#check values
valid = check_values(step.value,Vset.value,Vreset.value)
#during first button press
if first == True and valid == True:
change_state(information)#disable all widgets that are relevant about the information of the sample
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#write header to temp_file
write_header(temp_file,sample_series,field,DUT)
first = False
if valid == True:
if sampling.value == True: #do sampling set before set process(100mV)
......@@ -335,19 +292,17 @@ def on_set_button_clicked(b):
del device
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
def on_reset_button_clicked(b):
global first,folder,file,temp_file
global folder,temp_file
with output:
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
device = setup_memristor()
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#lock device
device.inst.lock_excl()
......@@ -356,15 +311,6 @@ def on_reset_button_clicked(b):
#check values
valid = check_values(step.value,Vset.value,Vreset.value)
#during first button press
if first == True and valid == True:
#disable checkboxes, text fields etc.
change_state(information)
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#write header to temp_file
write_header(temp_file,sample_series,field,DUT)
first = False #set first to false irrelvant if it is in the if statement or not
if valid == True:
if sampling.value == True: #do sampling set before reset process(10mV)
......@@ -407,17 +353,16 @@ def on_reset_button_clicked(b):
del device
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
def on_full_button_clicked(b):
global first,folder,file,temp_file
global folder,temp_file
with output:
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
device= setup_memristor()
# lock device
......@@ -565,52 +510,23 @@ def on_full_button_clicked(b):
del device
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
#move to next sample
def on_new_sample_button_clicked(b):
global first
with output:
#the if is to ensure that is not pressed many times
#just in case the user presses anything
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
first = True
#change_state(information) not anymore creating changing state but enabling the widgets
enable_widgets(information)
#sample_series.value=''
#field.value=''
DUT.value=''
#enable again
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
#new_folder clicked
def on_new_folder_button_clicked(b):
global folder,file,first
with output:
change_state(buttons) #just to be sure
change_state(parameters)
change_state(all_widgets)
folder = choose_folder() #choose new folder
#file = create_file(sample_series,field,DUT,folder) #and create the new file (creates multiple headers!!!)
first = True #that will write header if the directory is the same as the previous one!
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
def on_retention_button_clicked(b):
global first,folder,file,temp_file
with output:
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
device = setup_memristor()
......@@ -619,15 +535,8 @@ def on_retention_button_clicked(b):
clear_output()
#during first button press
if first == True:
#disable checkboxes, text fields etc.
change_state(information)
filename=f"{sample_series.value}_{field.value}_{DUT.value}.txt"
file = os.path.join(folder,filename)
#write header to temp_file
write_header(temp_file,sample_series,field,DUT)
first = False #set first to false irrelvant if it is in the if statement or not
#execute measurement
t,R=retention(Vretention.value,period.value,duration.value,device)
......@@ -645,18 +554,13 @@ def on_retention_button_clicked(b):
del device
change_state(buttons)
change_state(parameters)
change_state(all_widgets)
def on_sweep_button_clicked(b):
with output:
global first
clear_output(wait = True)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
check_pulse(sweep_dict)
sample_dict= {
......@@ -672,8 +576,6 @@ def on_sweep_button_clicked(b):
plot_sweep_pulse(values)
save_sweep(folder,sample_dict,values,times,sweep_dict)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
def on_constant_button_clicked(b):
......@@ -681,8 +583,7 @@ def on_constant_button_clicked(b):
global first
clear_output(wait = True)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
check_pulse(sweep_dict)
sample_dict= {
......@@ -690,16 +591,12 @@ def on_constant_button_clicked(b):
'field':field,
'dut':DUT
}
if first == True:
change_state(information)
first = False
times,values = constant_meas(cons_dict)
plot_constant_pulse(values)
save_constant(folder,sample_dict,values,times,cons_dict)
change_state(all_widgets)
change_state(buttons)
change_state(parameters)
#link buttons to widgets (pulsed)
sweep_button.on_click(on_sweep_button_clicked)
......@@ -709,7 +606,6 @@ cons_button.on_click(on_constant_button_clicked)
set.on_click(on_set_button_clicked)
reset.on_click(on_reset_button_clicked)
full.on_click(on_full_button_clicked)
new.on_click(on_new_sample_button_clicked)
new_folder.on_click(on_new_folder_button_clicked)
retention_button.on_click(on_retention_button_clicked)
contact_check.on_click(on_contact_check_clicked)
......
hp4155/memristor (Version 4.0)/schematic.png

17 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment