|
@@ -39,7 +39,7 @@ All_RAM Control2EPN {
|
|
|
$
|
|
|
value_tokens = $
|
|
|
Integer function value(model : Element, name : String, mapping : Element):
|
|
|
- return 1!
|
|
|
+ return 0!
|
|
|
$
|
|
|
}
|
|
|
Post_Encapsulated_PetriNet/Port post_ports_11 {
|
|
@@ -102,7 +102,7 @@ All_RAM Control2EPN {
|
|
|
$
|
|
|
value_tokens = $
|
|
|
Integer function value(model : Element, name : String, mapping : Element):
|
|
|
- return 1!
|
|
|
+ return 0!
|
|
|
$
|
|
|
}
|
|
|
Post_Encapsulated_PetriNet/Port post_ports_14 {
|
|
@@ -123,7 +123,18 @@ All_RAM Control2EPN {
|
|
|
$
|
|
|
value_tokens = $
|
|
|
Integer function value(model : Element, name : String, mapping : Element):
|
|
|
- return 0!
|
|
|
+ // Set the detected output based on the initial state
|
|
|
+ Element states
|
|
|
+ String state
|
|
|
+
|
|
|
+ states = allInstances(model, "PW_Control/State")
|
|
|
+ while (read_nr_out(states) > 0):
|
|
|
+ state = set_pop(states)
|
|
|
+ if (value_eq(read_attribute(model, state, "isInitial"), True)):
|
|
|
+ if (read_type(model, state) == "PW_Control/Up"):
|
|
|
+ return 1!
|
|
|
+ else:
|
|
|
+ return 0!
|
|
|
$
|
|
|
}
|
|
|
Post_Encapsulated_PetriNet/Port post_ports_15 {
|
|
@@ -144,7 +155,18 @@ All_RAM Control2EPN {
|
|
|
$
|
|
|
value_tokens = $
|
|
|
Integer function value(model : Element, name : String, mapping : Element):
|
|
|
- return 1!
|
|
|
+ // Set the detected output based on the initial state
|
|
|
+ Element states
|
|
|
+ String state
|
|
|
+
|
|
|
+ states = allInstances(model, "PW_Control/State")
|
|
|
+ while (read_nr_out(states) > 0):
|
|
|
+ state = set_pop(states)
|
|
|
+ if (value_eq(read_attribute(model, state, "isInitial"), True)):
|
|
|
+ if (read_type(model, state) == "PW_Control/Neutral"):
|
|
|
+ return 1!
|
|
|
+ else:
|
|
|
+ return 0!
|
|
|
$
|
|
|
}
|
|
|
Post_Encapsulated_PetriNet/Port post_ports_16 {
|
|
@@ -165,7 +187,18 @@ All_RAM Control2EPN {
|
|
|
$
|
|
|
value_tokens = $
|
|
|
Integer function value(model : Element, name : String, mapping : Element):
|
|
|
- return 0!
|
|
|
+ // Set the detected output based on the initial state
|
|
|
+ Element states
|
|
|
+ String state
|
|
|
+
|
|
|
+ states = allInstances(model, "PW_Control/State")
|
|
|
+ while (read_nr_out(states) > 0):
|
|
|
+ state = set_pop(states)
|
|
|
+ if (value_eq(read_attribute(model, state, "isInitial"), True)):
|
|
|
+ if (read_type(model, state) == "PW_Control/Down"):
|
|
|
+ return 1!
|
|
|
+ else:
|
|
|
+ return 0!
|
|
|
$
|
|
|
}
|
|
|
Post_Encapsulated_PetriNet/Port post_ports_17 {
|