Index: mttroot/mtt/bin/trans/m/rbg2abg.m ================================================================== --- mttroot/mtt/bin/trans/m/rbg2abg.m +++ mttroot/mtt/bin/trans/m/rbg2abg.m @@ -3,10 +3,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.10 1997/03/17 13:45:42 peterg +% %% Added more error info. +% %% % %% Revision 1.9 1996/12/31 11:25:57 peterg % %% Clearer error messages for incorrect ports. % %% % %% Revision 1.8 1996/12/04 21:52:39 peterg % %% Now uses fopen. @@ -81,12 +84,19 @@ % Locate the bond end nearest to each port % col 1 of port_near_bond contains a signed bond number (+ for arrow end) % col 2 of port_near_bond contains the corresponding port number for i = 1:n_ports - near_bond = adjbond(rports(i,1:2),arrow_end,other_end); - signed_bond = near_bond(1)*sign(1.5-near_bond(2)) + [i rports(i,1:2)/scale rports(i,3)] + near_bond = adjbond(rports(i,1:2),arrow_end,other_end) + [rows,cols]=size(near_bond); + if rows>1 + error(sprintf ... + ("A port is near to more than one bond at coordinates %g,%g\n", ... + rports(i,1)/scale, rports(i,2)/scale)); + end; + signed_bond = near_bond(1)*sign(1.5-near_bond(2)); port_near_bond(i,:) = [signed_bond, rports(i,3)]; end; % Locate the components at the ends of each bond % col 1 of comp_near_bond contain the component nearest to the arrow end