Differences From Artifact [1e80d94d7f]:

To Artifact [b751c30fd5]:


16
17
18
19
20
21
22




23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33







+
+
+
+







# [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile)

# ###############################################################
# ## Version control history
# ###############################################################
# ## $Id$
# ## $Log$
# ## Revision 1.43  1998/12/14 15:19:36  peterg
# ## Added missing "derivative_causality," argument to recursive call of
# ## this function
# ##
# ## Revision 1.42  1998/12/03 14:55:40  peterg
# ## Now uses number of components with complete causality to measure
# ## progress of algorithm -- Done.
# ## This replaces bond count -- done.
# ##
# ## Revision 1.41  1998/11/20 10:52:28  peterg
# ## Copies port bonds if the port bonds ARE set
228
229
230
231
232
233
234
235

236
237
238
239

240
241
242
243
244
245



246
247

248


249
250
251
252
253
254
255
232
233
234
235
236
237
238

239
240
241
242

243
244
245
246
247


248
249
250
251
252
253

254
255
256
257
258
259
260
261
262







-
+



-
+




-
-
+
+
+


+
-
+
+







    status = [];
    return
  end;

# Evaluate the system function to get the bonds and number of ports
#eval(["[bonds,components,n_ports,N_ports]=", fun_name, ";"]);
  eval(["[ABG]=", fun_name, ";"]);

!struct_contains(ABG,"subsystems")
  if !struct_contains(ABG,"subsystems")# Are there any subsystems?
    return;			# Nothing to do
  else
    [n_subsystems,junk] = size(struct_elements(ABG.subsystems));
    [n_subsystems,junk] = size(struct_elements(ABG.subsystems))
  endif
  
  if struct_contains(ABG,"portlist")# Are there any ports?
    [n_ports,junk] = size(ABG.portlist);
    port_bond_index=zeros(n_ports,1);
    for i=1:n_ports		# Find indices of the internal
#     port_bond_index=zeros(n_ports,1);
    i_port = 0;
    for i=1:n_ports		# Find indices of the internal ports
      name = deblank(ABG.portlist(i,:)); # Name of this port
      eval(["port = ABG.ports.",name,";"]); # Extract port info
      for j=1:length(port.connections) # Maybe vector SS
      port_bond_index(i) = abs(port.connections);
	port_bond_index(++i_port) = abs(port.connections(j));
      endfor;
    endfor
  else
    n_ports = 0;
  endif				   

				
  [n_bonds,columns] = size(ABG.bonds);# Find number of bonds

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