Differences From Artifact [f334abe696]:

To Artifact [a9df87bf22]:


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.26  1998/04/16 14:07:51  peterg
% %% Sorted out [] problem with vector ports -- new octave function
% %% split_port
% %%
% %% Revision 1.25  1998/04/12 15:01:04  peterg
% %% Converted to uniform port notation - always use []
% %%







>
>
>







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.27  1998/07/02 12:24:02  peterg
% %% Expand port aliases
% %%
% %% Revision 1.26  1998/04/16 14:07:51  peterg
% %% Sorted out [] problem with vector ports -- new octave function
% %% split_port
% %%
% %% Revision 1.25  1998/04/12 15:01:04  peterg
% %% Converted to uniform port notation - always use []
% %%
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% %% Revision 1.2  1996/08/04 18:37:57  peter
% %% Fixed  no causal strokes bug.
% %%
% %% Revision 1.1  1996/08/04 18:30:14  peter
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if nargin<7
  infofile='stdout';
else
  fnum = fopen(infofile, 'w');
end;








<







99
100
101
102
103
104
105

106
107
108
109
110
111
112
% %% Revision 1.2  1996/08/04 18:37:57  peter
% %% Fixed  no causal strokes bug.
% %%
% %% Revision 1.1  1996/08/04 18:30:14  peter
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if nargin<7
  infofile='stdout';
else
  fnum = fopen(infofile, 'w');
end;

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
    comp_type),fnum);
  end;
    

  % which end of bond at component?
  bond_end = index(:,2); 
  direction = -sign(bond_end-1.5*one);
  signed_bond_list = bond_list.*direction
  components = add_bond(components,signed_bond_list',i);

  % Unalias all the ports on this component - if not a junction
  if ((comp_type!="0")&&(comp_type!="1"))
    eval( ["alias = ", comp_type, '_alias']); # Get aliases
    if is_struct(alias)		# are there any aliases
      for j=1:n_comp_bonds
      	port_name_index = getindex(port_bond,signed_bond_list(j))
      	if port_name_index>0	# There is a port on this bond
      	  port_name_i = deblank(port_name(port_name_index,:));
          port_name_i = port_name_i(2:length(port_name_i)-1) # strip []
	  if struct_contains(alias,port_name_i) # Is this an alias?
	    eval(["new_port_name_i = alias.",port_name_i]);
	    mtt_info(["Expanding port name " port_name_i " of component " \
		      comp_name " (" comp_type ") to ", new_port_name_i],fnum);







|

<


|


|







205
206
207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224
225
226
    comp_type),fnum);
  end;
    

  % which end of bond at component?
  bond_end = index(:,2); 
  direction = -sign(bond_end-1.5*one);
  signed_bond_list = bond_list.*direction;
  components = add_bond(components,signed_bond_list',i);

  % Unalias all the ports on this component - if not a junction
  if ((comp_type!="0")&&(comp_type!="1"))
    eval( ["alias = ", comp_type, '_alias';]); # Get aliases
    if is_struct(alias)		# are there any aliases
      for j=1:n_comp_bonds
      	port_name_index = getindex(port_bond,signed_bond_list(j));
      	if port_name_index>0	# There is a port on this bond
      	  port_name_i = deblank(port_name(port_name_index,:));
          port_name_i = port_name_i(2:length(port_name_i)-1) # strip []
	  if struct_contains(alias,port_name_i) # Is this an alias?
	    eval(["new_port_name_i = alias.",port_name_i]);
	    mtt_info(["Expanding port name " port_name_i " of component " \
		      comp_name " (" comp_type ") to ", new_port_name_i],fnum);

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