JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
339 stars 337 forks source link

Calibration Assistant Function #386

Open paulplant opened 2 years ago

paulplant commented 2 years ago

This PR introduces a calibration assistant function to xdripswift.

When the user clicks calibrate, the previous x minutes of BG data is analysed (delta change, std deviation and current BG level), weightings are applied to the deviations calculated from the programmed limits and a result is output.

Based upon this result to user is allowed to calibrate normally or they are asked to consider waiting, or they are told directly to not calibrate.

A debug option is in developer settings to show the calculations in the UIAlert to allow troubleshooting. The results and recommendation are also logged to the trace file.

The user can enable a visual assistant that will change the calibration icon colour (every time a new BG is processed) to indicate if it is a good time to calibrate or not.

EN and ES translations are included

Example screenshot:

3451DF4F-4657-465F-A150-6F816B2DB3DE_1_105_c

paulplant commented 2 years ago

Don't merge yet. I will make changes first.