From 02b16688155d7b3e274d7ddab0a0632141ed69ec Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 30 Jun 2017 23:59:05 +0200 Subject: [PATCH] add more debug --- src/fenrir/core/eventManager.py | 10 +++------- src/fenrir/core/screenManager.py | 4 +++- src/fenrir/screenDriver/vcsaDriver.py | 1 + 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/fenrir/core/eventManager.py b/src/fenrir/core/eventManager.py index 69a11455..d6c06475 100644 --- a/src/fenrir/core/eventManager.py +++ b/src/fenrir/core/eventManager.py @@ -44,7 +44,7 @@ class eventManager(): self.eventDispatcher(event) #print('NET loop ' + str(time.time() - st)) def eventDispatcher(self, event): - print(event['Type'], self._eventQueue.qsize()) + self.env['runtime']['debug'].writeDebugOut('eventManager:eventDispatcher:start: event:' + str(event['Type']) + ' QueueSize:' + str( self._eventQueue.qsize()),debug.debugLevel.INFO) if not event: return if event['Type'] == fenrirEventType.Ignore: @@ -53,11 +53,9 @@ class eventManager(): self.handleStopMainLoop() return elif event['Type'] == fenrirEventType.ScreenUpdate: - pass self.env['runtime']['fenrirManager'].handleScreenUpdate() elif event['Type'] == fenrirEventType.KeyboardInput: self.env['runtime']['fenrirManager'].handleInput() - #self.env['runtime']['fenrirManager'].handleScreenUpdate() elif event['Type'] == fenrirEventType.BrailleInput: pass elif event['Type'] == fenrirEventType.PlugInputDevice: @@ -68,7 +66,6 @@ class eventManager(): self.env['runtime']['fenrirManager'].handleScreenChange() elif event['Type'] == fenrirEventType.HeartBeat: self.env['runtime']['fenrirManager'].handleHeartBeat() - #print('HeartBeat at {0} {1}'.format(event['Type'], event['Data'] )) def isMainEventLoopRunning(self): return self._mainLoopRunning.value == 1 def startMainEventLoop(self): @@ -76,7 +73,7 @@ class eventManager(): while( self.isMainEventLoopRunning()): st = time.time() self.proceedEventLoop() - print('ALL loop ' + str(time.time() - st)) + def handleStopMainLoop(self): self._mainLoopRunning.value = 0 time.sleep(0.1) @@ -141,8 +138,7 @@ class eventManager(): else: Data = function() except Exception as e: - pass - print(e) + self.env['runtime']['debug'].writeDebugOut('eventManager:simpleEventWorkerThread:function():' + st(e),debug.debugLevel.ERROR) self.putToEventQueue(event, Data) if runOnce: break diff --git a/src/fenrir/core/screenManager.py b/src/fenrir/core/screenManager.py index e59ae166..3d159901 100644 --- a/src/fenrir/core/screenManager.py +++ b/src/fenrir/core/screenManager.py @@ -21,9 +21,11 @@ class screenManager(): self.env['runtime']['settingsManager'].shutdownDriver('screenDriver') def update(self, trigger='onUpdate'): - self.env['runtime']['screenDriver'].getCurrScreen() + self.env['runtime']['screenDriver'].getCurrScreen() + if trigger == 'onScreenChange': self.env['runtime']['screenDriver'].getSessionInformation() + self.env['screen']['oldApplication'] = self.env['screen']['newApplication'] if self.isScreenChange(): self.changeBrailleScreen() diff --git a/src/fenrir/screenDriver/vcsaDriver.py b/src/fenrir/screenDriver/vcsaDriver.py index 2aa835c5..dc5cbf41 100644 --- a/src/fenrir/screenDriver/vcsaDriver.py +++ b/src/fenrir/screenDriver/vcsaDriver.py @@ -135,6 +135,7 @@ class driver(): def update(self, trigger='onUpdate'): if trigger == 'onInput': # no need for an update on input for VCSA return + #print(self.env['screen']['newTTY'], self.env['screen']['oldTTY']) newContentBytes = b'' try: # read screen