Index: mttroot/mtt/bin/trans/abg2cbg_m ================================================================== --- mttroot/mtt/bin/trans/abg2cbg_m +++ mttroot/mtt/bin/trans/abg2cbg_m @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.5 1996/08/19 15:38:31 peter +## Removed bug work round. +## ## Revision 1.4 1996/08/16 14:28:45 peter ## Some debugging lines removed. ## ## Revision 1.3 1996/08/08 18:06:55 peter ## Unified naming scheme. @@ -91,11 +94,11 @@ #Inform user echo Creating $1_cbg.m # Use matrix manipulation to accomplish the transformation -$MATRIX >abg2cbg_m.log 2>>abg2cbg_m.log << EOF +$MATRIX >abg2cbg_m.log 2>mtt_error << EOF infofile= '$infofile'; %Convert from acausal to causal bond graph in m-file form. system_name = '$1'; @@ -107,9 +110,23 @@ [cbonds,status] = abg2cbg(system_name, '', '', port_bonds,infofile); EOF cat mtt_info.txt + +# Test for errors and print if any +err_length=$(wc -c cbg2ese_m2r.log << EOF +$MATRIX > cbg2ese_m2r.log 2>mtt_error << EOF infofile = '$infofile' system_name = '$1' deffile = '$1_def.r'; @@ -54,8 +57,19 @@ makedef(structure,deffile); EOF cat $infofile + +# Test for errors and print if any +err_length=$(wc -c cbg_m2fig.log 2>> cbg_m2fig.log << EOF +$MATRIX > cbg_m2fig.log 2>mtt_error << EOF system_name = '$1'; thick = 3; length = 250; red = 4; blue = 1; green = 12; font = 18; cbg2fig(system_name, ... '', '', ... @@ -47,11 +50,21 @@ font, green, red); EOF cp $1_$1_cbg.fig $1_cbg.fig +# Test for errors and print if any +err_length=$(wc -c rbg2abg_m.log 2>>rbg2abg_m.log << EOF +$MATRIX > rbg2abg_m.log 2>mtt_err << EOF - warningfile = 'warning.txt'; + infofile = 'mtt_info.txt'; %Convert from the fig version of the bonds to a structured version [rbonds,rstrokes,rcomponents,rports,n_ports] = $1_rbg; - [bonds,components] = rbg2abg(rbonds,rstrokes,rcomponents,rports,warningfile); + [bonds,components] = rbg2abg(rbonds,rstrokes,rcomponents,rports,infofile); %Write the function m-file for the causal bond graph filename = '$1_abg.m'; c = '%'; fprintf(filename, 'function [bonds,components,n_ports] = $1_abg\n'); @@ -85,9 +87,23 @@ fprintf(filename, 'n_ports = %1.0f;\n', n_ports); EOF -cat warning.txt +touch mtt_info.txt +cat mtt_info.txt + +# Test for errors and print if any +err_length=$(wc -c