Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection_exerciser::get_current_reading needs Amp calculation updated #57

Closed
wes-b opened this issue Feb 11, 2019 · 0 comments
Closed
Assignees
Labels
Bug Something isn't working

Comments

@wes-b
Copy link
Contributor

wes-b commented Feb 11, 2019

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.

@wes-b wes-b added the Bug Something isn't working label Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants