Open justmara opened 10 months ago
Another buggy scenario. Assume enabled settings:
Using mgdl you can set TT for 100 so SMBs are disabled, but ISF is not altered. Using mmol you cannot set such TT because 5.5 (*18=99) would be 'low TT' (lower than 100) and thus ISF would be lowered. While 5.6 on the other hand is high TT (5.6*18=100.8 which is higher than 100) so ISF would be lowered.
So definitely normalTarget must be 99. Or, maybe, it must be the average of profile target (since it is specified as bg range)?
Also ExtendedBolusExtension.kt uses 100 as normalTarget in fun ExtendedBolus.iobCalc
There is a concept of 'normalTarget' widely used in AAPS: for high/low temptargets (target value is compared with normalTarget); dynISF uses normalTarget as a base to scale up/down ISF with BG level...
However there are some problems with it:
var normalTarget = 100;
- this is hardcoded value used in oref1 js files. But the value of 100 is impossible to be used on devices withmmol
units. Because 100 is5.(5)
- you cannon set up the tempTarget of 5.55555555... in AAPS, nor you can not set this value for profile. So is always lower or higher than normalTarget. The mgdl users does not suffer from this problem.Even documentation lies (hypo and activity sections) :) It states that TT
of 100 (or 5.5) or higher
is considered as High Temp-TargetBut the code uses strict comparision with 100:
else if (! profile.allowSMB_with_high_temptarget && profile.temptargetSet && target_bg > 100)
. So setting 100 with mgdl-units system witll not trigger 'high temp' despite doc says that. But setting 5.5 on mmol system will be treated as 'low TT`, while doc says it is high value :)Looks like AAPS requires new global constant of normalTarget (=99) to be reused when needed.