-
Notifications
You must be signed in to change notification settings - Fork 345
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
Implemented Insulin on Board. #366
base: develop
Are you sure you want to change the base?
Implemented Insulin on Board. #366
Conversation
Insulin on Board implementation, all done locally. OpenAPS docs were used as reference for this implementation: https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/understanding-insulin-on-board-calculations.html This commit features: - A settings section for insulin on board with 4 settings: enable display, show on chart, duration of insulin activity (OpenAPS dia, but in minutes) and insulin peak time (OpenAPS peak). - InsulinOnBoardCalculator, class responsible for calculating the IOB. - IOB plotted at main chart, as a blue line and same scale of insulin bolus. - Convenience ChartPoint init for a date and insulin amount, for IOB. Things to notice: - At RootViewController there are two TODOs, where the IOB display label should be set. The code to calculate the IOB there is already present. - Caching is not used, but the implementation was done considering that cache may be needed and implemented in the future.
Hi, I had a look at your contribution. Looks good at first glance! Some suggestions:
I am also unsure about what "Enable display" does. I only see the chart turn on/off with the "show on chart" setting. Should the current/historical (during scrolling) IOB value be displayed somewhere? |
This looks great! Thanks! |
We should perhaps also free some screen real-estate to simply show a total IOB (and perhaps COB). Perhaps below the pie-chart is an option. Currently the text there mimics the days setting; so it's pretty much redundant. If IOB is enabled, showing the IOB there as a number may be a nice touch. Just an idea. :) |
Agreed. And perhaps move the pie chart to the far left, so it can sit close to the days setting. |
Hi, Recently I have had close to no free time to code. COB would be a very nice addition, and could even reuse most of the plotting logic. Unfortunately, I'm not able to work on it right now. |
Can IOB be added to the calendar events? I'm guessing here |
Insulin on Board implementation, all done locally.
OpenAPS docs were used as reference for this implementation: https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/understanding-insulin-on-board-calculations.html
This commit features:
Things to notice:
Sample screenshot: