]> www.fi.muni.cz Git - slotcarman.git/commitdiff
replay -f: do not show semaphore
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 7 May 2011 21:17:07 +0000 (23:17 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 7 May 2011 21:42:07 +0000 (23:42 +0200)
When replaying log with -f (as fast as possible), do not show the semaphore,
because it is timed by wallclock time, and causes early start to be reported.
FIXME: we should probably time the semaphore using the log time instead.

SCX/Track.pm
slotcarman

index c88e6f8540ff024ce9d67c9636b60310084d4096..a86ba429f0fab626ffacb40958566f8a8b473944 100644 (file)
@@ -20,6 +20,7 @@ sub new {
                round => 0,
                now => 0,
                qualification_setup => -100,
+               no_semaphore => $args->{no_semaphore},
        };
 
        bless $self, $class;
@@ -49,6 +50,11 @@ sub race_start {
 
        if ($time - $self->{qualification_setup} < 1) {
                $self->{qualification_running} = 1;
+       } elsif ($self->{no_semaphore}) {
+               $self->{round} = 0;
+               $self->{race_running} = 1;
+               $self->{race_running_since} = $self->{now};
+               $self->{start_in_progress} = undef;
        } else {
                $self->{round} = 0;
                $self->{race_running} = 0;
index 5e3a04f15fda27453305d2b139f53dcd59e29465..66a6d985fd7752a66e4b93f03dff0aaf88d26364 100755 (executable)
@@ -26,7 +26,7 @@ if (($opt{t} && $opt{l})
 }
 
 my $gui = SCX::GUI->new({ img_height => 100 });
-my $track = SCX::Track->new({ gui => $gui });
+my $track = SCX::Track->new({ gui => $gui, no_semaphore => $opt{f} });
 
 my $logfile = 'log';