Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -13,10 +13,14 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.296 2001/03/27 01:07:34 geraint +## Improved determination of Octave version for ode2odes.exe creation. +## Removed FORCE check_update of .txts. +## ## Revision 1.295 2001/03/23 11:21:29 gawthrop ## Show -pdf oprion in help list ## ## Revision 1.294 2001/03/19 02:28:52 geraint ## Branch merge: merging-ode2odes-exe back to MAIN. @@ -1379,10 +1383,11 @@ rm -f *_csex.cc *_numpar.cc *_smxa.cc *_state.cc rm -f *_ode.cc *_odeo.cc rm -f *_logic.m *_logic.cc *_logic.oct rm -f *_state.m *_state.cc *_state.oct rm -f *_ode2odes.* *.dat2 + rm -f *_modpar.txt *_modpar.r rm -fR *_rep MTT_work exit fi # Clean up named system @@ -1413,10 +1418,11 @@ rm -f $1_csex.cc $1_numpar.cc $1_smxa.cc $1_state.cc rm -f $1_ode.cc $1_odeo.cc rm -f $1_logic.m $1_logic.cc $1_logic.oct rm -f $1_state.m $1_state.cc $1_state.oct rm -f $1_ode2odes.* $1.dat2 + rm -f $1_modpar.txt $1_modpar.r rm -fR $1_rep MTT_work exit fi if [ "$2" = "rep" ]; then @@ -1921,10 +1927,18 @@ lbl_txt2tex $1 #SUMMARY alias name aliases for each subsystem (txt) $1_alias.txt: $1_lbl.txt lbl2alias_txt2txt $1 + +#SUMMARY modpar name modulated parameters for each subsystem (txt) +$1_modpar.txt: $1_lbl.txt + lbl2modpar_txt $1 + +#SUMMARY modpar name modulated parameters for each subsystem (r) +$1_modpar.r: $1_modpar.txt $1_struc.txt + modpar_txt2r $1 #SUMMARY alias name aliases for each subsystem (m) $1_alias.m: $1_alias.txt alias_txt2m $1 @@ -2290,15 +2304,16 @@ #SUMMARY dae differential-algebraic equations (tex) #SUMMARY dae* differential-algebraic equations (view) #SUMMARY dae differential-algebraic equations (ps) #Differential-algebraic equations -${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r +${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r $1_modpar.r ifneq ($partition,) echo Doing subsystems mtt_make_subsystems ${sys} rdae r endif + mv $1_ese.r mtt_junk; cat $1_modpar.r mtt_junk > $1_ese.r # Add modulated parameters to start ese2rdae_r ${Subsystem}; tidy ${Subsystem}_rdae.r ${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r ifneq ($partition,) echo Doing subsystems @@ -2828,12 +2843,12 @@ endif endif ifeq ($computation,c) $1_ode2odes.out: $1_ode2odes.c - echo Creating $1_odes.out - $CC $1_ode2odes.c -lp2c -lm -o $1_ode2odes.out + echo Creating $1_odes.out by compiling *.c + $CC *.c -lp2c -lm -o $1_ode2odes.out $1_odes.dat2: $1_ode2odes.out echo Creating $1_odes.dat2 using c version time ./$1_ode2odes.out>$1_odes.dat2 endif Index: mttroot/mtt/bin/trans/cbg2ese_m2r ================================================================== --- mttroot/mtt/bin/trans/cbg2ese_m2r +++ mttroot/mtt/bin/trans/cbg2ese_m2r @@ -14,10 +14,14 @@ ## Version control history ############################################################### ## $Id$ ## ## $Log$ +## Revision 1.28 2001/02/05 17:19:52 gawthrop +## Now gives unique names to the states of multiports. Second name +## onwards labeled with port number +## ## Revision 1.27 2000/12/05 12:09:56 peterg ## Changed function name to name() ## ## Revision 1.26 2000/12/05 09:04:54 peterg ## *** empty log message *** @@ -179,11 +183,11 @@ if [ -z "$partition" ]; then ## Don't partition # Create the composite ese file - cat $1_ese.r $1_*_ese.r > $1_ese.tmp 2>> /dev/null + cat $1_ese.r $1_*_ese.r $1_modpar.r > $1_ese.tmp 2>> /dev/null mv $1_ese.tmp $1_ese.r # Zap the sub ese files rm -f $1_*_ese.r ADDED mttroot/mtt/bin/trans/lbl2modpar_txt Index: mttroot/mtt/bin/trans/lbl2modpar_txt ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/lbl2modpar_txt @@ -0,0 +1,38 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2modpar_txt2txt +# Creates the component modpares in text form + +# Copyright (C) 2001 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $$Id$ +## $Log$ +############################################################### + +# Inform user +echo Creating $1_modpar.txt + +#Create the modpar file complete with headers. +echo "# Modpar file ($1_modpar.txt)" > $1_modpar.txt +echo "# Generated by MTT at `date`" >> $1_modpar.txt + +#Write out the variables +grep '[%|#]MODPAR' $1_lbl.txt |\ +awk '{printf("%s\t%s\n", $2,$3)}' >> $1_modpar.txt + +echo "# End of $1_modpar.txt" >> $1_modpar.txt + + + + + + + + Index: mttroot/mtt/bin/trans/mtt_p2c ================================================================== --- mttroot/mtt/bin/trans/mtt_p2c +++ mttroot/mtt/bin/trans/mtt_p2c @@ -14,10 +14,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.10 2000/09/15 09:01:41 peterg +## Updated internal comments +## ## Revision 1.9 2000/05/16 18:56:58 peterg ## Now realised that libp2c.a avoids many probs - so simplified it. ## ## Revision 1.8 2000/05/11 19:34:50 peterg ## *** empty log message *** @@ -78,10 +81,11 @@ /* C program $1_$2.c */ /* Generated by MTT on $DATE */ /* Compile with gcc -lm -lp2c $1_$2.c -o $1_$2.out */ /* Note that p2c must be correctly installed so that p2c.h and libp2c.a are accessible */ +#include "$1.h" EOF #cat<>$1_$2.c #/* The following is the header file included here for completeness */ #EOF @@ -103,6 +107,7 @@ if [ -n "$info" ]; then cat mtt_p2c.log fi - +# Remove the garbage +rm -f mtt_junk.c