Browse Source

Fixed some problems with transformations which break up the reachability
analysis

Yentl Van Tendeloo 8 years ago
parent
commit
830846067d
3 changed files with 11 additions and 8 deletions
  1. 4 3
      integration/utils.py
  2. 1 1
      models/control_to_EPN.mvc
  3. 6 4
      models/plant_to_EPN.mvc

+ 4 - 3
integration/utils.py

@@ -19,6 +19,7 @@ from check_objects import to_recompile
 
 taskname = "test_task"
 parallel_push = True
+TIMEOUT = 2000
 
 slow = pytest.mark.skipif(
     not pytest.config.getoption("--runslow"),
@@ -154,13 +155,13 @@ def run_file(files, parameters, expected, wait=False):
         # ... and wait for replies
         if expected is None:
             while 1:
-                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240).read()
+                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=TIMEOUT).read()
                 val = json.loads(val)
                 print(val)
         for e in expected:
             c = len(e) if isinstance(e, set) else 1
             for _ in range(c):
-                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240).read()
+                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=TIMEOUT).read()
                 val = json.loads(val)
 
                 if proc.returncode is not None:
@@ -256,7 +257,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
                         # Modelverse has already terminated, which isn't a good sign!
                         return False
 
-                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240 if not timeout else 20).read()
+                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=TIMEOUT if not timeout else 20).read()
                     val = json.loads(val)
                 except:
                     if timeout:

+ 1 - 1
models/control_to_EPN.mvc

@@ -442,7 +442,7 @@ All_RAM Control2EPN {
                     label = "16"
                     value_name = $
                         String function value(model : Element, name : String, mapping : Element):
-                            return string_join(read_attribute(model, mapping["0"], "name"), read_type(model, mapping["2"]))!
+                            return string_join(string_join(read_attribute(model, mapping["0"], "name"), read_type(model, mapping["2"])), read_attribute(model, mapping["2"], "objDetected"))!
                         $
                 }
 

+ 6 - 4
models/plant_to_EPN.mvc

@@ -331,7 +331,7 @@ A B {
                     label = "10"
                     value_name = $
                         String function value(model : Element, name : String, mapping : Element):
-                            return string_join(read_attribute(model, mapping["0"], "name"), read_type(model, mapping["2"]))!
+                            return string_join(string_join(read_attribute(model, mapping["0"], "name"), read_type(model, mapping["2"])), read_attribute(model, mapping["2"], "objPresent"))!
                         $
                 }
                 Post_Encapsulated_PetriNet/P2T (post_ct_3, post_ct_10) {
@@ -561,6 +561,11 @@ A B {
                 Pre_Encapsulated_PetriNet/PortPlace (pre_de_20, pre_de_19) {
                     label = "21"
                 }
+
+                Pre_Encapsulated_PetriNet/T2P (pre_de_7, pre_de_10) {
+                    label = "26"
+                }
+
                 Pre_PLANT2EPN_tlink (pre_de_2, pre_de_7) {
                     label = "100"
                 }
@@ -655,9 +660,6 @@ A B {
                     label = "21"
                 }
 
-                Post_Encapsulated_PetriNet/P2T (post_de_10, post_de_7) {
-                    label = "22"
-                }
                 Post_Encapsulated_PetriNet/T2P (post_de_7, post_de_13) {
                     label = "23"
                 }