Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.4 2000/10/14 06:49:31 peterg +## Make parameter listing representation dependent +## ## Revision 1.3 2000/10/11 08:59:15 peterg ## Added csex rep ## ## Revision 1.2 2000/10/11 08:01:42 peterg ## Added noglobal fudge @@ -25,13 +28,13 @@ # Arguments system=$1 rep=$2 language=$3 -args=$4 -output=$5 -extras=$6 +#args=$4 +#output=$5 +#extras=$6 # Find system constants Nx=`mtt_getsize $system x` # States Nxx=`mtt_getsize $system xx` # States x States Nu=`mtt_getsize $system u` # Inputs @@ -38,70 +41,116 @@ Ny=`mtt_getsize $system y` # Outputs Nyz=`mtt_getsize $system yz` # Zero outputs Npar=`wc -l $system\_sympar.txt | awk '{print $1}'` # Representation-specific stuff + +eqnargs='mttx,mttu,mttt,mttpar' case $rep in cse) states=yes; inputs=yes; parameters=yes; + output='mttedx,mtte' + args=$eqnargs ;; csex) states=yes; inputs=yes; parameters=yes; + output=mttedx + args=$eqnargs ;; cseo) states=yes; inputs=yes; parameters=yes; + output=mtty + args=$eqnargs ;; - ode) - states=yes; - inputs=yes; - parameters=yes; + input) + states=no; + inputs=no; + parameters=no; + output=mttu + args='x,y,t,par' ;; numpar) states=no; inputs=no; parameters=no; + output='mttpar' + + ;; + ode) + states=yes; + inputs=yes; + parameters=yes; + output='mttdx' + args=$eqnargs ;; odeo) states=yes; inputs=yes; parameters=yes; + output='mtty' + args=$eqnargs + ;; + simpar) + states=no; + inputs=no; + parameters=no; + output=mttsimpar ;; sm) states=no; inputs=no; parameters=yes; + output='mtta,mttb,mttc,mttd' + args=mttpar + ;; + state) + states=no; + inputs=no; + parameters=yes; + output=mttx + args=mttpar ;; *) - + echo Representation $rep not supported - sorry; exit 1 esac + +## Sort out parentheses +if [ -n "$args" ]; then + Args='('$args')' +fi +if [ -n "$output" ]; then + Output="[$output] = " +fi + + # Lanuage specific stuff case $language in m) - modeline='% -*-octave-*- Put Emacs into octave-mode%'; + modeline='## -*-octave-*- Put Emacs into octave-mode ##'; ext='m'; Lc='##'; Rc=''; Lb='('; Rb=')'; function="function" - declaration="[$output] = $1_$rep($args);" + declaration="$Output$1_$rep$Args;" noglobals=true; # Fudge to make mtt_m2p work + start='## BEGIN Code' ;; *) echo Language $language not supported - sorry; exit 1 esac # Header information cat<