finally usuable(?) again!

This commit is contained in:
Florian Streibelt 2011-10-19 00:27:02 +02:00
parent 4af7594490
commit 67ebf64ffe
2 changed files with 8 additions and 7 deletions

View File

@ -78,7 +78,7 @@ class Display(threading.Thread):
#print "Starting Display thread" #print "Starting Display thread"
self.screensaver.start() self.screensaver.start()
while(self.runme): while(self.runme):
print("display thread loop\n") #print("display thread loop\n")
self.mutex_get() self.mutex_get()
#print("display got mutex and handles scroll\n") #print("display got mutex and handles scroll\n")
self.offset_line1 = self.display_handle_scroll(1,self.scroll_line1,self.offset_line1) self.offset_line1 = self.display_handle_scroll(1,self.scroll_line1,self.offset_line1)
@ -203,6 +203,8 @@ class Display(threading.Thread):
if (not self.serialport == None): if (not self.serialport == None):
if (idle_reset): if (idle_reset):
self.screensaver.idle_reset(); self.screensaver.idle_reset();
self.scroll_line1=None
self.scroll_line2=None
self.serialport.write(text) self.serialport.write(text)
else: else:
self.open_port() self.open_port()
@ -235,20 +237,20 @@ class Screensaver (threading.Thread):
self.display=display self.display=display
self.runme=True self.runme=True
self.idlecounter=0 self.idlecounter=0
self.timeout_dim=10 self.timeout_dim=30
self.timeout_message=20 self.timeout_message=60
self.timeout_off=32 self.timeout_off=300
self.mutex = allocate_lock() self.mutex = allocate_lock()
threading.Thread.__init__(self) threading.Thread.__init__(self)
def run(self): def run(self):
print "Starting Screensaver thread" #print "Starting Screensaver thread"
while(self.runme): while(self.runme):
self.mutex.acquire() self.mutex.acquire()
self._main_loop() self._main_loop()
self.mutex.release() self.mutex.release()
time.sleep(.5) time.sleep(.5)
print "Exiting Screensaver thread" #print "Exiting Screensaver thread"
def terminate(self): def terminate(self):
self.runme = False self.runme = False

View File

@ -430,7 +430,6 @@ def main():
myDisplay = Display("/dev/ttyUSB0") myDisplay = Display("/dev/ttyUSB0")
myDisplay.start() myDisplay.start()
myDisplay.cmd_reset() myDisplay.cmd_reset()
time.sleep(2)
myDisplay.cmd_cursor_show(False) myDisplay.cmd_cursor_show(False)
myDisplay.display_screen("HINWEIS","Herzlich willkommen bei der Freitagsrunde! *** ") myDisplay.display_screen("HINWEIS","Herzlich willkommen bei der Freitagsrunde! *** ")