Overview
Comment:General error handling.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 6480812feb34d783f5c299fc5b7f1c8fbf60445533c87644fc7e13939eb0ac4f
User & Date: gawthrop@users.sourceforge.net on 1996-08-25 09:20:32
Other Links: branch diff | manifest | tags
Context
1996-08-25
09:22:55
# Print errors, if any.
mtt_error error.txt
check-in: 3414ab4b1b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:20:32
General error handling. check-in: 6480812feb user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:20:00
Initial revision check-in: 643c8906da user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/rbg2abg_m from [9b1306de36] to [ccbe128fab].

1
2
3
4
5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.3  1996/08/24 14:58:56  peter
## Fixed missprint - mtt_err --> mtt_error
##
## Revision 1.2  1996/08/24 14:33:07  peter
## Error handling included.
##
## Revision 1.1  1996/08/05 12:22:16  peter













>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4  1996/08/24 17:57:41  peter
## Removed `touch mtt_info.txt'
##
## Revision 1.3  1996/08/24 14:58:56  peter
## Fixed missprint - mtt_err --> mtt_error
##
## Revision 1.2  1996/08/24 14:33:07  peter
## Error handling included.
##
## Revision 1.1  1996/08/05 12:22:16  peter
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
rm -f rbg2abg_m.log
rm -f $1_abg.m

#Inform user
echo Creating $1_abg.m

# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log  2>mtt_error << EOF

  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,infofile);

  %Write the function m-file for the causal bond graph







|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
rm -f rbg2abg_m.log
rm -f $1_abg.m

#Inform user
echo Creating $1_abg.m

# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log  2>mtt_error.txt << EOF

  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,infofile);

  %Write the function m-file for the causal bond graph
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  mat2mfile(components, 'components', filename);
  fprintf(filename, 'n_ports = %1.0f;\n', n_ports);

EOF

cat mtt_info.txt

# Test for errors and print if any
err_length=$(wc -c <mtt_error)
if [ $err_length != "0" ]
then
  echo MTT has failed with the following errors '...'
  cat mtt_error
  exit 1
else
  exit 0
fi












<
<
<
<
<
|
|
<
<
<





95
96
97
98
99
100
101





102
103



104
105
106
107
108
  mat2mfile(components, 'components', filename);
  fprintf(filename, 'n_ports = %1.0f;\n', n_ports);

EOF

cat mtt_info.txt






mtt_error mtt_error.txt










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