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

conversion of rT.variables in mg/dL #327

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

mountrcg
Copy link
Contributor

Needs to be done in parallel with nightscout/trio-oref#30

This concerns mainly ISF as transmitted from oref to suggestion / enacted. So far I only found one instance where ISF is used.

So far ISF is always transfered from oref in the current user glucose unit, so if mmol/L is used it comes in mmol/L. Therefore currently no conversion is applied in Trio to ISF originating from oref. Drawback is also that a change of user glucose unit will not be reflected in ISF unless a new loop is calculated. Refer also to nightscout/trio-oref#29

Also the watch app needs to adjusted as ISF may also be shown on watch.

@mountrcg
Copy link
Contributor Author

I need a little help on the watch part, still throws an error in the conversion function

from: (units == .mmolL ? isfValue.asMmolL : Decimal(isfValue)) as NSNumber

@mountrcg
Copy link
Contributor Author

successfully tested!
As Trio does not show ISF anywhere on UI, only watch can be used to review the changes.
Old sitiuation - ISF is only shown converted after a new loop

original state ISF after unit change, no new loop after new loop
Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 27 37 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 27 59 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 32 58
Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 27 39 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 28 01 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 32 52

After change, ISF is immediatly converted after changing units on phone. As it can be seen the popup still shows units from last loop, watch already has ISF converted.

original state ISF after unit change, no new loop
Simulator Screenshot - Dev 13 mini - 2024-06-24 at 08 57 34 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 08 57 47
Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 08 57 35 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 08 57 49

@mountrcg mountrcg changed the title Draft: Trio conversion of rT.variables in mg/dL rio conversion of rT.variables in mg/dL Jun 24, 2024
@mountrcg mountrcg changed the title rio conversion of rT.variables in mg/dL conversion of rT.variables in mg/dL Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

1 participant