Overview
Comment:More error handling.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 166d2c8e7a26daafa47866ba6fad8f834ce307532fd05344d8a4027581cab414
User & Date: gawthrop@users.sourceforge.net on 1996-08-25 09:31:49.000
Other Links: branch diff | manifest | tags
Context
1996-08-25
09:52:20
Initial revision check-in: d56a1e85e7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:31:49
More error handling. check-in: 166d2c8e7a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:22:55
# Print errors, if any.
mtt_error error.txt
check-in: 3414ab4b1b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
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.6  1996/08/24 14:36:01  peter
## Error handling included.
##
## Revision 1.5  1996/08/19 15:38:31  peter
## Removed bug work round.
##
## Revision 1.4  1996/08/16 14:28:45  peter







>
>
>
>







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

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.7  1996/08/25 09:22:55  peter
## # Print errors, if any.
## mtt_error error.txt
##
## Revision 1.6  1996/08/24 14:36:01  peter
## Error handling included.
##
## Revision 1.5  1996/08/19 15:38:31  peter
## Removed bug work round.
##
## Revision 1.4  1996/08/16 14:28:45  peter
112
113
114
115
116
117
118
119
120
121
122
  port_bonds = [];
  [cbonds,status] = abg2cbg(system_name, '', '', port_bonds,infofile);

EOF

cat mtt_info.txt

cp $1_$1_cbg.m $1_cbg.m 

# Print errors, if any.
mtt_error error.txt







|


|
116
117
118
119
120
121
122
123
124
125
126
  port_bonds = [];
  [cbonds,status] = abg2cbg(system_name, '', '', port_bonds,infofile);

EOF

cat mtt_info.txt

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

# Print errors, if any.
mtt_error mtt_error.txt
14
15
16
17
18
19
20



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (c) P.J.Gawthrop, 1996.

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



## Revision 1.2  1996/08/08 18:07:31  peter
## Sorted out naming scheme for files
##
## Revision 1.1  1996/08/05 20:13:56  peter
## Initial revision
##
###############################################################


# Remove the old log file
rm -f cbg_m2fig.log
rm -f mtt_info.txt

# The following sets up the fig header file for the system
# and each sub system.

ls $1_*_cbg.m | sed 's/\(.*_\)\(.*_\)cbg.m/cp \2fig.fig \1\2cbg.fig/' | sh



#Inform user
echo Creating $1_cbg.fig

# Use  matrix manipulation to accomplish the transformation
$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, ...
          '', '', ...
          length, thick, blue, ...
          font, green, red);
EOF

cp $1_$1_cbg.fig $1_cbg.fig

# 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













>
>
>















>
|
>






|









|

|
<
<
<
<
|
<
<
<
<
<





14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60




61





62
63
64
65
66
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3  1996/08/24 14:40:31  peter
## Error handling included.
##
## Revision 1.2  1996/08/08 18:07:31  peter
## Sorted out naming scheme for files
##
## Revision 1.1  1996/08/05 20:13:56  peter
## Initial revision
##
###############################################################


# Remove the old log file
rm -f cbg_m2fig.log
rm -f mtt_info.txt

# The following sets up the fig header file for the system
# and each sub system.
(ls $1_*_cbg.m \
| sed 's/\(.*_\)\(.*_\)cbg.m/cp \2fig.fig \1\2cbg.fig/' \
| sh ) 2>mtt_error.txt


#Inform user
echo Creating $1_cbg.fig

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

  system_name = '$1';
  thick = 3; length = 250; red = 4; blue = 1; green = 12; font = 18;
  cbg2fig(system_name, ...
          '', '', ...
          length, thick, blue, ...
          font, green, red);
EOF

cp $1_$1_cbg.fig $1_cbg.fig 2>> mtt_error.txt

# Print errors, if any.




mtt_error mtt_error.txt











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