Browse Source

Fix the read operation again: also return a list of instantiatable links

Yentl Van Tendeloo 9 years ago
parent
commit
dbf2eba432
2 changed files with 6 additions and 7 deletions
  1. 1 2
      bootstrap/object_operations.alc
  2. 5 5
      integration/code/pn_interface.alc

+ 1 - 2
bootstrap/object_operations.alc

@@ -100,8 +100,7 @@ Element function getInstantiatableAttributes(model : Element, element : Element)
 	while (0 < read_nr_out(set_own)):
 		e = set_pop(set_own)
 		if (is_physical_string(e)):
-			// This is a primitive type, so add to the list
-			dict_add(result, e, element[e])
+			dict_add(result, e, getName(model, element[e]))
 
 	return result
 

+ 5 - 5
integration/code/pn_interface.alc

@@ -285,11 +285,11 @@ Element function petrinet_loaded(model : Element):
 				if (cast_v2s(read_elem) != "None"):
 					output("Value: " + cast_v2s(read_elem))
 				output("Defines attributes:")
-				//attr_list_pn = getInstantiatableAttributes(model, read_elem)
-				//attr_keys_pn = dict_keys(attr_list_pn)
-				//while (0 < read_nr_out(attr_keys_pn)):
-				//	attr_key_pn = set_pop(attr_keys_pn)
-				//	output(((("   " + attr_key_pn) + " : ") + cast_e2s(attr_list_pn[attr_key_pn])))
+				attr_list_pn = getInstantiatableAttributes(model, read_elem)
+				attr_keys_pn = dict_keys(attr_list_pn)
+				while (0 < read_nr_out(attr_keys_pn)):
+					attr_key_pn = set_pop(attr_keys_pn)
+					output(((("   " + attr_key_pn) + " : ") + cast_v2s(attr_list_pn[attr_key_pn])))
 				output("Attributes:")
 				attr_list_pn = getAttributeList(model, cmd)
 				attr_keys_pn = dict_keys(attr_list_pn)