Overview
Comment:Changed a to w on open (Geraint's suggestion)
Explictly close files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 26121c61ecc843931c3045707235f90698acf8b9c1fa11ac4838806adebe8176
User & Date: gawthrop@users.sourceforge.net on 2001-07-26 04:07:28
Other Links: branch diff | manifest | tags
Context
2001-07-26
04:08:35
Removed lines deleting _type.sh and cbg.m
-- how did they get there ??
check-in: b7154ccc2d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
04:07:28
Changed a to w on open (Geraint's suggestion)
Explictly close files
check-in: 26121c61ec user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-07-25
06:27:08
Fixed mistake in computing entropy flow check-in: ce00f2811f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/abg2cbg_m from [3f77bd1eca] to [d479e4b728].

9
10
11
12
13
14
15



16
17
18
19
20
21
22
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## 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 ***
##
## Revision 1.12  1998/07/10 08:43:46  peterg







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## 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 ***
##
## Revision 1.12  1998/07/10 08:43:46  peterg
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162





163


164
165
166
167
168
169
170
171
172
173
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",'a');

  %Convert from acausal to causal bond graph in m-file form.
  system_name='$1';

  port_bonds = [];
  port_direction = [];
  port_status = [];
  [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ...
      $derivative,typefilenum, infofilenum, errorfilenum);






EOF



if [ "$info" = "info" ]; then
  cat $infofile
fi

# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt 

# Print errors, if any.
mtt_error mtt_error.txt








|










>
>
>
>
>

>
>










148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
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');

  %Convert from acausal to causal bond graph in m-file form.
  system_name='$1';

  port_bonds = [];
  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

# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt 

# Print errors, if any.
mtt_error mtt_error.txt


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]