Browse files

Catch false start more gracefully

  • Loading branch information...
1 parent b26a35a commit af457e5bee47b47fdd3e9d6805cac83b83e6086d @evanfarrar committed Sep 23, 2010
Showing with 10 additions and 259 deletions.
  1. +0 −255 build/debian/changelog
  2. +4 −3 lib/controllers/race_controller.rb
  3. +6 −1 lib/sensors/basic_message_arduino_sensor.rb
View
255 build/debian/changelog
@@ -1,33 +1,3 @@
-opensprints (0.6-9) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 06 Sep 2010 15:07:53 -0500
-opensprints (0.7-1) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sun, 05 Sep 2010 16:34:02 -0500
-opensprints (0.6-8) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 26 Aug 2010 06:32:30 -0500
-opensprints (0.6-7) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Tue, 13 Jul 2010 16:29:54 -0500
-opensprints (0.6-6) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 12 Jul 2010 17:14:03 -0500
-opensprints (0.6-5) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 23 Oct 2009 11:23:49 -0500
opensprints (0.6-4) unstable; urgency=low
Changed some stuff
@@ -102,11 +72,7 @@ opensprints (0.4-2) unstable; urgency=low
Changed some stuff
-<<<<<<< HEAD:build/debian/changelog
-- Evan Farrar <evan@opensprints.org> Mon, 28 Sep 2009 16:44:03 -0500
-=======
- -- Evan Farrar <evan@opensprints.org> Mon, 28 Sep 2009 10:25:24 -0500
->>>>>>> 973c5db96f2de324ecb1f870b0d5e32ee61103d3:build/debian/changelog
opensprints (0.4-1) unstable; urgency=low
Changed some stuff
@@ -156,224 +122,3 @@ opensprints (0.3-1) unstable; urgency=low
Changed some stuff
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 18:02:58 -0500
-opensprints (0.2-38) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 15:56:30 -0500
-opensprints (0.2-37) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 14:01:42 -0500
-opensprints (0.2-36) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 12:54:33 -0500
-opensprints (0.2-35) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 12:31:06 -0500
-opensprints (0.2-34) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 11:30:12 -0500
-opensprints (0.2-33) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 03:59:26 -0500
-opensprints (0.2-32) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 00:40:25 -0500
-opensprints (0.2-31) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 21 Sep 2009 00:37:04 -0500
-opensprints (0.2-30) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sun, 20 Sep 2009 22:10:24 -0500
-opensprints (0.2-29) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sun, 20 Sep 2009 19:18:09 -0500
-opensprints (0.2-28) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sun, 20 Sep 2009 01:01:33 -0500
-opensprints (0.2-27) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 19:05:25 -0500
-opensprints (0.2-26) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 18:59:41 -0500
-opensprints (0.2-25) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 16:58:41 -0500
-opensprints (0.2-24) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 16:52:33 -0500
-opensprints (0.2-23) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 02:28:20 -0500
-opensprints (0.2-22) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 01:45:35 -0500
-opensprints (0.2-21) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Sat, 19 Sep 2009 01:41:51 -0500
-opensprints (0.2-20) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 23:28:22 -0500
-opensprints (0.2-19) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 19:26:48 -0500
-opensprints (0.2-18) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 18:54:43 -0500
-opensprints (0.2-17) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 16:48:45 -0500
-opensprints (0.2-16) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 16:38:13 -0500
-opensprints (0.2-15) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 15:59:36 -0500
-opensprints (0.2-14) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 15:01:55 -0500
-opensprints (0.2-13) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 14:54:09 -0500
-opensprints (0.2-12) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Fri, 18 Sep 2009 14:51:21 -0500
-opensprints (0.2-11) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 17 Sep 2009 17:22:26 -0500
-opensprints (0.2-10) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 17 Sep 2009 15:18:51 -0500
-opensprints (0.2-9) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 17 Sep 2009 13:45:34 -0500
-opensprints (0.2-8) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 17 Sep 2009 12:35:02 -0500
-opensprints (0.2-7) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 17 Sep 2009 10:50:00 -0500
-opensprints (0.2-6) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Tue, 15 Sep 2009 18:32:59 -0500
-opensprints (0.2-5) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Tue, 15 Sep 2009 18:13:17 -0500
-opensprints (0.2-4) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Tue, 15 Sep 2009 16:53:14 -0500
-opensprints (0.2-3) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 20:22:17 -0500
-opensprints (0.2-2) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 20:20:14 -0500
-opensprints (0.2-1) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 18:42:45 -0500
-opensprints (0.1-6) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 00:40:17 -0500
-opensprints (0.1-5) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 00:20:54 -0500
-opensprints (0.1-4) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Thu, 10 Sep 2009 00:08:16 -0500
-opensprints (0.1-3) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Tue, 08 Sep 2009 09:58:45 -0500
-opensprints (0.1-2) unstable; urgency=low
-
- Changed some stuff
-
- -- Evan Farrar <evan@opensprints.org> Mon, 07 Sep 2009 20:10:49 -0500
-opensprints (0.1-1) unstable; urgency=low
-
- find him and kill him
-
- -- Evan Farrar <evan@opensprints.com> Fri, 12 Jun 2009 22:29:04 -0500
View
7 lib/controllers/race_controller.rb
@@ -59,6 +59,10 @@ def countdown(id)
race_track(race)
@countbox = flow(:attach => Window, :top => (HEIGHT/2 - 100), :left => (WIDTH/2 - 125), :width => 250, :height => 200) { }
@timer = animate(1) { |count|
+ if SENSOR.false_start
+ alert "False start by #{race.race_participations[SENSOR.false_start].racer.name}"
+ visit "/races/#{id}/ready"
+ end
case count
when 4
@countbox.clear do
@@ -81,9 +85,6 @@ def countdown(id)
visit "/races/#{id}"
end
}
- rescue FalseStart => e
- alert "#{e.message} had a false start"
- visit "/races/#{id}/ready"
end
def show(id)
View
7 lib/sensors/basic_message_arduino_sensor.rb
@@ -25,6 +25,7 @@ def start
@f.puts "!g"
Thread.current["racers"] = [[],[],[],[]]
Thread.current["finish_times"] = []
+ Thread.current["false_start"] = nil
@f.flush
while true do
l = @f.readline
@@ -57,7 +58,7 @@ def start
Thread.current["time"] = l.gsub(/t: /,'').to_i
end
if l =~ /F:/
- parent.raise FalseStart.new("Racer #{l.gsub(/F:/,'').to_i+1}")
+ Thread.current["false_start"] = l.gsub(/F:/,'').to_i
end
end
puts l
@@ -78,6 +79,10 @@ def time
@t['time'] || 0
end
+ def false_start
+ @t&&@t['false_start']
+ end
+
def stop
@f.puts '!s'
@f.flush

0 comments on commit af457e5

Please sign in to comment.