You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/Utilities/ConnEx/ConnEx.cpp connection_exerciser::get_current_reading() needs to be updated to properly calculate the measured current.
From Matt:
The original author noticed that if the number was negative, it was really 1000 + the value. So if the value was -2.98A, then the number was 1298. 2,98A would be 298. If a number was 1000 or greater, they would set the current to 1000 - current. This is correct, As 1000 - 1298 would give up -298.
The only small bug here is if the connection exerciser returns "negative zero" (1000). In that case we'd report 10 Amps, when we should report 0 amps. We just need to change if (raw_value > 1000) to if (raw_value >= 1000). I made the suggestion in the code.
The text was updated successfully, but these errors were encountered:
tests/Utilities/ConnEx/ConnEx.cpp connection_exerciser::get_current_reading() needs to be updated to properly calculate the measured current.
From Matt:
The original author noticed that if the number was negative, it was really 1000 + the value. So if the value was -2.98A, then the number was 1298. 2,98A would be 298. If a number was 1000 or greater, they would set the current to 1000 - current. This is correct, As 1000 - 1298 would give up -298.
The only small bug here is if the connection exerciser returns "negative zero" (1000). In that case we'd report 10 Amps, when we should report 0 amps. We just need to change if (raw_value > 1000) to if (raw_value >= 1000). I made the suggestion in the code.
The text was updated successfully, but these errors were encountered: