瀏覽代碼

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

Yentl Van Tendeloo 7 年之前
父節點
當前提交
57183a509b
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 二進制
      bootstrap/bootstrap.m.gz
  2. 4 1
      bootstrap/core_algorithm.alc
  3. 1 1
      wrappers/modelverse_SCCD.py

二進制
bootstrap/bootstrap.m.gz


+ 4 - 1
bootstrap/core_algorithm.alc

@@ -1046,6 +1046,7 @@ String function cmd_help():
 	result = ""
 	result = result + ("Model operations\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_list                      -- List all models\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
 			Element links
-			links = allIncomingAssociationInstances(core, "contains", source_id)
+			links = allIncomingAssociationInstances(core, source_id, "contains")
 			while (set_len(links) > 0):
 				model_delete_element(core, set_pop(links))
 			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_delete(caches["models"], source)
 
+			// Done
+			return "Success"!
 		else:
 			return "Model exists: " + target!
 	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)
 
-Date:   Wed May  2 08:26:00 2018
+Date:   Wed May  2 08:31:29 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server