fix things

This commit is contained in:
root
2016-07-12 16:51:26 +02:00
parent d17135da01
commit f67176771a
3 changed files with 20 additions and 14 deletions

View File

@@ -43,27 +43,33 @@ class fenrir():
self.threadUpdateScreen = Thread(target=self.updateScreen, args=())
self.threadHandleInput = Thread(target=self.handleInput, args=())
self.threadCommands = Thread(target=self.handleCommands, args=())
#self.threadUpdateScreen.start()
#self.threadHandleInput.start()
self.threadUpdateScreen.start()
self.threadHandleInput.start()
#self.threadCommands.start()
while(self.environment['generalInformation']['running']):
#starttime = time.time()
#time.sleep(0.2)
self.updateScreen()
self.handleInput()
self.handleCommands()
time.sleep(1)
#self.updateScreen()
#self.handleInput()
#self.handleCommands()
#print(time.time() -starttime)
self.shutdown()
def handleInput(self):
#while(self.environment['generalInformation']['running']):
self.environment = self.environment['runtime']['inputManager'].getKeyPressed(self.environment)
#if self.environment['input']['currShortcutString'] == '':
# self.environment['commandInfo']['currCommand'] = ''
while(self.environment['generalInformation']['running']):
self.environment = self.environment['runtime']['inputManager'].getKeyPressed(self.environment)
self.environment = self.environment['runtime']['screenDriver'].analyzeScreen(self.environment)
#print(self.environment['screenData']['delta'])
if self.environment['input']['currShortcutString'] != '':
self.handleCommands()
print('läuft')
#if self.environment['input']['currShortcutString'] == '':
# self.environment['commandInfo']['currCommand'] = ''
def updateScreen(self):
#while(self.environment['generalInformation']['running']):
self.environment = self.environment['runtime']['screenDriver'].analyzeScreen(self.environment)
while(self.environment['generalInformation']['running']):
self.environment = self.environment['runtime']['screenDriver'].analyzeScreen(self.environment)
time.sleep(0.5)
def handleCommands(self):
#while(self.environment['generalInformation']['running']):