mirror of
https://github.com/danog/libdvb.git
synced 2024-11-26 20:04:39 +01:00
status display fix
This commit is contained in:
parent
68e4f734bb
commit
21571ca7b0
@ -62,7 +62,7 @@ impl<'a> FeStatusDisplay<'a> {
|
||||
let lo: f64 = -85.0;
|
||||
let hi: f64 = -6.0;
|
||||
let relative = 100.0 - (signal - hi) * 100.0 / (lo - hi);
|
||||
write!(f, "{:.0}% ({:.02}dBm)", relative, signal)?;
|
||||
write!(f, "{:.02}dBm ({:.0}%)", signal, relative)?;
|
||||
} else {
|
||||
write!(f, "-")?;
|
||||
}
|
||||
@ -74,7 +74,7 @@ impl<'a> FeStatusDisplay<'a> {
|
||||
write!(f, " Q:")?;
|
||||
if let Some(snr) = self.inner.snr {
|
||||
let relative = 5 * snr as u32;
|
||||
write!(f, "{}% ({:.02}dB)", relative, snr)?;
|
||||
write!(f, "{:.02}dB ({}%)", snr, relative)?;
|
||||
} else {
|
||||
write!(f, "-")?;
|
||||
}
|
||||
@ -125,7 +125,7 @@ impl<'a> FeStatusDisplay<'a> {
|
||||
let lo: f64 = -85.0;
|
||||
let hi: f64 = -6.0;
|
||||
let relative = 100.0 - (signal - hi) * 100.0 / (lo - hi);
|
||||
write!(f, "{:.0}% ({:.02}dBm)", relative, signal)?;
|
||||
write!(f, "{:.02}dBm ({:.0}%)", signal, relative)?;
|
||||
} else {
|
||||
write!(f, "-")?;
|
||||
}
|
||||
@ -137,7 +137,7 @@ impl<'a> FeStatusDisplay<'a> {
|
||||
write!(f, "\nSNR: ")?;
|
||||
if let Some(snr) = self.inner.snr {
|
||||
let relative = 5 * snr as u32;
|
||||
write!(f, "{}% ({:.02}dB)", relative, snr)?;
|
||||
write!(f, "{:.02}dB ({}%)", snr, relative)?;
|
||||
} else {
|
||||
write!(f, "-")?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user