fuel => 0,
lap => 0,
laptime => 0,
- avg_lap => 0,
car_img => $args->{car_img},
id => $args->{id},
track => $args->{track},
my ($self, $lap_nr) = @_;
if (!$lap_nr) {
- $self->{avg_lap} = undef;
$self->{lap} = $lap_nr;
- $self->gui->set_avg_lap($self->{order}, undef);
$self->gui->set_lap($self->{order}, $lap_nr);
return;
}
$self->gui->set_lap($self->{order}, $lap_nr);
if ($self->track->{race_running} && $self->{lap} > 1) {
my $now = $self->{last_finish_time};
- my $avg = ($now - $self->track->{race_running_since})
- / ($self->{lap} - 1);
- $self->{avg_lap} = $avg;
- $self->gui->set_avg_lap($self->{order}, $self->{avg_lap});
}
}
$self->gui->set_lap($self->{order}, $self->{lap});
$self->gui->set_laptime($self->{order}, $self->{laptime});
$self->gui->set_best_lap($self->{order}, $self->{best_lap});
- $self->gui->set_avg_lap($self->{order}, $self->{avg_lap});
$self->gui->set_fuel($self->{order}, $self->{fuel});
$self->gui->set_car_id($self->{order}, $self->{id} + 1);
$self->gui->set_distance($self->{order},
$self->set_label('label_laptime', $row, format_lap_time($text));
}
-sub set_avg_lap {
- my ($self, $row, $text) = @_;
-
- $self->set_label('label_avg_lap', $row, format_lap_time($text));
-}
-
sub set_best_lap {
my ($self, $row, $text) = @_;
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="label" translatable="yes">Last/Best/Avg</property>
+ <property name="label" translatable="yes">Last/Best</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_avg_lap6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">0</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">5</property>