Differences From Artifact [cb66a7f672]:

To Artifact [c2cc49d035]:


8
9
10
11
12
13
14



15
16
17
18
19
20

21
22
23








24
25

26








27








28
29
30



31



32








  ##### Model Transformation Tools #####
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Log$



  ##
  ###############################################################

system=$1
infile=${system}_abg.fig
outfile=${system}_cmp.txt


echo Creating ${outfile}









## Find names of all components
grep -v '\[[0-9]*:[0-9]*\]' ${infile}  |\

gawk '/:/ {print $NF}'  | \








sed 's/\\001//' | \








sort -u> ${outfile}

## Create cmp.txt files beneath this one



##mtt -q -u -l 1 ${system} sub sh # Create the list of subsystems



##sh ${system}_sub.sh "abg2cmp_fig2txt " " " # Create the comp files















>
>
>






>



>
>
>
>
>
>
>
>
|
|
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
|
|
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
8
9
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  ##### Model Transformation Tools #####
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Log$
  ## Revision 1.1  2002/12/01 14:54:39  gawthrop
  ## Replaces defunct abg2lbl_fig2txt
  ##
  ##
  ###############################################################

system=$1
infile=${system}_abg.fig
outfile=${system}_cmp.txt
date=`date`

echo Creating ${outfile}

header() {
    cat <<EOF
## List of components contained in system ${system}
## File ${outfile}
## Created by mtt on ${date}

EOF
}
get_valid_components()

{
gawk '
function modulo10(x) {
  return x-int(x/10)*10
    }
BEGIN{
  polyline = 2;
  text = 4;
  compound_object = 6;
  length_terminator=4;

}
{
  object = $1;
  zero_depth =  (modulo10($4)==0)&&(object==text);
  if (zero_depth) {
    print substr($NF,1,length($NF)-length_terminator)
  }
}' 

}

remove_port_labels() {
  grep -v '^\[.*\]$'
}

remove_junctions() {
  grep -v '^[01]$' 
} 

## Create header
header > ${outfile}

## Make list of components
get_valid_components < ${infile} |\
   remove_port_labels |\
   remove_junctions |\
   sort -u >> ${outfile}

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