︙ | | |
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
+
+
+
|
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.35 1996/11/02 10:19:19 peterg
## Constitutive Relationship generation from lbl file
##
## Revision 1.34 1996/11/01 13:34:35 peterg
## -q (quiet) switch added
##
## Revision 1.33 1996/11/01 12:34:45 peterg
## Added browser - mtt_help
##
## Revision 1.32 1996/10/31 20:48:41 peterg
|
︙ | | |
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
+
+
+
-
-
+
+
+
+
+
+
+
+
-
+
+
-
+
|
## Revision 1.2 1996/08/05 19:50:55 peter
## Put in fig.fig target.
##
## Revision 1.1 1996/08/04 17:29:42 peter
## Initial revision
##
###############################################################
# MTT recursion level is zero unless explicitly set
level=0
#Look for a command line argument
if [ -n "`echo $1 | grep '-'`" ]; then
arg=$1
while [ -n "`echo $1 | grep '-'`" ]; do
case $1 in
-q )
quiet=quiet ;;
-l )
level=$2; shift ;;
esac
shift
done
fi
echo $level
#Print header if not in quiet (-q) mode.
if [ "$arg" != "-q" ]; then
if [ "$quiet" != "quiet" ]; then
echo
echo 'MTT (Model Transformation Tools) version 2.0++'
echo 'This is free software with ABSOLUTELY NO WARRANTY.'
echo 'Type `mtt warranty'\' 'for details.'
echo
fi
|
︙ | | |
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
cat $MTTPATH/trans/m/rcs_header.txt; \
echo "%% Each line should be of one of the following forms:"; \
echo "% a comment (ie starting with %)"; \
echo "% Component-name CR_name arg1,arg2,..argn"; \
echo "% blank"; \
)> $1_lbl.txt
#REPRESENTATION cr constitutive relationship description (r)
$1_cr.r:
#REPRESENTATION cr constitutive relationship for each subsystem (r)
$1_cr.r: $1_sub.sh
lbl2cr_txt2r $1
if [ "$level" = "0" ]; then \
mv $1_cr.r MTT_cr.r; \
else \
echo >> MTT_cr.r; \
echo "%% CRs for subsystem $1" >> MTT_cr.r; \
cat $1_cr.r >> MTT_cr.r; \
fi
echo Creating subsystem cr files for system $1 ...; \
sh $1_sub.sh "mtt -q -l $level+1 " ' cr r'; \
echo Finished creating subsystem cr files for system $1; \
if [ "$level" = "0" ]; then \
mv MTT_cr.r $1_cr.r; \
echo 'END;' >> $1_cr.r; \
fi
#REPRESENTATION simp simplification information (r)
$1_simp.r:
echo Creating $1_simp.r
( \
echo "%% Reduce comands to simplify output for system $1 ($1_simp.r)"; \
cat $MTTPATH/trans/m/rcs_header.txt; \
|
︙ | | |
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
|
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
|
-
-
+
|
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt
lbl2sympar_txt2r $1
#REPRESENTATION abg acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
echo Creating subsystem abg files for system $1 ...
sh < $1_sub.sh
sh $1_sub.sh 'mtt -q ' ' abg m'
echo Finished creating subsystem abg files for system $1
rbg2abg_m $1
#REPRESENTATION cbg causal bond graph (m)
#Acausal bond graph to causal bond graph: mfile
$1_cbg.m: $1_abg.m
|
︙ | | |