10
11
12
13
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
|
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3 2001/10/15 14:27:34 gawthrop
## Now handles [1:N] style port labels
##
## Revision 1.2 2001/07/23 23:26:23 gawthrop
## Removed some boring user feedback
##
## Revision 1.1 2001/06/11 19:47:49 gawthrop
## Makes the sub.sh file directly from the abg.fig file
## Used for making lbl files (abg2lbl_fig2txt)
##
##
###############################################################
# Copyright (C) 1996--2002 by Peter J. Gawthrop
get_valid_components()
{
awk '
function modulo10(x) {
return x-int(x/10)*10
}
BEGIN{
polyline = 2;
text = 4;
compound_object = 6;
|
>
>
>
|
|
10
11
12
13
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
|
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4 2002/04/22 10:25:47 gawthrop
## Handles unnamed components & ingnores artwork
##
## Revision 1.3 2001/10/15 14:27:34 gawthrop
## Now handles [1:N] style port labels
##
## Revision 1.2 2001/07/23 23:26:23 gawthrop
## Removed some boring user feedback
##
## Revision 1.1 2001/06/11 19:47:49 gawthrop
## Makes the sub.sh file directly from the abg.fig file
## Used for making lbl files (abg2lbl_fig2txt)
##
##
###############################################################
# Copyright (C) 1996--2002 by Peter J. Gawthrop
get_valid_components()
{
gawk '
function modulo10(x) {
return x-int(x/10)*10
}
BEGIN{
polyline = 2;
text = 4;
compound_object = 6;
|
65
66
67
68
69
70
71
72
73
74
75
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
103
104
105
106
107
|
echo "# Generated by MTT on `date`." >> $1_sub.sh
echo >> $1_sub.sh
# Get a list of all components from the _abg file
get_valid_components $1 |\
grep -v '\[[0-9]*:[0-9]*\]' |\
grep -v '\[.*\]' |\
awk '{if ($1==4) split($14,a,":"); print a[1]}' |\
sed 's/\\001//' |\
sort -u > mtt_tmp1
# Remove all components starting with 0 or 1
grep -v '^[01]' < mtt_tmp1 > mtt_tmp4
# Get a list of all standard simple components
ls $MTT_LIB/comp/simple |\
awk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2
# Get a list of all standard compound components
#ls $MTTPATH/comp/compound |\
# awk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2
# Sorted combined list
cat mtt_tmp2 | \
sed 's/^zero$/0/' |\
sed 's/^one$/1/' |\
sort -u >mtt_tmp3
# Print the non-standard components
comm mtt_tmp4 mtt_tmp3 |\
awk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \
>>$1_sub.sh
# Clean up mtt_tmp files
#rm -f mtt_tmp?
|
|
|
|
|
|
68
69
70
71
72
73
74
75
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
103
104
105
106
107
108
109
110
|
echo "# Generated by MTT on `date`." >> $1_sub.sh
echo >> $1_sub.sh
# Get a list of all components from the _abg file
get_valid_components $1 |\
grep -v '\[[0-9]*:[0-9]*\]' |\
grep -v '\[.*\]' |\
gawk '{if ($1==4) split($14,a,":"); print a[1]}' |\
sed 's/\\001//' |\
sort -u > mtt_tmp1
# Remove all components starting with 0 or 1
grep -v '^[01]' < mtt_tmp1 > mtt_tmp4
# Get a list of all standard simple components
ls $MTT_LIB/comp/simple |\
gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2
# Get a list of all standard compound components
#ls $MTTPATH/comp/compound |\
# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2
# Sorted combined list
cat mtt_tmp2 | \
sed 's/^zero$/0/' |\
sed 's/^one$/1/' |\
sort -u >mtt_tmp3
# Print the non-standard components
comm mtt_tmp4 mtt_tmp3 |\
gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \
>>$1_sub.sh
# Clean up mtt_tmp files
#rm -f mtt_tmp?
|