fix problem on startup

This commit is contained in:
chrys 2018-03-28 18:11:03 +02:00
parent a636d8020e
commit 88a10882f2
2 changed files with 7 additions and 5 deletions

View File

@ -52,7 +52,7 @@ class fenrirManager():
self.environment['runtime']['eventManager'].startMainEventLoop() self.environment['runtime']['eventManager'].startMainEventLoop()
self.shutdown() self.shutdown()
def handleInput(self, event): def handleInput(self, event):
#startTime = time.time #startTime = time.time()
self.environment['runtime']['debug'].writeDebugOut('DEBUG INPUT fenrirMan:' + str(event),debug.debugLevel.INFO) self.environment['runtime']['debug'].writeDebugOut('DEBUG INPUT fenrirMan:' + str(event),debug.debugLevel.INFO)
if not event['Data']: if not event['Data']:
event['Data'] = self.environment['runtime']['inputManager'].getInputEvent() event['Data'] = self.environment['runtime']['inputManager'].getInputEvent()

View File

@ -60,17 +60,19 @@ class driver(inputDriver):
def plugInputDeviceWatchdogUdev(self,active , eventQueue): def plugInputDeviceWatchdogUdev(self,active , eventQueue):
context = pyudev.Context() context = pyudev.Context()
monitor = pyudev.Monitor.from_netlink(context) monitor = pyudev.Monitor.from_netlink(context)
monitor.filter_by(subsystem='input') monitor.filter_by(subsystem='input')
# wait until start process finished
time.sleep(8)
monitor.start() monitor.start()
while active.value: while active.value:
devices = monitor.poll(2) devices = monitor.poll(2)
if devices: if devices:
while monitor.poll(0.5): while monitor.poll(0.2):
time.sleep(0.2) time.sleep(0.1)
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
return time.time() return time.time()
def plugInputDeviceWatchdogTimer(self, active): def plugInputDeviceWatchdogTimer(self, active):
time.sleep(2.5) time.sleep(10)
return time.time() return time.time()
def inputWatchdog(self,active , eventQueue): def inputWatchdog(self,active , eventQueue):