Commit 2e39f03e authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Avoid unnecessary changes to the Simulink block on saving.

When the table is closed, there is lots of unnecessary data being stored in
the block, all of which changes on the next load.  Remove that data before
closing, to try and avoid changing the underlying storage, making the TET
friendlier to SCMs.
parent e3a02fac
Loading
Loading
Loading
Loading

@Cell/purge.m

0 → 100644
+19 −0
Original line number Diff line number Diff line
%% purge
%    Removes useless data from the block on saving, avoiding unnecessary
%    changes and data storage.
% inputs:
%   object - Cell object
% outputs:
%   none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% Organization: McMaster Centre for Software Certification
function  purge( object )
object.grid_pb = [];
object.cond = [];
object.color = []; % This is always regenerated, so it is safe to kill.

for i=1:size(object.subgrid,2)
    object.subgrid(i).purge;
end
end

@Data/purge.m

0 → 100644
+16 −0
Original line number Diff line number Diff line
%% purge
%    Removes useless data from the block on saving, avoiding unnecessary
%    changes and data storage.
% inputs:
%   object - Data object
% outputs:
%   none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% Organization: McMaster Centre for Software Certification
function purge( object )
object.Grid0.purge

object.Grid1.purge
object.Grid2.purge
end
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ object.Data.fig = [];
delete(object.fig);
% remove reference to the old figure.
object.fig = [];
% Purge unnecessary information from Data
object.Data.purge;
% in simulink mode
if(object.mode == 1)
    parent = get_param(object.block_handle,'Parent');

@Grid/purge.m

0 → 100644
+21 −0
Original line number Diff line number Diff line
%% purge
%    Removes useless data from the block on saving, avoiding unnecessary
%    changes and data storage.
% inputs:
%   object - Grid object
% outputs:
%   none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% Organization: McMaster Centre for Software Certification
function purge( object )
% delete(object.new_cell_pb)
% delete(object.delete_cell_pb)
object.new_cell_pb = [];
object.delete_cell_pb = [];

for i=1:size(object.cells, 2)
    object.cells(i).purge
end

end

@RCell/purge.m

0 → 100644
+13 −0
Original line number Diff line number Diff line
%% purge
%    Removes useless data from the block on saving, avoiding unnecessary
%    changes and data storage.
% inputs:
%   object - RCell object
% outputs:
%   none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% Organization: McMaster Centre for Software Certification
function  purge( object )
object.result = [];
end
Loading