function [  ] = pvs_ext_call_sim( object, event, src )
%PVS_EXT_CALL_SIM Summary of this function goes here
%   Detailed explanation goes here
object.save_call([],[]);
object.save_data;

if (object.validation_report_handle ~= 0)
    delete(object.validation_report_handle);
end
error = object.check_call;

    [object.PVS.input_type,object.PVS.output_type] = object.compiled_types;
    %[is, os] = object.compiled_types;
    %object.PVS.output_type = object.output_data_type;
    
    %object.PVS.input_type = object.input_data_type;


object.PVS.type_mode = 1;


% copy pvs theory to pwd
copyfile(fullfile(fileparts(which('TTdiag')),'PVS_theories','matlab_types.pvs'),pwd);

% inputs = regexp(object.Data.function_inputs,',','split');
% for i=1:size(inputs,2)
%     varname = regexp(inputs(i),':','split');
%     for j=1:size(is,2)
%         if(strcmp(varname(1),is(j))
%             inputs(i)=PVS_Checker.replace_types_sim(inputs(i)
%         end
%     end
% end

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



