Differences From Artifact [b9d77f2ccd]:

To Artifact [fb6f8561fe]:


8
9
10
11
12
13
14








15
16
17
18
19
20
21
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$








## Revision 1.45  2004/04/07 12:17:43  gawthrop
## Handles new Fig header line.
##
## Revision 1.44  2002/05/25 09:23:47  gawthrop
## Self-naming components: name is mttTYPE or mttTYPE_2 ...
##
## Revision 1.43  2002/05/22 10:33:18  gawthrop







>
>
>
>
>
>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.46  2004/08/04 19:46:42  geraint
## Sorts components alphabetically (type:name) within the categories:
## internal ports, components, 0 junctions and 1 junctions.
##
## Standardising the order in which components are listed allows models
## built with different editors to interact correctly by separating the
## graphical information from the data which is required to build models.
##
## Revision 1.45  2004/04/07 12:17:43  gawthrop
## Handles new Fig header line.
##
## Revision 1.44  2002/05/25 09:23:47  gawthrop
## Self-naming components: name is mttTYPE or mttTYPE_2 ...
##
## Revision 1.43  2002/05/22 10:33:18  gawthrop
283
284
285
286
287
288
289





290


291
292
293
294
295
296
297
function sort_cmp() {
# Sorts components alphabetically by type then name
  for (i = 1; i <= i_label; i++) {
    name = label[i,1];
    type = comp_type[name];
    cmp_list[i] = sprintf ("'%s:%s'", type, name);
  }





  asort (cmp_list);


  for (i = 1; i <= i_label; i++) {
    for (j = 1; j <= i_label; j++) {
      name = label[j,1];
      type = comp_type[name];
      typename = sprintf ("'%s:%s'", type, name);
      if (typename == cmp_list[i]) {
	sort_cmp_list[i] = j;







>
>
>
>
>
|
>
>







291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
function sort_cmp() {
# Sorts components alphabetically by type then name
  for (i = 1; i <= i_label; i++) {
    name = label[i,1];
    type = comp_type[name];
    cmp_list[i] = sprintf ("'%s:%s'", type, name);
  }

  if (no_alpha_sort=="no_alpha_sort")
      print "Not sorting components alphabetically"
  else {
      print "Sorting components alphabetically";
      asort (cmp_list)
  };

  for (i = 1; i <= i_label; i++) {
    for (j = 1; j <= i_label; j++) {
      name = label[j,1];
      type = comp_type[name];
      typename = sprintf ("'%s:%s'", type, name);
      if (typename == cmp_list[i]) {
	sort_cmp_list[i] = j;

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