Loading @EMLGenerator/generate_eml_multi.m 0 → 100644 +52 −0 Original line number Diff line number Diff line %% generate_eml_horizontal % generate the embedded matlab code for grid1, seperated from % the code for grid2 since for a 2d table grid1 conditions will % be sub conditions of grid2 conditions % inputs: % object:EMLGenerator - current object % g1:Grid - Grid 1 % g2_cell:Cell - Cell for which grid1 is sub conditon of % depth:int - integer representing recursion dept for formating % use % outputs: % code:string - string of eml code % Author: Colin Eles elesc@mcmaster.ca % Organization: McMaster Centre for Software Certification function code = generate_eml_multi(object,g1,g2_cell,depth) space = ''; for i=1:depth space = [space sprintf(' ')]; end code = []; code2 = []; elsecell = []; for i=1:size(g1.cells,2) g1cond = g1.cells(i).cond_text; % condition string of otherwise corresponds to an else % statement, we allow this statement to be in any order % in the cells of the grid, so we need to find where it % is, if it exists. output_parsed = EMLGenerator.parse_inputs(strtrim(char(g1.cells(i).cond_text))); output = char(output_parsed{1}(1)); code = [code sprintf('%s%s = ',space,output)]; resultcell = object.data.Grid0.search_return(g1.cells(i),g2_cell); if(~isempty(resultcell)) code = [code sprintf('%s;\n',EMLGenerator.type_convert(output,object.datatype,char(resultcell.result_text)))]; else end end end info.xml +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ <matlabrelease>2010a</matlabrelease> <name>Table Toolbox</name> <type>Toolbox</type> <icon>$toolbox/simulink/simulink/simulinkicon.gif</icon> <icon>$toolbox/matlab/icons/matlabicon.gif</icon> <help_location>./html</help_location> <help_contents_icon>$toolbox/matlab/icons/bookicon.gif</help_contents_icon> <list> Loading @@ -21,7 +21,7 @@ <listitem> <label>Table Tool</label> <callback>TableToolMatlab</callback> <icon>$toolbox/simulink/simulink/simulinkicon.gif</icon> <icon>$toolbox/matlab/icons/figureicon.gif</icon> </listitem> </list> Loading Loading
@EMLGenerator/generate_eml_multi.m 0 → 100644 +52 −0 Original line number Diff line number Diff line %% generate_eml_horizontal % generate the embedded matlab code for grid1, seperated from % the code for grid2 since for a 2d table grid1 conditions will % be sub conditions of grid2 conditions % inputs: % object:EMLGenerator - current object % g1:Grid - Grid 1 % g2_cell:Cell - Cell for which grid1 is sub conditon of % depth:int - integer representing recursion dept for formating % use % outputs: % code:string - string of eml code % Author: Colin Eles elesc@mcmaster.ca % Organization: McMaster Centre for Software Certification function code = generate_eml_multi(object,g1,g2_cell,depth) space = ''; for i=1:depth space = [space sprintf(' ')]; end code = []; code2 = []; elsecell = []; for i=1:size(g1.cells,2) g1cond = g1.cells(i).cond_text; % condition string of otherwise corresponds to an else % statement, we allow this statement to be in any order % in the cells of the grid, so we need to find where it % is, if it exists. output_parsed = EMLGenerator.parse_inputs(strtrim(char(g1.cells(i).cond_text))); output = char(output_parsed{1}(1)); code = [code sprintf('%s%s = ',space,output)]; resultcell = object.data.Grid0.search_return(g1.cells(i),g2_cell); if(~isempty(resultcell)) code = [code sprintf('%s;\n',EMLGenerator.type_convert(output,object.datatype,char(resultcell.result_text)))]; else end end end
info.xml +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ <matlabrelease>2010a</matlabrelease> <name>Table Toolbox</name> <type>Toolbox</type> <icon>$toolbox/simulink/simulink/simulinkicon.gif</icon> <icon>$toolbox/matlab/icons/matlabicon.gif</icon> <help_location>./html</help_location> <help_contents_icon>$toolbox/matlab/icons/bookicon.gif</help_contents_icon> <list> Loading @@ -21,7 +21,7 @@ <listitem> <label>Table Tool</label> <callback>TableToolMatlab</callback> <icon>$toolbox/simulink/simulink/simulinkicon.gif</icon> <icon>$toolbox/matlab/icons/figureicon.gif</icon> </listitem> </list> Loading