Overview
Comment:Default two port list is [in;out] (or [out;in])
Dont do global default if no ports labels.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 292b73bff1ad12ed612a74ec0890997b484e714bc71278eb7d8488249cbcc93f
User & Date: gawthrop@users.sourceforge.net on 1997-08-09 11:31:16
Other Links: branch diff | manifest | tags
Context
1997-08-09
14:42:39
Added underscore to port regexp check-in: 7aafd38e0d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:31:16
Default two port list is [in;out] (or [out;in])
Dont do global default if no ports labels.
check-in: 292b73bff1 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-08-08
08:11:04
Suppress compoment trace. check-in: 96d016903b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [590cc1717c] to [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 ]