1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: mtt
# Usage: mtt system_name representation_name
# E.g.:
# mtt dc mtf
# converts dc to matlab transfer function form.
#
# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.19 1996/08/19 15:33:22 peter
## Included new state matric (sm) rep.
## Generate step response (sr) from sm.
##
## Revision 1.18 1996/08/19 13:30:54 peter
## New CLEAN target.
##
|
<
<
<
<
<
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: mtt
# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.20 1996/08/20 08:24:53 peter
## Now with version control.
##
## Revision 1.19 1996/08/19 15:33:22 peter
## Included new state matric (sm) rep.
## Generate step response (sr) from sm.
##
## Revision 1.18 1996/08/19 13:30:54 peter
## New CLEAN target.
##
|
︙ | | | ︙ | |
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
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
if [ "$1" = "" ]; then
echo 'Usage: mtt info'
echo ' mtt warranty'
echo ' mtt system_name clean'
echo ' mtt system_name representation vc'
echo ' mtt system_name representation language'
echo ' mtt system_name representation language parameters'
exit
fi
if [ "$1" = "info" ] && [$2 = ""]; then
info -f $MTTPATH/../doc/mtt.info
exit
fi
if [ "$1" = "warranty" ] && [$2 = ""]; then
cat << EOF
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995,1996 Peter J. Gawthrop
This is free software with ABSOLUTELY NO WARRANTY.
|
|
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
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
if [ "$1" = "" ]; then
echo 'Usage: mtt help'
echo ' mtt info'
echo ' mtt info topic'
echo ' mtt manual'
echo ' mtt warranty'
echo ' mtt clean'
echo ' mtt system_name clean'
echo ' mtt system_name representation vc'
echo ' mtt system_name representation language'
echo ' mtt system_name representation language parameters'
exit
fi
if [ "$1" = "info" ] && [ "$3" = "" ]; then
echo Invoking info
info -f $MTTPATH/../doc/mtt.info $2
exit
fi
if [ "$1" = "hinfo" ] && [$2 = ""]; then
echo Invoking $HTMLVIEW
(cd $MTTPATH/../doc; $HTMLVIEW ./mtt.html)&
exit
fi
if [ "$1" = "manual" ] && [$2 = ""]; then
echo Invoking $DVIVIEW
$DVIVIEW $MTTPATH/../doc/mtt.dvi &
exit
fi
if [ "$1" = "warranty" ] && [$2 = ""]; then
cat << EOF
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995,1996 Peter J. Gawthrop
This is free software with ABSOLUTELY NO WARRANTY.
|
︙ | | | ︙ | |
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
along with this program. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
EOF
exit
fi
if [ "$2" = "clean" ]; then
echo 'Removing all generated files for system ' $1
rm -f *.log mtt_info.txt warning.txt
rm -f $1_abg.m $1_args.*
rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1_*cbg.* $1_ese.* $1_def.*
rm -f $1_dae*.* $1_cse.* $1_ode*.* $1_obs.* $1_rfe.* $1_ss.*
rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_*fr.*
rm -f $1_rep.*
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
along with this program. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
EOF
exit
fi
# Clean up
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
echo 'Removing all generated files for all systems'
rm -f *.log mtt_info.txt warning.txt
rm -f *_abg.m *_args.*
rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.*
rm -f *_dae*.* *_cse.* *_ode*.* *_obs.* *_rfe.* *_ss.*
rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_*fr.*
rm -f *_rep.*
exit
fi
# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
echo 'Removing all generated files for system ' $1
rm -f *.log mtt_info.txt warning.txt
rm -f $1_abg.m $1_args.*
rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1_*cbg.* $1_ese.* $1_def.*
rm -f $1_dae*.* $1_cse.* $1_ode*.* $1_obs.* $1_rfe.* $1_ss.*
rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_*fr.*
rm -f $1_rep.*
|
︙ | | | ︙ | |
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
# Save up the argument list in a file; but only if argument has changed
ARGS=$4;
cat > $1_args.new <<EOF
$ARGS
EOF
DIFF=$(diff -bq $1_args.m $1_args.new)
if [ -n "$DIFF" ]; then
mv $1_args.new $1_args.m
fi
# Classify the representation - needed for conversion route to postscript
case $2 in
|
|
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# Save up the argument list in a file; but only if argument has changed
ARGS=$4;
cat > $1_args.new <<EOF
$ARGS
EOF
DIFF=$(diff -bq $1_args.m $1_args.new 2>/dev/null)
if [ -n "$DIFF" ]; then
mv $1_args.new $1_args.m
fi
# Classify the representation - needed for conversion route to postscript
case $2 in
|
︙ | | | ︙ | |
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
REPTYPE='data' ;;
*)
REPTYPE='tex' ;;
esac
# Version control
if [ "$3" = "vc" ]; then
case $2 in
abg )
VC='ok'
VCext='fig' ;;
lbl )
VC='ok'
|
>
>
|
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
REPTYPE='data' ;;
*)
REPTYPE='tex' ;;
esac
# Version control
VC=''
if [ "$3" = "vc" ]; then
case $2 in
abg )
VC='ok'
VCext='fig' ;;
lbl )
VC='ok'
|
︙ | | | ︙ | |
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
|
ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.tview
endif
#View a ps file
$1_$2.pview: $1_$2.ps
echo Creating view of $1_$2
ghostview $1_$2.ps&
#View a gdat file
$1_$2.dview: $1_$2.gdat
echo Creating view of $1_$2
gdat2view $1_$2 '$ARGS'&
#View a tex file
$1_$2.tview: $1_$2.dvi
echo Creating view of $1_$2
xdvi $1_$2.dvi&
#Report generation
$1_rep.make: $1_rep.txt
rep_txt2make $1
$1_rep.tex: $1_rep.make $(cat $1_rep.make)
rep_txt2tex $1;
#$1_rep.make: $1_rep.tex
# touch $1_rep.make
#$1_rep.rep: $1_rep.make
# sh<$1_rep.make; cp $1_rep.tex $1_rep.doc
$1_rep.html: $1_rep.dvi
|
|
|
|
|
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.tview
endif
#View a ps file
$1_$2.pview: $1_$2.ps
echo Creating view of $1_$2
$PSVIEW $1_$2.ps&
#View a gdat file
$1_$2.dview: $1_$2.gdat
echo Creating view of $1_$2
gdat2view $1_$2 '$ARGS'&
#View a tex file
$1_$2.tview: $1_$2.dvi
echo Creating view of $1_$2
$DVIVIEW $1_$2.dvi&
#Report generation
$1_rep.make: $1_rep.txt
rep_txt2make $1
$1_rep.tex: $1_rep.make $(cat $1_rep.make 2>/dev/null)
rep_txt2tex $1;
#$1_rep.make: $1_rep.tex
# touch $1_rep.make
#$1_rep.rep: $1_rep.make
# sh<$1_rep.make; cp $1_rep.tex $1_rep.doc
$1_rep.html: $1_rep.dvi
|
︙ | | | ︙ | |