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 2001/06/11 15:06:58 gawthrop
## Now handles user-defined components
##
## Revision 1.13 2001/06/04 08:13:37 gawthrop
## Various changes to support PPP
##
## Revision 1.12 2001/05/08 15:18:10 gawthrop
|
>
>
>
|
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/06/11 16:53:49 gawthrop
## Now uses abg2sympar_m2txt to get the arguments
##
## Revision 1.14 2001/06/11 15:06:58 gawthrop
## Now handles user-defined components
##
## Revision 1.13 2001/06/04 08:13:37 gawthrop
## Various changes to support PPP
##
## Revision 1.12 2001/05/08 15:18:10 gawthrop
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# Remove the old log file
rm -f abg2lbl_fig2txt.log
rm -f $1_cbg.m
rm -f $typefile
rm -f $infofile
rm -f mtt_junk*
#Inform user
if [ -n "$sensitivity" ]; then
echo "Creating $1_lbl.txt (sensitivity version)"
else
echo "Creating $1_lbl.txt"
fi
( \
|
|
>
>
>
>
>
>
>
>
>
>
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
# Remove the old log file
rm -f abg2lbl_fig2txt.log
rm -f $1_cbg.m
rm -f $typefile
rm -f $infofile
rm -f mtt_junk*
## Create lbl files beneath this one
mtt -q -u -l 1 $1 sub sh # Create the list
sh $1_sub.sh "abg2lbl_fig2txt "
if [ -f "$1_lbl.txt" ]; then
##echo "$1_lbl.txt exists in `pwd` - no action taken"
exit
##else
##echo "$1_lbl.txt dosn not exist in `pwd` "
fi
#Inform user
if [ -n "$sensitivity" ]; then
echo "Creating $1_lbl.txt (sensitivity version)"
else
echo "Creating $1_lbl.txt"
fi
( \
|
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
awk --field-separator ':' '
BEGIN {
OldComponent="None";
}
{
Component = $1;
Name = $2;
##Aliases
if (Component == "SS") {
port_alias[++j] = Name;
}
else {
alias[++i] = Name;
if (length(sensitivity)>0) {
|
>
>
|
|
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
awk --field-separator ':' '
BEGIN {
OldComponent="None";
}
{
Component = $1;
Name = $2;
name = Name;
gsub(/[()-+*/]/,"",name); # Remove maths
##Aliases
if (Component == "SS") {
port_alias[++j] = Name;
}
else {
alias[++i] = Name;
if (length(sensitivity)>0) {
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg);
## Heading
if (Component !~ OldComponent) print "\n% Component type", Component
## Component
printf("\t%s\t", Name);
if (Component in cr)
printf("%s\t\t", cr[Component])
else
printf("none\t\t");
if (Component in arg)
printf("%s\t\t\n", arg[Component])
|
|
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg);
## Heading
if (Component !~ OldComponent) print "\n% Component type", Component
## Component
printf("\t%s\t", name);
if (Component in cr)
printf("%s\t\t", cr[Component])
else
printf("none\t\t");
if (Component in arg)
printf("%s\t\t\n", arg[Component])
|