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.5 1996/08/05 12:01:28 peter +## The _cmp function now returns the number of ports. +## ## Revision 1.4 1996/08/05 10:14:46 peter ## Made ports appear, in order, at top of component lists ## ## Revision 1.3 1996/08/04 20:32:28 peter ## Stopped complaint about missing lbl entry for port components @@ -345,17 +348,17 @@ } } END { #Print out the matlab functions - printf("function [rbonds, rstrokes,rcomponents,rports] = %s_rbg\n", sys_name) > b_file; - printf("%% [rbonds,rstrokes,rcomponents,rports] = %s_rbg\n", sys_name) > b_file; + printf("function [rbonds, rstrokes,rcomponents,rports,n_ports] = %s_rbg\n", sys_name) > b_file; + printf("%% [rbonds,rstrokes,rcomponents,rports,n_ports] = %s_rbg\n", sys_name) > b_file; printf("%% Generated by MTT\n\n") > b_file; - printf("function [comp_type, name, cr, arg, n_ports] = %s_cmp(i)\n",\ + printf("function [comp_type, name, cr, arg] = %s_cmp(i)\n",\ sys_name) > c_file; - printf("%% [comp_type, name, cr, arg, n_ports] = %s_cmp\n", sys_name) > c_file; + printf("%% [comp_type, name, cr, arg] = %s_cmp\n", sys_name) > c_file; printf("%% Generated by MTT\n\n") > c_file; printf("rbonds = [\n") >> b_file; for (i = 1; i <= i_bond; i++) print bonds[i] >> b_file; @@ -369,12 +372,10 @@ printf("];\n") >> b_file; printf("rcomponents = [") >> b_file; j = 0; -# Number of ports - printf("n_ports = %1.0f;\n\n", i_port_component) >> c_file; # Do the port components, in order, first for (i = 1; i <= i_port_component; i++) { port_type = "SS"; name = sprintf("[%1.0f]", i); @@ -418,10 +419,13 @@ printf("];\n") >> b_file; printf("rports = [\n") >> b_file; for (i = 1; i <= i_port; i++) print ports[i] >> b_file; - printf("];\n") >> b_file; + printf("];\n\n") >> b_file; + printf("n_ports = %1.0f;\n", i_port_component) >> b_file; + + }