Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -15,10 +15,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.413 2005/11/16 00:43:15 geraint +## rtxi +## ## Revision 1.412 2005/09/29 13:46:25 gawthrop ## Converts labg.fig -> ps/eps correctly (using fig2ps) ## ## Revision 1.411 2005/03/15 15:03:28 gawthrop ## Now works for Hierarchical systems @@ -3359,11 +3362,11 @@ ${MTT_MATLAB_FLAGS} ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} \ ${MTT_LIB}/cc/mtt_kpathsea.cc ${MTT_LIB}/cc/mtt_matlab_octave.cc $1_ode2odes_rtxi.o: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ $1_rtxi.cc $1_rtxi.h - echo Creating $1_ode2odes_rtxi.o + @echo "Creating \$@" ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} ${MTT_RTXI_FLAGS} -c $1_ode2odes.cc -DCODEGENTARGET=RTXI -o \$@ $1_ode2odes.cc: $1_def.r $1_sympars.txt\ $1_ode2odes_common_m.stamp $1_ode2odes_common_cc.stamp\ $1_ode2odes_${integration_method}_m.stamp $1_ode2odes_${integration_method}_cc.stamp\ @@ -3370,12 +3373,19 @@ mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.cc mtt_${algebraic_solver}.hh touch $1_ode2odes.m make_ode2odes $1 cc $integration_method $algebraic_solver $sort_method #SUMMARY rtxi real time module (cc) -#$1_rtxi.o: $1_rtxi.cc $1_rtxi.h -# ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c \$^ +#SUMMARY rtxi real time module (o) +#SUMMARY rtxi real time module (so) +$1_rtxi.so: $1_rtxi.o $1_ode2odes_rtxi.o + @echo "Creating \$@" + ar -cr \$@ \$^ + +$1_rtxi.o: $1_rtxi.cc $1_rtxi.h + @echo Creating \$@ + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} ${MTT_RTXI_FLAGS} -c \$< -o \$@ $1_rtxi.cc: $1_struc.txt $1_sympar.txt echo Creating \$@ sympar2rtxi_txt2cc $1 Index: mttroot/mtt/bin/trans/sympar2rtxi_txt2cc ================================================================== --- mttroot/mtt/bin/trans/sympar2rtxi_txt2cc +++ mttroot/mtt/bin/trans/sympar2rtxi_txt2cc @@ -55,20 +55,40 @@ cat <> ${RTXI_CC} }; static size_t num_vars = sizeof(vars)/sizeof(DefaultGUIModel::variable_t); // TODO: initialise from numpar +static double EOF gawk ' - BEGIN { printf("static double\n"); } - { printf(" %s=0.0,\n", $1); } - END {printf(" ;\n"); } -' $sympar >> ${RTXI_CC} + { printf(" %s=0.0,", $1); } + END { printf ";" } +' $sympar |\ + sed -e 's/,;/;\n/' |\ + sed -e 's/,/,\n/' >> ${RTXI_CC} cat <> ${RTXI_CC} static long i_count = 0; + +${sys}::${sys}(void) + : DefaultGUIModel("${sys}",::vars,::num_vars), +EOF + +gawk ' + { printf(" %s(0.0),", $1); } + END { printf ";" } +' $sympar |\ + sed -e 's/,;/\n/' |\ + sed -e 's/,/,\n/' >> ${RTXI_CC} + + +cat <> ${RTXI_CC} +{ + doUpdate(INIT); + refresh(); +} ${sys}::~${sys}(void) {} // ${sys}::execute(void) is defined in ${sys}_ode2odes.cc