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.10 2000/11/07 17:20:51 peterg +## useful-functions.hh now included locally +## ## Revision 1.9 2000/11/07 16:56:24 peterg ## Version from Geraint ## ## Revision 1.2 2000/11/03 00:55:42 geraint ## typo: missed out 'd' in mttedx @@ -50,10 +53,11 @@ # Arguments system=$1 rep=$2 language=$3 +fun_name=${1}_${2} #args=$4 #output=$5 #extras=$6 # Find system constants @@ -94,17 +98,20 @@ states=yes; inputs=no; parameters=yes; output=mttu args=$inputeqnargs + declareinputs=yes ;; logic) states=no; inputs=no; parameters=yes; - output=open + output=mttopen args=$eqnargs + declareinputs=yes + declarestates=yes ;; numpar) states=no; inputs=no; parameters=no; @@ -122,29 +129,51 @@ inputs=yes; parameters=yes; output='mtty' args=$eqnargs ;; + ode2odes) + states=no; + inputs=no; + parameters=no; + output='y,x,t' + args='x,par,simpar' + ;; simpar) states=no; inputs=no; parameters=no; - output='mttsimpar_map' + output='mttsimpar' ;; sm) states=no; inputs=no; parameters=yes; output='mtta,mttb,mttc,mttd' args=mttpar ;; + smxa) + states=no; + inputs=no; + parameters=yes; + output='mtta' + args=$eqnargs + ;; + smxax) + states=no; + inputs=no; + parameters=yes; + output='mttax' + args=$eqnargs + ;; state) states=no; inputs=no; parameters=yes; output=mttx args=mttpar + declarestates=yes ;; *) echo Representation $rep not supported - sorry; exit 1 esac @@ -167,10 +196,13 @@ function="function" declaration="$Output$1_$rep$Args;" noglobals=true; # Fudge to make mtt_m2p work start='## BEGIN Code' finish='## END Code' + var_declaration=$Lc + declarestates=no + declareinputs=no ;; txt) modeline='## -*-octave-*- Put Emacs into octave-mode ##'; Lc='##'; Rc=''; @@ -180,20 +212,90 @@ declaration="" start='' parameters=no states=no inputs=no + declarestates=no + declareinputs=no ;; oct) modeline="// -*-c++-*- Put Emacs into c++-mode"; Lc='//'; oct_header=yes; + constant_declaration="const double " + var_declaration="double " + minusone="-1" + map="_map" ;; *) echo Language $language not supported - sorry; exit 1 esac +if [ "$rep" = "simpar" ]; then + output=${output}${map} # Output is simpar_map in this case +fi + +function declare_vars(){ +# Grab the names +names=`awk '{if ($1==var_type) print tolower($4)}' var_type=$1 ${system}_struc.txt` + +# Comments +cat <