修改水位计算逻辑

This commit is contained in:
root 2025-05-14 16:48:03 +08:00
parent 50b6bc2ca2
commit 70224a1e4f

View File

@ -45,7 +45,7 @@ void Msg_Handler(const mc::msg::CanFrame::SharedPtr msg)
{
const uint16_t WaterValue = (uint16_t)(((msg->data[3] & 0x3F) << 4) | ((msg->data[2] & 0xF0) >> 4));
float WaterLevel = WaterValue * (-0.235) + 199.75;
info_report.waterLevel = static_cast<int>(std::round(WaterLevel / 180.0f));
info_report.waterLevel = static_cast<int>(std::round(WaterLevel / 1.8f)); // 液位百分比
break;
}