%% check_call
%   callback function for check pushbutton. compiles a message of
%   the errors that were detected in each of the grids. outputs the
%   message to users via a msgbox.
% inputs:
%   object:GUI - current GUI object
%   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 error = check_call(object,src,event)
error = 0;

msg = object.check_inputs;
if (isempty(msg))
    set(object.function_inputs_control,'BackgroundColor',[1 1 1]);
    msg = object.check_grid_condition(object.Grid2);
    if object.multi_mode == 0
        msg = [msg object.check_grid_condition(object.Grid1)];
    end
    msg = [msg object.check_grid_result(object.Grid0)];
else
    set(object.function_inputs_control,'BackgroundColor',[0.92 0.65 0.65]);
end

if ~isempty(msg)
    
    if isempty(event)
        msgbox(msg);
    end
    error = 1;
end

end

