Differences From Artifact [8516bd9170]:

To Artifact [70a07044a9]:


1

2
3
4
5
6
7
8



9
10
11
12
13
14
15
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,\

				      infofile,errorfile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %% Revision 1.34  1998/07/02 19:41:29  peterg
% %% Fixed empty port string bug - set to null string.
% %%
% %% Revision 1.33  1998/07/02 17:16:06  peterg
% %% Commented out redundent code -- obsolete due to new default mechanism
% %%
% %% Revision 1.32  1998/07/02 15:12:05  peterg
|
>







>
>
>







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

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.35  1998/07/08 15:35:15  peterg
% %% Added errorfile argument
% %%
% %% Revision 1.34  1998/07/02 19:41:29  peterg
% %% Fixed empty port string bug - set to null string.
% %%
% %% Revision 1.33  1998/07/02 17:16:06  peterg
% %% Commented out redundent code -- obsolete due to new default mechanism
% %%
% %% Revision 1.32  1998/07/02 15:12:05  peterg
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
      end;
      
      % Replace by alias -- if any
    	eval( ["alias = ", comp_type, '_alias';]); # Get aliases
    	if is_struct(alias)		# are there any aliases
          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 "]\t on component " \
		      comp_name " (" comp_type ")\t to [" new_port_name_i "]"],infofile);
	    port_name = replace_name(port_name, \
				     ["[",new_port_name_i,"]"], \
				     port_name_index);
	  end
      	end
      end







|







294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
      end;
      
      % Replace by alias -- if any
    	eval( ["alias = ", comp_type, '_alias';]); # Get aliases
    	if is_struct(alias)		# are there any aliases
          if struct_contains(alias,port_name_i) # Is this an alias?
	    eval(["new_port_name_i = alias.",port_name_i]);
	    mtt_info(["Aliasing name [" port_name_i "]\t on component " \
		      comp_name " (" comp_type ")\t to [" new_port_name_i "]"],infofile);
	    port_name = replace_name(port_name, \
				     ["[",new_port_name_i,"]"], \
				     port_name_index);
	  end
      	end
      end
458
459
460
461
462
463
464













465
466
467
468
469
470
471
  
  %Find the port list for this component
  if exist([comp_type, '_cause'])==0
    eval(['[junk1,junk2,junk3,junk4,junk5,port_list]=', comp_type, '_rbg;']);
  else
    port_list=comp_ports(comp_type,n_comp_bonds);
  end;













  

  % Check that number of bonds on the component is the same as the number of
  % ports
  [n_comp_ports,m_comp_ports] = size(port_list);
  if (n_comp_ports~=n_comp_bonds) & ...
	~(strcmp(comp_type,'zero')|strcmp(comp_type,'one'))







>
>
>
>
>
>
>
>
>
>
>
>
>







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
  
  %Find the port list for this component
  if exist([comp_type, '_cause'])==0
    eval(['[junk1,junk2,junk3,junk4,junk5,port_list]=', comp_type, '_rbg;']);
  else
    port_list=comp_ports(comp_type,n_comp_bonds);
  end;

  [n_comp_ports,m_comp_ports] = size(port_list);
  subport_list="";
  for p=1:n_comp_ports		# Expand any vector ports
    [subport,n_sub] = split_port(port_list(p,:), ','); # Find the components
						  # of the vector port
    if n_sub>1
      mtt_info(sprintf("Expanding vector port %s of component type %s",\
		       port_list(p,:), comp_type, infofile));	
    end;
    subport_list = [subport_list; subport];
  end;
  port_list = subport_list;	# Set the expanded port list.
  

  % Check that number of bonds on the component is the same as the number of
  % ports
  [n_comp_ports,m_comp_ports] = size(port_list);
  if (n_comp_ports~=n_comp_bonds) & ...
	~(strcmp(comp_type,'zero')|strcmp(comp_type,'one'))
569
570
571
572
573
574
575


576
577
578
579
580
	mtt_error(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], errorfile); 
      else
	components(i,k) = signed_bond_list(j);     
      end;
    end;
  end;
end;














>
>





586
587
588
589
590
591
592
593
594
595
596
597
598
599
	mtt_error(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], errorfile); 
      else
	components(i,k) = signed_bond_list(j);     
      end;
    end;
  end;
end;








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