mirror of
https://github.com/ivabus/speakersafetyd
synced 2024-11-22 16:25:06 +03:00
types: Display rounded-to-0 gain
So the display goes directly to 0.00 instead of flickering -0.00. Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
ac120b7be1
commit
7a82648d59
1 changed files with 5 additions and 5 deletions
10
src/types.rs
10
src/types.rs
|
@ -388,15 +388,15 @@ impl Speaker {
|
||||||
|
|
||||||
s.gain = gain;
|
s.gain = gain;
|
||||||
|
|
||||||
debug!(
|
|
||||||
"{}: Coil {:.2} °C Magnet {:.2} °C Power {:.2} W Gain {:.2} dB",
|
|
||||||
self.name, s.t_coil, s.t_magnet, pwr_avg, gain
|
|
||||||
);
|
|
||||||
|
|
||||||
if s.gain > -0.01 {
|
if s.gain > -0.01 {
|
||||||
s.gain = 0.;
|
s.gain = 0.;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!(
|
||||||
|
"{}: Coil {:.2} °C Magnet {:.2} °C Power {:.2} W Gain {:.2} dB",
|
||||||
|
self.name, s.t_coil, s.t_magnet, pwr_avg, s.gain
|
||||||
|
);
|
||||||
|
|
||||||
s.gain
|
s.gain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue