Differences From Artifact [590cc1717c]:

To Artifact [d8d4e1e6ac]:


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.15  1997/08/06  21:43:19  peterg
% %% Corrected error in creating component list: the kth component of the
% %% list is given by the jth component of the original list NOT vice
% %% versa.
% %%
% %% Revision 1.14  1997/08/04 14:18:55  peterg
% %% If no ports labels at all, just use the default component list.







>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.16  1997/08/07  16:12:36  peterg
% %% Fixed sorting bug: now puts the jth component from the unsorted list
% %% into the kth component of the sorted list .. not vice versa!
% %%
% %% Revision 1.15  1997/08/06  21:43:19  peterg
% %% Corrected error in creating component list: the kth component of the
% %% list is given by the jth component of the original list NOT vice
% %% versa.
% %%
% %% Revision 1.14  1997/08/04 14:18:55  peterg
% %% If no ports labels at all, just use the default component list.
183
184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
	[port_index,m] = getindex(port_bond,b);
	if m==1
	  k=k+1;
	  unsorted_port_list(k,:) = port_name(port_index,:);
	end;
      end;
    else % just use that provided by the component
      unsorted_port_list = port_list;
      k = n_comp_ports;

    end;

    %Either all ports or no ports should be labelled - write error
    %message if this is not so
    if (k~=0)&(k~=n_comp_ports)
      mtt_info(['Component ', comp_name, ' (', comp_type, ') has wrong number of labels'], infofile); 
      mtt_info(sprintf("\tit has %1.0f labels but should have 0 or %1.0f",k,n_comp_ports), infofile); 







|
|
>







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
	[port_index,m] = getindex(port_bond,b);
	if m==1
	  k=k+1;
	  unsorted_port_list(k,:) = port_name(port_index,:);
	end;
      end;
    else % just use that provided by the component
%      unsorted_port_list = port_list;
%      k = n_comp_ports;
      k=0;
    end;

    %Either all ports or no ports should be labelled - write error
    %message if this is not so
    if (k~=0)&(k~=n_comp_ports)
      mtt_info(['Component ', comp_name, ' (', comp_type, ') has wrong number of labels'], infofile); 
      mtt_info(sprintf("\tit has %1.0f labels but should have 0 or %1.0f",k,n_comp_ports), infofile); 
214
215
216
217
218
219
220

221
222

223
224
225
226
227
228
229
230
    
    %Two port defaults
    if (n_comp_ports==2)&(n_unsorted_ports==0)
      if direction(1)==direction(2) % Wrong way for default
        mtt_info(['Two-port ', comp_name, ' (', comp_type, ') does not have though-pointing arrows'], infofile);
      end;
      if direction(1)==1 %in

        unsorted_port_list = port_list;
      else %reverse the order

        unsorted_port_list = port_list(2:1);
      end;
    end;
    
    % Recompute the number of unsorted ports
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;







>
|

>
|







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
    
    %Two port defaults
    if (n_comp_ports==2)&(n_unsorted_ports==0)
      if direction(1)==direction(2) % Wrong way for default
        mtt_info(['Two-port ', comp_name, ' (', comp_type, ') does not have though-pointing arrows'], infofile);
      end;
      if direction(1)==1 %in
        mtt_info([comp_name, ':in'], infofile);
        unsorted_port_list = ['[in]';'[out]'];
      else %reverse the order
        mtt_info([comp_name, ':out'], infofile);
        unsorted_port_list = ['[out]';'[in]'];
      end;
    end;
    
    % Recompute the number of unsorted ports
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;

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