Bläddra i källkod

Handle "/" in model_split with tracability information

Yentl Van Tendeloo 7 år sedan
förälder
incheckning
e35c97ca74
3 ändrade filer med 7 tillägg och 4 borttagningar
  1. BIN
      bootstrap/bootstrap.m.gz
  2. BIN
      bootstrap/minimal.m.gz
  3. 7 4
      bootstrap/model_management.alc

BIN
bootstrap/bootstrap.m.gz


BIN
bootstrap/minimal.m.gz


+ 7 - 4
bootstrap/model_management.alc

@@ -5,6 +5,7 @@ include "constructors.alh"
 include "metamodels.alh"
 include "library.alh"
 include "modelling.alh"
+include "utils.alh"
 
 Element function model_fuse(models : Element):
 	Element new_model
@@ -192,6 +193,8 @@ Element function model_join(models : Element, metamodel : Element, tracability_m
 
 			src_name = read_attribute(tracability_model, readAssociationSource(tracability_model, tracability_link), "name")
 			dst_name = read_attribute(tracability_model, readAssociationDestination(tracability_model, tracability_link), "name")
+
+			log("Drawing tracability link from " + src_name + " to " + dst_name)
 			type = read_attribute(tracability_model, tracability_link, "type")
 
 			// Now try to find all possible combinations
@@ -260,7 +263,7 @@ Element function model_split(merged_model : Element, models : Element, tracabili
 		key = set_pop(keys)
 		elem = merged_model["model"][key]
 		type = read_type(merged_model, key)
-		splitted = string_split(type, "/")
+		splitted = string_split_nr(type, "/", 1)
 
 		if (list_len(splitted) == 1):
 			// Only one, so no split possible
@@ -273,8 +276,8 @@ Element function model_split(merged_model : Element, models : Element, tracabili
 				dst = reverse[cast_id(read_edge_dst(elem))]
 
 				// All present, so create the link between them
-				src_name = list_pop_final(string_split(src, "/"))
-				dst_name = list_pop_final(string_split(dst, "/"))
+				src_name = list_pop_final(string_split_nr(src, "/", 1))
+				dst_name = list_pop_final(string_split_nr(dst, "/", 1))
 
 				source = instantiate_node(tracability_model, "Reference", "")
 				target = instantiate_node(tracability_model, "Reference", "")
@@ -286,7 +289,7 @@ Element function model_split(merged_model : Element, models : Element, tracabili
 		else:
 			retyping_key = splitted[0]
 			if (list_len(string_split(key, "/")) > 1):
-				new_name = list_read(string_split(key, "/"), 1)
+				new_name = list_read(string_split_nr(key, "/", 1), 1)
 			else:
 				new_name = key