[kepler-dev] Checking model sizes and locations

Christopher Brooks cxh at eecs.berkeley.edu
Wed Mar 22 14:01:58 PST 2006


Hi Dan,

The way I check model sizes is by running
ptolemy.actor.gui.CheckModelSize, which was developed by 
Rowland Johnson.

Here's how to run it on one file: 

cxh at carson 104% $PTII/bin/ptinvoke ptolemy.actor.gui.CheckModelSize $PTII/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml
CheckModelSize: 0 /home/eecs/cxh/ptII/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml
<h1>Check Size</h1>
Below are the results from checking the sizes of and centering of models
<table>
<tr>
  <td><a href="/home/eecs/cxh/ptII/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml">/home/eecs/cxh/ptII/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml</a></td>
  <td> seems to be OK.</td>
</table>

cxh at carson 105% 


CheckModelSize will take multiple MoML files as command line
arguments.


Currently, the "about:copyright" page will also allow you to check the
sizes of the models.  

If you start up Ptolemy and click on the "Copyrights" link and then
at the bottom, follow "Other information about this configuration."
and then click on 
"Check the sizes/centering of the models"

The way this works is that ptolemy/actor/gui/HTMLAbout.java generates
the page that has the "Check the sizes/centering of the models" link,
which is a link to about:checkModelSized#file.html, where file.html is
a file that contains links to MoML models.  (for example,
ptolemy/configs/compleeteDemos.htm)

HTMLAbout contains a method called _getURLs() that when given an html 
file will return the model urls in that html file and optionally 
in html files referred to by the given file.

For example, introScientists.htm includes links to .htm files that
contain links to MoML files  calling _getURLs() on the 
introScientists file returns the all the models referred to by
introScientists and by the files that introScientists refers to.

We then pass those models to the CheckModelSize.checkModelSize()
method which returns html about what files are bogus.

So, if you create a file called $KEPLER/check.htm that has this
contents:

<head>
<title>Check the sizes</title>
</head>
<body>
<a href="configs/ptolemy/configs/kepler/introScientists.htm">Intro for
scientists</a>
<br>
<a href="about:checkModelSizes#configs/ptolemy/configs/kepler/introScientists.htm">Check
model sizes</a>
<a href="about:configuration">Expand the configuration by cloning</a>
<br>
<br>
<a href="about:demos#configs/ptolemy/configs/kepler/introScientists.htm">Check
demos</a>
</body>

and then open it within Kepler and click on the "Check model sizes"
link, then a window appears that lists the models and any problems.  I
just fixed a bug in ptolemy.actor.gui.CheckModelSizes and now the
links to the models work properly.  So, if you update Ptolemy, you can
then click on the links fix the models, save and rerun the check.

There are also about: tags that will expand a configuration.
The about:demos#foo.htm will open all the models in foo.htm.
This is not as useful for Kepler because introScientists.htm has
multiple levels of .htm files.  However, either you could create a
separate file that contains all the demos, like
$PTII/ptolemy/configs/doc/completeDemos.htm, or else modify the code.

Here is html that might work for these tests.  I have not tried it.
<br>
<a href="about:configuration">Expand the configuration by cloning</a>
<br>
<a
href="about:links#configs/ptolemy/configs/kepler/introScientists.htm">Check
links</a>
<a
href="about:demos#configs/ptolemy/configs/kepler/introScientists.htm">Check
demos</a>


The advantage of opening up all the demos is that it is a good way to
exercise the code and find missing classes.

Note that some messages appear on stdout about lsid problems when I
check the sizes.

_Christopher
 



More information about the Kepler-dev mailing list