Index: mttroot/mtt/bin/trans/m/cbg2fig.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2fig.m +++ mttroot/mtt/bin/trans/m/cbg2fig.m @@ -24,10 +24,15 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.7 1997/08/19 09:49:19 peterg +% %% Modified to take account of the expanded vector bonds. Only displays +% %% causality corresponding to the bond connecting the first element of +% %% the vector ports. +% %% % %% Revision 1.6 1997/08/19 09:41:47 peterg % %% Some debugging lines added. % %% % %% Revision 1.5 1997/05/16 07:33:45 peterg % %% Now checks to see if sub system is a simple component before @@ -98,11 +103,11 @@ % Setup file - append to the fig file filenum = fopen(fig_name, 'a'); % Get the raw and the processed bonds eval(['[rbonds,rstrokes,rcomponents] = ', system_type, '_rbg;']); -eval(['[bonds] = ', system_type, '_abg;']); +eval(['[bonds,components,n_ports] = ', system_type, '_abg;']); % Original number of bonds [n_bonds,junk] = size(rbonds); % Get the causal bonds @@ -137,13 +142,21 @@ unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]); unit_stroke_vector = (rot*unit_bond_vector')'; % Get indices of bonds with changed causality -- but ignore the extra bonds % due to vector bond expansion -changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1) -changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2) -changed = changed_e|changed_f +changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1); +changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2); +changed = changed_e|changed_f; +% Don't do port bonds +if n_ports>0 + port_bonds = sort(abs(components(1:n_ports,1))); + changed(port_bonds) = zeros(n_ports,1); + changed_e(port_bonds) = zeros(n_ports,1); + changed_f(port_bonds) = zeros(n_ports,1); +end + index_e = getindex(changed_e,1)' index_f = getindex(changed_f,1)' index = getindex(changed,1)'; % Print the new strokes in fig format