Skip to content
Commits on Source (30)
......@@ -87,6 +87,8 @@ for i=1:size(inports,1)
for j=1:size(in_handles,1)
if strcmp(get_param(inports(i),'Name'),get_param(in_handles(j),'Name'))
% Make sure the port numbers agree.
set_param(inports(i), 'Port', get_param(in_handles(j), 'Port'));
found = 1;
end
end
......@@ -121,6 +123,8 @@ for j = 1:size(in_handles,1)
add_block('simulink/Sources/In1',new_port);
new_port_num = sprintf('%s/1',get_param(in_handles(j),'Name'));
dest_port = sprintf('%s/%d','code',j);
% Set the port number so the ports line up properly.
set_param(new_port, 'Port', get_param(in_handles(j), 'Port'));
% sometimes line will be created automatically
try
add_line(getfullname(block_handle),new_port_num,dest_port);
......@@ -139,6 +143,10 @@ for i=1:size(outports,1)
for j=1:size(out_handles,1)
if strcmp(get_param(outports(i),'Name'),get_param(out_handles(j),'Name'))
% Set the port number so the ports line up properly.
set_param(outports(i), 'Port', get_param(out_handles(j), 'Port'));
found = 1;
end
end
......@@ -170,6 +178,10 @@ for j = 1:size(out_handles,1)
add_block('simulink/Sinks/Out1',new_port);
new_port_num = sprintf('%s/1',get_param(out_handles(j),'Name'));
dest_port = sprintf('%s/%d','code',j);
% Set the port number so the ports line up properly.
set_param(new_port, 'Port', get_param(out_handles(j), 'Port'));
try
add_line(getfullname(block_handle),dest_port,new_port_num);
end
......
......@@ -21,7 +21,7 @@ function [ check, seqs ] = cvc_check( object )
waitbar(.10,box,'Running Proof');
%tic
% run the cvc command
[status, result] = system(['cvc3 ' filename ' +model']);
[status, result] = safe_execute_external_command(['cvc3 ' filename ' +model']);
%toc
% check return status for errors
if (status ~= 0)
......
......@@ -39,7 +39,7 @@ if size(object.data.Grid2.cells,2) > 1
end
code = [code new_code];
if size(object.data.Grid1.cells,2) > 1
if object.data.multi_mode == 0 && size(object.data.Grid1.cells,2) > 1
[new_code,new_queries] = CVC_checker.generate_cvc_grid(object.data.Grid1,size(queries,2));
queries = [queries new_queries];
code = [code new_code];
......
%% 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
%% upgrade
% Preforms any necessary upgrades to the TET to comply with the latest version.
% inputs:
% object - Cell object
% outputs:
% none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% 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
%% 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
%% upgrade
% Preforms any necessary upgrades to the TET to comply with the latest version.
% inputs:
% object - Data object
% outputs:
% none
% Author: Matthew Dawson <matthew@mjdsystems.ca>
% Organization: McMaster Centre for Software Certification
function upgrade( object )
object.Grid0.upgrade
object.Grid1.upgrade
object.Grid2.upgrade
end
......@@ -59,13 +59,19 @@ end
% guaranteed to
% be filled in, regardless of the dimensionality of the table.
left_top_right_top_cell = object.data.Grid2.cells(1);
while size(left_top_right_top_cell.subgrid) ~= 0
left_top_right_top_cell = left_top_right_top_cell.subgrid.cells(1);
end
if (object.data.multi_mode == 1)
for i=1:size(object.data.Grid1.cells,2)
parsed_output = EMLGenerator.parse_inputs(strtrim(char(object.data.Grid1.cells(i).cond_text)));
output_str = char(parsed_output{1}(1));
code = [code sprintf('%s=%s;\n',output_str,EMLGenerator.type_convert(output_str,object.datatype,char(object.data.Grid0.Cells(i).result_text)))];
code = [code sprintf('%s=%s;\n',output_str,EMLGenerator.type_convert(output_str,object.datatype,char(object.data.Grid0.search_return(object.data.Grid1.cells(i), left_top_right_top_cell).result_text)))];
end
......
......@@ -64,7 +64,7 @@ classdef GUI < handle
multi_opt_out = [];
prover_opt_pvs = [];
prover_opt_cvc = [];
version = '0.5';
version = '0.7.4';
undo_man = [];
undo_opt = [];
redo_opt = [];
......
......@@ -7,5 +7,5 @@
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = about_call(object,src,event)
msgbox(sprintf('Table Toolbox v%s\nCopyright 2011\nColin Eles\nMcMaster Center for Software Certification',object.version),'About Table Tool','modal');
end
\ No newline at end of file
msgbox(sprintf('Tabular Expression Toolbox v%s\nCopyright 2011\nColin Eles & 2012 Matthew Dawson, Mark Lawford\nMcMaster Center for Software Certification',object.version),'About Tabular Expression Toolbox','modal');
end
......@@ -17,11 +17,13 @@ for i = 1:size(grid.cells,2)
error = '';
string = get(grid.cells(i).cond,'String');
s = [string(1,:)];
for j = 2:size(string,1)
s = [s ' ' string(j,:)];
if size(string) > 0
s = [string(1,:)];
for j = 2:size(string,1)
s = [s ' ' string(j,:)];
end
string = s;
end
string = s;
if ( strcmp(string,'') || isempty(string)) && i == 1 && isempty(grid.parent_grid) && size(grid.cells,2) == 1
break;
......
......@@ -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');
......
......@@ -19,7 +19,6 @@ control = uicontrol('style','edit',...
'min',0,'max',1,... % This is the key to multiline edits.
'string',{''},...
'Max',2.0,...
'Clipping','on',...
'fontweight','bold',...
'BackgroundColor',[1 1 1],...
'horizontalalign','center',...
......
......@@ -2,8 +2,8 @@
% function will call the draw methods for each of the 3 grids.
% inputs:
% obj:GUI - current GUI object
% load:boolean - 0 if grid is being refreshed, 1 if grid is being
% loaded for the firs time.
% load:tristate - 0 if grid is being refreshed, 1 if grid should reload
% data, 2 if the grid is being initialized.
% outputs:
% none
% Author: Colin Eles elesc@mcmaster.ca
......
......@@ -3,13 +3,13 @@
% inputs:
% obj:GUI - current GUI object
% grid:Grid - grid to be drawn, should be grid on left.
% load:boolean - 0 if grid is being refreshed, 1 if grid is being
% loaded for the firs time.
% load:tristate - 0 if grid is being refreshed, 1 if grid should reload
% data, 2 if the grid is being initialized.
% outputs:
% none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = draw_grid0(object,grid,load)
function [] = draw_grid0(object,grid,load, init)
% ensure that the results grid is up to date.
grid.refresh();
for i=1:size(grid.Cells,2)
......@@ -22,12 +22,12 @@ for i=1:size(grid.Cells,2)
pos(2) = pos2(2);
pos(3) = pos1(3);
pos(4) = pos2(4);
if isempty(grid.Cells(i).result) || ~ishandle(grid.Cells(i).result)%load == 1
if load == 2 || isempty(grid.Cells(i).result) || ~ishandle(grid.Cells(i).result)
grid.Cells(i).result = object.create_std_text(object.fig,pos);
% if we are loading the cell, try to restore the text
% that was saved using save_results.
if load == 1
if load ~= 0
set(grid.Cells(i).result,'String',grid.Cells(i).result_text);
end
else
......
......@@ -4,8 +4,8 @@
% inputs:
% obj:GUI - current GUI object
% grid:Grid - grid to be drawn, should be grid on top.
% load:boolean - 0 if grid is being refreshed, 1 if grid is being
% loaded for the firs time.
% load:tristate - 0 if grid is being refreshed, 1 if grid should reload
% data, 2 if the grid is being initialized.
% outputs:
% none
% Author: Colin Eles elesc@mcmaster.ca
......@@ -34,9 +34,9 @@ for i=1:size(grid.cells,2)
pos(1) = pos(1) + (i-1)*grid.cells(i).condition_text_width + grid.cells(i).condition_text_offset + pb_space;
% if the edit box does not exist create it, if it does
% adjust it's position.
if (isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))%load == 1)
if (load == 2 || isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))
grid.cells(i).cond = object.create_std_text(object.fig,pos);
if (load == 1)
if (load ~= 0)
set(grid.cells(i).cond,'String',grid.cells(i).cond_text);
end
else
......@@ -71,7 +71,7 @@ else
delete(grid.delete_cell_pb)
grid.delete_cell_pb = [];
end
if object.edit ==1 || load == 1
if object.edit ==1 || load ~= 0
fig_pos = get(object.fig,'position');
if(pos(1)+pos(3)>fig_pos(3))
fig_pos(3) = pos(1)+pos(3);
......
......@@ -3,8 +3,8 @@
% inputs:
% obj:GUI - current GUI object
% grid:Grid - grid to be drawn, should be grid on left.
% load:boolean - 0 if grid is being refreshed, 1 if grid is being
% loaded for the firs time.
% load:tristate - 0 if grid is being refreshed, 1 if grid should reload
% data, 2 if the grid is being initialized.
% outputs:
% none
% Author: Colin Eles elesc@mcmaster.ca
......@@ -67,7 +67,7 @@ if (~isempty(grid))
% if the edit box does not exist, ie. it is just being
% created or we are loading the figure
if (isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))%load == 1)
if (load == 2 || isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))
% create the new edit box
grid.cells(i).cond = object.create_std_text(object.fig,pos);
% if cell is the first in the grid use the new
......@@ -82,7 +82,7 @@ if (~isempty(grid))
% if we are loading the cell set the string of the
% edit box to be the value that we saved as a
% result of calling save_conditions
if (load == 1)
if (load ~= 0)
set(grid.cells(i).cond,'String',grid.cells(i).cond_text);
end
else
......
......@@ -41,11 +41,13 @@ check_string = [check_string counter sprintf('\n')];
for i=1:size(grid.cells,2)
condition_string = get(grid.cells(i).cond,'string');
s = [condition_string(1,:)];
for j = 2:size(condition_string,1)
s = [s ' ' condition_string(j,:)];
if size(condition_string,1) > 0
s = [condition_string(1,:)];
for j = 2:size(condition_string,1)
s = [s ' ' condition_string(j,:)];
end
condition_string = s;
end
condition_string = s;
if(~isempty(condition_string))
......
......@@ -174,11 +174,11 @@ uimenu(checkmenu,'Label','PVS Generate file','Callback',@(src,event)pvs_file_cal
uimenu(checkmenu,'Label','PVS Typecheck SimTypes','Callback',@(src,event)pvs_ext_call_sim(object,src,event));
uimenu(helpmenu,'Label','Product Help','Callback',@(src,event)help_call(object,src,event));
uimenu(helpmenu,'Label','About Table Tool','Callback',@(src,event)about_call(object,src,event));
uimenu(helpmenu,'Label','About Tabular Expression Toolbox','Callback',@(src,event)about_call(object,src,event));
object.set_command_pos;
object.reset_wh();
object.draw_allgrids(1);
object.draw_allgrids(2);
object.saved = 1;
object.setPBenable;
......
%% 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