Differences From Artifact [8d7790c91d]:

To Artifact [04eb14e49f]:


326
327
328
329
330
331
332






333
334
335
336
337
338
339
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345







+
+
+
+
+
+







      mtt_error(sprintf("Vector ports %s and %s are not compatible",
			head_bond.label, tail_bond.label), errorfile);
    elseif (head.n_subs > 1)
      mtt_info(sprintf("Vector port %s matches %s",
		       head_bond.label, tail_bond.label), infofile);
    endif

    ## write type at other end
    eval(sprintf("%s.other_end_type = '%s';",
		 head_str, tail.type));
    eval(sprintf("%s.other_end_type = '%s';",
		 tail_str, head.type));

    ## assign bond number
    for i = 1:head.n_subs
      ++unique_bond_number;
      eval(sprintf("%s.subbond%i.index = +%i;",
		   head_str, i, unique_bond_number));
      eval(sprintf("%s.subbond%i.index = -%i;",
		   tail_str, i, unique_bond_number));
463
464
465
466
467
468
469

470
471
472
473
474

















475
476
477
478
479
480
481
469
470
471
472
473
474
475
476





477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500







+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







  components = zeros(n_comps, max(n_vector_bonds));

  if (struct_contains(comp_s, "comp"))
    for [comp, comp_name] = comp_s.comp
      counter = 0;
      for [bond, bond_name] = comp
	if (index(bond_name, "bond") == 1)
	  if (strcmp(bond.other_end_type, "SS"))
	  for [sub_bond, sub_bond_name] = bond
	    if (index(sub_bond_name, "subbond") == 1)
	      components(comp.index, ++counter) = sub_bond.index
	    endif
	  endfor
	    for [sub_bond, sub_bond_name] = bond
	      if (index(sub_bond_name, "subbond") == 1)
		components(comp.index, ++counter) = sub_bond.index
	      endif
	    endfor
	  endif
	endif
      endfor
      for [bond, bond_name] = comp
	if (index(bond_name, "bond") == 1)
	  if (!strcmp(bond.other_end_type, "SS"))
	    for [sub_bond, sub_bond_name] = bond
	      if (index(sub_bond_name, "subbond") == 1)
		components(comp.index, ++counter) = sub_bond.index
	      endif
	    endfor
	  endif
	endif
      endfor
    endfor
  endif

  if (struct_contains(comp_s, "port"))
    for [port, port_name] = comp_s.port

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