Browse Source

Workaround for bug in SCCD with keep_running

Yentl Van Tendeloo 6 years ago
parent
commit
3e8b65d6e1

+ 2 - 0
integration/test_powerwindow.py

@@ -157,8 +157,10 @@ class TestPowerWindow(unittest.TestCase):
                     raise Exception("Seemingly called some operation twice!")
                 called += 1
                 if called > len(callbacks) and fixed is not None:
+                    print("Uploading fixed!")
                     model_overwrite(None, open(fixed, "r").read())
                 else:
+                    print("Uploading first for %s!" % filename)
                     model_overwrite(None, open(filename, "r").read())
             return func
 

+ 1 - 0
models/merge_EPN.alc

@@ -12,4 +12,5 @@ Boolean function main(model : Element):
 		split = string_split(read_type(model, key), "/")
 		retype(model, key, string_join("Encapsulated_PetriNet/", split[1]))
 
+	//log("merge_EPN has seen # elements: " + cast_v2s(dict_len(model["model"])))
 	return True!

+ 3 - 2
unit/log_output.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 Aug 23 14:57:48 2017
+Date:   Mon Aug 28 10:53:51 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   Logging
@@ -69,7 +69,7 @@ class Logging(RuntimeClassBase):
         self.states["/init"].addTransition(_init_2)
     
     def _init_enter(self):
-        self.addTimer(0, 10)
+        self.addTimer(0, 0.1)
     
     def _init_exit(self):
         self.removeTimer(0)
@@ -77,6 +77,7 @@ class Logging(RuntimeClassBase):
     def _init_0_exec(self, parameters):
         value = parameters[0]
         self.log.append(value)
+        print("Got value: " + str(value))
     
     def initializeStatechart(self):
         # enter default state

+ 1 - 2
unit/log_output.xml

@@ -12,7 +12,6 @@
             <parameter name="log"/>
             <body>
                 self.log = log
-                print("SC initialized")
             </body>
         </constructor>
         <scxml initial="init">
@@ -25,7 +24,7 @@
                     </script>
                 </transition>
 
-                <transition after="10" target="."/>
+                <transition after="0.1" target="."/>
 
                 <transition event="terminate" port="inp" target="../finished"/>
             </state>

+ 2 - 2
wrappers/poll_print.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 Aug 23 16:04:59 2017
+Date:   Mon Aug 28 10:54:41 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   Logging
@@ -73,7 +73,7 @@ class Logging(RuntimeClassBase):
         self.states["/init"].addTransition(_init_3)
     
     def _init_enter(self):
-        self.addTimer(0, 10)
+        self.addTimer(0, 0.1)
     
     def _init_exit(self):
         self.removeTimer(0)

+ 1 - 1
wrappers/poll_print.xml

@@ -18,7 +18,7 @@
                     </script>
                 </transition>
 
-                <transition after="10" target="."/>
+                <transition after="0.1" target="."/>
 
                 <transition event="terminate" port="inp" target="../finished"/>