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.15 2001/07/23 23:24:02 gawthrop +## Now only writes to type.sh and cbg.m when causality is complete +## ## Revision 1.14 2000/12/28 12:16:13 peterg ## *** empty log message *** ## ## Revision 1.13 1998/07/27 20:30:12 peterg ## *** empty log message *** @@ -147,11 +150,11 @@ # Use matrix manipulation to accomplish the transformation $MATRIX << EOF >abg2cbg_m.log #2>mtt_error.txt infofilenum = fopen("$infofile",'w'); errorfilenum = fopen("$errorfile",'w'); - typefilenum = fopen("$typefile",'a'); + typefilenum = fopen("$typefile",'w'); %Convert from acausal to causal bond graph in m-file form. system_name='$1'; port_bonds = []; @@ -158,11 +161,18 @@ port_direction = []; port_status = []; [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ... $derivative,typefilenum, infofilenum, errorfilenum); + ## close the files + fclose(infofilenum); + fclose(errorfilenum); + fclose(typefilenum); + EOF + + if [ "$info" = "info" ]; then cat $infofile fi