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.24 1998/02/19 08:57:16 peterg
% %% Fixed mtt-info bug -- confused filename with number
% %%
% %% Revision 1.23 1997/12/04 14:24:22 peterg
% %% Removed error message about through-pointing arrows
% %%
% %% Revision 1.22 1997/09/18 19:49:37 peterg
|
>
>
>
|
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.25 1998/04/12 15:01:04 peterg
% %% Converted to uniform port notation - always use []
% %%
% %% Revision 1.24 1998/02/19 08:57:16 peterg
% %% Fixed mtt-info bug -- confused filename with number
% %%
% %% Revision 1.23 1997/12/04 14:24:22 peterg
% %% Removed error message about through-pointing arrows
% %%
% %% Revision 1.22 1997/09/18 19:49:37 peterg
|
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
[n_bonds,junk] = size(bonds);
n_exp_ports=n_ports;
exp_port_name="";
exp_port_bond = [];
%exp_comps = [];
for i=1:n_ports
port_name_i = port_name(i,:)
subport = split(port_name_i, ','); % Find the components of the vector port
[n_subports,junk] = size(subport);
if n_subports==1 % an ordinary port
exp_port_name = [exp_port_name; subport(1,:)]; % Write out the only port
exp_port_bond = [exp_port_bond; port_bond(i)]; % and the port_bond
else % its a vector port
% Check that there is a corresponding vector port at the other end of the
% bond
signed_bond_index = port_bond(i);
[other_bond_index,n_other] = getindex(port_bond,-signed_bond_index);
if n_other == 1
other_port_name = port_name(other_bond_index,:);
other_subport = split(other_port_name, ',');
[n_other_subports,junk] = size(other_subport);
if n_other_subports~=n_subports
mtt_info(['Vector ports ', port_name_i, ' and ', other_port_name, 'are not compatible'],fnum);
end
else
mtt_info(['Vector port ', port_name_i, ' has no matching port'], fnum);
end;
|
|
<
|
<
|
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
[n_bonds,junk] = size(bonds);
n_exp_ports=n_ports;
exp_port_name="";
exp_port_bond = [];
%exp_comps = [];
for i=1:n_ports
port_name_i = port_name(i,:)
[subport,n_subports] = split_port(port_name_i, ','); % Find the components of the vector port
if n_subports==1 % an ordinary port
exp_port_name = [exp_port_name; subport(1,:)]; % Write out the only port
exp_port_bond = [exp_port_bond; port_bond(i)]; % and the port_bond
else % its a vector port
% Check that there is a corresponding vector port at the other end of the
% bond
signed_bond_index = port_bond(i);
[other_bond_index,n_other] = getindex(port_bond,-signed_bond_index);
if n_other == 1
other_port_name = port_name(other_bond_index,:);
[other_subport,n_other_subports] = split_port(other_port_name, ',');
if n_other_subports~=n_subports
mtt_info(['Vector ports ', port_name_i, ' and ', other_port_name, 'are not compatible'],fnum);
end
else
mtt_info(['Vector port ', port_name_i, ' has no matching port'], fnum);
end;
|