]> www.fi.muni.cz Git - slotcarman.git/commitdiff
Rework for OO infrastructure
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 3 Dec 2010 22:11:08 +0000 (23:11 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 3 Dec 2010 22:11:08 +0000 (23:11 +0100)
SCX/Car.pm [new file with mode: 0644]
SCX/GUI.pm [new file with mode: 0755]
SCX/Reader.pm
SCX/Track.pm [new file with mode: 0644]
gui.pl
img/throttle13.svg [new file with mode: 0644]
slotcarman.glade

diff --git a/SCX/Car.pm b/SCX/Car.pm
new file mode 100644 (file)
index 0000000..e55676d
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+package SCX::Car;
+
+use strict;
+
+sub new {
+       my ($class, $args) = @_;
+
+       my $self = {
+               gui => $args->{gui},
+               throttle => -1,
+               fuel => -1,
+               order => $args->{order},
+       };
+
+       bless $self, $class;
+
+       $self->set_throttle(undef);
+       $self->set_fuel(undef);
+
+       return $self;
+}
+
+sub gui { return shift->{gui}; }
+
+sub set_throttle {
+       my ($self, $val) = @_;
+
+       return if (!defined $self->{throttle} && !defined $val)
+               || (defined $self->{throttle} && defined $val
+                       && $self->{throttle} == $val);
+
+       $self->{throttle} = $val;
+       $self->gui->set_throttle($self->{order}, $val);
+}
+
+
+sub set_fuel {
+       my ($self, $val) = @_;
+
+       return if (!defined $self->{fuel} && !defined $val)
+               || (defined $self->{fuel} && defined $val
+                       && $self->{fuel} == $val);
+
+       $self->{fuel} = $val;
+       $self->gui->set_fuel($self->{order}, $val);
+}
+
+sub set_light {
+       # TODO
+}
+
+sub set_backbutton {
+       # TODO
+}
+
+1;
+
diff --git a/SCX/GUI.pm b/SCX/GUI.pm
new file mode 100755 (executable)
index 0000000..9190fe3
--- /dev/null
@@ -0,0 +1,81 @@
+#!/usr/bin/perl -w
+
+package SCX::GUI;
+
+use strict;
+use utf8;
+
+use Gtk2 '-init';
+use Glib qw(TRUE FALSE);
+
+use SCX::Reader;
+
+sub new {
+       my ($class, $args) = @_;
+
+       my $self = {
+               throttle_images => [ 
+                       load_image_set('img/throttle%d.svg', 13, 100)
+               ],
+               fuel_images => [
+                       load_image_set('img/fuel%d.svg', 8, 100)
+               ],
+               builder => Gtk2::Builder->new,
+       };
+
+       bless $self, $class;
+
+       $self->{builder}->add_from_file('slotcarman.glade');
+
+       $self->{builder}->connect_signals(undef);
+
+       return $self;
+}
+
+sub show {
+       my ($self) = @_;
+
+       my $window = $self->{builder}->get_object('slotcarman');
+       $window->show();
+}
+
+sub get_object { return shift->{builder}->get_object(@_); }
+
+sub load_image_set {
+       my ($pattern, $limit, $height) = @_;
+
+       my @rv;
+       for my $i (0..$limit) {
+               my $file = sprintf($pattern, $i);
+               
+               my $dummy = Gtk2::Gdk::Pixbuf->new_from_file($file);
+               my $width = $dummy->get_width * $height / $dummy->get_height;
+               push @rv, Gtk2::Gdk::Pixbuf->new_from_file_at_scale(
+                       $file, $width, $height, TRUE
+               );
+       }
+       return @rv;
+}
+
+sub set_throttle {
+       my ($self, $row, $val) = @_;
+
+       $row++;
+       $val = 13 if !defined $val;
+
+       my $image = $self->get_object("image_throttle$row");
+       $image->set_from_pixbuf($self->{throttle_images}->[$val]);
+}
+
+sub set_fuel {
+       my ($self, $row, $val) = @_;
+
+       $row++;
+       $val = 0 if !defined $val;
+
+       my $image = $self->get_object("image_fuel$row");
+       $image->set_from_pixbuf($self->{fuel_images}->[$val]);
+}
+
+1;
+
index c60ec95ea6f7fe65a949f90381efb6b44a690e0c..ea012b49ce1e2dfbf9354797028505fedd813930 100644 (file)
@@ -42,7 +42,7 @@ sub new {
                log_gen   => $log_gen,
                log_start => $now,
                starttime => $now,
-               callback  => $callback,
+               track     => $track,
                bytes     => [],
        };
 
@@ -243,23 +243,17 @@ sub fuel_level_packet {
                || $bytes[2] & 0x0F > 8
                || ($bytes[5] != 0xAA && $bytes[5] != 0xFF);
 
-=comment
-               my @fuel = (0,
-                       $data[1] >> 4, $data[1] & 0x0f,
-                       $data[2] >> 4, $data[2] & 0x0f,
-                       $data[3] >> 4, $data[3] & 0x0f,
-               );
-               for my $car (1..6) {
-                       next if defined $controllers[$car-1]
-                               &&$controllers[$car-1] == $fuel[$car];
-                       
-                       my $progressbar = $builder->get_object(
-                               'progressbar_fuel'.$car);
-                       $progressbar->set_fraction($fuel[$car]/8);
-               }
-=cut
+       my @fuel = (
+               $bytes[1] >> 4, $bytes[1] & 0x0f,
+               $bytes[2] >> 4, $bytes[2] & 0x0f,
+               $bytes[3] >> 4, $bytes[3] & 0x0f,
+       );
 
-       return $msg; # FIXME - to be implemented
+       for my $car (0..5) {
+               $track->car($car)->set_fuel($fuel[$car]);
+       }
+
+       return $msg;
 }
 
 
@@ -362,31 +356,30 @@ sub controller_status_packet {
        my $msg = 'Strange controller_status packet'
                if $fail;
 
-=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;
                }
-=cut
 
-       return $msg; # FIXME - to be implemented
+               my $light = !($byte & 0x20);
+               my $backbutton = !($byte & 0x10);
+               my $throttle = $byte & 0x0f;
+
+               $track->car($car)->set_throttle($throttle);
+               $track->car($car)->set_light($light);
+               $track->car($car)->set_backbutton($backbutton);
+       }
+
+       return $msg;
 }
 
 1;
diff --git a/SCX/Track.pm b/SCX/Track.pm
new file mode 100644 (file)
index 0000000..ab12a44
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+
+package SCX::Track;
+
+use strict;
+use Carp;
+
+use SCX::Car;
+
+sub new {
+       my ($class, $args) = @_;
+
+       my $self;
+
+       $self->{gui} = $args->{gui} or croak;
+       $self->{race_running} = 0;
+       $self->{lap_counting_up} = 1;
+
+       for my $i (0..5) {
+               $self->{cars}->[$i] = SCX::Car->new({
+                       gui => $self->{gui},
+                       order => $i,
+               });
+       }
+
+       bless $self, $class;
+}
+
+sub car { return shift->{cars}->[shift]; }
+
+1;
+
diff --git a/gui.pl b/gui.pl
index 1df07dea30af65a31b8c426d603b24d4ff5eafac..9311331b995d2ede32c2a5048672f74eb708fda8 100755 (executable)
--- a/gui.pl
+++ b/gui.pl
@@ -6,119 +6,40 @@ use utf8;
 use Gtk2 '-init';
 use Glib qw(TRUE FALSE);
 
+use SCX::GUI;
+use SCX::Track;
 use SCX::Reader;
 
-my @controllers = (0, 0, 0, 0, 0, 0);
 my $no_reader = 0;
 
-my $builder = Gtk2::Builder->new;
-$builder->add_from_file('slotcarman.glade');
+my $gui = SCX::GUI->new;
+my $track = SCX::Track->new({ gui => $gui });
 
-my $window = $builder->get_object('slotcarman');
+if (!$no_reader) {
+       my $reader = SCX::Reader->new({
+               portname   => '/dev/ttyUSB0',
+               logfile    => 'log',
+               track      => $track,
+       });
 
-$builder->connect_signals(undef);
-$window->show();
+       Glib::IO->add_watch(fileno($reader->fh), 'in', \&scx_read, $reader);
+}
+
+$gui->show;
+
+Gtk2->main();
+
+exit 0;
 
 sub quit {
        Gtk2->main_quit;
        return FALSE;
 }
 
-my $reader = SCX::Reader->new({
-       portname   => '/dev/ttyUSB0',
-       logfile    => 'log',
-       callback   => \&do_packet,
-}) if !$no_reader;
-
 sub scx_read {
-       my $event = shift;
+       my ($event, $reader) = @_;
 
        $reader->read();
        return TRUE;
 }
 
-Glib::IO->add_watch(fileno($reader->fh), 'in', \&scx_read, 1)
-       if !$no_reader;
-
-Gtk2->main();
-
-sub do_packet {
-       my (@data) = @_;
-
-       if ($data[0] == 0xff) { # controller status
-               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);
-               }
-       } elsif ($data[0] == 0xd6) { # fuel status
-               my @fuel = (0,
-                       $data[1] >> 4, $data[1] & 0x0f,
-                       $data[2] >> 4, $data[2] & 0x0f,
-                       $data[3] >> 4, $data[3] & 0x0f,
-               );
-               for my $car (1..6) {
-                       next if defined $controllers[$car-1]
-                               &&$controllers[$car-1] == $fuel[$car];
-                       
-                       my $progressbar = $builder->get_object(
-                               'progressbar_fuel'.$car);
-                       $progressbar->set_fraction($fuel[$car]/8);
-               }
-       } else {
-               print "Unknown packet",
-                       (map { sprintf(" %02x", $_) } @data), "\n";
-       }
-}
-                       
-__END__
-use Gtk2 '-init';
-
-my $window = Gtk2::Window->new('toplevel');
-$window->signal_connect(delete_event => sub { Gtk2->main_quit; return FALSE });
-$window->set_title("Slot Cars Manager");
-
-$window->set_border_width(10);
-
-my $button = Gtk2::Button->new("Button 1");
-$button->signal_connect(clicked => \&callback, 'button 1');
-
-my $box1 = Gtk2::HBox->new(FALSE, 0);
-$window->add($box1);
-$box1->pack_start($button, TRUE, TRUE, 0);
-
-$button->show;
-$button = Gtk2::Button->new("Button 2");
-$button->signal_connect(clicked => \&callback, 'button 2');
-$box1->pack_start($button, TRUE, TRUE, 0);
-
-$button->show;
-$box1->show;
-$window->show;
-
-Gtk2->main();
-
-
-sub callback
-{
-       my ($button, $data) = @_;
-       
-       print "Hello again - $data was pressed\n";
-}
-
diff --git a/img/throttle13.svg b/img/throttle13.svg
new file mode 100644 (file)
index 0000000..c3a4505
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="200"
+   height="200"
+   id="svg4265"
+   version="1.1"
+   inkscape:version="0.48.0 r9654"
+   sodipodi:docname="throttle13.svg">
+  <defs
+     id="defs4267">
+    <linearGradient
+       id="linearGradient6758">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop6760" />
+      <stop
+         style="stop-color:#3a2f2f;stop-opacity:1;"
+         offset="1"
+         id="stop6762" />
+    </linearGradient>
+    <linearGradient
+       osb:paint="gradient"
+       id="linearGradient6391">
+      <stop
+         id="stop6393"
+         offset="0"
+         style="stop-color:#03ff18;stop-opacity:1;" />
+      <stop
+         style="stop-color:#ffcc00;stop-opacity:1;"
+         offset="0.62396693"
+         id="stop6395" />
+      <stop
+         id="stop6397"
+         offset="1"
+         style="stop-color:#d40000;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient6383"
+       osb:paint="solid">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop6385" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient6348"
+       osb:paint="gradient">
+      <stop
+         style="stop-color:#03ff18;stop-opacity:1;"
+         offset="0"
+         id="stop6350" />
+      <stop
+         id="stop6364"
+         offset="0.62025315"
+         style="stop-color:#ffcc00;stop-opacity:1;" />
+      <stop
+         style="stop-color:#d40000;stop-opacity:1;"
+         offset="1"
+         id="stop6352" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient6306"
+       osb:paint="solid">
+      <stop
+         style="stop-color:#d40000;stop-opacity:1;"
+         offset="0"
+         id="stop6308" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient6348"
+       id="linearGradient6362"
+       x1="42"
+       y1="103.7132"
+       x2="163"
+       y2="103.7132"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient6391"
+       id="linearGradient6389"
+       gradientUnits="userSpaceOnUse"
+       x1="42"
+       y1="103.7132"
+       x2="163"
+       y2="103.7132" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.3825079"
+     inkscape:cx="36.830122"
+     inkscape:cy="107.25171"
+     inkscape:current-layer="layer1"
+     inkscape:document-units="px"
+     showgrid="true"
+     inkscape:window-width="1900"
+     inkscape:window-height="1120"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4273"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata4270">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     transform="translate(0,-280)">
+    <path
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 100,295 0,15"
+       id="path5762"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-y="-92.5" />
+    <path
+       inkscape:transform-center-y="-85.458855"
+       inkscape:connector-curvature="0"
+       id="path6312"
+       d="m 138.26834,302.61205 -5.74025,13.85819"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="-35.398215" />
+    <path
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 29.289322,465.71068 10.606602,-10.6066"
+       id="path6314"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-y="65.40738"
+       inkscape:transform-center-x="65.407377" />
+    <path
+       inkscape:transform-center-y="35.398215"
+       inkscape:connector-curvature="0"
+       id="path6316"
+       d="M 7.6120467,433.26834 21.47024,427.52809"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="85.458857" />
+    <path
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 0,395 15,0"
+       id="path6318"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-x="92.5" />
+    <path
+       inkscape:transform-center-y="-35.398215"
+       inkscape:connector-curvature="0"
+       id="path6320"
+       d="M 7.6120467,356.73166 21.47024,362.47191"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="85.458857" />
+    <path
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 29.289322,324.28932 10.606602,10.6066"
+       id="path6322"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-y="-65.40738"
+       inkscape:transform-center-x="65.407377" />
+    <path
+       inkscape:transform-center-y="-85.458855"
+       inkscape:connector-curvature="0"
+       id="path6324"
+       d="m 61.731657,302.61205 5.740251,13.85819"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="35.398218" />
+    <path
+       inkscape:transform-center-x="-85.458855"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 192.38795,356.73166 -13.85819,5.74025"
+       id="path6326"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-y="-35.398215" />
+    <path
+       inkscape:transform-center-y="-65.40738"
+       inkscape:connector-curvature="0"
+       id="path6328"
+       d="m 170.71067,324.28932 -10.6066,10.6066"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="-65.40737" />
+    <path
+       inkscape:transform-center-y="65.40738"
+       inkscape:connector-curvature="0"
+       id="path6330"
+       d="m 170.71067,465.71068 -10.6066,-10.6066"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="-65.40737" />
+    <path
+       inkscape:transform-center-x="-92.5"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 200,395 -15,0"
+       id="path6332"
+       inkscape:connector-curvature="0" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path6334"
+       d="m 192.38795,433.26834 -13.85819,-5.74025"
+       style="fill:none;stroke:#666666;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       inkscape:transform-center-x="-85.458855"
+       inkscape:transform-center-y="35.398215" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;stroke:#666666;stroke-width:40;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path6731"
+       sodipodi:cx="97.5"
+       sodipodi:cy="102.5"
+       sodipodi:rx="60"
+       sodipodi:ry="60"
+       d="m 55.073593,144.92641 c -23.431458,-23.43146 -23.431457,-61.42136 10e-7,-84.852817 23.431457,-23.431458 61.421356,-23.431457 84.852816,10e-7 23.43145,23.431457 23.43145,61.421356 0,84.852816 0,0 0,0 0,0"
+       transform="translate(2.5,292.5)"
+       sodipodi:start="2.3561945"
+       sodipodi:end="7.0685835"
+       sodipodi:open="true" />
+  </g>
+</svg>
index 45c33e0effd98ec3fcb58133623b2bcab374c753..e31b0566fb3bd1662d52c7b197836a51d9d828f2 100644 (file)
               </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel1">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel2">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel3">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel4">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel5">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_fuel6">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">10</property>
+                <property name="right_attach">11</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
+              </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkImage" id="image_throttle1">
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </object>
+              <packing>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
             </child>
             <child>
               <placeholder/>
               <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel1">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel2">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel3">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel4">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel5">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_fuel6">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">10</property>
-                <property name="right_attach">11</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller1">
-                <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
-              </object>
-              <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller2">
+              <object class="GtkImage" id="image_throttle2">
                 <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
+                <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
                 <property name="top_attach">2</property>
                 <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller3">
+              <object class="GtkImage" id="image_throttle3">
                 <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
+                <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
                 <property name="top_attach">3</property>
                 <property name="bottom_attach">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller4">
+              <object class="GtkImage" id="image_throttle4">
                 <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
+                <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
                 <property name="top_attach">4</property>
                 <property name="bottom_attach">5</property>
               </packing>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller5">
+              <object class="GtkImage" id="image_throttle5">
                 <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
+                <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
                 <property name="top_attach">5</property>
                 <property name="bottom_attach">6</property>
               </packing>
             </child>
             <child>
-              <object class="GtkProgressBar" id="progressbar_controller6">
+              <object class="GtkImage" id="image_throttle6">
                 <property name="visible">True</property>
-                <property name="orientation">bottom-to-top</property>
+                <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
+                <property name="left_attach">9</property>
+                <property name="right_attach">10</property>
                 <property name="top_attach">6</property>
                 <property name="bottom_attach">7</property>
               </packing>