Code covered by the BSD License  

Highlights from
Toolbox to analyze nanoindentation data.

image thumbnail

Toolbox to analyze nanoindentation data.

by

 

06 Sep 2013 (Updated )

A MATLAB GUI to plot and to analyze (nano)indentation data (obtained with conical indenters)

A_refresh_indenters_GUI
%% Copyright 2014 MERCIER David
function A_refresh_indenters_GUI
%% Function used to refresh the interface in function of the selected indenter
gui = guidata(gcf);

if gui.flag.flag_data == 0
    helpdlg('Import data first !', '!!!');
    
else
    list_indenters = get(gui.handles.value_indentertype_GUI, 'String');
    num_indenters  = get(gui.handles.value_indentertype_GUI, 'Value');
    indenter_id    = list_indenters(num_indenters, :);
    
    for ii = 1:1:length(gui.config.Indenter_IDs)
        func_area = getfield(gui.config, {1}, indenter_id{':'}, {':'});
        func_area = cell2mat(func_area(:));
        
        if strcmp(indenter_id, gui.config.Indenter_IDs(ii)) == 1
            [gui.data.indenter_id_str] = indenter_id{:};
            
            if strcmp(gui.data.indenter_id_str(1:4), 'Berk') == 1
                set(gui.handles.bg_Berkovich_tip_GUI, 'Visible', 'on');
                set(gui.handles.bg_Vickers_tip_GUI,   'Visible', 'off');
                set(gui.handles.bg_conical_tip_GUI,   'Visible', 'off');
                set(gui.handles.value_C1_GUI, 'String', num2str(func_area(1)));
                set(gui.handles.value_C2_GUI, 'String', num2str(func_area(2)));
                set(gui.handles.value_C3_GUI, 'String', num2str(func_area(3)));
                set(gui.handles.value_C4_GUI, 'String', num2str(func_area(4)));
                set(gui.handles.value_C5_GUI, 'String', num2str(func_area(5)));
                set(gui.handles.value_indenterberk_prop_GUI, 'String', num2str(func_area(6)));
                
            elseif strcmp(gui.data.indenter_id_str(1:4), 'Vick') == 1
                set(gui.handles.bg_Berkovich_tip_GUI, 'Visible', 'off');
                set(gui.handles.bg_Vickers_tip_GUI, 'Visible', 'on');
                set(gui.handles.bg_conical_tip_GUI, 'Visible', 'off');
                set(gui.handles.value_indentervickers_prop_GUI, 'String', num2str(func_area(1)));
                
            elseif strcmp(gui.data.indenter_id_str(1:4), 'Coni') == 1
                set(gui.handles.bg_Berkovich_tip_GUI, 'Visible', 'off');
                set(gui.handles.bg_Vickers_tip_GUI,   'Visible', 'off');
                set(gui.handles.bg_conical_tip_GUI,   'Visible', 'on');
                set(gui.handles.value_indentercon_ang_prop_GUI, 'String', num2str(func_area(1)));
                set(gui.handles.value_indentercon_def_prop_GUI, 'String', num2str(func_area(2)));
                
            end
        end
    end
    %% Initialization
    guidata(gcf, gui);
    
    A_get_and_plot;
    gui = guidata(gcf); guidata(gcf, gui);
    
    gui.flag.flag = 1;
    
end

guidata(gcf, gui);

end

Contact us