Artificial-Pancreas / iAPS

MIT License
176 stars 720 forks source link

Lower I:C #158

Closed LiroyvH closed 1 year ago

LiroyvH commented 1 year ago

It appears the carb ratio has a minimum value of 1u:3gr. I'm not sure if this limit was chosen by some design (couldn't find anything about it), but I for example need it to be lower. Was wondering if there's no particular reason for a cap of 3, if it could be removed. I found that modifying the json to a lower number simply reverts back to 3.

Jon-b-m commented 1 year ago

I guess it was added as a safety measure, avoiding inadvertently entering too low carb ratios. It's hard coded in FreeAPS/Sources/Modules/CREditor/CREditorStateModel.swift, line: let rateValues = stride(from: 30.0, to: 501.0, by: 1.0).map { ($0.decimal ?? .zero) / 10 }

Jon-b-m commented 1 year ago

Which ratio do you need?

LiroyvH commented 1 year ago

@Jon-b-m Thanks! Makes sense. Maybe a better option would be not to limit it, but to ask for confirmation if the user is absolutely sure this is the ratio they want to save - much like when you want to bolus but it predicts you'll go low; you get the confirmation/warning box.

I'm currently looking at 1:2.0 in the evening and 1:2.5 in the morning/afternoon. I hope I won't need to go any lower. :/ This ratio is annoying enough as it is. :P (Use too much for Omnipod :()

Jon-b-m commented 1 year ago

OK, so lowering it to 1 would be an easy fix then...

Jon-b-m commented 1 year ago

Fix here in dev https://github.com/Artificial-Pancreas/iAPS/commit/9bc38cf30637e7e165905e31c368bfb852f1f23f