Commit 8af291be authored by Colin Eles's avatar Colin Eles
Browse files

can now figure out compiled types of code block, could now use these types for...

can now figure out compiled types of code block, could now use these types for proving, still need a way of consolidating types between input box and port definitions

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@6317 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent 4e589711
Loading
Loading
Loading
Loading

@GUI/compiled_types.m

0 → 100644
+31 −0
Original line number Diff line number Diff line
function [ inputs, outputs ] = compiled_types( object )
inputs = [];
outputs = [];
try
eval([bdroot '([],[],[],''compile'')']);
catch exception
    return;
end
if (object.mode == 1)
    S = sfroot;
    code_block = sprintf('%s/code',getfullname(object.block_handle));
    code_blocks = find_system(getfullname(object.block_handle),'LookUnderMasks','all','BlockType','SubSystem','Name','code');
    if ~isempty(code_blocks)
        myState = S.find('-isa','Stateflow.EMChart', '-and', 'Path', code_block); % find which one we want to edit
        for (i=1:size(myState.Inputs,1))
            
           inputs = [inputs;{myState.Inputs(i).Name, myState.Inputs(i).CompiledType}];

        end
        
         for (i=1:size(myState.Outputs,1))
            
           outputs = [outputs;{myState.Outputs(i).Name, myState.Outputs(i).CompiledType}];

        end

end
eval([bdroot '([],[],[],''term'')']);

end
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ elseif object.mode == 1
    if ~redo
        object.save_call([],[]);
    end
    [inputs, outputs] = object.compiled_types
end
end

+19 −2
Original line number Diff line number Diff line
@@ -19,9 +19,26 @@
% To create a subgrid for a condition click on the "+" button next to the
% intended box.
%
% Whenever the configuration of the vertical conditions and horizontal
% conditions is changed the corresponding output boxes will update as well.
% Whenever the configuration of the vertical and horizontal conditions
% is changed the corresponding output boxes will update as well.
%% Inputs
% The input box labeled "Inputs" allows for the specification of inputs to
% the table. There is no limit in the number of inputs supported. 
%% Expression Name
%% Conditions
% Text input for a condition box must be valid embedded matlab code.
% Expressions in condition boxes will be evaulated with the assumed type of
% boolean. Since embedded matlab is not typechecked this is a pottential
% cause of errors. By running pvs on a table, each expression in a
% condition box will be checked that it is of type boolean.
%
% For a table with multiple outputs, the horizontal condition boxes
% represent different outputs. In the example below, the table has 2
% different outputs labeled, out1 and out2. The syntax of the output specification
% is the same as for the inputs; this allows for outputs to have
% different types.
%
% <<ug_layout_3.png>>
%
%% Outputs
%
 No newline at end of file
+20 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
   <!--
This HTML is auto-generated from an M-file.
To make changes, update the M-file and republish this document.
      --><title>Editing a Tabular Expression</title><meta name="generator" content="MATLAB 7.10"><meta name="date" content="2010-09-13"><meta name="m-file" content="TT_ug_editing"><style type="text/css">
      --><title>Editing a Tabular Expression</title><meta name="generator" content="MATLAB 7.10"><meta name="date" content="2010-10-07"><meta name="m-file" content="TT_ug_editing"><style type="text/css">

body {
  background-color: white;
@@ -62,7 +62,7 @@ p.footer {
  color: gray;
}

  </style></head><body><div class="content"><h1>Editing a Tabular Expression</h1><!--introduction--><p>The Tabular Expression Dialog allows users to graphically layout a tabular expression, for which conditions and outputs can be filled in using the embedded matlab subset of the Matlab languauge.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Layout</a></li><li><a href="#2">Conditions</a></li><li><a href="#3">Outputs</a></li></ul></div><h2>Layout<a name="1"></a></h2><p>The Dialog interface allows for the creation of 1-Dimensional vertical and horizontal tables, as well as 2-Dimensional tables. The tool supports multiple outputs for 1-Dimensional vertical tables.</p><p>The figure below shows an example 2-Dimensional Table with the Vertical Conditions, Horizontal Conditions, and Outputs notated.</p><p><img vspace="5" hspace="5" src="ug_layout_2.png" alt=""> </p><p>The "new" button will create an additional condition box for a particular grid. The "delete" button will remove the last condition box in a grid. For each condition in the vertical conditions, a subgrid can be created. To create a subgrid for a condition click on the "+" button next to the intended box.</p><h2>Conditions<a name="2"></a></h2><h2>Outputs<a name="3"></a></h2><p class="footer"><br>
  </style></head><body><div class="content"><h1>Editing a Tabular Expression</h1><!--introduction--><p>The Tabular Expression Dialog allows users to graphically layout a tabular expression, for which conditions and outputs can be filled in using the embedded matlab subset of the Matlab languauge.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Layout</a></li><li><a href="#2">Inputs</a></li><li><a href="#3">Expression Name</a></li><li><a href="#4">Conditions</a></li><li><a href="#5">Outputs</a></li></ul></div><h2>Layout<a name="1"></a></h2><p>The Dialog interface allows for the creation of 1-Dimensional vertical and horizontal tables, as well as 2-Dimensional tables. The tool supports multiple outputs for 1-Dimensional vertical tables.</p><p>The figure below shows an example 2-Dimensional Table with the Vertical Conditions, Horizontal Conditions, and Outputs notated.</p><p><img vspace="5" hspace="5" src="ug_layout_2.png" alt=""> </p><p>The "new" button will create an additional condition box for a particular grid. The "delete" button will remove the last condition box in a grid. For each condition in the vertical conditions, a subgrid can be created. To create a subgrid for a condition click on the "+" button next to the intended box.</p><p>Whenever the configuration of the vertical and horizontal conditions is changed the corresponding output boxes will update as well.</p><h2>Inputs<a name="2"></a></h2><h2>Expression Name<a name="3"></a></h2><h2>Conditions<a name="4"></a></h2><p>Text input for a condition box must be valid embedded matlab code. Expressions in condition boxes will be evaulated with the assumed type of boolean. Since embedded matlab is not typechecked this is a pottential cause of errors. By running pvs on a table, each expression in a condition box will be checked that it is of type boolean.</p><p>For a table with multiple outputs, the horizontal condition boxes represent different outputs. In the example below, the table has 2 different outputs labeled, out1 and out2. The syntax of the output specification is the same as for the inputs; this allows for outputs to have different types.</p><p><img vspace="5" hspace="5" src="ug_layout_3.png" alt=""> </p><h2>Outputs<a name="5"></a></h2><p class="footer"><br>
      Published with MATLAB&reg; 7.10<br></p></div><!--
##### SOURCE BEGIN #####
%% Editing a Tabular Expression
@@ -85,7 +85,25 @@ p.footer {
% For each condition in the vertical conditions, a subgrid can be created.
% To create a subgrid for a condition click on the "+" button next to the
% intended box.
%
% Whenever the configuration of the vertical and horizontal conditions
% is changed the corresponding output boxes will update as well.
%% Inputs
%% Expression Name
%% Conditions
% Text input for a condition box must be valid embedded matlab code.
% Expressions in condition boxes will be evaulated with the assumed type of
% boolean. Since embedded matlab is not typechecked this is a pottential
% cause of errors. By running pvs on a table, each expression in a
% condition box will be checked that it is of type boolean.
%
% For a table with multiple outputs, the horizontal condition boxes
% represent different outputs. In the example below, the table has 2
% different outputs labeled, out1 and out2. The syntax of the output specification
% is the same as for the inputs; this allows for outputs to have
% different types.
%
% <<ug_layout_3.png>>
%
%% Outputs
%

html/html/TTtbx_gs_top.html

deleted100644 → 0
+0 −82
Original line number Diff line number Diff line

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <!--
This HTML is auto-generated from an M-file.
To make changes, update the M-file and republish this document.
      --><title>Table Toolbox</title><meta name="generator" content="MATLAB 7.10"><meta name="date" content="2010-08-30"><meta name="m-file" content="TTtbx_gs_top"><style type="text/css">

body {
  background-color: white;
  margin:10px;
}

h1 {
  color: #990000; 
  font-size: x-large;
}

h2 {
  color: #990000;
  font-size: medium;
}

/* Make the text shrink to fit narrow windows, but not stretch too far in 
wide windows. */ 
p,h1,h2,div.content div {
  max-width: 600px;
  /* Hack for IE6 */
  width: auto !important; width: 600px;
}

pre.codeinput {
  background: #EEEEEE;
  padding: 10px;
}
@media print {
  pre.codeinput {word-wrap:break-word; width:100%;}
} 

span.keyword {color: #0000FF}
span.comment {color: #228B22}
span.string {color: #A020F0}
span.untermstring {color: #B20000}
span.syscmd {color: #B28C00}

pre.codeoutput {
  color: #666666;
  padding: 10px;
}

pre.error {
  color: red;
}

p.footer {
  text-align: right;
  font-size: xx-small;
  font-weight: lighter;
  font-style: italic;
  color: gray;
}

  </style></head><body><div class="content"><h1>Table Toolbox</h1><p><b>Available Documentation</b></p><div><ul><li><a href="upslope_release_notes.html">Release Notes</a></li><li><a href="upslope_features.html">Features</a></li><li><a href="upslope_getting_started.html">Getting Started</a></li><li><a href="upslope_user_guide.html">User Guide</a></li><li><a href="upslope_functions_by_cat.html">Function Reference</a></li></ul></div><p>Copyright 2010 Colin Eles</p><p class="footer"><br>
      Published with MATLAB&reg; 7.10<br></p></div><!--
##### SOURCE BEGIN #####
%% Table Toolbox
%
% *Available Documentation*
%
% * <upslope_release_notes.html Release Notes>
% * <upslope_features.html Features>
% * <upslope_getting_started.html Getting Started>
% * <upslope_user_guide.html User Guide>
% * <upslope_functions_by_cat.html Function Reference>
%
%
% Copyright 2010 Colin Eles

##### SOURCE END #####
--></body></html>
 No newline at end of file
Loading