|
@@ -126,6 +126,7 @@ Element function model_loaded(model : Element):
|
|
output(" delete -- Delete an existing element")
|
|
output(" delete -- Delete an existing element")
|
|
output(" attr_add -- Add an attribute to an element")
|
|
output(" attr_add -- Add an attribute to an element")
|
|
output(" attr_del -- Delete an attribute of an element")
|
|
output(" attr_del -- Delete an attribute of an element")
|
|
|
|
+ output(" constrain -- Add a constraint function to the model")
|
|
output(" rename -- Rename an existing element")
|
|
output(" rename -- Rename an existing element")
|
|
output(" modify -- Modify the attributes of an element")
|
|
output(" modify -- Modify the attributes of an element")
|
|
output(" list -- Prints the list of elements in the model")
|
|
output(" list -- Prints the list of elements in the model")
|
|
@@ -182,6 +183,23 @@ Element function model_loaded(model : Element):
|
|
output("Instantiation error!")
|
|
output("Instantiation error!")
|
|
else:
|
|
else:
|
|
output("Unknown type specified; aborting")
|
|
output("Unknown type specified; aborting")
|
|
|
|
+ elif (cmd == "constrain"):
|
|
|
|
+ output("Element to constrain (empty for global)?")
|
|
|
|
+ String model_name
|
|
|
|
+ model_name = input()
|
|
|
|
+
|
|
|
|
+ if (model_name == ""):
|
|
|
|
+ // Global constraint
|
|
|
|
+ output("Give input to function constructors for GLOBAL constraint!")
|
|
|
|
+ set_model_constraints(model, construct_function())
|
|
|
|
+ elif (dict_in(model["model"], model_name)):
|
|
|
|
+ // Local constraint for this model
|
|
|
|
+ output("Give input to function constructors for LOCAL constraint!")
|
|
|
|
+ add_constraint(model, model_name, construct_function())
|
|
|
|
+ output("Added constraint to model!")
|
|
|
|
+ else:
|
|
|
|
+ // Local constraint, but model not found
|
|
|
|
+ output("Unknown model; aborting")
|
|
elif (cmd == "modify"):
|
|
elif (cmd == "modify"):
|
|
String model_name
|
|
String model_name
|
|
output("Element to modify?")
|
|
output("Element to modify?")
|