Http Version - Fix to calculate the fill rate.

This commit is contained in:
unrealdragon 2026-08-12 14:58:48 +05:30
commit 99bc9209af

View file

@ -84,7 +84,7 @@ void RequestWorker::requestFinished(QNetworkReply *rep)
float water_level = (float) ((float) (data_water_level) / 10.0); float water_level = (float) ((float) (data_water_level) / 10.0);
float rate_of_fill = ( float )(prev_distance - water_level) /(float) time_in_microseconds; float rate_of_fill = ( float )(prev_distance - water_level) /(float) time_in_microseconds;
rate_of_fill = rate_of_fill * 1'000'000; rate_of_fill = rate_of_fill * 1'000'000;
int expected_to_fill = (max_height - water_level) / rate_of_fill; int expected_to_fill = (water_level - min_height) / rate_of_fill;
if(reply_number == 0) { if(reply_number == 0) {
rate_of_fill = 0; rate_of_fill = 0;
expected_to_fill = 0; expected_to_fill = 0;