# HG changeset patch # User Malte Bayer # Date 1324137966 -3600 # Node ID bcba10c35f09c844a429a2830c20721c8d3bd7f8 # Parent 85c4a4da2ffd18446a8d461dd4b43ee788ebd845 added test option without communication diff -r 85c4a4da2ffd -r bcba10c35f09 slotUI/SlotCli.py --- a/slotUI/SlotCli.py Sat Dec 17 16:47:04 2011 +0100 +++ b/slotUI/SlotCli.py Sat Dec 17 17:06:06 2011 +0100 @@ -27,7 +27,7 @@ SOUNDS = { "countdown_start": os.path.abspath(SOUNDPREFIX + "sound/countdown.mp3"), "race_start": os.path.abspath(SOUNDPREFIX + "sound/racestart.mp3"), - "race_prepare": os.path.abspath(SOUNDPREFIX + "sound/siren.mp3"), + "race_prepare": os.path.abspath(SOUNDPREFIX + "sound/prepare.mp3"), "lap_record": os.path.abspath(SOUNDPREFIX + "sound/laprecord.mp3"), "fuel_warning1": os.path.abspath(SOUNDPREFIX + "sound/fuel1.mp3"), "fuel_warning2": os.path.abspath(SOUNDPREFIX + "sound/fuel2.mp3"), @@ -76,6 +76,7 @@ ] self.reset_slots() self.sysclk = 0.00 + self.sysclk_last = 0.00 self.bestlap = 9999999.00 self.test = test self.laplimit = 999; @@ -399,15 +400,17 @@ trigger_sound("resume") - if (self.sysclk_last != self.sysclk) and ((self.sysclk / 60) >= self.timelimit): - # we have time limit reached! - trigger_sound("win") - # get the one with position 1 - for slot in self.slots: - if slot["position"] == 1: - slot["status"] = "WINNER!" - self.box.query("+") # stop race - + if (self.sysclk_last > 0) and (self.sysclk_last != self.sysclk) and ((self.sysclk / 60) >= self.timelimit): + self.sysclk_last = self.sysclk + # we have time limit reached! + trigger_sound("win") + # get the one with position 1 + for slot in self.slots: + if slot["position"] == 1: + slot["status"] = "WINNER!" + self.box.query("+") # stop race + self.sysclk_last = self.sysclk + self.scr.addstr(17,31,