Loading GUI.m +30 −7 Original line number Diff line number Diff line Loading @@ -249,6 +249,16 @@ classdef GUI < handle obj.Data.fig = obj.fig; end function [] = set_block_display(object) if obj.pvs_checked == 1 end end function [] = update_Statusbar(object) Loading Loading @@ -409,6 +419,18 @@ classdef GUI < handle end function type = output_data_type(object) S = sfroot; code_block = sprintf('%s/code',getfullname(object.block_handle)); myState = S.find('-isa','Stateflow.EMChart', '-and', 'Path', code_block); % find which one we want to edit if strncmp(myState.Outputs.DataType,'Inherit',7); type = '' else type = myState.Outputs.DataType; end end %% save_call % callback function that is called whenever the save button is % pressed. This function will generate code and store it in the Loading @@ -422,6 +444,7 @@ classdef GUI < handle % outputs; % none function eml_handle = save_call(object,src,event) if object.mode == 0 model = gcs; %make sure we are not looking at the library model Loading Loading @@ -465,7 +488,7 @@ classdef GUI < handle % temporary solution is just to use one of the outputs from our % table, we will use the first cell because it is guaranteed to % be filled in, regardless of the dimensionality of the table. code = [code sprintf('output=%s;\n',get(object.Grid0.Cells(1).result,'String'))]; code = [code sprintf('output=%s(%s);\n',object.output_data_type,get(object.Grid0.Cells(1).result,'String'))]; code = [code object.generate_code(object.Grid1,object.Grid2,0)]; fprintf('%s',code); Loading Loading @@ -937,7 +960,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -968,7 +991,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1045,7 +1068,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1079,7 +1102,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1148,7 +1171,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))] code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))] depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1182,7 +1205,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading
GUI.m +30 −7 Original line number Diff line number Diff line Loading @@ -249,6 +249,16 @@ classdef GUI < handle obj.Data.fig = obj.fig; end function [] = set_block_display(object) if obj.pvs_checked == 1 end end function [] = update_Statusbar(object) Loading Loading @@ -409,6 +419,18 @@ classdef GUI < handle end function type = output_data_type(object) S = sfroot; code_block = sprintf('%s/code',getfullname(object.block_handle)); myState = S.find('-isa','Stateflow.EMChart', '-and', 'Path', code_block); % find which one we want to edit if strncmp(myState.Outputs.DataType,'Inherit',7); type = '' else type = myState.Outputs.DataType; end end %% save_call % callback function that is called whenever the save button is % pressed. This function will generate code and store it in the Loading @@ -422,6 +444,7 @@ classdef GUI < handle % outputs; % none function eml_handle = save_call(object,src,event) if object.mode == 0 model = gcs; %make sure we are not looking at the library model Loading Loading @@ -465,7 +488,7 @@ classdef GUI < handle % temporary solution is just to use one of the outputs from our % table, we will use the first cell because it is guaranteed to % be filled in, regardless of the dimensionality of the table. code = [code sprintf('output=%s;\n',get(object.Grid0.Cells(1).result,'String'))]; code = [code sprintf('output=%s(%s);\n',object.output_data_type,get(object.Grid0.Cells(1).result,'String'))]; code = [code object.generate_code(object.Grid1,object.Grid2,0)]; fprintf('%s',code); Loading Loading @@ -937,7 +960,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -968,7 +991,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1045,7 +1068,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1079,7 +1102,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1148,7 +1171,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))] code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))] depth = depth - 1; space = []; for k=1:depth Loading Loading @@ -1182,7 +1205,7 @@ classdef GUI < handle for k=1:depth space = [space sprintf(' ')]; end code = [code sprintf('%soutput = %s;\n',space,strtrim(char(get(cell.result,'String'))))]; code = [code sprintf('%soutput = %s(%s);\n',space,obj.output_data_type,strtrim(char(get(cell.result,'String'))))]; depth = depth - 1; space = []; for k=1:depth Loading