Differences From Artifact [3e21c7fb36]:

To Artifact [67d597485a]:


9
10
11
12
13
14
15



16
17
18
19
20
21
22
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.25  2001/10/15 14:27:00  gawthrop
## Now handles [1:N] style port labels
##
## Revision 1.24  2001/08/02 03:24:48  geraint
## Replaced mtt_version.sh with mtt_banner.sh - I think this was the intent.
##
## Revision 1.23  2001/07/26 04:08:35  gawthrop
## Removed lines deleting _type.sh and cbg.m
##  -- how did they get there ??
##
170
171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193
194
195
196
197
173
174
175
176
177
178
179

180
181
182
183
184
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200







-
+












-
+







}

create_lbl_body()
{

## Find names of all components
grep -v '\[[0-9]*:[0-9]*\]' $1_abg.fig  |\
awk '/:/ {print $NF}'  | \
gawk '/:/ {print $NF}'  | \
sed 's/\\001//' | \
sort | \
tee $1_raw_list | \
sort -u> $1_unique_raw_list


#Write out non-unique names
#echo 'Non-unique names (if any):'
#diff $1_unique_raw_list  $1_raw_list | grep '>' | sed 's/>/	/'

#Write out the outline lbl file
grep -v  '\[[0-9]*\]'  $1_unique_raw_list | \
awk --field-separator ':' '
gawk --field-separator ':' '
 BEGIN {
    OldComponent="None";
    default_cr = "lin";
 }
 { 
  Component = $1;
  Name = $2;
301
302
303
304
305
306
307
308

309
310
311
312
313
314
315
304
305
306
307
308
309
310

311
312
313
314
315
316
317
318







-
+







create_arg_aliases()
{
cat <<EOF

## Argument aliases
EOF
abg2sympar_m2txt ${system} ${system} use_label_file |\
awk '{printf("#ALIAS\t$%i\t%s\n", ++i, $1)}'
gawk '{printf("#ALIAS\t$%i\t%s\n", ++i, $1)}'
}

## Main 

create_lbl_body $1> $1_lbl.txt
create_arg_aliases > mtt_args.txt # using $1_lbl.txt
mv $1_lbl.txt mtt_junk_lbl.txt

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