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.17 2001/07/28 21:09:22 geraint +## Eliminated duplicate lines in type.sh. +## ## Revision 1.16 2001/07/26 04:07:28 gawthrop ## Changed a to w on open (Geraint's suggestion) ## Explictly close files ## ## Revision 1.15 2001/07/23 23:24:02 gawthrop @@ -152,13 +155,13 @@ mtt_header $1 type sh > $typefile # 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",'w'); + infofilenum = fopen("$infofile",'wt'); + errorfilenum = fopen("$errorfile",'wt'); + typefilenum = fopen("$typefile",'wt'); %Convert from acausal to causal bond graph in m-file form. system_name='$1'; port_bonds = []; 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.32 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## ## Revision 1.31 2001/07/13 04:54:04 geraint ## Branch merge: numerical-algebraic-solution back to main. ## ## Revision 1.30 2001/07/12 04:02:53 gawthrop ## Now fixes multiports for input and output as well as state @@ -163,15 +167,15 @@ # Use matrix manipulation to accomplish the transformation # This creates an ese file for every subsystem. $MATRIX << EOF > cbg2ese_m2r.log 2>mtt_error.txt infofile = "$infofile";; -infofilenum = fopen(infofile,"w"); +infofilenum = fopen(infofile,"wt"); structurefile = "$structurefile";; -structurefilenum = fopen(structurefile,"w"); +structurefilenum = fopen(structurefile,"wt"); deffile = "$1_def.r"; -deffilenum = fopen(deffile,"w"); +deffilenum = fopen(deffile,"wt"); system_name = "$1"; system_type = ""; system_cr = ""; system_args = ""; @@ -228,11 +232,11 @@ # echo Ny $Ny Nu $Nu Nx $Nx Nui $Nui Nuc $Nuc ## Definitions file octave -q < ${log} 2> ${err} <0 by if (N>0)&&(M>0) # Flipped ports exist +## ## Revision 1.3 1998/08/25 20:05:33 peterg ## Write flipped port info ## ## Revision 1.2 1998/08/25 06:21:19 peterg ## Just writes additional information; basic info from the abg structure. @@ -15,11 +18,11 @@ ## Initial revision ## ############################################################### - fid=fopen([system_name,"_cbg.m"], "w");# Open file + fid=fopen([system_name,"_cbg.m"], "wt");# Open file StatusFormat = " %s.%s.%s.status = %i;\n"; Bformat = " %s.bonds = [\n"; Iformat = " %s.%s.%s.connections(%i) = %i;\n"; Index: mttroot/mtt/bin/trans/m/write_ibg.m ================================================================== --- mttroot/mtt/bin/trans/m/write_ibg.m +++ mttroot/mtt/bin/trans/m/write_ibg.m @@ -1,10 +1,10 @@ ## -*-octave-*- function write_ibg(system_name,bonds); - fid = fopen([system_name,"_ibg.m"], "w"); + fid = fopen([system_name,"_ibg.m"], "wt"); [nbonds, junk] = size(struct_elements(bonds)); format_hc = " %s.bonds.bond%i.head.component\t= \"%s\";\n"; format_tc = " %s.bonds.bond%i.tail.component\t= \"%s\";\n"; format_hp = " %s.bonds.bond%i.head.ports\t= \"%s\";\n"; format_tp = " %s.bonds.bond%i.tail.ports\t= \"%s\";\n"; Index: mttroot/mtt/bin/trans/m/write_matrix.m ================================================================== --- mttroot/mtt/bin/trans/m/write_matrix.m +++ mttroot/mtt/bin/trans/m/write_matrix.m @@ -5,10 +5,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.7 2002/05/15 16:37:30 gawthrop +% %% Added third argument (file extension) +% %% % %% Revision 1.6 2000/12/27 16:06:17 peterg % %% *** empty log message *** % %% % %% Revision 1.5 1998/02/03 08:40:39 peterg % %% Fixed a horrible bug -- changed filename -> filenum @@ -31,11 +34,11 @@ if nargin<3 extn="m"; endif filename = sprintf("%s.%s", name, extn); -filenum = fopen(filename,'w'); +filenum = fopen(filename,'wt'); % Write the function m-file for the causal bond graph pc = '%'; fprintf(filenum, 'function data = %s\n', name); fprintf(filenum, '%s data = %s\n\n', pc, name); Index: mttroot/mtt/bin/trans/makesspar ================================================================== --- mttroot/mtt/bin/trans/makesspar +++ mttroot/mtt/bin/trans/makesspar @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 1998/02/09 14:13:39 peterg +## Put octave stuff to /dev/null +## ## Revision 1.2 1998/02/09 08:39:27 peterg ## Set inputs to zero as well. ## ## Revision 1.1 1998/02/06 15:53:49 peterg ## Initial revision @@ -32,11 +35,11 @@ cat $MTTPATH/trans/m/rcs_header.txt >> $1_sspar.r echo "% Set all states and inputs to zero" >> $1_sspar.r $MATRIX <> /dev/null -fnum=fopen("$1_sspar.r","a"); +fnum=fopen("$1_sspar.r","at"); [nx,ny,nu,nz,nyz] = $1_def; for i = 1:nx fprintf(fnum,"MTTX%i := 0;\n", i); Index: mttroot/mtt/bin/trans/rbg2abg_m ================================================================== --- mttroot/mtt/bin/trans/rbg2abg_m +++ mttroot/mtt/bin/trans/rbg2abg_m @@ -9,10 +9,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.20 2004/02/19 12:05:49 gawthrop +## Fix prob. when no bonds +## ## Revision 1.19 2002/04/28 18:55:03 geraint ## Fixed [ 549658 ] awk should be gawk. ## Replaced calls to awk with call to gawk. ## ## Revision 1.18 2001/03/30 15:13:58 gawthrop @@ -140,12 +143,12 @@ echo Creating ${abg_file} # Use matrix manipulation to accomplish the transformation $MATRIX > rbg2abg_m.log 2>mtt_error.txt << EOF name = '$1' - infofile = fopen('mtt_info.txt', 'w'); - errorfile = fopen('mtt_error.txt', 'w'); + infofile = fopen('mtt_info.txt', 'wt'); + errorfile = fopen('mtt_error.txt', 'wt'); %Convert from the fig version of the bonds to a structured version [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = $1_rbg [n_ports, junk] = size(port_list) Index: mttroot/mtt/bin/trans/rbg2ibg_m ================================================================== --- mttroot/mtt/bin/trans/rbg2ibg_m +++ mttroot/mtt/bin/trans/rbg2ibg_m @@ -32,12 +32,12 @@ echo Creating ${ibg} # Use matrix manipulation to accomplish the transformation ${MATRIX} > ${log} 2> ${err} <