Merge initial implementation of Pedal and Leader Board widgets #3

Merged
hodasemi merged 16 commits from ui into master 2023-01-18 11:50:37 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit be7a746931 - Show all commits

View file

@ -60,9 +60,9 @@ impl DataReceiver for Pedals {
if let Some(telemetry) = telemetries.iter().find(|telemetry| telemetry.id == id) {
self.brake
.set_progress(telemetry.unfiltered_throttle as f32)?;
.set_progress(1.0 - telemetry.unfiltered_brake as f32)?;
self.throttle
.set_progress(telemetry.unfiltered_throttle as f32)?;
.set_progress(1.0 - telemetry.unfiltered_throttle as f32)?;
self.gear.set_text(telemetry.gear)?;
let fuel = telemetry.fuel;
self.fuel.set_text(format!("{:.2}", fuel))?;

View file

@ -2,10 +2,10 @@
<root reference_width="2560" reference_height="1440">
<grid x_dim="7" y_dim="2" x_offset="-750" y_offset="-250" width="150" height="200"
vert_align="bottom" hori_align="right" margin="3" padding="3" background="#686868">
<progressbar id="brake" x_slot="0" y_slot="0" y_size="2" background="#f44444"
<progressbar id="brake" x_slot="0" y_slot="0" y_size="2" background="#494949"
direction="bottom_to_top" foreground="#e30000"></progressbar>
<progressbar id="throttle"
x_slot="1" y_slot="0" y_size="2" background="#51fd51" direction="bottom_to_top"
x_slot="1" y_slot="0" y_size="2" background="#494949" direction="bottom_to_top"
foreground="#00b900"></progressbar>
<label id="fuel" x_slot="2"
x_size="5" y_slot="0"