浏览代码

Workaround for bug in SCCD with keep_running

Yentl Van Tendeloo 8 年之前
父节点
当前提交
3e8b65d6e1
共有 6 个文件被更改,包括 10 次插入7 次删除
  1. 2 0
      integration/test_powerwindow.py
  2. 1 0
      models/merge_EPN.alc
  3. 3 2
      unit/log_output.py
  4. 1 2
      unit/log_output.xml
  5. 2 2
      wrappers/poll_print.py
  6. 1 1
      wrappers/poll_print.xml

+ 2 - 0
integration/test_powerwindow.py

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

+ 1 - 0
models/merge_EPN.alc

@@ -12,4 +12,5 @@ Boolean function main(model : Element):
 		split = string_split(read_type(model, key), "/")
 		split = string_split(read_type(model, key), "/")
 		retype(model, key, string_join("Encapsulated_PetriNet/", split[1]))
 		retype(model, key, string_join("Encapsulated_PetriNet/", split[1]))
 
 
+	//log("merge_EPN has seen # elements: " + cast_v2s(dict_len(model["model"])))
 	return True!
 	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)
 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 author: Yentl Van Tendeloo
 Model name:   Logging
 Model name:   Logging
@@ -69,7 +69,7 @@ class Logging(RuntimeClassBase):
         self.states["/init"].addTransition(_init_2)
         self.states["/init"].addTransition(_init_2)
     
     
     def _init_enter(self):
     def _init_enter(self):
-        self.addTimer(0, 10)
+        self.addTimer(0, 0.1)
     
     
     def _init_exit(self):
     def _init_exit(self):
         self.removeTimer(0)
         self.removeTimer(0)
@@ -77,6 +77,7 @@ class Logging(RuntimeClassBase):
     def _init_0_exec(self, parameters):
     def _init_0_exec(self, parameters):
         value = parameters[0]
         value = parameters[0]
         self.log.append(value)
         self.log.append(value)
+        print("Got value: " + str(value))
     
     
     def initializeStatechart(self):
     def initializeStatechart(self):
         # enter default state
         # enter default state

+ 1 - 2
unit/log_output.xml

@@ -12,7 +12,6 @@
             <parameter name="log"/>
             <parameter name="log"/>
             <body>
             <body>
                 self.log = log
                 self.log = log
-                print("SC initialized")
             </body>
             </body>
         </constructor>
         </constructor>
         <scxml initial="init">
         <scxml initial="init">
@@ -25,7 +24,7 @@
                     </script>
                     </script>
                 </transition>
                 </transition>
 
 
-                <transition after="10" target="."/>
+                <transition after="0.1" target="."/>
 
 
                 <transition event="terminate" port="inp" target="../finished"/>
                 <transition event="terminate" port="inp" target="../finished"/>
             </state>
             </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)
 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 author: Yentl Van Tendeloo
 Model name:   Logging
 Model name:   Logging
@@ -73,7 +73,7 @@ class Logging(RuntimeClassBase):
         self.states["/init"].addTransition(_init_3)
         self.states["/init"].addTransition(_init_3)
     
     
     def _init_enter(self):
     def _init_enter(self):
-        self.addTimer(0, 10)
+        self.addTimer(0, 0.1)
     
     
     def _init_exit(self):
     def _init_exit(self):
         self.removeTimer(0)
         self.removeTimer(0)

+ 1 - 1
wrappers/poll_print.xml

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