fixed DataLogger bug

This commit is contained in:
Youen Toupin 2022-03-28 20:48:36 +02:00
parent a7e662faf1
commit 61c5bb090f

View File

@ -12,11 +12,11 @@ public:
bool isDifferent(const Entry& other)
{
const float scale = speed > 0.0f ? 1.0f : 5.0f;
const float scale = speed > 0.0f || other.speed > 0.0f ? 1.0f : 5.0f;
return
std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale
&& std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale
&& std::abs(speed - other.speed) > 0.1f;
|| std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale
|| std::abs(speed - other.speed) > 0.1f;
}
};