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.38 2001/03/23 14:57:31 gawthrop +## Now puts space after header fields + writes _port.fig +## ## 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 ## @@ -257,11 +260,11 @@ str = $14; for (i=15; i<=NF; i++) { str = sprintf("%s %s", str, $i) } -# The depth is field 4 +# The depth is field 4 (for strings) depth = modulo10($4); # It is terminated by \001 - so delete this termination str = substr(str,1,length(str)-4); @@ -471,10 +474,19 @@ function write_fig() { # Create _fig.fig file from _abg file - not components # and write out the components in a _cmp.fig file # and write out the bonds in a _bnd.fig file + +# The artwork -- not header and not zero depth + + if ((NF>2)&&(!zero_depth)) { + art=$0; + sub("----"," ",art) + printf("%s\n", art) >> art_file + } + #Everything except components if ( ((object!=text)||(isa_component==0)) ) { #Replace the data_symbol if (exact_match($1,data_symbol)) { @@ -583,10 +595,11 @@ 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); + art_file = sprintf("%s_art.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"; @@ -641,11 +654,11 @@ process_fig() } } END { -#Print out the matlab functions +#Print out the Octave functions printf("function [rbonds, rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; printf("%% [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; printf("%% Generated by MTT\n\n") > b_file; printf("function [comp_type, name, cr, arg, repetitions] = %s_cmp(i)\n",\