Forráskód Böngészése

Add model_move to help menu and several fixes to original code; seems to work in simple scenario's

Yentl Van Tendeloo 7 éve
szülő
commit
0e533dfc54
2 módosított fájl, 5 hozzáadás és 2 törlés
  1. 4 1
      bootstrap/core_algorithm.alc
  2. 1 1
      wrappers/modelverse_SCCD.py

+ 4 - 1
bootstrap/core_algorithm.alc

@@ -1046,6 +1046,7 @@ String function cmd_help():
 	result = ""
 	result = ""
 	result = result + ("Model operations\n")
 	result = result + ("Model operations\n")
 	result = result + ("    model_add                       -- Add a new model\n")
 	result = result + ("    model_add                       -- Add a new model\n")
+	result = result + ("    model_move                      -- Move a model to a different location\n")
 	result = result + ("    model_modify                    -- Modify an existing model\n")
 	result = result + ("    model_modify                    -- Modify an existing model\n")
 	result = result + ("    model_list                      -- List all models\n")
 	result = result + ("    model_list                      -- List all models\n")
 	result = result + ("    model_list_full                 -- List all models with full info\n")
 	result = result + ("    model_list_full                 -- List all models with full info\n")
@@ -1106,7 +1107,7 @@ String function cmd_model_move(source : String, target : String):
 
 
 			// Now the folder links
 			// Now the folder links
 			Element links
 			Element links
-			links = allIncomingAssociationInstances(core, "contains", source_id)
+			links = allIncomingAssociationInstances(core, source_id, "contains")
 			while (set_len(links) > 0):
 			while (set_len(links) > 0):
 				model_delete_element(core, set_pop(links))
 				model_delete_element(core, set_pop(links))
 			instantiate_link(core, "contains", "", get_entry_id(get_foldername(target)), source_id)
 			instantiate_link(core, "contains", "", get_entry_id(get_foldername(target)), source_id)
@@ -1115,6 +1116,8 @@ String function cmd_model_move(source : String, target : String):
 			dict_add(caches["models"], target, caches["models"][source])
 			dict_add(caches["models"], target, caches["models"][source])
 			dict_delete(caches["models"], source)
 			dict_delete(caches["models"], source)
 
 
+			// Done
+			return "Success"!
 		else:
 		else:
 			return "Model exists: " + target!
 			return "Model exists: " + target!
 	else:
 	else:

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Wed May  2 08:26:00 2018
+Date:   Wed May  2 08:31:29 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server