Overview
Comment:Now puts space after header fields + writes _port.fig
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 06d82dcd1c4a628ab1053db77470e31f7628306bc0fb3b45ec150d0c54a3d6b3
User & Date: gawthrop@users.sourceforge.net on 2001-03-23 14:57:31
Other Links: branch diff | manifest | tags
Context
2001-03-23
14:58:16
Fixed cosmetic bugs -- component display check-in: dc4cb529ab user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:57:31
Now puts space after header fields + writes _port.fig check-in: 06d82dcd1c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:56:21
Now puts space after header fields + write _port.fig check-in: ab625cac44 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/awk/rbg_fig2m.awk from [754458c338] to [eaa48607db].

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.36  1999/11/19 04:00:26  peterg
## Changed a comment to be more accurate.
##
## Revision 1.35  1999/07/25 22:19:45  peterg
## Fixed bug with false objects when compound objects present.
## -- Reset object to 0 after processing text.
##







>
>
>
>
>







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

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.37  2000/09/14 08:43:32  peterg
## Add additional directional informatiuon to rbonds:
## 	cols 7-8 Arrow end directional bond
## 	cols 9-10 Arrow end directional bond
##
## Revision 1.36  1999/11/19 04:00:26  peterg
## Changed a comment to be more accurate.
##
## Revision 1.35  1999/07/25 22:19:45  peterg
## Fixed bug with false objects when compound objects present.
## -- Reset object to 0 after processing text.
##
475
476
477
478
479
480
481
482
483
484


485
486
487
488
489
490
491
492


493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516







517
518
519
520
521
522
523
    if (exact_match($1,data_symbol)) {
      field_1 = out_data_symbol
	}
    else {
      field_1 = $1
      }

    printf field_1   >> fig_file
      for (i=2; i<=NF; i++)
	printf(" %s", $i)  >> fig_file;


    printf("\n") >> fig_file
    }

# Header
  if ( NF<3 ) {
	printf("%s", $1)  >> head_file;
        for (i=2; i<=NF; i++)
	  printf(" %s", $i)  >> head_file;


    printf("\n") >> head_file
    }
# Bonds
  if (isa_bond) {

    #Replace the data_symbol
    if (exact_match($1,data_symbol)) {
      field_1 = out_data_symbol
	}
    else {
      field_1 = $1
	}

    printf field_1   >> bnd_file
      for (i=2; i<=NF; i++)
	printf(" %s", $i)  >> bnd_file;
    printf("\n") >> bnd_file
      }

# Components & ports
  if ( isa_component||isa_port ) {
        for (i=1; i<=NF; i++)
	printf(" %s", $i)  >> cmp_file;
    printf("\n") >> cmp_file







}
}

function process_fig() {
# Test for the fig format first line and data line
  data_line = (match($1,data_symbol)>0);
  first_line = (data_line==0)&&(NF>min_line_length);







|


>
>








>
>
|




















|
|
|
>
>
>
>
>
>
>







480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
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
    if (exact_match($1,data_symbol)) {
      field_1 = out_data_symbol
	}
    else {
      field_1 = $1
      }

    printf("%s",field_1)   >> fig_file
      for (i=2; i<=NF; i++)
	printf(" %s", $i)  >> fig_file;
    if (NF==1) 
	printf(" ")   >> fig_file; # Put space after header fields
    printf("\n") >> fig_file
    }

# Header
  if ( NF<3 ) {
	printf("%s", $1)  >> head_file;
        for (i=2; i<=NF; i++)
	  printf(" %s", $i)  >> head_file;
	if (NF==1) 
	    printf(" ")   >> head_file; # Put space after header fields
	printf("\n") >> head_file
    }
# Bonds
  if (isa_bond) {

    #Replace the data_symbol
    if (exact_match($1,data_symbol)) {
      field_1 = out_data_symbol
	}
    else {
      field_1 = $1
	}

    printf field_1   >> bnd_file
      for (i=2; i<=NF; i++)
	printf(" %s", $i)  >> bnd_file;
    printf("\n") >> bnd_file
      }

# Components & ports
  if ( isa_component||isa_port ) {
      for (i=1; i<=NF; i++)
	  printf(" %s", $i)  >> cmp_file;
      printf("\n") >> cmp_file
	  }

# Ports
  if ( isa_port_component ||isa_port) {
      for (i=1; i<=NF; i++)
	  printf(" %s", $i)  >> port_file;
      printf("\n") >> port_file
}
}

function process_fig() {
# Test for the fig format first line and data line
  data_line = (match($1,data_symbol)>0);
  first_line = (data_line==0)&&(NF>min_line_length);
562
563
564
565
566
567
568

569
570
571
572
573
574
575
  sys_name = ARGV[1];
  delete ARGV[1];

  b_file = sprintf("%s_rbg.m", sys_name);
  c_file = sprintf("%s_cmp.m", sys_name);
  fig_file = sprintf("%s_fig.fig", sys_name);
  cmp_file = sprintf("%s_cmp.fig", sys_name);

  bnd_file = sprintf("%s_bnd.fig", sys_name); 
  head_file = sprintf("%s_head.fig", sys_name);

  warning_f = "WARNING %s \t in fig file but not lbl file  - using\n";
  warning_l = "WARNING %s \t in lbl file but not fig file  - ignoring\n";
  warning_p = "ERROR system ports are not consecutively numbered\n";
  warning_u = "ERROR %s has already appeared in the fig file\n";







>







578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
  sys_name = ARGV[1];
  delete ARGV[1];

  b_file = sprintf("%s_rbg.m", sys_name);
  c_file = sprintf("%s_cmp.m", sys_name);
  fig_file = sprintf("%s_fig.fig", sys_name);
  cmp_file = sprintf("%s_cmp.fig", sys_name);
  port_file = sprintf("%s_port.fig", sys_name);
  bnd_file = sprintf("%s_bnd.fig", sys_name); 
  head_file = sprintf("%s_head.fig", sys_name);

  warning_f = "WARNING %s \t in fig file but not lbl file  - using\n";
  warning_l = "WARNING %s \t in lbl file but not fig file  - ignoring\n";
  warning_p = "ERROR system ports are not consecutively numbered\n";
  warning_u = "ERROR %s has already appeared in the fig file\n";


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