Skip to content

Conversation

@itsmojo
Copy link
Contributor

@itsmojo itsmojo commented Nov 22, 2019

Instead of have a fixed 10 second value for insertionWait constant,
calculate this value as (Pod.cannulaInsertionUnits/Pod.pulseSize)
(i.e., 0.5/0.05 = 10 with default cannulaInsertionUnits) so
that the insertion wait time will scale with cannulaInsertionUnits

@marionbarker
Copy link
Contributor

I request that this be merged when convenient. Per Joe's suggestion, I customized my cannulaInsertionUnits value in Pod.swift. Without this change, Loop thinks insertion did not complete (because it took more than 10 sec) and I had to go through 3 additional screens following a successful insertion screen: "complete pod setup", insert cannula and then an immediate insertion successful screen. (names approximate). I've updated my personal version to have this change and it fixed the problem. Fortunately, pods all worked fine but it was a little disconcerting - especially the first time.

@ps2
Copy link
Owner

ps2 commented Nov 26, 2019

Pod.pulseSize is not the right divisor; it should be a rate. It works here because it just happens to be the same as cannula insertion units per second. I.e. if the pod pulse size was a 0.025 U size, the math would be wrong. We should have a variable on Pod that represents the cannula dosing rate. Maybe primeUnitsPerSecond to share it with prime, since they share the same rate, or make a separate one cannulaInsertionUnitsPerSecond.

@itsmojo
Copy link
Contributor Author

itsmojo commented Nov 27, 2019

The math is actually fully correct independent of the pod pulse size, but having a constant for a rate using the prime pulse timing makes things more understandable & consistent. Created a new Pod constant for primeDeliveryRate (to match the existing bolusDeliveryRate constant) as well for secondsPerPrimePulse and secondsPerBolusPulse and reworked derived values and code to use these new constants as appropriate.

@ps2 ps2 merged commit 31e8be4 into ps2:dev Dec 7, 2019
@itsmojo itsmojo deleted the insertionWait-fix branch December 21, 2019 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants