Skip to content
GitLab
Explore
Sign in
Hide whitespace changes
Inline
Side-by-side
@GUI/check_grid_condition.m
View file @
dc0f1445
...
...
@@ -16,6 +16,14 @@ for i = 1:size(grid.cells,2)
error
=
''
;
string
=
get
(
grid
.
cells
(
i
)
.
cond
,
'String'
);
if
size
(
string
)
>
0
s
=
[
string
(
1
,:)];
for
j
=
2
:
size
(
string
,
1
)
s
=
[
s
' '
string
(
j
,:)];
end
string
=
s
;
end
if
(
strcmp
(
string
,
''
)
||
isempty
(
string
))
&&
i
==
1
&&
isempty
(
grid
.
parent_grid
)
&&
size
(
grid
.
cells
,
2
)
==
1
break
;
...
...
@@ -40,7 +48,7 @@ for i = 1:size(grid.cells,2)
msg
=
[
msg
error
sprintf
(
'\n'
)];
% set tooltip string of cell to error msg
set
(
grid
.
cells
(
i
)
.
cond
,
'TooltipString'
,
error
)
set
(
grid
.
cells
(
i
)
.
cond
,
'TooltipString'
,
error
)
;
% change background colour
grid
.
cells
(
i
)
.
flag_cell
(
1
);
else
...
...
@GUI/check_matlab_syntax_condition.m
View file @
dc0f1445
...
...
@@ -28,6 +28,7 @@ for i=1:size(parsed_input,2)
end
if
~
result
% the string is a condition we need to evaulate it as it
% will be used in the code, as in order for an if statement
...
...
@GUI/close_fig.m
View file @
dc0f1445
...
...
@@ -11,7 +11,8 @@
% Organization: McMaster Centre for Software Certification
function
[]
=
close_fig
(
object
,
src
,
event
)
if
(
object
.
validation_report_handle
~=
0
)
delete
(
object
.
validation_report_handle
)
delete
(
object
.
validation_report_handle
);
object
.
validation_report_handle
=
0
;
end
object
.
save_data
;
object
.
Data
.
open
=
0
;
...
...
@@ -19,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'
);
...
...
@GUI/create_std_text.m
View file @
dc0f1445
...
...
@@ -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'
,
...
...
...
@GUI/cvc_ext_call.m
View file @
dc0f1445
...
...
@@ -7,6 +7,7 @@ object.save_call([],[]);
object
.
save_data
;
if
(
object
.
validation_report_handle
~=
0
)
delete
(
object
.
validation_report_handle
);
object
.
validation_report_handle
=
0
;
end
error
=
object
.
check_call
([],
2
);
...
...
@@ -22,6 +23,7 @@ if (~error)
else
Valid_Report
=
ValidationReport
(
object
);
Valid_Report
.
set_results
(
result
);
Valid_Report
.
set_mode
(
1
);
Valid_Report
.
init
();
end
object
.
pvs_checked
=
check
;
...
...
@GUI/draw_allgrids.m
View file @
dc0f1445
...
...
@@ -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
...
...
@GUI/draw_grid0.m
View file @
dc0f1445
...
...
@@ -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
...
...
@GUI/draw_grid1.m
View file @
dc0f1445
...
...
@@ -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
...
...
@@ -66,12 +66,12 @@ if( object.edit == 1)
set
(
grid
.
delete_cell_pb
,
'userdata'
,
object
);
set
(
grid
.
new_cell_pb
,
'userdata'
,
object
);
else
delete
(
grid
.
new_cell_pb
)
delete
(
grid
.
new_cell_pb
)
;
grid
.
new_cell_pb
=
[];
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
);
...
...
@GUI/draw_grid2.m
View file @
dc0f1445
...
...
@@ -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
...
...
@@ -100,11 +100,11 @@ if (~isempty(grid))
if
(
ishghandle
(
grid
.
cells
(
i
)
.
grid_pb
))
set
(
grid
.
cells
(
i
)
.
grid_pb
,
'Visible'
,
'on'
);
end
grid
.
cells
(
i
)
.
set_pb
(
object
.
fig
,
pb_pos
)
grid
.
cells
(
i
)
.
set_pb
(
object
.
fig
,
pb_pos
)
;
set
(
grid
.
cells
(
i
)
.
grid_pb
,
'UserData'
,
object
);
elseif
(
grid
.
cells
(
i
)
.
pb_flag
==
1
&&
object
.
edit
~=
1
)
if
(
ishghandle
(
grid
.
cells
(
i
)
.
grid_pb
))
set
(
grid
.
cells
(
i
)
.
grid_pb
,
'Visible'
,
'off'
)
set
(
grid
.
cells
(
i
)
.
grid_pb
,
'Visible'
,
'off'
)
;
end
end
...
...
@GUI/evaluate_counter_grid.m
View file @
dc0f1445
...
...
@@ -40,6 +40,15 @@ end
check_string
=
[
check_string
counter
sprintf
(
'\n'
)];
for
i
=
1
:
size
(
grid
.
cells
,
2
)
condition_string
=
get
(
grid
.
cells
(
i
)
.
cond
,
'string'
);
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
if
(
~
isempty
(
condition_string
))
eval
([
check_string
'result =('
char
(
condition_string
)
');'
])
...
...
@GUI/init.m
View file @
dc0f1445
...
...
@@ -174,18 +174,18 @@ 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 Tab
le
Tool'
,
'Callback'
,
@
(
src
,
event
)
about_call
(
object
,
src
,
event
));
uimenu
(
helpmenu
,
'Label'
,
'About Tab
ular Expression
Tool
box
'
,
'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
;
object
.
default_prover
=
object
.
CVC_const
;
object
.
settings
=
Settings
();
object
.
settings
=
TT
Settings
();
if
isfield
(
object
.
Data
.
settings
,
'set'
)
object
.
settings
.
setvalues
(
object
.
Data
.
settings
);
else
...
...
@GUI/pvs_ext_call.m
View file @
dc0f1445
...
...
@@ -13,6 +13,7 @@ object.save_call([],[]);
object
.
save_data
;
if
(
object
.
validation_report_handle
~=
0
)
delete
(
object
.
validation_report_handle
);
object
.
validation_report_handle
=
0
;
end
error
=
object
.
check_call
([],
2
);
...
...
@@ -35,6 +36,7 @@ if (~error)
else
Valid_Report
=
ValidationReport
(
object
);
Valid_Report
.
set_results
(
result
);
Valid_Report
.
set_mode
(
0
);
Valid_Report
.
init
();
end
object
.
pvs_checked
=
check
;
...
...
@GUI/pvs_ext_call_sim.m
View file @
dc0f1445
...
...
@@ -41,6 +41,7 @@ if (~error)
else
Valid_Report
=
ValidationReport
(
object
);
Valid_Report
.
set_results
(
result
);
Valid_Report
.
set_mode
(
0
);
Valid_Report
.
init
();
end
object
.
pvs_checked
=
check
;
...
...
@GUI/pvs_file_call.m
View file @
dc0f1445
...
...
@@ -10,7 +10,7 @@
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function
[]
=
pvs_file_call
(
object
,
src
,
event
)
object
.
save_data
object
.
save_data
;
object
.
PVS
.
generate_pvs_file
(
object
.
Data
.
function_name
);
...
...
@GUI/save_call.m
View file @
dc0f1445
...
...
@@ -35,7 +35,7 @@ if object.mode == 0
open_system
(
model
);
load_system
(
'TableLibrary'
);
new_block
=
add_block
(
'TableLibrary/Tabular Expression'
,[
model
'/'
function_name
]);
set_param
(
new_block
,
'UserData'
,
object
.
Data
)
set_param
(
new_block
,
'UserData'
,
object
.
Data
)
;
set_param
(
new_block
,
'UserDataPersistent'
,
'on'
);
object
.
mode
=
1
;
object
.
block_handle
=
new_block
;
...
...
@GUI/save_data.m
View file @
dc0f1445
...
...
@@ -24,6 +24,7 @@ set.set = 1;
set
.
inputs
=
object
.
settings
.
pvs_includes
;
set
.
count
=
object
.
settings
.
counter_trials
;
set
.
range
=
object
.
settings
.
counter_range
;
set
.
except
=
object
.
settings
.
except
;
object
.
Data
.
settings
=
set
;
end
@GUI/textbox_callback.m
View file @
dc0f1445
...
...
@@ -29,7 +29,7 @@ if(~isempty(unicode2native(event.Character)))
if
event
.
Character
>
33
||
event
.
Character
==
8
if
object
.
pvs_checked
==
1
object
.
pvs_checked
=
0
;
object
.
update_Statusbar
object
.
update_Statusbar
;
if
(
object
.
mode
==
1
)
TableBlock
.
set_block_display
(
object
.
block_handle
,
object
.
pvs_checked
);
end
...
...
@GUI/undo_call.m
View file @
dc0f1445
...
...
@@ -66,6 +66,6 @@ else
end
object
.
update_undoredo
object
.
update_undoredo
;
end
@Grid/pb_new_call.m
View file @
dc0f1445
...
...
@@ -31,7 +31,7 @@ if isempty(event) || event ~= 1
gui
.
undo_man
.
new_state
(
undo_data
);
end
gui
.
update_undoredo
gui
.
update_undoredo
;
end
...
...
@Grid/purge.m
0 → 100644
View file @
dc0f1445
%% 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
Prev
1
2
3
4
5
6
…
8
Next