From 423efd72d1cc98b78bd9db23d866fb378dc60ef8 Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Thu, 15 May 2014 17:37:59 -0700 Subject: [PATCH] Create a mechanism to upgrade the TET's data structures, and do some cleanup. The TET now has a mechanism to upgrade TE blocks to the latest data structures, though backwards compatibility is not currently dealt with. Also clear unneeded cell arrays that held text. I'm not sure why that existed, and at least the quadratic example has both cell and non-cell arrays for holding the text, speaking to the uselessness of the array. Thus remove the array as an upgrade mechanism. This shrinks down the size of the TE blocks some too! --- @Cell/upgrade.m | 18 ++++++++++++++++++ @Data/upgrade.m | 15 +++++++++++++++ @Grid/upgrade.m | 16 ++++++++++++++++ @RCell/upgrade.m | 14 ++++++++++++++ @RGrid/upgrade.m | 14 ++++++++++++++ TTdiag.m | 2 ++ 6 files changed, 79 insertions(+) create mode 100644 @Cell/upgrade.m create mode 100644 @Data/upgrade.m create mode 100644 @Grid/upgrade.m create mode 100644 @RCell/upgrade.m create mode 100644 @RGrid/upgrade.m diff --git a/@Cell/upgrade.m b/@Cell/upgrade.m new file mode 100644 index 0000000..6e93e21 --- /dev/null +++ b/@Cell/upgrade.m @@ -0,0 +1,18 @@ +%% upgrade +% Preforms any necessary upgrades to the TET to comply with the latest version. +% inputs: +% object - Cell object +% outputs: +% none +% Author: Matthew Dawson +% Organization: McMaster Centre for Software Certification +function upgrade( object ) +if iscell(object.cond_text) + object.cond_text = object.cond_text{1}; +end + +for i=1:size(object.subgrid,2) + object.subgrid(i).upgrade; +end +end + diff --git a/@Data/upgrade.m b/@Data/upgrade.m new file mode 100644 index 0000000..97dd07a --- /dev/null +++ b/@Data/upgrade.m @@ -0,0 +1,15 @@ +%% upgrade +% Preforms any necessary upgrades to the TET to comply with the latest version. +% inputs: +% object - Data object +% outputs: +% none +% Author: Matthew Dawson +% Organization: McMaster Centre for Software Certification +function upgrade( object ) +object.Grid0.upgrade + +object.Grid1.upgrade +object.Grid2.upgrade +end + diff --git a/@Grid/upgrade.m b/@Grid/upgrade.m new file mode 100644 index 0000000..55aa1a7 --- /dev/null +++ b/@Grid/upgrade.m @@ -0,0 +1,16 @@ +%% upgrade +% Preforms any necessary upgrades to the TET to comply with the latest version. +% inputs: +% object - Grid object +% outputs: +% none +% Author: Matthew Dawson +% Organization: McMaster Centre for Software Certification +function upgrade( object ) + +for i=1:size(object.cells, 2) + object.cells(i).upgrade +end + +end + diff --git a/@RCell/upgrade.m b/@RCell/upgrade.m new file mode 100644 index 0000000..4dfaf38 --- /dev/null +++ b/@RCell/upgrade.m @@ -0,0 +1,14 @@ +%% upgrade +% Preforms any necessary upgrades to the TET to comply with the latest version. +% inputs: +% object - RCell object +% outputs: +% none +% Author: Matthew Dawson +% Organization: McMaster Centre for Software Certification +function upgrade( object ) + if iscell(object.result_text) + object.result_text = object.result_text{1}; + end +end + diff --git a/@RGrid/upgrade.m b/@RGrid/upgrade.m new file mode 100644 index 0000000..19db683 --- /dev/null +++ b/@RGrid/upgrade.m @@ -0,0 +1,14 @@ +%% upgrade +% Preforms any necessary upgrades to the TET to comply with the latest version. +% inputs: +% object - RGrid object +% outputs: +% none +% Author: Matthew Dawson +% Organization: McMaster Centre for Software Certification +function upgrade( object ) +for i = 1:size(object.Cells, 2) + object.Cells(i).upgrade; +end +end + diff --git a/TTdiag.m b/TTdiag.m index 5b8b915..10c27e6 100644 --- a/TTdiag.m +++ b/TTdiag.m @@ -123,6 +123,8 @@ else figure(data.fig); return end + else + data.upgrade end end -- GitLab