%% pvs_ext_call
%   function will initiate the typechecking procedure for the table
% inputs:
%   obj:GUI - GUI objecto
%   src:double - source of the callback calling
%   event:eventdata - event that triggered the callback
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = pvs_ext_call(object,src,event)
object.save_call([],[]);
object.save_data;
if (object.validation_report_handle ~= 0)
    delete(object.validation_report_handle);
    object.validation_report_handle = 0;
end
error = object.check_call([],2);

if(object.multi_mode == 0)
    object.PVS.output_type = object.output_data_type;
    
    object.PVS.input_type = object.input_data_type;
    
    
end

object.PVS.type_mode = 0;

if (~error)
    [check,result] = object.PVS.pvs_check;
    if (check == 1)
        msgbox('table is valid');
    elseif (check == 0 && strcmp(result,'canceled'))
        return;
    else
        Valid_Report = ValidationReport(object);
        Valid_Report.set_results(result);
        Valid_Report.set_mode(0);
        Valid_Report.init();
    end
    object.pvs_checked = check;
    object.update_Statusbar;
    if (object.mode == 1)
        
        TableBlock.set_block_display(object.block_handle,object.pvs_checked);
    end
end

end

