%% check_output_consistent
%   checks if the block has the correct number of outputs based on the
%   output mode, checks that the outputs names are compatible witht the
%   matlab spec for naming variables.
% inputs:
%   object:GUI - gui object
% outputs:
%   result:boolean - true if table consistent, false if not.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function result = check_output_consistent( object )
output_block_types = object.output_data_type;

output_table = {};
if (object.multi_mode == 1)
    for i=1:size(object.Grid1.cells,2)
        parsed_output = EMLGenerator.parse_inputs(strtrim(char(object.Grid1.cells(i).cond_text)));
        
        output_table = [output_table  {char(parsed_output{1}(1))}];
        
        
    end
else
    output_table = {'output'};
end

if (size(output_block_types,1) ~= size(output_table,2))
    result = false;
    return;
end

for i=1:size(output_table,2)
    if (~strcmp(output_block_types{i},output_table{i}))
        result = false;
        return;
    end
end
result = true;

end

