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

Optional scaling of Prediction Curves by DynISF #6

Open
wants to merge 785 commits into
base: EN-MASTER
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
785 commits
Select commit Hold shift + click to select a range
d8ac4b7
TBR+ when ENactive experiment
dicko72 Sep 28, 2022
3b29433
return SR_TDD_wt to 100%
dicko72 Sep 28, 2022
d0f3532
insulinReqTBR with no SMB
dicko72 Sep 28, 2022
97c454b
insulinReqTBR with no SMB
dicko72 Sep 28, 2022
0b47a74
sens_normalTarget_scaler to scale bg with sens at normalTarget
dicko72 Sep 28, 2022
60b2bf0
insulinReq_sens uses sens_normalTarget_scaler
dicko72 Sep 28, 2022
a0c996f
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
b38f386
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
f1b7637
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
044e78e
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
8644cf6
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
c5b84ec
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
2e1a60e
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
dbdbd10
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 28, 2022
954aa19
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
23ebc5c
Merge remote-tracking branch 'DICKO-PRIVATE/EN-MASTER' into EN-MASTER
dicko72 Sep 29, 2022
2b29067
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
c38f3f2
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
276770f
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
bc9aeb9
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
bff94dd
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
badd2ac
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
f4e5992
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
52c6252
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
ec7b815
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
cffda30
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
8c587ed
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
40b60bf
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
d7aeace
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
7a60cbf
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
8d6f15b
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
71d2b30
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
86802e9
dynISF(bg, normalTarget, sens_normalTarget, ins_val)
dicko72 Sep 29, 2022
225e310
insulinReqTBR prep
dicko72 Sep 29, 2022
e9000a6
Removed UAM and COB SAFETY: when not accelerating use TBR. UAM now ha…
dicko72 Sep 29, 2022
d74d0e8
insulinReqTBR bug when microBolus is not defined
dicko72 Sep 29, 2022
78305d2
eBGw for COB UAM bug
dicko72 Sep 29, 2022
b726fd0
eBGw for COB UAM bug
dicko72 Sep 29, 2022
240eed1
Remove saftey for delta slow, fallback to initial eBGw
dicko72 Sep 29, 2022
1c4c833
Merge remote-tracking branch 'DICKO-PRIVATE/EN-MASTER' into EN-MASTER
dicko72 Sep 29, 2022
4ece152
UAM+ uses the largest boost addition of eBG and BG
dicko72 Sep 29, 2022
5c4ab84
missing ;
dicko72 Sep 30, 2022
647fff8
missing ;
dicko72 Sep 30, 2022
bafe78a
UAM+ gets maxBolus from UAM if not set
dicko72 Sep 30, 2022
72d32a4
eBGw stronger also when eventualBG higher than bg
dicko72 Sep 30, 2022
26e2541
remove stubborn high eBGw to troubleshoot
dicko72 Sep 30, 2022
0b634ce
use TIRS with stubborn high eBGw to troubleshoot
dicko72 Sep 30, 2022
7275a1c
DeltaPctS and DeltaPctL
dicko72 Sep 30, 2022
a60e4e2
code cleanup
dicko72 Sep 30, 2022
27a4d09
UAM+ predType defined for faster initial bolus response
dicko72 Sep 30, 2022
dcd1802
UAM+ predType defined for faster initial bolus response
dicko72 Sep 30, 2022
7d2f2ab
DSTHelper
dicko72 Oct 1, 2022
a750452
If loop ran after 90 seconds assume its out of sequence, restrict SMB…
dicko72 Oct 1, 2022
d7416a6
UAM+ increase minPredBG when a prebolus is OK
dicko72 Oct 1, 2022
299b98a
UAM+ increase minPredBG when a prebolus is OK
dicko72 Oct 1, 2022
5cc6cb5
SMB timeout up to 2 minutes
dicko72 Oct 1, 2022
c13b889
EN Variant selector
dicko72 Oct 1, 2022
fa14aae
Experimental UAM+ always on
dicko72 Oct 2, 2022
df74143
UAMPreBolus fix
dicko72 Oct 2, 2022
334ef2c
UAM+ settings
dicko72 Oct 2, 2022
ccbcb4d
Prepare for Experimental settings
dicko72 Oct 2, 2022
a0b0460
Sync Experimental determine-basal.js
dicko72 Oct 2, 2022
0c11c3c
Show variant in oaps reason
dicko72 Oct 2, 2022
d9acc21
Apply TIRS with SRTDD SR
dicko72 Oct 2, 2022
01e9778
Apply TIRS with SRTDD SR
dicko72 Oct 2, 2022
1583dd6
UAMPreBolus fix
dicko72 Oct 2, 2022
601cf24
UAMPreBolus fix, sync variants
dicko72 Oct 2, 2022
27e89b7
UAMPreBolus fix maybe
dicko72 Oct 3, 2022
3a79ffd
sync variants
dicko72 Oct 3, 2022
326c0aa
SR_TDD bugfix for TT
dicko72 Oct 3, 2022
810383f
SR_TDD bugfix for profile switch
dicko72 Oct 3, 2022
8f17e11
SR_TDD bugfix for profile switch
dicko72 Oct 3, 2022
41742ec
SR_TDD bugfix for profile switch
dicko72 Oct 3, 2022
7c8b462
SR_TDD bugfix for profile switch
dicko72 Oct 3, 2022
ca615a8
SR_TDD bugfix for profile switch
dicko72 Oct 3, 2022
0c8af77
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
bab6876
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
a29ec3e
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
c97dced
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
5aadba0
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
0246cf7
remove if loop ran again check
dicko72 Oct 3, 2022
f2ab992
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
1e54b22
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
de8c714
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 3, 2022
03627ae
UAM+ predtype when predicted high
dicko72 Oct 4, 2022
3a4202d
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 4, 2022
0f964df
EXPERIMENTAL: UAM+ uses COB defined from prefs as prebolus within 30 …
dicko72 Oct 4, 2022
b99e7ff
sync variants
dicko72 Oct 4, 2022
5da1707
when a TT starts some treatments will be processed before it starts c…
dicko72 Oct 4, 2022
1b571ec
when a TT starts some treatments will be processed before it starts c…
dicko72 Oct 4, 2022
04b9d42
UAM+ gets 100% insulinReqPct
dicko72 Oct 4, 2022
cfa95ea
merge UAM COB prebolus into default variant
dicko72 Oct 4, 2022
140e3e2
UAM+ 100% insulinReqPct and TBR
dicko72 Oct 4, 2022
469d881
UAMPreBolus with COB first 15m COB stay constant
dicko72 Oct 4, 2022
c7f89da
insulinReqTBR fix for UAM+
dicko72 Oct 4, 2022
3823a95
UAM+ 85% IR%
dicko72 Oct 4, 2022
ece98ec
code tidy
dicko72 Oct 4, 2022
dd114b9
UAM+ with ENW
dicko72 Oct 4, 2022
b5613f2
UAM+ with ENW
dicko72 Oct 4, 2022
54d1c6e
UAM+ with ENW
dicko72 Oct 4, 2022
af5088b
UAMPreBolus for 30m
dicko72 Oct 4, 2022
ca58c97
UAMPreBolus for ENW at 30m start fade
dicko72 Oct 4, 2022
d14d586
UAM+ UAMBGPreBolus and UAMCOBPreBolus
dicko72 Oct 5, 2022
c91912d
Removed insulinReqTBR
dicko72 Oct 5, 2022
c10894e
Removed insulinReqTBR
dicko72 Oct 5, 2022
b4470bb
UAM+ allowed higher IR% when set
dicko72 Oct 5, 2022
5f04d32
UAM+ allowed higher IR% when set
dicko72 Oct 5, 2022
bb1b92f
UAMCOBPreBolus gets full UAM+
dicko72 Oct 5, 2022
c44c906
UAMCOBPreBolus gets full UAM+
dicko72 Oct 5, 2022
5b77c67
Changes to insulinReqPct when no ENW and no UAM+ allowed
dicko72 Oct 5, 2022
5540b53
UAMCOBPreBolus 15 minute constant
dicko72 Oct 5, 2022
f38f01a
UAM+ 75% eBGw when not in ENW
dicko72 Oct 6, 2022
73242c8
Minimum SMB of maxBolusOrig outside ENW
dicko72 Oct 6, 2022
4858865
Restore csf to OpenAPSSMBDynamicISF default
dicko72 Oct 6, 2022
91e333a
Show full SR_TDD and TIR_sens potential
dicko72 Oct 7, 2022
9a9f1ca
EXPERIMENTAL: try UAM+ with ENWindowOK instead of ttTime
dicko72 Oct 7, 2022
f0bd21f
TDDAvg1d bug
dicko72 Oct 7, 2022
443fd74
ENWindow log formatting
dicko72 Oct 7, 2022
afd8acc
ENWindow log formatting
dicko72 Oct 7, 2022
c87b7cd
ENWindow log formatting
dicko72 Oct 7, 2022
e243b43
ENWindow log formatting
dicko72 Oct 7, 2022
94f049b
EXPERIMENTAL: try UAM+ with ENWindowRunTime instead of ENWindowOK
dicko72 Oct 8, 2022
873c88f
TDDAvg1d bug
dicko72 Oct 8, 2022
ee8d373
SAFETY: Restrict insulinReq when not ENW to lower dynamic insulinReq …
dicko72 Oct 8, 2022
4634364
For TBR predtype when stuck high set a higher eventualBG
dicko72 Oct 8, 2022
f3acf4b
For TBR predtype when stuck high set a higher eventualBG
dicko72 Oct 8, 2022
eb7708f
Always calc and show TDD stats
dicko72 Oct 8, 2022
298ae6c
stable and latest variants
dicko72 Oct 8, 2022
a7cddc3
stable and latest variants
dicko72 Oct 8, 2022
3f7d848
TDDAvg3dtoCannula
dicko72 Oct 8, 2022
9300a0c
TDDAvgtoCannula
dicko72 Oct 9, 2022
98e3550
TDDAvgtoCannula
dicko72 Oct 9, 2022
cf1ba29
TDDAvgtoCannula
dicko72 Oct 9, 2022
1314354
TDDAvgtoCannula
dicko72 Oct 9, 2022
1be85dd
TDDAvgtoCannula
dicko72 Oct 9, 2022
f56d581
TDDAvgtoCannula
dicko72 Oct 9, 2022
6d4841b
TDDAvgtoCannula
dicko72 Oct 9, 2022
94dfa22
TDDAvgtoCannula
dicko72 Oct 9, 2022
c86e558
TDDAvgtoCannula
dicko72 Oct 9, 2022
f05e2dd
TDDAvgtoCannula
dicko72 Oct 9, 2022
87c1220
TDDAvgtoCannula
dicko72 Oct 9, 2022
ffdc12c
UAMBGPreBolus immediately as TBR will be used with ENWindowRunTime in…
dicko72 Oct 9, 2022
2518628
Remove requirement for autosens when using other sensitivity features
dicko72 Oct 9, 2022
c208b5f
ENMaxSMB uses adjust basal
dicko72 Oct 9, 2022
399a45e
stable determine-basal.js
dicko72 Oct 9, 2022
77eab83
stable determine-basal.js
dicko72 Oct 9, 2022
d01347e
stable determine-basal.js
dicko72 Oct 9, 2022
f3eb9a0
stable determine-basal.js
dicko72 Oct 9, 2022
d928729
stable determine-basal.js
dicko72 Oct 9, 2022
0868b7f
stable determine-basal.js
dicko72 Oct 9, 2022
8c09a88
stable determine-basal.js
dicko72 Oct 9, 2022
2a30304
UAM+ when predicted high and bg is lower
dicko72 Oct 10, 2022
3848b0b
SAFETY: if ENactive and an SMB given reduce the temp rate, unless res…
dicko72 Oct 10, 2022
73e6680
TDDLastCannula reset for 24h when new site
dicko72 Oct 10, 2022
63836bb
TDDLastCannula reset for 24h when new site
dicko72 Oct 10, 2022
3598ca9
UAM+ 75%
dicko72 Oct 12, 2022
158f6f1
UAMCOBPreBolus and UAMBGPreBolus uses ENWindowRunTime not ENWindow
dicko72 Oct 12, 2022
8ae2f48
debug for cannula TDD
dicko72 Oct 12, 2022
9be06ac
debug for cannula TDD
dicko72 Oct 12, 2022
6b234a6
TDD in DetermineBasalAdapterENJS.kt
dicko72 Oct 13, 2022
47965aa
prevent debug duplication
dicko72 Oct 13, 2022
8922f35
Remove sens_predType BG for UAM
dicko72 Oct 13, 2022
c59e043
SRTDD 1 on new site change
dicko72 Oct 14, 2022
b7b5833
UAM+ increase minPredBG and eventualBG only when a prebolus is OK
dicko72 Oct 15, 2022
cbbeb0b
UAM+ set initial eBGw at 50% unless bg is in range and accelerating, …
dicko72 Oct 15, 2022
62a7cfb
TIRH uses delta when high as this can exaggerate predictions too much
dicko72 Oct 15, 2022
d0c6c3f
eBGw when bg > threshold
dicko72 Oct 15, 2022
65ba872
EXPERIMENT: minGuardBG prevents reduction in high bg force higher unt…
dicko72 Oct 16, 2022
f23cc93
TIR_sens tweak for current bg
dicko72 Oct 16, 2022
a9ec31a
BG+ provides 20 mins SMB during day only
dicko72 Oct 16, 2022
7bc3b19
TDDAvgtoCannula needs more time to collect data
dicko72 Oct 16, 2022
3547945
remove debug for cannula
dicko72 Oct 16, 2022
dce8cc6
sens_predType PRE for prebolus
dicko72 Oct 16, 2022
bbd1fb3
EXPERIMENT: minGuardBG prevents early prebolus with UAM force higher …
dicko72 Oct 17, 2022
4ed8232
Show TIR based on time
dicko72 Oct 17, 2022
9cdcd2d
AllowZT to disable ZT for PRE and UAM+ and COB
dicko72 Oct 17, 2022
e016b9e
COB minimum eBGw 50%
dicko72 Oct 17, 2022
8dc095d
BG+ predtype with COB
dicko72 Oct 17, 2022
cf7194b
minGuardBG = threshold
dicko72 Oct 17, 2022
398f7e3
ENMaxSMB not scaled for preBolus
dicko72 Oct 18, 2022
6751e22
TDDLastCannula reason
dicko72 Oct 18, 2022
dd4e2d7
TIR_sens increase after 25% @ 150mgdl
dicko72 Oct 19, 2022
6c80430
BG+ only when ENActive
dicko72 Oct 22, 2022
9b5094b
latest sync with stable
dicko72 Oct 22, 2022
dcae2d1
BG+ only on flat or positive delta
dicko72 Oct 24, 2022
7847421
BG+ only on flat or positive delta
dicko72 Oct 24, 2022
e297dca
SRTDD compare current TDD to this cannula avg
dicko72 Oct 25, 2022
5bf3495
TDD changes
dicko72 Oct 25, 2022
b77dbd8
SRTDD dont reset on new cannula
dicko72 Oct 25, 2022
c2d4bd6
TIRS overnight minimum bg 6/108
dicko72 Oct 25, 2022
07216da
sync variants
dicko72 Oct 26, 2022
8b02fbf
when SR_TDD shows sensitivity but TIR is resistant reset sensitivityR…
dicko72 Oct 27, 2022
af63488
SAFETY: UAM+ fast delta with higher bg lowers eBGw
dicko72 Oct 27, 2022
58a87df
BG+ provides 20 min blocks of SMB based on TIR
dicko72 Oct 29, 2022
f6c6e24
SRTDD compare current TDD to this cannula avg
dicko72 Oct 30, 2022
9430325
sens_LCTDD
dicko72 Oct 31, 2022
64f0802
PCTDD
dicko72 Oct 31, 2022
f3d29ed
SRTDD uses TDDLastCannula and TDDAvg7d
dicko72 Nov 1, 2022
da2b638
Prebolus uses ISF of currentBG for insulinReq_sens
dicko72 Nov 1, 2022
a8364e5
SRTDD will adjust SR based on TDD ISF and profile ISF if enabled
dicko72 Nov 2, 2022
8af9b8a
TDDLastCannula uses average of 80% TDDAvgtoCannula and 20% TDD prior …
dicko72 Nov 3, 2022
b3f7713
when SR_TDD shows sensitivity but TIR is resistant reset sensitivityR…
dicko72 Nov 3, 2022
dab9bfb
TIR_sens overnight can use a higher positive delta
dicko72 Nov 4, 2022
47eb000
EN_UAMPlus_NoENW doesn't allow increased insulinReqPct
dicko72 Nov 6, 2022
b6b22a5
TDDLastCannula uses average of TDDAvg7d and TDD prior to 24h
dicko72 Nov 6, 2022
318258f
adjust basal prior to TIR_sens addition with limits applied
dicko72 Nov 6, 2022
f47640e
EN Reason cleanup
dicko72 Nov 7, 2022
57f0507
when no ENW and UAM+ at normalTarget + 1mmol enable ENW
dicko72 Nov 7, 2022
6729f57
move LCTDD to experimental prefs as more testing needed
dicko72 Nov 8, 2022
c4ce5dd
when no ENW and UAM+ rising fast or bg higher enable ENW
dicko72 Nov 9, 2022
41b47ba
TDD7d every 6h
dicko72 Nov 10, 2022
9658a69
UAM+ predtype when sufficient delta and not a COB prediction
dicko72 Nov 10, 2022
f93c795
profile_isf -> dyn_isf on overview screen
dicko72 Nov 11, 2022
8330bd9
TIR_sens overnight can be used during the day when 1mmol higher
dicko72 Nov 11, 2022
1b89813
TIR_sens uses TIRH or TIRL respectively
dicko72 Nov 12, 2022
28a6712
use_sens_TDD or use_sens_LCTDD uses sensitivityRatio of 1. Was causin…
dicko72 Nov 13, 2022
60ce485
TDDLastCannula < 24h use TDDAvg7d@80% TDD@20%
dicko72 Nov 13, 2022
2700fee
ISFbgMax reduction and relocation
dicko72 Nov 13, 2022
eade0b0
show UAM+ with ENW if activated
dicko72 Nov 13, 2022
b6d0668
use target_bg instead of normalTarget for some conditions
dicko72 Nov 14, 2022
649268c
EN window status
dicko72 Nov 14, 2022
3411923
carb_ratio gets SR_TDD
dicko72 Nov 14, 2022
df75473
no BG+ after a recent drop
dicko72 Nov 15, 2022
9e097d1
revert to normalTarget for dynISF
dicko72 Nov 15, 2022
cd0ada3
High temp with SMB disables EN
dicko72 Nov 17, 2022
bc09fa3
BG+ requires avg deltas to be >=0
dicko72 Nov 17, 2022
0f22b06
adjust basal including TIRS
dicko72 Nov 18, 2022
f038694
SRTDD adjusts basal TIRS adjusts ISF, MaxISF applied
dicko72 Nov 19, 2022
aab5e3f
ignoreCOBAlways option
dicko72 Nov 19, 2022
50e900a
database call optimisation
dicko72 Nov 21, 2022
793cb81
SAFETY: UAM fast delta with higher bg lowers eBGw
dicko72 Nov 22, 2022
864df91
correct ignoreCOB status
dicko72 Nov 22, 2022
c6519f8
TIR debug
dicko72 Nov 23, 2022
6707f06
TIR debug
dicko72 Nov 23, 2022
a68916a
comment cleanup
dicko72 Nov 23, 2022
f4f9130
circSens debug
dicko72 Nov 23, 2022
dcc08f4
TIR for sens_currentBG
dicko72 Nov 25, 2022
27e8348
Remove TIR for sens_currentBG and rename some reason text
dicko72 Nov 25, 2022
cf94b57
Allow BG+ overnight
dicko72 Nov 25, 2022
d2f5b01
TIR Bands and combined TIR_sens using autosens limits, still adjustin…
dicko72 Nov 25, 2022
f0d041d
BG+ change for max delta of 4 dur to TIR banding
dicko72 Nov 25, 2022
7d7d4c2
apply TIRS to ISF only when delta is slight
dicko72 Nov 26, 2022
f68d476
SR_TDD always regardless of TIR_sens
dicko72 Nov 26, 2022
725266f
TIR banding improvements
dicko72 Nov 26, 2022
743d94b
swapped SMB and TBR commands in Loop result
Sep 23, 2022
3a3a9be
disable SMB when TT set to normalTarget if option is enabled
dicko72 Nov 30, 2022
67d09a0
TIR code blocks
dicko72 Nov 30, 2022
8727d37
TIR_sens_limited reset to 1 when not being used
dicko72 Nov 30, 2022
09ffdf9
indicate % for TIR_sens and SR_TDD
dicko72 Dec 1, 2022
3901f64
Optional scaling of Prediction Curves by DynISF
rafaeldelrey Dec 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ app/.classpath
app/.settings/org.eclipse.buildship.core.prefs
wear/.classpath
wear/.settings/org.eclipse.buildship.core.prefs
*/output-metadata.json!/nsclient/release/output-metadata.json
/nsclient2/release/output-metadata.json
/nsclient/release/output-metadata.json
/app/nsclient/release/output-metadata.json
/app/nsclient2/release/output-metadata.json
10 changes: 9 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion .idea/dictionaries/project_dictionary.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions ENTT_Notes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Index: app/src/main/java/info/nightscout/androidaps/dialogs/ENTempTargetDialog.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ENTempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ENTempTargetDialog.kt
--- a/app/src/main/java/info/nightscout/androidaps/dialogs/ENTempTargetDialog.kt (revision 2085d94769ffcc20f276ac99245d489abf323b6d)
+++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ENTempTargetDialog.kt (revision af526fe31aa68725ebdbe8a04235c405f47de9c5)
@@ -185,6 +185,11 @@
actions.add(rh.gs(R.string.stoptemptarget))
reason = rh.gs(R.string.stoptemptarget)
}
+
+ val notes = binding.notesLayout.notes.text.toString()
+ if (notes.isNotEmpty())
+ actions.add(rh.gs(R.string.notes_label) + ": " + notes)
+
if (eventTimeChanged)
actions.add(rh.gs(R.string.time) + ": " + dateUtil.dateAndTimeString(eventTime))

@@ -227,6 +232,10 @@
})
}

+ // attempt to log a notes entry also
+ //uel.log(Action.CAREPORTAL, CareDialog.EventType.NOTE, notes, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
+ uel.log(Action.CAREPORTAL, Sources.Note, notes, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_NOW), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration))
+
if (duration == 10) sp.putBoolean(R.string.key_objectiveusetemptarget, true)
})
}
Index: app/src/main/res/layout/dialog_en_temptarget.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/res/layout/dialog_en_temptarget.xml b/app/src/main/res/layout/dialog_en_temptarget.xml
--- a/app/src/main/res/layout/dialog_en_temptarget.xml (revision 2085d94769ffcc20f276ac99245d489abf323b6d)
+++ b/app/src/main/res/layout/dialog_en_temptarget.xml (revision af526fe31aa68725ebdbe8a04235c405f47de9c5)
@@ -196,7 +196,11 @@
android:visibility="gone" />

</LinearLayout>
-
+
+ <include
+ android:id="@+id/notes_layout"
+ layout="@layout/notes" />
+
<include
android:id="@+id/datetime"
layout="@layout/datetime" />
83 changes: 75 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,86 @@
# AndroidAPS

* Check the wiki: https://androidaps.readthedocs.io
* Everyone who’s been looping with AndroidAPS needs to fill out the form after 3 days of looping https://docs.google.com/forms/d/14KcMjlINPMJHVt28MDRupa4sz4DDIooI4SrW0P3HSN8/viewform?c=0&w=1

[![Support Server](https://img.shields.io/discord/629952586895851530.svg?label=Discord&logo=Discord&colorB=7289da&style=for-the-badge)](https://discord.gg/4fQUWHZ4Mw)
[![Support Server](https://img.shields.io/discord/629952586895851530.svg?label=Discord&logo=Discord&colorB=7289da&style=for-the-badge)](https://discord.gg/zHA3rKHbRE)

[![CircleCI](https://circleci.com/gh/nightscout/AndroidAPS/tree/master.svg?style=svg)](https://circleci.com/gh/nightscout/AndroidAPS/tree/master)
[![Build status](https://travis-ci.org/nightscout/AndroidAPS.svg?branch=master)](https://travis-ci.org/nightscout/AndroidAPS)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/androidaps/localized.svg)](https://translations.androidaps.org/project/androidaps)
[![Documentation Status](https://readthedocs.org/projects/androidaps/badge/?version=latest)](https://androidaps.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/nightscout/AndroidAPS/branch/master/graph/badge.svg)](https://codecov.io/gh/MilosKozak/AndroidAPS)
[![codecov](https://codecov.io/gh/MilosKozak/AndroidAPS/branch/master/graph/badge.svg)](https://codecov.io/gh/MilosKozak/AndroidAPS)
dev: [![codecov](https://codecov.io/gh/MilosKozak/AndroidAPS/branch/dev/graph/badge.svg)](https://codecov.io/gh/MilosKozak/AndroidAPS)


![BTC](https://bitit.io/assets/coins/icon-btc-1e5a37bc0eb730ac83130d7aa859052bd4b53ac3f86f99966627801f7b0410be.svg) 3KawK8aQe48478s6fxJ8Ms6VTWkwjgr9f2

########################################
This version of AAPS has evolved over time using elements from AIMI and Boost.
This AAPS variation is called "Eating Now" (EN) as it is a reactive operating mode without needing to inform the system.
The intent of this plugin is the same, to deliver insulin earlier using mostly openAPS predictions.
This has been tested successfully with a blend of Fiasp 80% and Novorapid 20% (F80N).
The code can be used with or without bolusing or COB entries.
However it will not become active until a treatment has been performed after the active start time.
Allowing a delayed start time for example if you sleep in. :)
This treatment can be 1g or 0.1U for example.
After this the EN mode is active until the end time specified in the preferences.
It is recommended to set maxSMBBasalMinutes and maxUAMSMBBasalMinutes to 60 minutes max as these will be used when EN is not active.

These are the methods utilised within this version:

UAM:
This is based upon Boost and is used when there is a sudden increase in BGL of >=9 (0.5 mmol)
UAMBoost will only operate when there are no COB.
TDD is used as a reference point for initial insulin dose that can be scaled within preferences.

COB:
When carbs are entered there is a time window like AIMI.
The COBpredBG prediction uses the dynamic ISF from Boost to increase insulinReq.
If within the COBBoost Window the calculated insulinReq may be delivered via a larger SMB using the COBBoost maxBolus.
Once the time window has elapsed COBBoost maxBolus is no longer used.

Predictions leverage the dynamic ISF concept within the Boost plugin.
Using the eventualBG mostly to determine the insulinReq.
The main difference is the initial ISF used to determine the predictions is based on the profile ISF.
If BG is currently the normalTarget BG from the profile the ISF will be the same as the profile.
Once BG rises the ISF number reduces, and as BG lowers the ISF number will increase.
ISF scaling can be adjusted and eventualBG weighting for UAM and COB predictions can be applied.

These are the preferences utilised for EN mode:

DEV:
[![CircleCI](https://circleci.com/gh/nightscout/AndroidAPS/tree/dev.svg?style=svg)](https://circleci.com/gh/nightscout/AndroidAPS/tree/dev)
[![codecov](https://codecov.io/gh/nightscout/AndroidAPS/branch/dev/graph/badge.svg)](https://codecov.io/gh/MilosKozak/AndroidAPS)
General:
Start Time: The time the EN mode will start in hours as 24h clock format
EN mode will be active after this time when there has been a COB or manual bolus entry of any size
End Time: The time that EN mode will finish. Normal maxBolus of 65% is resumed.
If there are COB or a TT of normalTarget EN will be active after this time, however AAPS maxBolus will be used.
No SMB will be given when inactive unless there is COB, detected resistance from autosens or BG is above SMB BG Threshold.
InsulinReqPct: Percentage that will be used for EN insulinReq as SMB to utilise prior to maxBolus restriction.
This will be 65% when EN is not active.
Max IOB: The percentage of current max-iob setting that will be used as the limit for EN.
EN will not add insulin when above this limit.
SMB BG Offset: There will be no SMB when below this BG offset at night without COB or detected resistance.
e.g. if target bg is 99/5.5 and this setting is 27/1.5 there will be no SMB below 126/7.0
ISF BG Scaler: As BG increases ISF will become stronger. The level of scaling can be adjusted.
0 = normal scaling, 5 is 5% stronger, -5 is 5% weaker ISF scaling. Additional scaling does not happen when EN is not active.
ISF BG Offset: As BG increases ISF will become stronger. ISF will no longer scale when above this level.
e.g. if target bg is 99/5.5 and this setting is 27/1.5 there will be no scaling above 126/7.0

UAM:
UAMBoost Bolus Scale: Multiply the initial UAMBoost bolus by this amount. 0 will disable UAMBoost.
UAM maxBolus: maxBolus to use for all BG rises without COB. 0 will use maxSMBBasalMinutes or maxUAMSMBBasalMinutes.

<img src="https://cdn.iconscout.com/icon/free/png-256/bitcoin-384-920569.png" srcset="https://cdn.iconscout.com/icon/free/png-512/bitcoin-384-920569.png 2x" alt="Bitcoin Icon" width="100">
COB:
Use GhostCOB: Ignore COB predictions after the COBBoost Window and rely purely on UAM. This setting can be handy when COB lingers for too long.
COBBoost InsulinReqPct: Percentage that will be used for EN insulinReq within the COBBoost Window.
COBBoost Window: If within the COBBoost Window the calculated insulinReq from COBPredBG may be delivered via a larger SMB using the COBBoost maxBolus.
Once the time window has elapsed COBBoost maxBolus is no longer used.
0 minutes will disable this functionality.
COBBoost maxBolus: maxBolus to use within the COBBoost Window. 0 will use AAPS maxBolus.
COB maxBolus: maxBolus to use with COB outside of the initial COBBoost Window. 0 will use AAPS maxBolus.

3KawK8aQe48478s6fxJ8Ms6VTWkwjgr9f2
EXPERIMENTAL:
• Use 3PM Basal ISF Variance: Use 3PM Basal as the basis for ISF changes. The basal at 3PM is taken as the basis for baseline ISF.
Basal variation from this point is used to scale the ISF, stronger basal will make ISF weaker.
Only use when the profile uses a single ISF for 24 hours and the basal profile is fully populated.
• Use TDD for ISF: Use the last 24H TDD for ISF. This will override the profile ISF and can be used with 3PM basal ISF variance.
• TDD ISF Scaling: This will use a percentage of the calculated TDD ISF. If TDD ISF is too strong it can be reduced e.g. 50 will make TDD ISF 50% weaker.
39 changes: 35 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,46 @@ android {
defaultConfig {
multiDexEnabled true
versionCode 1500
version "3.1.0"
version "3.1.0.3-EatingNow-Angel"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "BUILDVERSION", '"' + 'EN-' + generateGitBuild()[0..7] + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
buildConfigField "String", "COMMITTED", '"' + allCommitted() + '"'

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
testCoverageEnabled(project.hasProperty('coverage'))
}
firebaseDisable {
System.setProperty("disableFirebase", "true")
ext.enableCrashlytics = false
}
applicationVariants.all{
// this method is use to rename your all apk weather
// it may be signed or unsigned(debug apk)
variant ->
variant.outputs.each{
// on below line we are setting a name to our apk
output->
// on below line we are adding the formatted date to our apk file name.
def formattedDate = new Date().format('YYMMdd')
// on below line we are creating a new name for our apk.
def newName = output.outputFile.name
newName = newName.replace("-release", "")
newName = newName.replace("app-", "")
// on below line we are replacing -release with our formatted date and ID.
newName = formattedDate + "-" + generateGitBuild()[0..7] + "-en-" + newName
// at last we are setting our apk name to it.
output.outputFileName = newName
}
}
}
flavorDimensions "standard"
productFlavors {
full {
Expand Down Expand Up @@ -244,6 +275,6 @@ if (isMaster() && !gitAvailable()) {
throw new GradleException('GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it')
}
if (isMaster() && !allCommitted()) {
throw new GradleException('There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update')
//throw new GradleException('There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update')
}

60 changes: 60 additions & 0 deletions app/src/main/assets/EN/latest/basal-set-temp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

function reason(rT, msg) {
rT.reason = (rT.reason ? rT.reason + '. ' : '') + msg;
console.error(msg);
}

var tempBasalFunctions = {};

tempBasalFunctions.getMaxSafeBasal = function getMaxSafeBasal(profile) {

var max_daily_safety_multiplier = (isNaN(profile.max_daily_safety_multiplier) || profile.max_daily_safety_multiplier == null) ? 3 : profile.max_daily_safety_multiplier;
var current_basal_safety_multiplier = (isNaN(profile.current_basal_safety_multiplier) || profile.current_basal_safety_multiplier == null) ? 4 : profile.current_basal_safety_multiplier;

return Math.min(profile.max_basal, max_daily_safety_multiplier * profile.max_daily_basal, current_basal_safety_multiplier * profile.current_basal);
};

tempBasalFunctions.setTempBasal = function setTempBasal(rate, duration, profile, rT, currenttemp) {
//var maxSafeBasal = Math.min(profile.max_basal, 3 * profile.max_daily_basal, 4 * profile.current_basal);

var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
var round_basal = require('./round-basal');

if (rate < 0) {
rate = 0;
} else if (rate > maxSafeBasal) {
rate = maxSafeBasal;
}

var suggestedRate = round_basal(rate, profile);
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && typeof(currenttemp.rate) !== 'undefined' && currenttemp.duration > (duration-10) && currenttemp.duration <= 120 && suggestedRate <= currenttemp.rate * 1.2 && suggestedRate >= currenttemp.rate * 0.8 && duration > 0 ) {
rT.reason += " "+currenttemp.duration+"m left and " + round_basal(currenttemp.rate, profile) + " ~ req " + suggestedRate + "U/hr: no temp required";
return rT;
}

if (suggestedRate === profile.current_basal) {
if (profile.skip_neutral_temps === true) {
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && currenttemp.duration > 0) {
reason(rT, 'Suggested rate is same as profile rate, a temp basal is active, canceling current temp');
rT.duration = 0;
rT.rate = 0;
return rT;
} else {
reason(rT, 'Suggested rate is same as profile rate, no temp basal is active, doing nothing');
return rT;
}
} else {
reason(rT, 'Setting neutral temp basal of ' + profile.current_basal + 'U/hr');
rT.duration = duration;
rT.rate = suggestedRate;
return rT;
}
} else {
rT.duration = duration;
rT.rate = suggestedRate;
return rT;
}
};

module.exports = tempBasalFunctions;
Loading