mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 11:02:19 +08:00
cabana: round signal raw value for value description
old-commit-hash: e57f3ab4daeb18ac1c8786b3b5c7d0ad7b000646
This commit is contained in:
@@ -131,7 +131,7 @@ void cabana::Signal::update() {
|
||||
|
||||
QString cabana::Signal::formatValue(double value) const {
|
||||
// Show enum string
|
||||
int64_t raw_value = (value - offset) / factor;
|
||||
int64_t raw_value = round((value - offset) / factor);
|
||||
for (const auto &[val, desc] : val_desc) {
|
||||
if (std::abs(raw_value - val) < 1e-6) {
|
||||
return desc;
|
||||
|
||||
Reference in New Issue
Block a user