performance improvements

This commit is contained in:
chrys
2017-06-27 01:35:12 +02:00
parent 449f149f97
commit 16f4e3e981
6 changed files with 90 additions and 12 deletions

View File

@@ -53,9 +53,11 @@ 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:

View File

@@ -63,8 +63,8 @@ class fenrirManager():
self.environment['runtime']['inputManager'].clearEventBuffer()
if self.environment['input']['keyForeward'] > 0:
self.environment['input']['keyForeward'] -=1
#self.environment['runtime']['screenManager'].update('onInput')
#self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
self.environment['runtime']['screenManager'].update('onInput')
self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
self.handleCommands()
def handleScreenChange(self):
self.environment['runtime']['screenManager'].update('onScreenChange')
@@ -80,14 +80,15 @@ class fenrirManager():
def handleScreenUpdate(self):
s = time.time()
self.environment['runtime']['screenManager'].update('onUpdate')
'''
if self.environment['runtime']['applicationManager'].isApplicationChange():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onApplicationChange')
self.environment['runtime']['commandManager'].executeSwitchTrigger('onSwitchApplicationProfile', \
self.environment['runtime']['applicationManager'].getPrevApplication(), \
self.environment['runtime']['applicationManager'].getCurrentApplication())
'''
#if not self.environment['runtime']['screenManager'].isScreenChange():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
#print(time.time() -s)

View File

@@ -21,16 +21,18 @@ class screenManager():
self.env['runtime']['settingsManager'].shutdownDriver('screenDriver')
def update(self, trigger='onUpdate'):
self.env['runtime']['screenDriver'].getCurrScreen()
self.env['runtime']['screenDriver'].getSessionInformation()
if trigger == 'onScreenChange':
self.env['runtime']['screenDriver'].getCurrScreen()
self.env['runtime']['screenDriver'].getSessionInformation()
self.env['screen']['oldApplication'] = self.env['screen']['newApplication']
if self.isScreenChange():
self.changeBrailleScreen()
if not self.isSuspendingScreen(self.env['screen']['newTTY']):
self.env['runtime']['screenDriver'].update(trigger)
if trigger == 'onUpdate' or self.isScreenChange() \
or len(self.env['screen']['newDelta']) > 6:
self.env['runtime']['screenDriver'].getCurrApplication()
#if trigger == 'onUpdate' or self.isScreenChange() \
# or len(self.env['screen']['newDelta']) > 6:
# self.env['runtime']['screenDriver'].getCurrApplication()
self.env['screen']['lastScreenUpdate'] = time.time()
def isSuspendingScreen(self, screen = None):