Loading Data.m +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ classdef Data < handle end function [] = save(obj) filename = [ obj.function_name '.data']; filename = [ obj.function_name '.table']; save(filename,'obj'); end end Loading GUI.m +49 −17 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ classdef GUI < handle 'Parent',obj.fig,... 'callback',@(src,event)input_call(obj,src,event)); % Input/Output button % Settings button obj.settings_pb = uicontrol('style','push',... 'units','pix',... 'string','Settings',... Loading Loading @@ -211,12 +211,13 @@ classdef GUI < handle editmenu = uimenu('Label','Edit'); pvsmenu = uimenu('Label','PVS'); uimenu(filemenu,'Label','New','Accelerator','n','Callback',@(src,event)new_call(obj,src,event)); uimenu(filemenu,'Label','Open...'); uimenu(filemenu,'Label','Open...','Callback',@(src,event)open_call(obj,src,event)); uimenu(filemenu,'Label','Save to Block','Separator','on','Accelerator','s','Callback',@(src,event)save_call(obj,src,event)); uimenu(filemenu,'Label','Save to M-File','Callback',@(src,event)save_ext_call(obj,src,event)); uimenu(filemenu,'Label','Close','Accelerator','w','Separator','on','Callback',@(src,event)close_fig(obj,src,event)); uimenu(editmenu,'Label','Show edit controls','Checked','on'); uimenu(editmenu,'Label','Ports and Data Manager','Accelerator','p','Callback',@(src,event)input_call(obj,src,event)); uimenu(pvsmenu,'Label','Typecheck','Accelerator','t','Callback',@(src,event)pvs_ext_call(obj,src,event)); uimenu(pvsmenu,'Label','PVS Settings','Callback',@(src,event)settings_call(obj,src,event)); Loading Loading @@ -273,6 +274,12 @@ classdef GUI < handle TableToolMatlab end function [] = open_call(object,src,event) [FileName, PathName, FilterIndex] = uigetfile('*.table','Select pvs files'); TTdiag('Load',[PathName FileName]); end %% set_command_pos % sets the location of all the command buttons, labels and edit % boxes, places objects at the top of the figure which it Loading Loading @@ -340,8 +347,10 @@ classdef GUI < handle fprintf(fileid,code); % save an extra file called expression_name.data which % contains a binary representation of the current gui object. filename = [get(object.function_name_control,'String') '.data']; filename = [get(object.function_name_control,'String') '.table']; %save(filename,'object'); object.save_data; object.save_settings; object.Data.save; fclose(fileid); Loading @@ -349,12 +358,12 @@ classdef GUI < handle %% function [] = input_call(object,src,event) %da = DAStudio.ModelExplorer %dataddg modelddg(object.block_handle) %da.show; %da = DAStudio.DiagnosticViewer('test'); eml_handle = object.save_call([],[]); currentDir = pwd; cd([matlabroot filesep 'toolbox' filesep 'stateflow' filesep 'stateflow' filesep 'private']); fHandle = @eml_man; cd(currentDir); fHandle('edit_data_ports', sf('get', get_param(char(eml_handle),'UserData'), '.chart')) end %% Loading Loading @@ -411,7 +420,7 @@ classdef GUI < handle % event:eventdata - event that triggered the callback % outputs; % none function [] = save_call(object,src,event) 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 @@ -488,9 +497,10 @@ classdef GUI < handle % if the code block does not already exists we need to create a % new one if (isempty(code_blocks)) add_block('simulink/User-Defined Functions/Embedded MATLAB Function',code_block); code_blocks = add_block('simulink/User-Defined Functions/Embedded MATLAB Function',code_block); end eml_handle = code_blocks % find the state of the code block and update it to the new % code myState = S.find('-isa','Stateflow.EMChart', '-and', 'Path', code_block); % find which one we want to edit Loading Loading @@ -1256,7 +1266,33 @@ classdef GUI < handle % outputs; % none function [] = close_fig(object,src,event) % save the relavent edit boxes to respective variables % % save the relavent edit boxes to respective variables % save_conditions(object,object.Grid2); % save_conditions(object,object.Grid1); % save_results(object,object.Grid0); % % depricated % object.function_name_text = get(object.function_name_control,'String'); % object.function_inputs_text = get(object.function_inputs_control,'String'); % % new storage % object.Data.function_name = get(object.function_name_control,'String'); % object.Data.function_inputs = get(object.function_inputs_control,'String'); % object.Data.checked = object.pvs_checked; % object.Data.open = 0; % object.Data.fig = []; % % set.set = 1; % set.inputs = object.settings.pvs_includes; % set.count = object.settings.counter_trials; % set.range = object.settings.counter_range; % object.Data.settings = set; % delete the figure, closing the window. object.save_data; delete(object.fig); % remove reference to the old figure. object.fig = []; end function [] = save_data(object) save_conditions(object,object.Grid2); save_conditions(object,object.Grid1); save_results(object,object.Grid0); Loading @@ -1275,10 +1311,6 @@ classdef GUI < handle set.count = object.settings.counter_trials; set.range = object.settings.counter_range; object.Data.settings = set; % delete the figure, closing the window. delete(object.fig); % remove reference to the old figure. object.fig = []; end function [] = save_settings(object) Loading TTdiag.m +15 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ switch Action, case 'Open', Mode = varargin{2}; if 1 ~= nargin if 2 ~= nargin DAStudio.warning('improper function use') end blockHandleTTTopMask = orig_gcbh; Loading @@ -32,6 +32,20 @@ switch Action, LocalCopyBlockFcn(blockHandleTTTopMask); DAStudio.ModelExplorer case 'Load', if 2 ~= nargin DAStudio.warning('improper function use') end file = varargin{2}; try data = importdata(file); gui = GUI([],0); gui.setData(data) gui.init(); catch exception msgbox(exception.identifier) end otherwise, DAStudio.error('Simulink:dialog:UnknownAction',Action); Loading importfile.m +1 −1 Original line number Diff line number Diff line function importfile(fileToRead1) function vars = importfile(fileToRead1) %IMPORTFILE(FILETOREAD1) % Imports data from the specified file % FILETOREAD1: file to read Loading Loading
Data.m +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ classdef Data < handle end function [] = save(obj) filename = [ obj.function_name '.data']; filename = [ obj.function_name '.table']; save(filename,'obj'); end end Loading
GUI.m +49 −17 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ classdef GUI < handle 'Parent',obj.fig,... 'callback',@(src,event)input_call(obj,src,event)); % Input/Output button % Settings button obj.settings_pb = uicontrol('style','push',... 'units','pix',... 'string','Settings',... Loading Loading @@ -211,12 +211,13 @@ classdef GUI < handle editmenu = uimenu('Label','Edit'); pvsmenu = uimenu('Label','PVS'); uimenu(filemenu,'Label','New','Accelerator','n','Callback',@(src,event)new_call(obj,src,event)); uimenu(filemenu,'Label','Open...'); uimenu(filemenu,'Label','Open...','Callback',@(src,event)open_call(obj,src,event)); uimenu(filemenu,'Label','Save to Block','Separator','on','Accelerator','s','Callback',@(src,event)save_call(obj,src,event)); uimenu(filemenu,'Label','Save to M-File','Callback',@(src,event)save_ext_call(obj,src,event)); uimenu(filemenu,'Label','Close','Accelerator','w','Separator','on','Callback',@(src,event)close_fig(obj,src,event)); uimenu(editmenu,'Label','Show edit controls','Checked','on'); uimenu(editmenu,'Label','Ports and Data Manager','Accelerator','p','Callback',@(src,event)input_call(obj,src,event)); uimenu(pvsmenu,'Label','Typecheck','Accelerator','t','Callback',@(src,event)pvs_ext_call(obj,src,event)); uimenu(pvsmenu,'Label','PVS Settings','Callback',@(src,event)settings_call(obj,src,event)); Loading Loading @@ -273,6 +274,12 @@ classdef GUI < handle TableToolMatlab end function [] = open_call(object,src,event) [FileName, PathName, FilterIndex] = uigetfile('*.table','Select pvs files'); TTdiag('Load',[PathName FileName]); end %% set_command_pos % sets the location of all the command buttons, labels and edit % boxes, places objects at the top of the figure which it Loading Loading @@ -340,8 +347,10 @@ classdef GUI < handle fprintf(fileid,code); % save an extra file called expression_name.data which % contains a binary representation of the current gui object. filename = [get(object.function_name_control,'String') '.data']; filename = [get(object.function_name_control,'String') '.table']; %save(filename,'object'); object.save_data; object.save_settings; object.Data.save; fclose(fileid); Loading @@ -349,12 +358,12 @@ classdef GUI < handle %% function [] = input_call(object,src,event) %da = DAStudio.ModelExplorer %dataddg modelddg(object.block_handle) %da.show; %da = DAStudio.DiagnosticViewer('test'); eml_handle = object.save_call([],[]); currentDir = pwd; cd([matlabroot filesep 'toolbox' filesep 'stateflow' filesep 'stateflow' filesep 'private']); fHandle = @eml_man; cd(currentDir); fHandle('edit_data_ports', sf('get', get_param(char(eml_handle),'UserData'), '.chart')) end %% Loading Loading @@ -411,7 +420,7 @@ classdef GUI < handle % event:eventdata - event that triggered the callback % outputs; % none function [] = save_call(object,src,event) 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 @@ -488,9 +497,10 @@ classdef GUI < handle % if the code block does not already exists we need to create a % new one if (isempty(code_blocks)) add_block('simulink/User-Defined Functions/Embedded MATLAB Function',code_block); code_blocks = add_block('simulink/User-Defined Functions/Embedded MATLAB Function',code_block); end eml_handle = code_blocks % find the state of the code block and update it to the new % code myState = S.find('-isa','Stateflow.EMChart', '-and', 'Path', code_block); % find which one we want to edit Loading Loading @@ -1256,7 +1266,33 @@ classdef GUI < handle % outputs; % none function [] = close_fig(object,src,event) % save the relavent edit boxes to respective variables % % save the relavent edit boxes to respective variables % save_conditions(object,object.Grid2); % save_conditions(object,object.Grid1); % save_results(object,object.Grid0); % % depricated % object.function_name_text = get(object.function_name_control,'String'); % object.function_inputs_text = get(object.function_inputs_control,'String'); % % new storage % object.Data.function_name = get(object.function_name_control,'String'); % object.Data.function_inputs = get(object.function_inputs_control,'String'); % object.Data.checked = object.pvs_checked; % object.Data.open = 0; % object.Data.fig = []; % % set.set = 1; % set.inputs = object.settings.pvs_includes; % set.count = object.settings.counter_trials; % set.range = object.settings.counter_range; % object.Data.settings = set; % delete the figure, closing the window. object.save_data; delete(object.fig); % remove reference to the old figure. object.fig = []; end function [] = save_data(object) save_conditions(object,object.Grid2); save_conditions(object,object.Grid1); save_results(object,object.Grid0); Loading @@ -1275,10 +1311,6 @@ classdef GUI < handle set.count = object.settings.counter_trials; set.range = object.settings.counter_range; object.Data.settings = set; % delete the figure, closing the window. delete(object.fig); % remove reference to the old figure. object.fig = []; end function [] = save_settings(object) Loading
TTdiag.m +15 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ switch Action, case 'Open', Mode = varargin{2}; if 1 ~= nargin if 2 ~= nargin DAStudio.warning('improper function use') end blockHandleTTTopMask = orig_gcbh; Loading @@ -32,6 +32,20 @@ switch Action, LocalCopyBlockFcn(blockHandleTTTopMask); DAStudio.ModelExplorer case 'Load', if 2 ~= nargin DAStudio.warning('improper function use') end file = varargin{2}; try data = importdata(file); gui = GUI([],0); gui.setData(data) gui.init(); catch exception msgbox(exception.identifier) end otherwise, DAStudio.error('Simulink:dialog:UnknownAction',Action); Loading
importfile.m +1 −1 Original line number Diff line number Diff line function importfile(fileToRead1) function vars = importfile(fileToRead1) %IMPORTFILE(FILETOREAD1) % Imports data from the specified file % FILETOREAD1: file to read Loading