File tree Expand file tree Collapse file tree 3 files changed +31
-15
lines changed Expand file tree Collapse file tree 3 files changed +31
-15
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,20 @@ def __onTimer(self):
109109 self .put (event )
110110
111111 #----------------------------------------------------------------------
112- def start (self ):
113- """引擎启动"""
112+ def start (self , timer = True ):
113+ """
114+ 引擎启动
115+ timer:是否要启动计时器
116+ """
114117 # 将引擎设为启动
115118 self .__active = True
116119
117120 # 启动事件处理线程
118121 self .__thread .start ()
119122
120123 # 启动计时器,计时器事件间隔默认设定为1秒
121- self .__timer .start (1000 )
124+ if timer :
125+ self .__timer .start (1000 )
122126
123127 #----------------------------------------------------------------------
124128 def stop (self ):
@@ -245,17 +249,21 @@ def __runTimer(self):
245249 sleep (self .__timerSleep )
246250
247251 #----------------------------------------------------------------------
248- def start (self ):
249- """引擎启动"""
252+ def start (self , timer = True ):
253+ """
254+ 引擎启动
255+ timer:是否要启动计时器
256+ """
250257 # 将引擎设为启动
251258 self .__active = True
252259
253260 # 启动事件处理线程
254261 self .__thread .start ()
255262
256263 # 启动计时器,计时器事件间隔默认设定为1秒
257- self .__timerActive = True
258- self .__timer .start ()
264+ if timer :
265+ self .__timerActive = True
266+ self .__timer .start ()
259267
260268 #----------------------------------------------------------------------
261269 def stop (self ):
Original file line number Diff line number Diff line change @@ -109,16 +109,20 @@ def __onTimer(self):
109109 self .put (event )
110110
111111 #----------------------------------------------------------------------
112- def start (self ):
113- """引擎启动"""
112+ def start (self , timer = True ):
113+ """
114+ 引擎启动
115+ timer:是否要启动计时器
116+ """
114117 # 将引擎设为启动
115118 self .__active = True
116119
117120 # 启动事件处理线程
118121 self .__thread .start ()
119122
120123 # 启动计时器,计时器事件间隔默认设定为1秒
121- self .__timer .start (1000 )
124+ if timer :
125+ self .__timer .start (1000 )
122126
123127 #----------------------------------------------------------------------
124128 def stop (self ):
@@ -245,17 +249,21 @@ def __runTimer(self):
245249 sleep (self .__timerSleep )
246250
247251 #----------------------------------------------------------------------
248- def start (self ):
249- """引擎启动"""
252+ def start (self , timer = True ):
253+ """
254+ 引擎启动
255+ timer:是否要启动计时器
256+ """
250257 # 将引擎设为启动
251258 self .__active = True
252259
253260 # 启动事件处理线程
254261 self .__thread .start ()
255262
256263 # 启动计时器,计时器事件间隔默认设定为1秒
257- self .__timerActive = True
258- self .__timer .start ()
264+ if timer :
265+ self .__timerActive = True
266+ self .__timer .start ()
259267
260268 #----------------------------------------------------------------------
261269 def stop (self ):
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class MainEngine(object):
2323 def __init__ (self ):
2424 """Constructor"""
2525 # 创建事件引擎
26- self .eventEngine = EventEngine2 ()
26+ self .eventEngine = EventEngine ()
2727 self .eventEngine .start ()
2828
2929 # 创建数据引擎
You can’t perform that action at this time.
0 commit comments