Index: mttroot/mtt/bin/trans/cbg2sese_m2r ================================================================== --- mttroot/mtt/bin/trans/cbg2sese_m2r +++ mttroot/mtt/bin/trans/cbg2sese_m2r @@ -7,10 +7,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ + ## Revision 1.1 2003/03/13 15:44:53 gawthrop + ## The main transformation for sorted elementary equations + ## ## Revision 1.3 2003/03/13 09:00:22 peterg ## Revised for new mtt_component_eqn arg list ## ## Revision 1.2 2003/03/11 10:16:03 peterg ## Removed NAME argument @@ -22,11 +25,22 @@ ############################################################### ## cbg2seqn_m2r: Converts causal bond graph into sorted equations ## Copyright (C) 2003 by Peter J. Gawthrop +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done +infofile='mtt_info.txt'; strucfile=$1_struc.txt outfile=$1_sese.r make=mtt_make_sese.m CD='%%%% =====' ## Inform user @@ -70,11 +84,11 @@ create_octave() { gawk '{ if ($1==which) { printf("printf(\"\\n%s The %s equation for %s\");\n", CD, $1, $4); printf("[known] = mtt_component_eqn\\\n"); - printf("(\"%s\",1,mtt_other_causality(\"%s\"),known);\n", $4, $6); + printf("(\"%s\",1,mtt_other_causality(\"%s\"),known,\"\",\"\");\n", $4, $6); } }' "CD=${CD}" which=$1 < ${strucfile} } create_octave_header() { @@ -122,5 +136,11 @@ done cat<> ${outfile} END; EOF + +## Print info + +if [ "$info" = "info" ]; then + cat $infofile +fi