1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.19 1997/08/14 11:59:47 peterg
% %% Vector ports added!!
% %%
% %% Revision 1.18 1997/08/14 11:01:42 peterg
% %% Reordered algorithms as follows:
% %% bond end coordinates
% %% associate port labels with bonds (port_bond)
|
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.20 1997/08/18 19:39:48 peterg
% %% Now generates (exampaded) port_bond list correctely
% %%
% %% Revision 1.19 1997/08/14 11:59:47 peterg
% %% Vector ports added!!
% %%
% %% Revision 1.18 1997/08/14 11:01:42 peterg
% %% Reordered algorithms as follows:
% %% bond end coordinates
% %% associate port labels with bonds (port_bond)
|
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
% We now have a list (comp_near_bond) of the component(s) at each end
% of each bond
% Now do a list of the bonds on each component - unsorted at this stage.
components = [];
for i = 1:n_components
% There are n_comp_bonds bonds on this component with corresponding index
[index,n_comp_bonds] = getindex(comp_near_bond,i);
% Create the signed list of bonds on this component
one = ones(n_comp_bonds,1);
bond_list = index(:,1); % bond at component
bond_end = index(:,2); % which end of bond at component?
direction = -sign(bond_end-1.5*one);
signed_bond_list = bond_list.*direction;
|
>
>
>
>
>
>
>
>
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
% We now have a list (comp_near_bond) of the component(s) at each end
% of each bond
% Now do a list of the bonds on each component - unsorted at this stage.
components = [];
for i = 1:n_components
%Get component type
eval(['[comp_type, comp_name] = ', name, '_cmp(i)']);
% There are n_comp_bonds bonds on this component with corresponding index
[index,n_comp_bonds] = getindex(comp_near_bond,i);
if index(1,1)==0
mtt_info(sprintf("Component %s (%s) has no bonds", comp_name,
comp_type),infofile);
end;
% Create the signed list of bonds on this component
one = ones(n_comp_bonds,1);
bond_list = index(:,1); % bond at component
bond_end = index(:,2); % which end of bond at component?
direction = -sign(bond_end-1.5*one);
signed_bond_list = bond_list.*direction;
|