Index: mttroot/mtt/bin/trans/awk/rbg_fig2m.awk ================================================================== --- mttroot/mtt/bin/trans/awk/rbg_fig2m.awk +++ mttroot/mtt/bin/trans/awk/rbg_fig2m.awk @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.7 1996/08/05 18:44:56 peter +## Now writes out a _cbg file without ----- symbol. +## ## Revision 1.6 1996/08/05 12:17:37 peter ## n_ports now appear in the _abg file instead. ## ## Revision 1.5 1996/08/05 12:01:28 peter ## The _cmp function now returns the number of ports. @@ -250,24 +253,24 @@ strokes[i_stroke] = sprintf("%s %s %s %s", $2, $3, $4, $5); } } } -function write_cbg() { -# Create _cbg.fig file from _abg file - not components - if ( (fig_file)&&((object!=text)||(isa_component==0))) { +function write_fig() { +# Create _fig.fig file from _abg file - not components + if ( (isa_fig_file)&&((object!=text)||(isa_component==0))) { if (exact_match($1,data_symbol)) { field_1 = out_data_symbol } else { field_1 = $1 } - printf field_1 >> cbg_file + printf field_1 >> fig_file for (i=2; i<=NF; i++) - printf(" %s", $i) >> cbg_file; - printf("\n") >> cbg_file + printf(" %s", $i) >> fig_file; + printf("\n") >> fig_file } } function process_fig() { # Test for the fig format first line and data line @@ -298,20 +301,20 @@ (style==firm_style) \ ) { process_bond() } - write_cbg() + write_fig() } BEGIN { sys_name = ARGV[1]; delete ARGV[1]; b_file = sprintf("%s_rbg.m", sys_name); c_file = sprintf("%s_cmp.m", sys_name); - cbg_file = sprintf("%s_cbg.fig", sys_name); + fig_file = sprintf("%s_fig.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 = "WARNING system ports are not consecutively numbered\n"; data_symbol = "----"; @@ -322,11 +325,11 @@ q = "\047"; terminator = "\\001"; component_regexp = "[^0-9a-zA-Z_:]"; port_regexp = "\[[0-9]*\]"; - fig_file = 0; + isa_fig_file = 0; min_line_length = 10; object = 0; polyline = 2; sub_polyline=1; firm_style = 0; @@ -346,14 +349,14 @@ } { # Start of .fig file? if ( (NF>0) && (match("#FIG", $1) > 0) ) { - fig_file=1; + isa_fig_file=1; } - if (fig_file==0) { + if (isa_fig_file==0) { process_lbl() } else { process_fig() }