8 my ($class, $args) = @_;
14 order => $args->{order},
19 $self->set_throttle(undef);
20 $self->set_fuel(undef);
25 sub gui { return shift->{gui}; }
28 my ($self, $val) = @_;
30 return if (!defined $self->{throttle} && !defined $val)
31 || (defined $self->{throttle} && defined $val
32 && $self->{throttle} == $val);
34 $self->{throttle} = $val;
35 $self->gui->set_throttle($self->{order}, $val);
40 my ($self, $val) = @_;
42 return if (!defined $self->{fuel} && !defined $val)
43 || (defined $self->{fuel} && defined $val
44 && $self->{fuel} == $val);
47 $self->gui->set_fuel($self->{order}, $val);
59 my ($self, $name) = @_;
61 return if (!defined $self->{car_icon} && !defined $name)
62 || (defined $self->{car_icon} && defined $name
63 && $self->{car_icon} ne $name);
65 $self->{car_icon} = $name;
66 $self->gui->set_car_icon($self->{order}, $name);
70 my ($self, $lap_nr) = @_;
72 return if (!defined $self->{lap} && !defined $lap_nr)
73 || (defined $self->{lap} && defined $lap_nr
74 && $self->{lap} != $lap_nr);
76 $self->{lap} = $lap_nr;
77 $self->gui->set_lap($self->{order}, $lap_nr || 'N/A');
81 my ($self, $lap_time) = @_;
83 if (defined $lap_time) {
84 $lap_time = sprintf("%.2f", $lap_time);
85 if (!defined $self->{best_lap}
86 || $self->{best_lap} > $lap_time) {
88 $self->gui->set_best_lap($self->{order}, $lap_time);
89 $self->{best_lap} = $lap_time;
94 return if (!defined $self->{laptime} && !defined $lap_time)
95 || (defined $self->{laptime} && defined $lap_time
96 && $self->{laptime} != $lap_time);
98 $self->{laptime} = $lap_time;
100 $self->gui->set_laptime($self->{order}, $lap_time || 'N/A');
104 my ($self, $driver_name) = @_;
106 return if (!defined $self->{driver} && !defined $driver_name)
107 || (defined $self->{driver} && defined $driver_name
108 && $self->{driver} != $driver_name);
110 $self->{driver} = $driver_name;
111 $self->gui->set_driver($self->{order}, $driver_name || 'N/A');