-=comment
- for my $controller (1..6) {
- my $byte = $data[$controller];
- next if defined $controllers[$controller-1]
- && $controllers[$controller-1] == $byte;
- $controllers[$controller-1] = $byte;
-
- my $progressbar = $builder->get_object(
- 'progressbar_controller'.$controller);
- if ($byte == 0xaa) {
- $progressbar->set_text('inactive');
- $progressbar->set_fraction(0);
- next;
- }
- my $light = !($byte & 0x20);
- my $backbutton = !($byte & 0x10);
- my $speed = $byte & 0x0f;
-
- my $text = ($backbutton ? '+' : '') . $speed;
- $progressbar->set_text($text);
- $progressbar->set_fraction($speed / 12);
+ my @fuel = (
+ $bytes[1] >> 4, $bytes[1] & 0x0f,
+ $bytes[2] >> 4, $bytes[2] & 0x0f,
+ $bytes[3] >> 4, $bytes[3] & 0x0f,
+ );
+
+ for my $car (0..5) {
+ my $byte = $bytes[$car];
+
+ if ($byte == 0xAA) {
+ $track->car($car)->set_throttle(undef);
+ next;