Differences From Artifact [88812e8fad]:

To Artifact [80cfe69023]:


1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
function [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,\
				      port_coord,port_name,\
				      infofile,errorfile)

  ## ###############################################################
  ## ## Version control history
  ## ###############################################################
  ## ## $Id$
  ## ## $Log$



  ## ## Revision 1.48  2004/02/19 18:27:47  geraint
  ## ## [ 852694 ] octave 2.1.52 breaks rbg2abg
  ## ##
  ## ## Octave now prefers row vectors to column vectors.
  ## ##
  ## ## Revision 1.47  2002/08/27 16:09:01  geraint
  ## ## Added port_name to error message when multiple bonds are near a port.









>
>
>







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

  ## ###############################################################
  ## ## Version control history
  ## ###############################################################
  ## ## $Id$
  ## ## $Log$
  ## ## Revision 1.49  2004/07/22 13:18:02  geraint
  ## ## Minor typo in error message.
  ## ##
  ## ## Revision 1.48  2004/02/19 18:27:47  geraint
  ## ## [ 852694 ] octave 2.1.52 breaks rbg2abg
  ## ##
  ## ## Octave now prefers row vectors to column vectors.
  ## ##
  ## ## Revision 1.47  2002/08/27 16:09:01  geraint
  ## ## Added port_name to error message when multiple bonds are near a port.
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
	  ## port_name_i = deblank(port_name(port_name_index,:));
	  ## port_name_i = port_name_i(2:length(port_name_i)-1) # strip []
	endif
	
	
	## 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);
	  endif







|
|







378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
	  ## port_name_i = deblank(port_name(port_name_index,:));
	  ## port_name_i = port_name_i(2:length(port_name_i)-1) # strip []
	endif
	
	
	## Replace by alias -- if any
    	eval( ["alias = ", comp_type, '_alias';]); # Get aliases
    	if isstruct(alias)		# are there any aliases
          if isfield(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);
	  endif
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
    signed_bond_list = nozeros(components(i,:));
    n_comp_bonds = length(signed_bond_list);
    direction = sign(signed_bond_list);
    
    ##Find the port list for this component
    if exist([comp_type, '_cause'])==0
      eval(["ABG = ",comp_type, "_abg;"]);
      if struct_contains (ABG, "portlist")
	port_list = ABG.portlist;
      else
	error(sprintf("Component %s has no ports", comp_type));
        port_list = [];
      endif
    else
      port_list=comp_ports(comp_type,n_comp_bonds)







|







570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
    signed_bond_list = nozeros(components(i,:));
    n_comp_bonds = length(signed_bond_list);
    direction = sign(signed_bond_list);
    
    ##Find the port list for this component
    if exist([comp_type, '_cause'])==0
      eval(["ABG = ",comp_type, "_abg;"]);
      if isfield (ABG, "portlist")
	port_list = ABG.portlist;
      else
	error(sprintf("Component %s has no ports", comp_type));
        port_list = [];
      endif
    else
      port_list=comp_ports(comp_type,n_comp_bonds)

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