Overview
Comment:Fixed bug with false objects when compound objects present.
-- Reset object to 0 after processing text.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 86ec1b07921d490e364e40798187646984229cb60fef1a574b83dc2e3506f22e
User & Date: gawthrop@users.sourceforge.net on 1999-07-25 22:19:45
Other Links: branch diff | manifest | tags
Context
1999-07-25
23:46:36
Initial revision check-in: 04e907332b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
22:19:45
Fixed bug with false objects when compound objects present.
-- Reset object to 0 after processing text.
check-in: 86ec1b0792 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-07-20
23:43:05
V 3.8 ( to Eric) check-in: c26665b273 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/awk/rbg_fig2m.awk from [6b24a93f28] to [8edaddadea].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15






16
17
18
19
20
21
22

###################################### 
##### Model Transformation Tools #####
######################################

# gawk script: rbg_fig2m.awk
# Raw  bond-graph conversion from fig to matlab
# P.J.Gawthrop June 1996
# Copyright (c) P.J.Gawthrop, 1996.

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






## Revision 1.33  1998/08/10 15:51:06  peterg
## Comments may now be prefaced by # as well as %
##
## Revision 1.32  1998/07/27 20:30:03  peterg
## *** empty log message ***
##
## Revision 1.31  1998/04/16 13:18:13  peterg
<














>
>
>
>
>
>








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

###################################### 
##### Model Transformation Tools #####
######################################

# gawk script: rbg_fig2m.awk
# Raw  bond-graph conversion from fig to matlab
# P.J.Gawthrop June 1996
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.34  1999/02/17 06:23:49  peterg
## Bugs arising from Fig 3.2 fixed
##
## -- depth now zero modulo 10 (3.2 defaults to depth 100!!)
## -- horrible bug using = in place of == fixed.
##
## Revision 1.33  1998/08/10 15:51:06  peterg
## Comments may now be prefaced by # as well as %
##
## Revision 1.32  1998/07/27 20:30:03  peterg
## *** empty log message ***
##
## Revision 1.31  1998/04/16 13:18:13  peterg
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
}
}

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);

#Process firstline
  if (first_line) {
    object = $1;
    sub_type = $2;
    style = $3;
    zero_depth = ((modulo10($7)==0)&&(object==polyline)) || ((modulo10($4)==0)&&(object==text))
    f_arrow = ($14==1)&&(object=polyline);
    b_arrow = ($15==1)&&(object=polyline);
    arrow = f_arrow||b_arrow;
    arg_count = 0;
  }

#Process text
  if (object==text) {
    process_text()

      }

# Process bond
isa_bond = (zero_depth &&\
       (object==polyline)&& \
       (sub_type==sub_polyline)&& \
       (style==firm_style) \







>














|
>







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
}
}

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);

#Process firstline
  if (first_line) {
    object = $1;
    sub_type = $2;
    style = $3;
    zero_depth = ((modulo10($7)==0)&&(object==polyline)) || ((modulo10($4)==0)&&(object==text))
    f_arrow = ($14==1)&&(object=polyline);
    b_arrow = ($15==1)&&(object=polyline);
    arrow = f_arrow||b_arrow;
    arg_count = 0;
  }

#Process text
  if (object==text) {
    process_text();
    object = 0; # Text on one line so reset object to zero- avoids compound problem
      }

# Process bond
isa_bond = (zero_depth &&\
       (object==polyline)&& \
       (sub_type==sub_polyline)&& \
       (style==firm_style) \
562
563
564
565
566
567
568

569
570
571
572
573
574
575
  isa_fig_file = 0;
  min_line_length = 10;
  object = 0;
  polyline = 2;
  sub_polyline=1; 
  firm_style = 0;
  text = 4;

  bond_coords = 3;
  stroke_coords = 2;
  arrow_coords = 2;

  i_bond = 0;
  i_port = 0;
  i_stroke = 0;







>







569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
  isa_fig_file = 0;
  min_line_length = 10;
  object = 0;
  polyline = 2;
  sub_polyline=1; 
  firm_style = 0;
  text = 4;
  compound_object = 6;
  bond_coords = 3;
  stroke_coords = 2;
  arrow_coords = 2;

  i_bond = 0;
  i_port = 0;
  i_stroke = 0;


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