NickRoach / blackheath-wind-meter

0 stars 0 forks source link

Fix percentage off-scale calculation #50

Closed NickRoach closed 1 month ago

NickRoach commented 1 month ago

The percentage off-scale, i.e. ">6 m/s" when the units are "m/s" is wrong. It's too low. Needs fixing. This will be a frontEnd change, as the value is calculated client-side.

In this screenshot only one record is not off scale, but the percentage off-scale is only 60%

Screenshot_20240719-193839_Chrome.jpg

NickRoach commented 1 month ago

and here all the observations were off the scale, but it says only 62%!

image
burtscriptor commented 1 month ago

From what I can understand aboveMax gets incremented when the speed is above the max for that unit of measurement. -Line 219... } else aboveMax++ Then it is displayed to the user on line 231 but it is never used in a calculation to workout percentage. This is the current line 231...

NickRoach commented 1 month ago

Ok. Sounds like you've found the relevant code and found the solution! You should be able to test the code by just opening index.html with a browser, or you could use live server plugin for vs code. Can you please commit your fix to a new branch, then Google how to push your branch to this remote repo and make a pull request? Please reference the ticket number in your pull request i.e. #50

Ps it's good practice to name your branch using the ticket number e.g. 50-fix-off-scale-percentage