|
@@ -321,16 +321,26 @@ Void function process_raised_event(model : Element, event : Element, parameter_a
|
|
|
identifier = list_read(parameter_action, 0)
|
|
|
delete_class(model, data, identifier)
|
|
|
set_add_node(data["current_class_handle"]["new_events"], create_tuple("instance_deleted", parameter_action))
|
|
|
+
|
|
|
elif (scope == "broad"):
|
|
|
// Send to all classes
|
|
|
Element classes
|
|
|
classes = dict_keys(data["classes"])
|
|
|
while(set_len(classes) > 0):
|
|
|
set_add_node(data["classes"][set_pop(classes)]["new_events"], create_tuple(read_attribute(model, event, "event"), parameter_action))
|
|
|
+
|
|
|
elif (scope == "narrow"):
|
|
|
// Send to the specified class only
|
|
|
// TODO some error checking would be nice...
|
|
|
set_add_node(data["classes"][read_attribute(model, event, "target")]["new_events"], create_tuple(read_attribute(model, event, "event"), parameter_action))
|
|
|
+
|
|
|
+ elif (scope == "output"):
|
|
|
+ // Store it in the output event model
|
|
|
+ evt = instantiate_node(model, "trace/Event", "")
|
|
|
+ instantiate_attribute(model, evt, "timestamp", data["time_sim"])
|
|
|
+ instantiate_attribute(model, evt, "name", read_attribute(model, event, "event"))
|
|
|
+ instantiate_attribute(model, evt, "parameter", dict_to_string(parameter_action))
|
|
|
+
|
|
|
else:
|
|
|
// Same as local
|
|
|
set_add_node(data["current_class_handle"]["new_events"], create_tuple(read_attribute(model, event, "event"), parameter_action))
|
|
@@ -722,6 +732,10 @@ Boolean function main(model : Element):
|
|
|
time_sim = 0.0
|
|
|
dict_add(data, "time_sim", 0.0)
|
|
|
|
|
|
+ Boolean afap
|
|
|
+ // NOTE this can be changed to True for testing
|
|
|
+ afap = False
|
|
|
+
|
|
|
// Prepare for input
|
|
|
output("Ready for input!")
|
|
|
|
|
@@ -736,6 +750,8 @@ Boolean function main(model : Element):
|
|
|
Element interrupt
|
|
|
timeout = 0.0
|
|
|
while (True):
|
|
|
+ if (afap):
|
|
|
+ timeout = 0.0
|
|
|
interrupt = input_timeout(timeout)
|
|
|
|
|
|
if (value_eq(interrupt, "#EXIT#")):
|