Differences From Artifact [6edafa9130]:

To Artifact [7bd05447ed]:


1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
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.46  2000/09/11 08:22:02  peterg
  ## ## Checks for absent port list in subsystem abg file.
  ## ##
  ## ## Revision 1.45  1999/10/19 02:13:31  peterg
  ## ## Now assigns correct bonds to the new junction port names
  ## ##
  ## ## Revision 1.44  1999/10/19 00:05:44  peterg
  ## ## Now defaults junction ports when only one specified (for vector junctions)
  ## ##
  ## ## Revision 1.43  1999/10/18 04:08:46  peterg
219
220
221
222
223
224
225
226
227


228
229
230
231
232
233
234
222
223
224
225
226
227
228


229
230
231
232
233
234
235
236
237







-
-
+
+







  ## col 2  of port_near_bond contains the corresponding port index
  port_bond = [];
  for i = 1:n_ports
    near_bond = adjbond(port_coord(i,1:2),arrow_end,other_end);
    [rows,cols]=size(near_bond);
    if rows>1
      error(sprintf ...
	    ("A port is near to more than one bond at coordinates %g,%g\n", ...
	     port_coord(i,1)/scale,  port_coord(i,2)/scale));
	    ("A port is near to more than one bond at coordinates %g,%g %s\n", ...
	     port_coord(i,1)/scale,  port_coord(i,2)/scale, deblank(port_name(i,:))));
    endif
    

    ##The (signed) bond corresponding to the ith port label
    port_bond(i) = near_bond(1)*sign(1.5-near_bond(2));
  endfor

356
357
358
359
360
361
362
363

364
365
366
367
368
369
370
359
360
361
362
363
364
365

366
367
368
369
370
371
372
373







-
+







	  mtt_info(["Defaulting port name [" port_name_i "]\t on component " \
		    comp_name " (" comp_type ")" ],infofile);
	  port_name = [port_name; ["[" port_name_i "]"]];	# add to list
	  [port_name_index,junk] = size(port_name); # the corresponding
				# index
	  port_bond(port_name_index,:) = signed_bond; # add to port bond
	else  
	  port_name_i = mtt_strip_name(port_name(port_name_index,:));
	  port_name_i = mtt_strip_name(port_name(port_name_index,:))
	  ## 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
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
669
670
671
672
673
674
675


























-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
	  components(i,k) = signed_bond_list(j);     
	endif
      endfor
    endif
  endfor

endfunction




















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