Differences From Artifact [58045c3642]:

To Artifact [14243645f4]:


1
2
3
4
5
6
7



8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17







+
+
+







function [bonds,components] = rbg2abg(rbonds,rstrokes,rcomponents,rports,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.5  1996/08/24 19:21:26  peter
% %% More specific error messages.
% %%
% %% Revision 1.4  1996/08/24 18:00:33  peter
% %% Fixed bug with finding ports.
% %%
% %% Revision 1.3  1996/08/09 08:26:35  peter
% %% Cosmetic tidy up.
% %%
% %% Revision 1.2  1996/08/04 18:37:57  peter
94
95
96
97
98
99
100
101


102

103

104
105
106
107

108
109
110




111
112
113
114
115
116
117
97
98
99
100
101
102
103

104
105
106
107

108

109
110
111
112



113
114
115
116
117
118
119
120
121
122
123







-
+
+

+
-
+
-



+
-
-
-
+
+
+
+







    if n_ports>0
      % Are the component ports numbered? (either they all are or none are)
      k=0;
      for j = 1:n
	b = bond_list(j); e = bond_end(j);
	% Find all ports on this bond
	[port_indices,m] = getindex(port_near_bond(:,1),b);
	% Now find the one at this end
	% Now find the one at this end  - if any
	port_index = 0;
	for l=1:m
	  if port_near_bond(port_indices(l),2)==e
	  port_index = port_indices(l);
	    port_index = port_indices(l);
	  if port_near_bond(port_index,2)==e
	    break;
	  end;
	end;
	if port_index>0
	% and put the corresponding number in the list
	k=k+1;
	port_number(k,1) = port_near_bond(port_index,3);
	  % and put the corresponding number in the list
	  k=k+1;
	  port_number(k,1) = port_near_bond(port_index,3);
	end;
      end;

	% Must have a lable for each port or non at all
      if k==n
	[sorted,sort_index]=sort(port_number);
	if sum(sorted==[1:n]')~=n % The there is something wrong
	  mtt_info(port_error,fnum);

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]