added empty lines between live data display entries

Fri, 16 Dec 2011 00:57:40 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Fri, 16 Dec 2011 00:57:40 +0100
changeset 87
761863c71884
parent 86
79fb119cf3c3
child 88
c889aa0be7e2

added empty lines between live data display entries

slotUI/SlotCli.py file | annotate | diff | comparison | revisions
--- a/slotUI/SlotCli.py	Fri Dec 16 00:41:36 2011 +0100
+++ b/slotUI/SlotCli.py	Fri Dec 16 00:57:40 2011 +0100
@@ -34,6 +34,7 @@
         "fuel_full":       os.path.abspath(SOUNDPREFIX + "sound/fuel_full.mp3"),
         "pitlane_enter":   os.path.abspath(SOUNDPREFIX + "sound/pitlane_enter.mp3"),
         "pitlane_exit":    os.path.abspath(SOUNDPREFIX + "sound/pitlane_exit.mp3"),
+        "data_error":      os.path.abspath(SOUNDPREFIX + "sound/data_error.mp3"),
     }
 
 def trigger_sound(what):
@@ -69,6 +70,7 @@
         self.reset_slots()
         self.sysclk = 0.00
         self.bestlap = 9999999.00
+        self.test = test
 
     def reset_slots(self):
         idx = 0
@@ -101,7 +103,7 @@
             "Pos | #/Name            | Laps | Best     | Last     | Fuel | Status    ",
             curses.color_pair(2))
         for idx in range(MAXSLOTS):
-            self.scr.addstr((3 + self.slot[idx]["position"]), 0,
+            self.scr.addstr((3 + (self.slot[idx]["position"] * 2)), 0,
                 "%3i | %i %15s | %4i | %7.2fs | %7.2fs | %3i%% | %10s" % (
                 self.slot[idx]["position"],
                 self.slot[idx]["car"] + 1, self.slot[idx]["name"],
@@ -188,8 +190,8 @@
 
             # is there something in the rx buffer?
             rx = self.box.readline()
-            if rx != "":
-                self.scr.addstr(10,0,
+            if (rx != "") or self.test:
+                self.scr.addstr(17,0,
                     "Last RX: %19s" % rx, curses.color_pair(2))
                 self.scr.refresh()
                 # we have received something
@@ -287,7 +289,7 @@
                             self.slot[slot]["status"] = "~~~~~~~~~~"
                         trigger_sound("countdown_start")
 
-                    self.scr.addstr(10,31,
+                    self.scr.addstr(17,31,
                         "Race Timer: %7.3f min" % (self.sysclk / 60),
                         curses.color_pair(2))
 

mercurial