Merge remote-tracking branch 'Nightscout/dev' into Autotune/TuneWeekDaysClean_TestMerge

# Conflicts:
#	app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePlugin.kt
This commit is contained in:
Philoul 2022-09-22 23:24:10 +02:00
commit 815ca1fc25
306 changed files with 6571 additions and 1882 deletions

View file

@ -3,9 +3,12 @@
<option name="AUTODETECT_INDENTS" value="false" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value />
</option>
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
<option name="BLANK_LINES_AROUND_BLOCK_WHEN_BRANCHES" value="1" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>

View file

@ -105,7 +105,7 @@ android {
defaultConfig {
multiDexEnabled true
versionCode 1500
version "3.1.0.2-dev-a"
version "3.1.0.3-dev-b"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'

View file

@ -35,7 +35,6 @@
<!-- To receive data from Aidex -->
<uses-permission android:name="com.microtechmd.cgms.aidex.permissions.RECEIVE_BG_ESTIMATE" />
<application
android:name=".MainApp"
android:allowBackup="true"

View file

@ -203,206 +203,97 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
// 80 mg/dL with low_temptarget_lowers_sensitivity would give 1.5x basal, but is limited to autosens_max (1.2x by default)
}
//*********************************************************************************
//** Start of Dynamic ISF code for predictions **
//*********************************************************************************
var profile_sens = round(profile.sens,1)
var sens = profile.sens;
console.error("---------------------------------------------------------");
console.error( " Dynamic ISF version Beta 1.6.5 ");
console.error("---------------------------------------------------------");
var now = new Date().getHours();
if (now < 1){
now = 1;}
else {
console.error("Time now is "+now+"; ");
}
//*********************************************************************************
//** Start of Dynamic ISF code for predictions **
//*********************************************************************************
var variable_sens = profile.variable_sens;
var TDD = profile.TDD;
var insulinDivisor = profile.insulinDivisor;
console.error("---------------------------------------------------------");
console.error( " Dynamic ISF version Beta 1.6.5 ");
console.error("---------------------------------------------------------");
//*********************************************************************************
//** End of Dynamic ISF code for predictions **
//*********************************************************************************
if (meal_data.TDDAIMI7){
var tdd7 = meal_data.TDDAIMI7;
}
else{
var tdd7 = ((basal * 12)*100)/21;
}
console.error("7-day average TDD is: " +tdd7+ "; ");
if (meal_data.TDDLast24){
var tdd_24 = meal_data.TDDLast24;
}
else {
var tdd_24 = (( basal * 24 ) * 2.8);
}
if (meal_data.TDDPUMP){
var tdd_pump = ( (meal_data.TDDPUMP / now ) * 24);
}
else {
var tdd_pump = (( basal * 24 ) * 2.8);
}
console.log("Rolling TDD for last 24 hours is: "+tdd_24+"; ");
/*var tdd_pump_now = meal_data.TDDPUMP;
var tdd_pump = ( tdd_pump_now / (now / 24));*/
//var TDD = (tdd7 * 0.4) + (tdd_pump * 0.6);
var tdd1 = meal_data.TDDAIMI1;
var tdd_4 = meal_data.TDDLast4;
var tdd8to4 = meal_data.TDD4to8;
var tdd_last8_wt = ( ( ( 1.4 * tdd_4) + ( 0.6 * tdd8to4) ) * 3 );
console.error("Rolling 8 hours weight average: "+tdd_last8_wt+"; ");
console.error("1-day average TDD is: "+tdd1+"; ");
console.error("7-day average TDD is: " +tdd7+ "; ");
//TDD = ( tdd_last8_wt * 0.6) + ( tdd7 * 0.4 );
var TDD = ( tdd_last8_wt * 0.33 ) + ( tdd7 * 0.34 ) + (tdd1 * 0.33);
console.log("TDD = " +TDD+ " using average of 7-day, 1-day and weighted 8hr average");
//var ins_val = 75;
var insulin = profile.insulinType;
console.log("Insulin Peak = "+profile.insulinPeak+"; ");
//console.log("Initial insulin value for ISF: "+ins_val+"; ");
//console.log("Current value for insulin: "+insulin+"; ");
var ins_val;
if (profile.insulinPeak > 65) { // lyumjev peak: 45
ins_val = 55;
} else if (profile.insulinPeak > 50 ){ // ultra rapid peak: 55
ins_val = 65;
if ( high_temptarget_raises_sensitivity && profile.temptargetSet && target_bg > normalTarget
|| profile.low_temptarget_lowers_sensitivity && profile.temptargetSet && target_bg < normalTarget ) {
// w/ target 100, temp target 110 = .89, 120 = 0.8, 140 = 0.67, 160 = .57, and 200 = .44
// e.g.: Sensitivity ratio set to 0.8 based on temp target of 120; Adjusting basal from 1.65 to 1.35; ISF from 58.9 to 73.6
//sensitivityRatio = 2/(2+(target_bg-normalTarget)/40);
var c = halfBasalTarget - normalTarget;
sensitivityRatio = c/(c+target_bg-normalTarget);
// limit sensitivityRatio to profile.autosens_max (1.2x by default)
sensitivityRatio = Math.min(sensitivityRatio, profile.autosens_max);
sensitivityRatio = round(sensitivityRatio,2);
console.log("Sensitivity ratio set to "+sensitivityRatio+" based on temp target of "+target_bg+"; ");
} else if (typeof autosens_data !== 'undefined' && autosens_data) {
sensitivityRatio = autosens_data.ratio;
console.log("Autosens ratio: "+sensitivityRatio+"; ");
}
if (sensitivityRatio) {
basal = profile.current_basal * sensitivityRatio;
basal = round_basal(basal, profile);
if (basal !== profile_current_basal) {
console.log("Adjusting basal from "+profile_current_basal+" to "+basal+"; ");
} else {
ins_val = 75; // rapid peak: 75
console.log("Basal unchanged: "+basal+"; ");
}
console.log("For "+profile.insulinType+" (insulin peak: "+profile.insulinPeak+") divisor is: "+ins_val+"; ");
}
console.log("Insulin value for ISF based on profile: "+ins_val+"; ");
var dynISFadjust = profile.DynISFAdjust;
dynISFadjust = ( dynISFadjust / 100 );
TDD = ( dynISFadjust * TDD );
var variable_sens = 1800 / ( TDD * (Math.log(( bg / ins_val ) + 1 ) ) );
variable_sens = round(variable_sens,1);
if (dynISFadjust > 1 ) {
console.log("TDD adjustment factor is: " +dynISFadjust+"; ");
console.log("TDD adjusted to "+TDD+" using adjustment factor of "+dynISFadjust+"; ");
console.log("Current sensitivity for predictions is " +variable_sens+" based on current bg");
}
else if (dynISFadjust < 1 ){
console.log("TDD adjustment factor is: " +dynISFadjust+"; ");
console.log("TDD adjusted to "+TDD+" using adjustment factor of "+dynISFadjust+"; ");
console.log("Current sensitivity for predictions is " +variable_sens+" based on current bg");
} else {
console.log("Current sensitivity for predictions is " +variable_sens+" based on current bg");
}
sens = variable_sens;
//*********************************************************************************
//** End of Dynamic ISF code for predictions **
//*********************************************************************************
if ( high_temptarget_raises_sensitivity && profile.temptargetSet && target_bg > normalTarget || profile.low_temptarget_lowers_sensitivity && profile.temptargetSet && target_bg < normalTarget ) {
// w/ target 100, temp target 110 = .89, 120 = 0.8, 140 = 0.67, 160 = .57, and 200 = .44
// e.g.: Sensitivity ratio set to 0.8 based on temp target of 120; Adjusting basal from 1.65 to 1.35; ISF from 58.9 to 73.6
//sensitivityRatio = 2/(2+(target_bg-normalTarget)/40);
var c = halfBasalTarget - normalTarget;
sensitivityRatio = c/(c+target_bg-normalTarget);
// limit sensitivityRatio to profile.autosens_max (1.2x by default)
sensitivityRatio = Math.min(sensitivityRatio, profile.autosens_max);
sensitivityRatio = round(sensitivityRatio,2);
console.log("Sensitivity ratio set to "+sensitivityRatio+" based on temp target of "+target_bg+"; ");
sens = sens / sensitivityRatio ;
sens = round(sens, 1);
console.log("ISF from "+variable_sens+" to "+sens+ "due to temp target; ");
}
else {
sensitivityRatio = ( meal_data.TDD24 / tdd7 );
}
if (sensitivityRatio > 1) {
sensitivityRatio = Math.min(sensitivityRatio, profile.autosens_max);
sensitivityRatio = round(sensitivityRatio,2);
console.log("Sensitivity ratio: "+sensitivityRatio+"; ");
}
else if( sensitivityRatio < 1) {
sensitivityRatio = Math.max(sensitivityRatio, profile.autosens_min);
sensitivityRatio = round(sensitivityRatio,2);
console.log("Sensitivity ratio: "+sensitivityRatio+"; ");
}
else {
console.log("Sensitivity ratio: "+sensitivityRatio+"; ");
}
if (sensitivityRatio && profile.openapsama_useautosens === true) {
basal = profile.current_basal * sensitivityRatio;
basal = round_basal(basal, profile);
if (basal !== profile_current_basal) {
console.log("Adjusting basal from "+profile_current_basal+" to "+basal+"; ");
// adjust min, max, and target BG for sensitivity, such that 50% increase in ISF raises target from 100 to 120
if (profile.temptargetSet) {
//console.log("Temp Target set, not adjusting with autosens; ");
} else if (typeof autosens_data !== 'undefined' && autosens_data) {
if ( profile.sensitivity_raises_target && autosens_data.ratio < 1 || profile.resistance_lowers_target && autosens_data.ratio > 1 ) {
// with a target of 100, default 0.7-1.2 autosens min/max range would allow a 93-117 target range
min_bg = round((min_bg - 60) / autosens_data.ratio) + 60;
max_bg = round((max_bg - 60) / autosens_data.ratio) + 60;
var new_target_bg = round((target_bg - 60) / autosens_data.ratio) + 60;
// don't allow target_bg below 80
new_target_bg = Math.max(80, new_target_bg);
if (target_bg === new_target_bg) {
console.log("target_bg unchanged: "+new_target_bg+"; ");
} else {
console.log("Autosens disabled. Basal unchanged: "+basal+"; ");
console.log("target_bg from "+target_bg+" to "+new_target_bg+"; ");
}
target_bg = new_target_bg;
}
}
// adjust min, max, and target BG for sensitivity, such that 50% increase in ISF raises target from 100 to 120
if (profile.temptargetSet) {
//console.log("Temp Target set, not adjusting with autosens; ");
} else {
if ( profile.sensitivity_raises_target && sensitivityRatio < 1 && profile.openapsama_useautosens === true || profile.resistance_lowers_target && sensitivityRatio > 1 && profile.openapsama_useautosens === true) {
// with a target of 100, default 0.7-1.2 autosens min/max range would allow a 93-117 target range
min_bg = round((min_bg - 60) / sensitivityRatio) + 60;
max_bg = round((max_bg - 60) / sensitivityRatio) + 60;
var new_target_bg = round((target_bg - 60) / sensitivityRatio) + 60;
// don't allow target_bg below 80
new_target_bg = Math.max(80, new_target_bg);
if (target_bg === new_target_bg) {
console.log("target_bg unchanged: "+new_target_bg+"; ");
} else {
console.log("target_bg from "+target_bg+" to "+new_target_bg+"; ");
}
target_bg = new_target_bg;
}
}
if (typeof iob_data === 'undefined' ) {
rT.error ='Error: iob_data undefined. ';
return rT;
}
var iobArray = iob_data;
if (typeof(iob_data.length) && iob_data.length > 1) {
iob_data = iobArray[0];
//console.error(JSON.stringify(iob_data[0]));
}
if (typeof iob_data === 'undefined' ) {
rT.error ='Error: iob_data undefined. ';
return rT;
}
if (typeof iob_data.activity === 'undefined' || typeof iob_data.iob === 'undefined' ) {
rT.error ='Error: iob_data missing some property. ';
return rT;
}
var iobArray = iob_data;
if (typeof(iob_data.length) && iob_data.length > 1) {
iob_data = iobArray[0];
//console.error(JSON.stringify(iob_data[0]));
}
var tick;
if (typeof iob_data.activity === 'undefined' || typeof iob_data.iob === 'undefined' ) {
rT.error ='Error: iob_data missing some property. ';
return rT;
}
if (glucose_status.delta > -0.5) {
tick = "+" + round(glucose_status.delta,0);
} else {
tick = round(glucose_status.delta,0);
}
//var minDelta = Math.min(glucose_status.delta, glucose_status.short_avgdelta, glucose_status.long_avgdelta);
var minDelta = Math.min(glucose_status.delta, glucose_status.short_avgdelta);
var minAvgDelta = Math.min(glucose_status.short_avgdelta, glucose_status.long_avgdelta);
var maxDelta = Math.max(glucose_status.delta, glucose_status.short_avgdelta, glucose_status.long_avgdelta);
var tick;
if (glucose_status.delta > -0.5) {
tick = "+" + round(glucose_status.delta,0);
} else {
tick = round(glucose_status.delta,0);
}
//var minDelta = Math.min(glucose_status.delta, glucose_status.short_avgdelta, glucose_status.long_avgdelta);
var minDelta = Math.min(glucose_status.delta, glucose_status.short_avgdelta);
var minAvgDelta = Math.min(glucose_status.short_avgdelta, glucose_status.long_avgdelta);
var maxDelta = Math.max(glucose_status.delta, glucose_status.short_avgdelta, glucose_status.long_avgdelta);
console.error("; CR:",profile.carb_ratio);
var sens = variable_sens
// compare currenttemp to iob_data.lastTemp and cancel temp if they don't match
var lastTempAge;
@ -413,7 +304,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
}
//console.error("currenttemp:",currenttemp,"lastTemp:",JSON.stringify(iob_data.lastTemp),"lastTempAge:",lastTempAge,"m");
var tempModulus = (lastTempAge + currenttemp.duration) % 30;
console.error("currenttemp:",currenttemp,"lastTempAge:",lastTempAge,"m","tempModulus:",tempModulus,"m");
console.error("currenttemp:",round(currenttemp.rate,2),"lastTempAge:",lastTempAge,"m","tempModulus:",tempModulus,"m");
rT.temp = 'absolute';
rT.deliverAt = deliverAt;
if ( microBolusAllowed && currenttemp && iob_data.lastTemp && currenttemp.rate !== iob_data.lastTemp.rate && lastTempAge > 10 && currenttemp.duration ) {
@ -822,39 +713,36 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
console.error("UAM Impact:",uci,"mg/dL per 5m; UAM Duration:",UAMduration,"hours");
console.log("EventualBG is" +eventualBG+" ;");
console.log("EventualBG is" +eventualBG+" ;");
minIOBPredBG = Math.max(39,minIOBPredBG);
minCOBPredBG = Math.max(39,minCOBPredBG);
minUAMPredBG = Math.max(39,minUAMPredBG);
minPredBG = round(minIOBPredBG);
minIOBPredBG = Math.max(39,minIOBPredBG);
minCOBPredBG = Math.max(39,minCOBPredBG);
minUAMPredBG = Math.max(39,minUAMPredBG);
minPredBG = round(minIOBPredBG);
var fSensBG = Math.min(minPredBG,bg);
var fSensBG = Math.min(minPredBG,bg);
if (bg > target_bg && glucose_status.delta < 3 && glucose_status.delta > -3 && glucose_status.short_avgdelta > -3 && glucose_status.short_avgdelta < 3 && eventualBG > target_bg && eventualBG < bg ) {
var future_sens = ( 1800 / (Math.log((((fSensBG * 0.5) + (bg * 0.5))/ins_val)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * ((bg * 0.5) + (eventualBG * 0.5 ))));
console.log("Future state sensitivity is " +future_sens+" based on eventual and current bg due to flat glucose level above target");
rT.reason += "Dosing sensitivity: " +future_sens+" using eventual BG;";
if (bg > target_bg && glucose_status.delta < 3 && glucose_status.delta > -3 && glucose_status.short_avgdelta > -3 && glucose_status.short_avgdelta < 3 && eventualBG > target_bg && eventualBG < bg ) {
var future_sens = ( 1800 / (Math.log((((fSensBG * 0.5) + (bg * 0.5))/insulinDivisor)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * ((bg * 0.5) + (eventualBG * 0.5 ))));
console.log("Future state sensitivity is " +future_sens+" based on eventual and current bg due to flat glucose level above target");
rT.reason += "Dosing sensitivity: " +future_sens+" using eventual BG;";
}
else if( glucose_status.delta > 0 && eventualBG > target_bg || eventualBG > bg) {
var future_sens = ( 1800 / (Math.log((bg/insulinDivisor)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * bg));
console.log("Future state sensitivity is " +future_sens+" using current bg due to small delta or variation");
rT.reason += "Dosing sensitivity: " +future_sens+" using current BG;";
}
else if( glucose_status.delta > 0 && eventualBG > target_bg || eventualBG > bg ) {
var future_sens = ( 1800 / (Math.log((bg/ins_val)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * bg));
console.log("Future state sensitivity is " +future_sens+" using current bg due to small delta or variation");
rT.reason += "Dosing sensitivity: " +future_sens+" using current BG;";
}
else {
var future_sens = ( 1800 / (Math.log((fSensBG/ins_val)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * eventualBG));
console.log("Future state sensitivity is " +future_sens+" based on eventual bg due to -ve delta");
rT.reason += "Dosing sensitivity: " +future_sens+" using eventual BG;";
}
future_sens = round(future_sens,1);
else {
var future_sens = ( 1800 / (Math.log((fSensBG/insulinDivisor)+1)*TDD));
//var future_sens_old = ( 277700 / (TDD * eventualBG));
console.log("Future state sensitivity is " +future_sens+" based on eventual bg due to -ve delta");
rT.reason += "Dosing sensitivity: " +future_sens+" using eventual BG;";
}
future_sens = round(future_sens,1);
var fractionCarbsLeft = meal_data.mealCOB/meal_data.carbs;
@ -1079,25 +967,22 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
}
}
// calculate 30m low-temp required to get projected BG up to target
// multiply by 2 to low-temp faster for increased hypo safety
var insulinReq = 2 * Math.min(0, (eventualBG - target_bg) / future_sens);
insulinReq = round( insulinReq , 2);
// calculate naiveInsulinReq based on naive_eventualBG
var naiveInsulinReq = Math.min(0, (naive_eventualBG - target_bg) / sens);
naiveInsulinReq = round( naiveInsulinReq , 2);
if (minDelta < 0 && minDelta > expectedDelta) {
// if we're barely falling, newinsulinReq should be barely negative
var newinsulinReq = round(( insulinReq * (minDelta / expectedDelta) ), 2);
//console.error("Increasing insulinReq from " + insulinReq + " to " + newinsulinReq);
insulinReq = newinsulinReq;
}
// rate required to deliver insulinReq less insulin over 30m:
var rate = basal + (2 * insulinReq);
rate = round_basal(rate, profile);
// calculate 30m low-temp required to get projected BG up to target
// multiply by 2 to low-temp faster for increased hypo safety
var insulinReq = 2 * Math.min(0, (eventualBG - target_bg) / future_sens);
insulinReq = round( insulinReq , 2);
// calculate naiveInsulinReq based on naive_eventualBG
var naiveInsulinReq = Math.min(0, (naive_eventualBG - target_bg) / sens);
naiveInsulinReq = round( naiveInsulinReq , 2);
if (minDelta < 0 && minDelta > expectedDelta) {
// if we're barely falling, newinsulinReq should be barely negative
var newinsulinReq = round(( insulinReq * (minDelta / expectedDelta) ), 2);
//console.error("Increasing insulinReq from " + insulinReq + " to " + newinsulinReq);
insulinReq = newinsulinReq;
}
// rate required to deliver insulinReq less insulin over 30m:
var rate = basal + (2 * insulinReq);
rate = round_basal(rate, profile);
// if required temp < existing temp basal
var insulinScheduled = currenttemp.duration * (currenttemp.rate - basal) / 60;
@ -1185,14 +1070,14 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
}
} else { // otherwise, calculate 30m high-temp required to get projected BG down to target
// insulinReq is the additional insulin required to get minPredBG down to target_bg
//console.error(minPredBG,eventualBG);
insulinReq = round( (Math.min(minPredBG,eventualBG) - target_bg) / future_sens, 2);
// if that would put us over max_iob, then reduce accordingly
if (insulinReq > max_iob-iob_data.iob) {
rT.reason += "max_iob " + max_iob + ", ";
insulinReq = max_iob-iob_data.iob;
}
// insulinReq is the additional insulin required to get minPredBG down to target_bg
//console.error(minPredBG,eventualBG);
insulinReq = round( (Math.min(minPredBG,eventualBG) - target_bg) / future_sens, 2);
// if that would put us over max_iob, then reduce accordingly
if (insulinReq > max_iob-iob_data.iob) {
rT.reason += "max_iob " + max_iob + ", ";
insulinReq = max_iob-iob_data.iob;
}
// rate required to deliver insulinReq more insulin over 30m:
rate = basal + (2 * insulinReq);

View file

@ -295,6 +295,7 @@ class MainActivity : NoSplashAppCompatActivity() {
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
super.onCreateOptionsMenu(menu)
menu.setGroupDividerEnabled(true)
this.menu = menu
menuInflater.inflate(R.menu.menu_main, menu)
@ -306,6 +307,7 @@ class MainActivity : NoSplashAppCompatActivity() {
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
super.onOptionsItemSelected(item)
when (item.itemId) {
R.id.nav_preferences -> {
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {

View file

@ -80,7 +80,7 @@ class MainApp : DaggerApplication() {
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper
@Inject lateinit var notificationStore: NotificationStore
@Inject lateinit var processLifecycleListener: ProcessLifecycleListener
@Inject lateinit var processLifecycleListener: Provider<ProcessLifecycleListener>
@Inject lateinit var profileSwitchPlugin: ThemeSwitcherPlugin
@Inject lateinit var localAlertUtils: LocalAlertUtils
@Inject lateinit var rh: Provider<ResourceHelper>
@ -94,7 +94,6 @@ class MainApp : DaggerApplication() {
RxDogTag.install()
setRxErrorHandler()
LocaleHelper.update(this)
ProcessLifecycleOwner.get().lifecycle.addObserver(processLifecycleListener)
var gitRemote: String? = BuildConfig.REMOTE
var commitHash: String? = BuildConfig.HEAD
@ -151,6 +150,7 @@ class MainApp : DaggerApplication() {
localAlertUtils.preSnoozeAlarms()
doMigrations()
uel.log(UserEntry.Action.START_AAPS, UserEntry.Sources.Aaps)
ProcessLifecycleOwner.get().lifecycle.addObserver(processLifecycleListener.get())
// schedule widget update
refreshWidget = Runnable {

View file

@ -12,7 +12,7 @@ import com.google.android.material.datepicker.MaterialDatePicker
import com.jjoe64.graphview.GraphView
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.activities.fragments.HistoryBrowserData
import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.events.EventCustomCalculationFinished
@ -21,27 +21,18 @@ import info.nightscout.androidaps.events.EventScale
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.extensions.toVisibilityKeepSpace
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Loop
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus
import info.nightscout.androidaps.plugins.general.overview.OverviewData
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
import info.nightscout.androidaps.receivers.DataWorker
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.Translator
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.workflow.CalculationWorkflow
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import java.util.*
@ -50,23 +41,16 @@ import kotlin.math.min
class HistoryBrowseActivity : NoSplashAppCompatActivity() {
@Inject lateinit var historyBrowserData: HistoryBrowserData
@Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var sp: SP
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var repository: AppRepository
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var overviewMenus: OverviewMenus
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var config: Config
@Inject lateinit var loop: Loop
@Inject lateinit var nsDeviceStatus: NSDeviceStatus
@Inject lateinit var translator: Translator
@Inject lateinit var context: Context
@Inject lateinit var dataWorker: DataWorker
@Inject lateinit var calculationWorkflow: CalculationWorkflow
private val disposable = CompositeDisposable()
@ -78,9 +62,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
private var rangeToDisplay = 24 // for graph
// private var start: Long = 0
private lateinit var iobCobCalculator: IobCobCalculatorPlugin
private lateinit var overviewData: OverviewData
private lateinit var binding: ActivityHistorybrowseBinding
private var destroyed = false
@ -89,42 +70,12 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
binding = ActivityHistorybrowseBinding.inflate(layoutInflater)
setContentView(binding.root)
// We don't want to use injected singletons but own instance working on top of different data
overviewData =
OverviewData(
aapsLogger,
rh,
dateUtil,
sp,
activePlugin,
defaultValueHelper,
profileFunction,
repository,
fabricPrivacy
)
iobCobCalculator =
IobCobCalculatorPlugin(
injector,
aapsLogger,
aapsSchedulers,
rxBus,
sp,
rh,
profileFunction,
activePlugin,
fabricPrivacy,
dateUtil,
repository,
overviewData,
calculationWorkflow
)
binding.left.setOnClickListener {
adjustTimeRange(overviewData.fromTime - T.hours(rangeToDisplay.toLong()).msecs())
adjustTimeRange(historyBrowserData.overviewData.fromTime - T.hours(rangeToDisplay.toLong()).msecs())
loadAll("onClickLeft")
}
binding.right.setOnClickListener {
adjustTimeRange(overviewData.fromTime + T.hours(rangeToDisplay.toLong()).msecs())
adjustTimeRange(historyBrowserData.overviewData.fromTime + T.hours(rangeToDisplay.toLong()).msecs())
loadAll("onClickRight")
}
binding.end.setOnClickListener {
@ -138,7 +89,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
}
binding.zoom.setOnLongClickListener {
Calendar.getInstance().also { calendar ->
calendar.timeInMillis = overviewData.fromTime
calendar.timeInMillis = historyBrowserData.overviewData.fromTime
calendar[Calendar.MILLISECOND] = 0
calendar[Calendar.SECOND] = 0
calendar[Calendar.MINUTE] = 0
@ -151,13 +102,13 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
binding.date.setOnClickListener {
MaterialDatePicker.Builder.datePicker()
.setSelection(dateUtil.timeStampToUtcDateMillis(overviewData.fromTime))
.setSelection(dateUtil.timeStampToUtcDateMillis(historyBrowserData.overviewData.fromTime))
.setTheme(R.style.DatePicker)
.build()
.apply {
addOnPositiveButtonClickListener { selection ->
setTime(dateUtil.mergeUtcDateToTimestamp(overviewData.fromTime, selection))
binding.date.text = dateUtil.dateAndTimeString(overviewData.fromTime)
setTime(dateUtil.mergeUtcDateToTimestamp(historyBrowserData.overviewData.fromTime, selection))
binding.date.text = dateUtil.dateAndTimeString(historyBrowserData.overviewData.fromTime)
loadAll("onClickDate")
}
}
@ -180,8 +131,8 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
prepareGraphsIfNeeded(overviewMenus.setting.size)
savedInstanceState?.let { bundle ->
rangeToDisplay = bundle.getInt("rangeToDisplay", 0)
overviewData.fromTime = bundle.getLong("start", 0)
overviewData.toTime = bundle.getLong("end", 0)
historyBrowserData.overviewData.fromTime = bundle.getLong("start", 0)
historyBrowserData.overviewData.toTime = bundle.getLong("end", 0)
}
}
@ -220,11 +171,11 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
.observeOn(aapsSchedulers.main)
.subscribe({
rangeToDisplay = it.hours
setTime(overviewData.fromTime)
setTime(historyBrowserData.overviewData.fromTime)
loadAll("rangeChange")
}, fabricPrivacy::logException)
if (overviewData.fromTime == 0L) {
updateCalcProgress(100)
if (historyBrowserData.overviewData.fromTime == 0L) {
// set start of current day
setTime(dateUtil.now())
loadAll("onResume")
@ -236,8 +187,8 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putInt("rangeToDisplay", rangeToDisplay)
outState.putLong("start", overviewData.fromTime)
outState.putLong("end", overviewData.toTime)
outState.putLong("start", historyBrowserData.overviewData.fromTime)
outState.putLong("end", historyBrowserData.overviewData.toTime)
}
private fun prepareGraphsIfNeeded(numOfGraphs: Int) {
@ -293,18 +244,18 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
}
private fun adjustTimeRange(start: Long) {
overviewData.fromTime = start
overviewData.toTime = overviewData.fromTime + T.hours(rangeToDisplay.toLong()).msecs()
overviewData.endTime = overviewData.toTime
historyBrowserData.overviewData.fromTime = start
historyBrowserData.overviewData.toTime = historyBrowserData.overviewData.fromTime + T.hours(rangeToDisplay.toLong()).msecs()
historyBrowserData.overviewData.endTime = historyBrowserData.overviewData.toTime
}
private fun runCalculation(from: String) {
calculationWorkflow.runCalculation(
CalculationWorkflow.HISTORY_CALCULATION,
iobCobCalculator,
overviewData,
historyBrowserData.iobCobCalculator,
historyBrowserData.overviewData,
from,
overviewData.toTime,
historyBrowserData.overviewData.toTime,
bgDataReload = true,
limitDataToOldestAvailable = false,
cause = EventCustomCalculationFinished(),
@ -325,7 +276,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
}
private fun updateDate() {
binding.date.text = dateUtil.dateAndTimeString(overviewData.fromTime)
binding.date.text = dateUtil.dateAndTimeString(historyBrowserData.overviewData.fromTime)
binding.zoom.text = rangeToDisplay.toString()
}
@ -337,9 +288,9 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
updateDate()
val pump = activePlugin.activePump
val graphData = GraphData(injector, binding.bgGraph, overviewData)
val graphData = GraphData(injector, binding.bgGraph, historyBrowserData.overviewData)
val menuChartSettings = overviewMenus.setting
graphData.addInRangeArea(overviewData.fromTime, overviewData.endTime, defaultValueHelper.determineLowLine(), defaultValueHelper.determineHighLine())
graphData.addInRangeArea(historyBrowserData.overviewData.fromTime, historyBrowserData.overviewData.endTime, defaultValueHelper.determineLowLine(), defaultValueHelper.determineHighLine())
graphData.addBgReadings(menuChartSettings[0][OverviewMenus.CharType.PRE.ordinal], context)
if (buildHelper.isDev()) graphData.addBucketedData()
graphData.addTreatments(context)
@ -355,7 +306,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
// set manual x bounds to have nice steps
graphData.setNumVerticalLabels()
graphData.formatAxis(overviewData.fromTime, overviewData.endTime)
graphData.formatAxis(historyBrowserData.overviewData.fromTime, historyBrowserData.overviewData.endTime)
graphData.performUpdate()
@ -365,7 +316,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
val now = System.currentTimeMillis()
for (g in 0 until min(secondaryGraphs.size, menuChartSettings.size + 1)) {
val secondGraphData = GraphData(injector, secondaryGraphs[g], overviewData)
val secondGraphData = GraphData(injector, secondaryGraphs[g], historyBrowserData.overviewData)
var useABSForScale = false
var useIobForScale = false
var useCobForScale = false
@ -393,7 +344,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] && buildHelper.isDev()) secondGraphData.addDeviationSlope(useDSForScale, 1.0)
// set manual x bounds to have nice steps
secondGraphData.formatAxis(overviewData.fromTime, overviewData.endTime)
secondGraphData.formatAxis(historyBrowserData.overviewData.fromTime, historyBrowserData.overviewData.endTime)
secondGraphData.addNowLine(now)
secondaryGraphsData.add(secondGraphData)
}

View file

@ -91,6 +91,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
@Inject lateinit var poctechPlugin: PoctechPlugin
@Inject lateinit var tomatoPlugin: TomatoPlugin
@Inject lateinit var glunovoPlugin: GlunovoPlugin
@Inject lateinit var intelligoPlugin: IntelligoPlugin
@Inject lateinit var aidexPlugin: AidexPlugin
@Inject lateinit var smsCommunicatorPlugin: SmsCommunicatorPlugin
@Inject lateinit var statusLinePlugin: StatusLinePlugin
@ -167,6 +168,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
addPreferencesFromResourceIfEnabled(dexcomPlugin, rootKey)
addPreferencesFromResourceIfEnabled(tomatoPlugin, rootKey)
addPreferencesFromResourceIfEnabled(glunovoPlugin, rootKey)
addPreferencesFromResourceIfEnabled(intelligoPlugin, rootKey)
addPreferencesFromResourceIfEnabled(poctechPlugin, rootKey)
addPreferencesFromResourceIfEnabled(aidexPlugin, rootKey)
addPreferencesFromResourceIfEnabled(glimpPlugin, rootKey)

View file

@ -69,13 +69,13 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
super.attachBaseContext(LocaleHelper.wrap(newBase))
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
android.R.id.home -> {
onBackPressed()
return true
true
}
else -> super.onOptionsItemSelected(item)
}
return super.onOptionsItemSelected(item)
}
}

View file

@ -175,29 +175,29 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
for (i in 0..1) {
if (typeSelected[i] == ProfileType.MOTOL_DEFAULT) {
if (ageUsed[i] < 1 || ageUsed[i] > 18) {
ToastUtils.showToastInUiThread(this, R.string.invalidage)
ToastUtils.warnToast(this, R.string.invalidage)
return@setOnClickListener
}
if ((weightUsed[i] < 5 || weightUsed[i] > 150) && tddUsed[i] == 0.0) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
if ((tddUsed[i] < 5 || tddUsed[i] > 150) && weightUsed[i] == 0.0) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
}
if (typeSelected[i] == ProfileType.DPV_DEFAULT) {
if (ageUsed[i] < 1 || ageUsed[i] > 18) {
ToastUtils.showToastInUiThread(this, R.string.invalidage)
ToastUtils.warnToast(this, R.string.invalidage)
return@setOnClickListener
}
if (tddUsed[i] < 5 || tddUsed[i] > 150) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
if ((pctUsed[i] < 32 || pctUsed[i] > 37)) {
ToastUtils.showToastInUiThread(this, R.string.invalidpct)
ToastUtils.warnToast(this, R.string.invalidpct)
return@setOnClickListener
}
}
@ -226,7 +226,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
return@setOnClickListener
}
}
ToastUtils.showToastInUiThread(this, R.string.invalidinput)
ToastUtils.warnToast(this, R.string.invalidinput)
}
binding.ageLabel.labelFor = binding.age.editTextId
binding.tddLabel.labelFor = binding.tdd.editTextId

View file

@ -27,25 +27,31 @@ class SingleFragmentActivity : DaggerAppCompatActivityWithResult() {
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
if (savedInstanceState == null) {
supportFragmentManager.beginTransaction().replace(R.id.frame_layout,
supportFragmentManager.fragmentFactory.instantiate(ClassLoader.getSystemClassLoader(), plugin?.pluginDescription?.fragmentClass!!)).commit()
supportFragmentManager.beginTransaction().replace(
R.id.frame_layout,
supportFragmentManager.fragmentFactory.instantiate(ClassLoader.getSystemClassLoader(), plugin?.pluginDescription?.fragmentClass!!)
).commit()
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == android.R.id.home) {
finish()
return true
} else if (item.itemId == R.id.nav_plugin_preferences) {
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, Runnable {
val i = Intent(this, PreferencesActivity::class.java)
i.putExtra("id", plugin?.preferencesId)
startActivity(i)
}, null)
return true
override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
android.R.id.home -> {
finish()
true
}
R.id.nav_plugin_preferences -> {
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {
val i = Intent(this, PreferencesActivity::class.java)
i.putExtra("id", plugin?.preferencesId)
startActivity(i)
}, null)
true
}
else -> super.onOptionsItemSelected(item)
}
return false
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
if (plugin?.preferencesId != -1) menuInflater.inflate(R.menu.menu_single_fragment, menu)

View file

@ -52,15 +52,15 @@ class SurveyActivity : NoSplashAppCompatActivity() {
val weight = SafeParse.stringToDouble(binding.weight.text.toString())
val tdd = SafeParse.stringToDouble(binding.tdd.text.toString())
if (age < 1 || age > 120) {
ToastUtils.showToastInUiThread(this, R.string.invalidage)
ToastUtils.warnToast(this, R.string.invalidage)
return@setOnClickListener
}
if ((weight < 5 || weight > 150) && tdd == 0.0) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
if ((tdd < 5 || tdd > 150) && weight == 0.0) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
profileFunction.getProfile()?.let { runningProfile ->
@ -84,11 +84,11 @@ class SurveyActivity : NoSplashAppCompatActivity() {
r.age = SafeParse.stringToInt(binding.age.text.toString())
r.weight = SafeParse.stringToInt(binding.weight.text.toString())
if (r.age < 1 || r.age > 120) {
ToastUtils.showToastInUiThread(this, R.string.invalidage)
ToastUtils.warnToast(this, R.string.invalidage)
return@setOnClickListener
}
if (r.weight < 5 || r.weight > 150) {
ToastUtils.showToastInUiThread(this, R.string.invalidweight)
ToastUtils.warnToast(this, R.string.invalidweight)
return@setOnClickListener
}
@ -110,7 +110,7 @@ class SurveyActivity : NoSplashAppCompatActivity() {
database.child("survey").child(r.id).setValue(r)
} else {
aapsLogger.error("signInAnonymously:failure", task.exception!!)
ToastUtils.showToastInUiThread(this, "Authentication failed.")
ToastUtils.warnToast(this, "Authentication failed.")
//updateUI(null)
}

View file

@ -7,7 +7,13 @@ import androidx.fragment.app.FragmentTransaction
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import info.nightscout.androidaps.R
import info.nightscout.androidaps.activities.fragments.*
import info.nightscout.androidaps.activities.fragments.TreatmentsBolusCarbsFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsCareportalFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsExtendedBolusesFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsProfileSwitchFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsTempTargetFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsTemporaryBasalsFragment
import info.nightscout.androidaps.activities.fragments.TreatmentsUserEntryFragment
import info.nightscout.androidaps.databinding.TreatmentsFragmentBinding
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.ActivePlugin
@ -25,7 +31,7 @@ class TreatmentsActivity : NoSplashAppCompatActivity() {
super.onCreate(savedInstanceState)
binding = TreatmentsFragmentBinding.inflate(layoutInflater)
setContentView(binding.root)
// Use index, TabItems crashes with an id
val useFakeTempBasal = activePlugin.activePump.isFakingTempsByExtendedBoluses
binding.treatmentsTabs.getTabAt(1)?.view?.visibility = useFakeTempBasal.toVisibility()
@ -55,16 +61,15 @@ class TreatmentsActivity : NoSplashAppCompatActivity() {
})
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
android.R.id.home -> {
finish()
true
}
else -> false
else -> super.onOptionsItemSelected(item)
}
}
private fun setFragment(selectedFragment: Fragment) {
supportFragmentManager.beginTransaction()

View file

@ -0,0 +1,72 @@
package info.nightscout.androidaps.activities.fragments
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.OverviewData
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.workflow.CalculationWorkflow
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.sharedPreferences.SP
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class HistoryBrowserData @Inject constructor(
injector: HasAndroidInjector,
aapsSchedulers: AapsSchedulers,
rxBus: RxBus,
aapsLogger: AAPSLogger,
rh: ResourceHelper,
dateUtil: DateUtil,
sp: SP,
activePlugin: ActivePlugin,
defaultValueHelper: DefaultValueHelper,
profileFunction: ProfileFunction,
repository: AppRepository,
fabricPrivacy: FabricPrivacy,
calculationWorkflow: CalculationWorkflow
) {
var iobCobCalculator: IobCobCalculatorPlugin
var overviewData: OverviewData
init {
// We don't want to use injected singletons but own instance working on top of different data
overviewData =
OverviewData(
aapsLogger,
rh,
dateUtil,
sp,
activePlugin,
defaultValueHelper,
profileFunction,
repository,
fabricPrivacy
)
iobCobCalculator =
IobCobCalculatorPlugin(
injector,
aapsLogger,
aapsSchedulers,
rxBus,
sp,
rh,
profileFunction,
activePlugin,
fabricPrivacy,
dateUtil,
repository,
overviewData,
calculationWorkflow
)
}
}

View file

@ -6,6 +6,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -28,6 +30,7 @@ import info.nightscout.androidaps.events.EventTreatmentChange
import info.nightscout.androidaps.extensions.iobCalc
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
@ -40,7 +43,6 @@ import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
@ -52,7 +54,7 @@ import io.reactivex.rxjava3.kotlin.subscribeBy
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class TreatmentsBolusCarbsFragment : DaggerFragment() {
class TreatmentsBolusCarbsFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var sp: SP
@ -93,11 +95,11 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun bolusMealLinksWithInvalid(now: Long) = repository
@ -215,7 +217,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
holder.binding.bolusInvalid.visibility = bolus.isValid.not().toVisibility()
val iob = bolus.iobCalc(activePlugin, System.currentTimeMillis(), profile.dia)
if (iob.iobContrib > 0.01) {
holder.binding.iob.setTextColor(rh.gac(context , R.attr.activeColor))
holder.binding.iob.setTextColor(rh.gac(context, R.attr.activeColor))
holder.binding.iob.text = rh.gs(R.string.formatinsulinunits, iob.iobContrib)
holder.binding.iobLabel.visibility = View.VISIBLE
holder.binding.iob.visibility = View.VISIBLE
@ -225,8 +227,8 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
holder.binding.iobLabel.visibility = View.GONE
holder.binding.iob.visibility = View.GONE
}
if (bolus.timestamp > dateUtil.now()) holder.binding.date.setTextColor(rh.gac(context, R.attr.scheduledColor)) else holder.binding.date.setTextColor(holder.binding.carbs
.currentTextColor)
if (bolus.timestamp > dateUtil.now())
holder.binding.date.setTextColor(rh.gac(context, R.attr.scheduledColor)) else holder.binding.date.setTextColor(holder.binding.carbs.currentTextColor)
holder.binding.mealOrCorrection.text =
when (ml.bolus.type) {
Bolus.Type.SMB -> "SMB"
@ -268,6 +270,10 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
}
holder.binding.calculation.tag = ml
var notes = ml.carbs?.notes ?: ml.bolus?.notes ?: ""
holder.binding.notes.text = notes
holder.binding.notes.visibility = if (notes != "") View.VISIBLE else View.GONE
}
override fun getItemCount() = mealLinks.size
@ -291,10 +297,14 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_carbs_bolus, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_insulin, false) || !sp.getBoolean(R.string.key_ns_receive_carbs, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
val hasItems = (binding.recyclerview.adapter?.itemCount ?: 0) > 0
menu.findItem(R.id.nav_delete_future)?.isVisible = hasItems
}
private fun updateMenuVisibility() {
@ -302,24 +312,14 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_insulin, false) || !sp.getBoolean(R.string.key_ns_receive_carbs, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
val hasItems = (binding.recyclerview.adapter?.itemCount ?: 0) > 0
menu.findItem(R.id.nav_delete_future)?.isVisible = hasItems
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -327,7 +327,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.hide_invalidated_records))
ToastUtils.infoToast(context, R.string.hide_invalidated_records)
swapAdapter()
true
}
@ -369,7 +369,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
}
}
fun deleteFutureTreatments() {
private fun deleteFutureTreatments() {
activity?.let { activity ->
OKDialog.showConfirmation(activity, rh.gs(R.string.overview_treatment_label), rh.gs(R.string.deletefuturetreatments) + "?", Runnable {
uel.log(Action.DELETE_FUTURE_TREATMENTS, Sources.Treatments)

View file

@ -4,6 +4,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -20,13 +22,13 @@ import info.nightscout.androidaps.databinding.TreatmentsCareportalFragmentBindin
import info.nightscout.androidaps.databinding.TreatmentsCareportalItemBinding
import info.nightscout.androidaps.events.EventTherapyEventChange
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientRestart
import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
@ -38,7 +40,7 @@ import io.reactivex.rxjava3.kotlin.subscribeBy
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class TreatmentsCareportalFragment : DaggerFragment() {
class TreatmentsCareportalFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBus
@ -70,11 +72,11 @@ class TreatmentsCareportalFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun refreshFromNightscout() {
@ -184,18 +186,12 @@ class TreatmentsCareportalFragment : DaggerFragment() {
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_careportal, menu)
super.onCreateOptionsMenu(menu, inflater)
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
return super.onPrepareOptionsMenu(menu)
}
private fun updateMenuVisibility() {
@ -203,14 +199,14 @@ class TreatmentsCareportalFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -218,7 +214,7 @@ class TreatmentsCareportalFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.hide_invalidated_records))
ToastUtils.infoToast(context, R.string.hide_invalidated_records)
swapAdapter()
true
}
@ -265,5 +261,4 @@ class TreatmentsCareportalFragment : DaggerFragment() {
})
}
}
}

View file

@ -5,6 +5,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -42,7 +44,7 @@ import io.reactivex.rxjava3.kotlin.plusAssign
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class TreatmentsExtendedBolusesFragment : DaggerFragment() {
class TreatmentsExtendedBolusesFragment : DaggerFragment(), MenuProvider {
private val disposable = CompositeDisposable()
@ -76,11 +78,11 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
fun swapAdapter() {
@ -174,10 +176,10 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_extended_bolus, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
}
private fun updateMenuVisibility() {
@ -185,19 +187,14 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
override fun onMenuItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -205,7 +202,7 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.hide_invalidated_records))
ToastUtils.infoToast(context, R.string.hide_invalidated_records)
swapAdapter()
true
}
@ -243,5 +240,4 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment() {
})
}
}
}

View file

@ -6,6 +6,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -48,7 +50,7 @@ import io.reactivex.rxjava3.kotlin.plusAssign
import io.reactivex.rxjava3.kotlin.subscribeBy
import javax.inject.Inject
class TreatmentsProfileSwitchFragment : DaggerFragment() {
class TreatmentsProfileSwitchFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var sp: SP
@ -81,11 +83,11 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun refreshFromNightscout() {
@ -272,10 +274,12 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_profile_switch, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
}
private fun updateMenuVisibility() {
@ -283,22 +287,14 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -306,7 +302,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.hide_invalidated_records))
ToastUtils.infoToast(context, R.string.hide_invalidated_records)
swapAdapter()
true
}

View file

@ -5,6 +5,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -27,6 +29,7 @@ import info.nightscout.androidaps.extensions.friendlyDescription
import info.nightscout.androidaps.extensions.highValueToUnitsToString
import info.nightscout.androidaps.extensions.lowValueToUnitsToString
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
@ -35,7 +38,6 @@ import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientR
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData
import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
@ -47,7 +49,7 @@ import io.reactivex.rxjava3.kotlin.subscribeBy
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class TreatmentsTempTargetFragment : DaggerFragment() {
class TreatmentsTempTargetFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var sp: SP
@Inject lateinit var rxBus: RxBus
@ -81,10 +83,10 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun refreshFromNightscout() {
@ -203,10 +205,12 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_temp_target, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_temp_target, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
}
private fun updateMenuVisibility() {
@ -214,22 +218,14 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
val nsUploadOnly = !sp.getBoolean(R.string.key_ns_receive_temp_target, false) || !buildHelper.isEngineeringMode()
menu.findItem(R.id.nav_refresh_ns)?.isVisible = !nsUploadOnly
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -237,7 +233,7 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}

View file

@ -5,6 +5,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -48,7 +50,7 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject
import kotlin.math.abs
class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
class TreatmentsTemporaryBasalsFragment : DaggerFragment(), MenuProvider {
private val disposable = CompositeDisposable()
@ -81,11 +83,11 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun tempBasalsWithInvalid(now: Long) = repository
@ -216,10 +218,10 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_temp_basal, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
}
private fun updateMenuVisibility() {
@ -227,20 +229,14 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_invalidated)?.isVisible = !showInvalidated
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_remove_items -> actionHelper.startRemove()
R.id.nav_show_invalidated -> {
showInvalidated = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_invalidated_records))
ToastUtils.infoToast(context, R.string.show_invalidated_records)
swapAdapter()
true
}
@ -248,7 +244,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
R.id.nav_hide_invalidated -> {
showInvalidated = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.hide_invalidated_records))
ToastUtils.infoToast(context, R.string.hide_invalidated_records)
swapAdapter()
true
}

View file

@ -2,6 +2,8 @@ package info.nightscout.androidaps.activities.fragments
import android.os.Bundle
import android.view.*
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -16,6 +18,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.ImportExportPrefs
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DateUtil
@ -24,14 +27,13 @@ import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.Translator
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
class TreatmentsUserEntryFragment : DaggerFragment() {
class TreatmentsUserEntryFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var repository: AppRepository
@Inject lateinit var aapsSchedulers: AapsSchedulers
@ -60,11 +62,11 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.emptyView = binding.noRecordsText
binding.recyclerview.loadingView = binding.progressBar
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
private fun exportUserEntries() {
@ -144,10 +146,10 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
override fun getItemCount() = entries.size
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
this.menu = menu
inflater.inflate(R.menu.menu_treatments_user_entry, menu)
super.onCreateOptionsMenu(menu, inflater)
updateMenuVisibility()
}
private fun updateMenuVisibility() {
@ -155,17 +157,12 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
menu?.findItem(R.id.nav_show_loop)?.isVisible = !showLoop
}
override fun onPrepareOptionsMenu(menu: Menu) {
updateMenuVisibility()
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.nav_show_loop -> {
showLoop = true
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_loop_records))
ToastUtils.infoToast(context, R.string.show_loop_records)
swapAdapter()
true
}
@ -173,7 +170,7 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
R.id.nav_hide_loop -> {
showLoop = false
updateMenuVisibility()
ToastUtils.showToastInUiThread(context, rh.gs(R.string.show_hide_records))
ToastUtils.infoToast(context, R.string.show_hide_records)
swapAdapter()
true
}
@ -185,5 +182,4 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
else -> false
}
}

View file

@ -31,31 +31,31 @@ class CompatDBHelper @Inject constructor(
*
*/
var newestGlucoseValue: GlucoseValue? = null
it.filterIsInstance<GlucoseValue>().lastOrNull()?.let { gv ->
it.filterIsInstance<GlucoseValue>().maxByOrNull { gv -> gv.timestamp }?.let { gv ->
aapsLogger.debug(LTag.DATABASE, "Firing EventNewBg $gv")
rxBus.send(EventNewBG(gv))
newestGlucoseValue = gv
}
it.filterIsInstance<GlucoseValue>().map { gv -> gv.timestamp }.minOrNull()?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventNewHistoryData $newestGlucoseValue")
it.filterIsInstance<GlucoseValue>().minOfOrNull { gv -> gv.timestamp }?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventNewHistoryData $timestamp $newestGlucoseValue")
rxBus.send(EventNewHistoryData(timestamp, true, newestGlucoseValue))
}
it.filterIsInstance<Carbs>().map { t -> t.timestamp }.minOrNull()?.let { timestamp ->
it.filterIsInstance<Carbs>().minOfOrNull { t -> t.timestamp }?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventTreatmentChange $timestamp")
rxBus.send(EventTreatmentChange())
rxBus.send(EventNewHistoryData(timestamp, false))
}
it.filterIsInstance<Bolus>().map { t -> t.timestamp }.minOrNull()?.let { timestamp ->
it.filterIsInstance<Bolus>().minOfOrNull { t -> t.timestamp }?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventTreatmentChange $timestamp")
rxBus.send(EventTreatmentChange())
rxBus.send(EventNewHistoryData(timestamp, false))
}
it.filterIsInstance<TemporaryBasal>().map { t -> t.timestamp }.minOrNull()?.let { timestamp ->
it.filterIsInstance<TemporaryBasal>().minOfOrNull { t -> t.timestamp }?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventTempBasalChange $timestamp")
rxBus.send(EventTempBasalChange())
rxBus.send(EventNewHistoryData(timestamp, false))
}
it.filterIsInstance<ExtendedBolus>().map { t -> t.timestamp }.minOrNull()?.let { timestamp ->
it.filterIsInstance<ExtendedBolus>().minOfOrNull { t -> t.timestamp }?.let { timestamp ->
aapsLogger.debug(LTag.DATABASE, "Firing EventExtendedBolusChange $timestamp")
rxBus.send(EventExtendedBolusChange())
rxBus.send(EventNewHistoryData(timestamp, false))

View file

@ -370,6 +370,12 @@ abstract class PluginsModule {
@IntKey(470)
abstract fun bindGlunovoPlugin(plugin: GlunovoPlugin): PluginBase
@Binds
@AllConfigs
@IntoMap
@IntKey(473)
abstract fun bindIntelligoPlugin(plugin: IntelligoPlugin): PluginBase
@Binds
@AllConfigs
@IntoMap
@ -412,4 +418,4 @@ abstract class PluginsModule {
@Qualifier
annotation class APS
}
}

View file

@ -78,15 +78,15 @@ class CarbsDialog : DialogFragmentWithDate() {
val time = binding.time.value.toInt()
if (time > 12 * 60 || time < -7 * 24 * 60) {
binding.time.value = 0.0
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.constraintapllied))
ToastUtils.warnToast(ctx, R.string.constraintapllied)
}
if (binding.duration.value > 10) {
binding.duration.value = 0.0
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.constraintapllied))
ToastUtils.warnToast(ctx, R.string.constraintapllied)
}
if (binding.carbs.value.toInt() > maxCarbs) {
binding.carbs.value = 0.0
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.carbsconstraintapplied))
ToastUtils.warnToast(ctx, R.string.carbsconstraintapplied)
}
}
@ -392,7 +392,7 @@ class CarbsDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -120,7 +120,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -208,7 +208,7 @@ class FillDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -83,11 +83,11 @@ class InsulinDialog : DialogFragmentWithDate() {
val maxInsulin = constraintChecker.getMaxBolusAllowed().value()
if (abs(binding.time.value.toInt()) > 12 * 60) {
binding.time.value = 0.0
ToastUtils.showToastInUiThread(context, rh.gs(R.string.constraintapllied))
ToastUtils.warnToast(context, R.string.constraintapllied)
}
if (binding.amount.value > maxInsulin) {
binding.amount.value = 0.0
ToastUtils.showToastInUiThread(context, rh.gs(R.string.bolusconstraintapplied))
ToastUtils.warnToast(context, R.string.bolusconstraintapplied)
}
}
@ -267,7 +267,7 @@ class InsulinDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -153,7 +153,7 @@ class LoopDialog : DaggerDialogFragment() {
aapsLogger.debug("UpdateGUI from $from")
val pumpDescription: PumpDescription = activePlugin.activePump.pumpDescription
val closedLoopAllowed = constraintChecker.isClosedLoopAllowed(Constraint(true))
val closedLoopAllowed2 = objectivePlugin.objectives[ObjectivesPlugin.MAXIOB_OBJECTIVE].isCompleted
val closedLoopAllowed2 = objectivePlugin.objectives[ObjectivesPlugin.MAXIOB_OBJECTIVE].isAccomplished
val lgsEnabled = constraintChecker.isLgsAllowed(Constraint(true))
val apsMode = sp.getString(R.string.key_aps_mode, "open")
val pump = activePlugin.activePump
@ -304,7 +304,7 @@ class LoopDialog : DaggerDialogFragment() {
commandQueue.cancelTempBasal(true, object : Callback() {
override fun run() {
if (!result.success) {
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.tempbasaldeliveryerror))
ToastUtils.errorToast(ctx, rh.gs(R.string.tempbasaldeliveryerror))
}
}
})
@ -449,7 +449,7 @@ class LoopDialog : DaggerDialogFragment() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -258,7 +258,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -153,7 +153,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -230,7 +230,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -72,11 +72,11 @@ class TreatmentDialog : DialogFragmentWithDate() {
val maxInsulin = constraintChecker.getMaxBolusAllowed().value()
if (SafeParse.stringToInt(binding.carbs.text) > maxCarbs) {
binding.carbs.value = 0.0
ToastUtils.showToastInUiThread(context, rh.gs(R.string.carbsconstraintapplied))
ToastUtils.warnToast(context, R.string.carbsconstraintapplied)
}
if (SafeParse.stringToDouble(binding.insulin.text) > maxInsulin) {
binding.insulin.value = 0.0
ToastUtils.showToastInUiThread(context, rh.gs(R.string.bolusconstraintapplied))
ToastUtils.warnToast(context, R.string.bolusconstraintapplied)
}
}
@ -212,7 +212,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -335,7 +335,7 @@ class WizardDialog : DaggerDialogFragment() {
val tempTarget = repository.getTemporaryTargetActiveAt(dateUtil.now()).blockingGet()
if (profile == null || profileStore == null) {
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.noprofile))
ToastUtils.errorToast(ctx, R.string.noprofile)
dismiss()
return
}
@ -409,7 +409,7 @@ class WizardDialog : DaggerDialogFragment() {
val carbsAfterConstraint = constraintChecker.applyCarbsConstraints(Constraint(carbs)).value()
if (abs(carbs - carbsAfterConstraint) > 0.01) {
binding.carbsInput.value = 0.0
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.carbsconstraintapplied))
ToastUtils.warnToast(ctx, R.string.carbsconstraintapplied)
return
}
@ -511,7 +511,7 @@ class WizardDialog : DaggerDialogFragment() {
val cancelFail = {
queryingProtection = false
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_canceled)
ToastUtils.warnToast(ctx, R.string.dialog_canceled)
dismiss()
}
protectionCheck.queryProtection(activity, BOLUS, { queryingProtection = false }, cancelFail, cancelFail)

View file

@ -2,18 +2,20 @@ package info.nightscout.androidaps.plugins.aps.loop
import android.os.Bundle
import android.view.*
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.LoopFragmentBinding
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.Loop
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.sharedPreferences.SP
@ -21,7 +23,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
class LoopFragment : DaggerFragment() {
class LoopFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var aapsSchedulers: AapsSchedulers
@ -32,7 +34,7 @@ class LoopFragment : DaggerFragment() {
@Inject lateinit var loop: Loop
@Inject lateinit var dateUtil: DateUtil
private val ID_MENU_RUN = 1
private val ID_MENU_RUN = 501
private var disposable: CompositeDisposable = CompositeDisposable()
@ -45,7 +47,7 @@ class LoopFragment : DaggerFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
LoopFragmentBinding.inflate(inflater, container, false).also {
_binding = it
setHasOptionsMenu(true)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -54,22 +56,18 @@ class LoopFragment : DaggerFragment() {
with(binding.swipeRefresh) {
setColorSchemeColors(rh.gac(context, R.attr.colorPrimaryDark), rh.gac(context, R.attr.colorPrimary), rh.gac(context, R.attr.colorSecondary))
setOnRefreshListener {
binding.lastrun.text = rh.gs(info.nightscout.androidaps.R.string.executing)
binding.lastrun.text = rh.gs(R.string.executing)
Thread { loop.invoke("Loop swiperefresh", true) }.start()
}
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
if (isResumed) {
menu.removeItem(ID_MENU_RUN)
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
ID_MENU_RUN -> {
binding.lastrun.text = rh.gs(R.string.executing)
@ -132,13 +130,14 @@ class LoopFragment : DaggerFragment() {
binding.smbsetbypump.text = it.smbSetByPump?.let { smbSetByPump -> HtmlHelper.fromHtml(smbSetByPump.toHtml()) }
?: ""
val constraints =
var constraints =
it.constraintsProcessed?.let { constraintsProcessed ->
val allConstraints = Constraint(0.0)
constraintsProcessed.rateConstraint?.let { rateConstraint -> allConstraints.copyReasons(rateConstraint) }
constraintsProcessed.smbConstraint?.let { smbConstraint -> allConstraints.copyReasons(smbConstraint) }
allConstraints.getMostLimitedReasons(aapsLogger)
} ?: ""
constraints += loop.closedLoopEnabled?.getReasons(aapsLogger) ?: ""
binding.constraints.text = constraints
binding.swipeRefresh.isRefreshing = false
}

View file

@ -105,6 +105,7 @@ class LoopPlugin @Inject constructor(
private var carbsSuggestionsSuspendedUntil: Long = 0
private var prevCarbsreq = 0
override var lastRun: LastRun? = null
override var closedLoopEnabled: Constraint<Boolean>? = null
override fun onStart() {
createNotificationChannel()
@ -294,8 +295,8 @@ class LoopPlugin @Inject constructor(
rxBus.send(EventLoopSetLastRunGui(rh.gs(R.string.pumpsuspended)))
return
}
val closedLoopEnabled = constraintChecker.isClosedLoopAllowed()
if (closedLoopEnabled.value()) {
closedLoopEnabled = constraintChecker.isClosedLoopAllowed()
if (closedLoopEnabled?.value() == true) {
if (allowNotification) {
if (resultAfterConstraints.isCarbsRequired
&& resultAfterConstraints.carbsReq >= sp.getInt(

View file

@ -3,16 +3,18 @@ package info.nightscout.androidaps.plugins.aps.openAPSAMA
import android.os.Bundle
import android.text.TextUtils
import android.view.*
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.OpenapsamaFragmentBinding
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.JSONFormatter
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
@ -22,7 +24,7 @@ import org.json.JSONArray
import org.json.JSONException
import javax.inject.Inject
class OpenAPSAMAFragment : DaggerFragment() {
class OpenAPSAMAFragment : DaggerFragment(), MenuProvider {
private var disposable: CompositeDisposable = CompositeDisposable()
@ -35,7 +37,8 @@ class OpenAPSAMAFragment : DaggerFragment() {
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var jsonFormatter: JSONFormatter
private val ID_MENU_RUN = 1
@Suppress("PrivatePropertyName")
private val ID_MENU_RUN = 502
private var _binding: OpenapsamaFragmentBinding? = null
@ -46,7 +49,7 @@ class OpenAPSAMAFragment : DaggerFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
OpenapsamaFragmentBinding.inflate(inflater, container, false).also {
_binding = it
setHasOptionsMenu(true)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -55,23 +58,19 @@ class OpenAPSAMAFragment : DaggerFragment() {
with(binding.swipeRefresh) {
setColorSchemeColors(rh.gac(context, R.attr.colorPrimaryDark), rh.gac(context, R.attr.colorPrimary), rh.gac(context, R.attr.colorSecondary))
setOnRefreshListener {
binding.lastrun.text = rh.gs(info.nightscout.androidaps.R.string.executing)
Thread { openAPSAMAPlugin.invoke("OpenAPSAMA swiperefresh", false) }.start()
binding.lastrun.text = rh.gs(R.string.executing)
Thread { openAPSAMAPlugin.invoke("OpenAPSAMA swipe refresh", false) }.start()
}
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
if (isResumed) {
menu.removeItem(ID_MENU_RUN)
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
ID_MENU_RUN -> {
binding.lastrun.text = rh.gs(R.string.executing)

View file

@ -4,17 +4,19 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.text.TextUtils
import android.view.*
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.OpenapsamaFragmentBinding
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.JSONFormatter
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
@ -24,7 +26,7 @@ import org.json.JSONArray
import org.json.JSONException
import javax.inject.Inject
class OpenAPSSMBFragment : DaggerFragment() {
class OpenAPSSMBFragment : DaggerFragment(), MenuProvider {
private var disposable: CompositeDisposable = CompositeDisposable()
@ -36,9 +38,9 @@ class OpenAPSSMBFragment : DaggerFragment() {
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var jsonFormatter: JSONFormatter
private lateinit var refreshDialog: Runnable
private val ID_MENU_RUN = 1
@Suppress("PrivatePropertyName")
private val ID_MENU_RUN = 503
private var _binding: OpenapsamaFragmentBinding? = null
@ -49,7 +51,7 @@ class OpenAPSSMBFragment : DaggerFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
OpenapsamaFragmentBinding.inflate(inflater, container, false).also {
_binding = it
setHasOptionsMenu(true)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -58,22 +60,18 @@ class OpenAPSSMBFragment : DaggerFragment() {
with(binding.swipeRefresh) {
setColorSchemeColors(rh.gac(context, R.attr.colorPrimaryDark), rh.gac(context, R.attr.colorPrimary), rh.gac(context, R.attr.colorSecondary))
setOnRefreshListener {
binding.lastrun.text = rh.gs(info.nightscout.androidaps.R.string.executing)
Thread { activePlugin.activeAPS.invoke("OpenAPSSMB swiperefresh", false) }.start()
binding.lastrun.text = rh.gs(R.string.executing)
Thread { activePlugin.activeAPS.invoke("OpenAPSSMB swipe refresh", false) }.start()
}
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
if (isResumed) {
menu.removeItem(ID_MENU_RUN)
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.openapsma_run)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
ID_MENU_RUN -> {
binding.lastrun.text = rh.gs(R.string.executing)

View file

@ -22,6 +22,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.Round
import info.nightscout.androidaps.utils.stats.TddCalculator
import info.nightscout.shared.SafeParse
import info.nightscout.shared.logging.AAPSLogger
@ -36,6 +37,7 @@ import java.io.IOException
import java.lang.reflect.InvocationTargetException
import java.nio.charset.StandardCharsets
import javax.inject.Inject
import kotlin.math.ln
class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scriptReader: ScriptReader, private val injector: HasAndroidInjector) : DetermineBasalAdapterInterface {
@ -194,10 +196,6 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.profile.put("current_basal_safety_multiplier", sp.getDouble(R.string.key_openapsama_current_basal_safety_multiplier, 4.0))
this.profile.put("lgsThreshold", Profile.toMgdl(sp.getDouble(R.string.key_lgs_threshold, 65.0)))
val insulin = activePlugin.activeInsulin
val insulinType = insulin.friendlyName
val insulinPeak = insulin.peak
//mProfile.put("high_temptarget_raises_sensitivity", SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity));
this.profile.put("high_temptarget_raises_sensitivity", sp.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity))
//mProfile.put("low_temptarget_lowers_sensitivity", SP.getBoolean(R.string.key_low_temptarget_lowers_sensitivity, SMBDefaults.low_temptarget_lowers_sensitivity));
@ -227,9 +225,6 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.profile.put("enableSMB_after_carbs", smbEnabled && sp.getBoolean(R.string.key_enableSMB_after_carbs, false) && advancedFiltering)
this.profile.put("maxSMBBasalMinutes", sp.getInt(R.string.key_smbmaxminutes, SMBDefaults.maxSMBBasalMinutes))
this.profile.put("maxUAMSMBBasalMinutes", sp.getInt(R.string.key_uamsmbmaxminutes, SMBDefaults.maxUAMSMBBasalMinutes))
this.profile.put("DynISFAdjust", SafeParse.stringToDouble(sp.getString(R.string.key_DynISFAdjust, "100")))
this.profile.put("insulinType", insulinType)
this.profile.put("insulinPeak", insulinPeak)
this.profile.put("maxUAMSMBBasalMinutes", sp.getInt(R.string.key_uamsmbmaxminutes, SMBDefaults.maxUAMSMBBasalMinutes))
//set the min SMB amount to be the amount set by the pump.
this.profile.put("bolus_increment", pumpBolusStep)
@ -237,8 +232,7 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.profile.put("current_basal", basalRate)
this.profile.put("temptargetSet", tempTargetSet)
this.profile.put("autosens_max", SafeParse.stringToDouble(sp.getString(R.string.key_openapsama_autosens_max, "1.2")))
this.profile.put("autosens_min", SafeParse.stringToDouble(sp.getString(R.string.key_openapsama_autosens_min, "0.8")))
this.profile.put("openapsama_useautosens", sp.getBoolean(R.string.key_openapsama_useautosens, false))
this.profile.put("autosens_min", SafeParse.stringToDouble(sp.getString(R.string.key_openapsama_autosens_min, "0.7")))
//set the min SMB amount to be the amount set by the pump.
if (profileFunction.getUnits() == GlucoseUnit.MMOL) {
this.profile.put("out_units", "mmol/L")
@ -270,19 +264,53 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.mealData.put("lastBolusTime", mealData.lastBolusTime)
this.mealData.put("lastCarbTime", mealData.lastCarbTime)
this.mealData.put("TDDAIMI1", tddCalculator.averageTDD(tddCalculator.calculate(1))?.totalAmount)
this.mealData.put("TDDAIMI7", tddCalculator.averageTDD(tddCalculator.calculate(7))?.totalAmount)
this.mealData.put("TDDLast4", tddCalculator.calculateDaily(-4, 0).totalAmount)
this.mealData.put("TDD4to8", tddCalculator.calculateDaily(-8, -4).totalAmount)
this.mealData.put("TDD24", tddCalculator.calculateDaily(-24, 0).totalAmount)
val tdd1D = tddCalculator.averageTDD(tddCalculator.calculate(1))?.totalAmount
val tdd7D = tddCalculator.averageTDD(tddCalculator.calculate(7))?.totalAmount
val tddLast24H = tddCalculator.calculateDaily(-24, 0).totalAmount
val tddLast4H = tddCalculator.calculateDaily(-4, 0).totalAmount
val tddLast8to4H = tddCalculator.calculateDaily(-8, -4).totalAmount
val tddWeightedFromLast8H = ((1.4 * tddLast4H) + (0.6 * tddLast8to4H)) * 3
// console.error("Rolling 8 hours weight average: " + tdd_last8_wt + "; ");
// console.error("1-day average TDD is: " + tdd1 + "; ");
// console.error("7-day average TDD is: " + tdd7 + "; ");
var tdd =
if (tdd1D != null && tdd7D != null) (tddWeightedFromLast8H * 0.33) + (tdd7D * 0.34) + (tdd1D * 0.33)
else tddWeightedFromLast8H
// console.log("TDD = " + TDD + " using average of 7-day, 1-day and weighted 8hr average");
if (constraintChecker.isAutosensModeEnabled().value()) {
autosensData.put("ratio", autosensDataRatio)
} else {
autosensData.put("ratio", 1.0)
// console.log("Insulin Peak = " + insulin.peak + "; ");
val insulin = activePlugin.activeInsulin
val insulinDivisor = when {
insulin.peak > 65 -> 55 // lyumjev peak: 45
insulin.peak > 50 -> 65 // ultra rapid peak: 55
else -> 75 // rapid peak: 75
}
// console.log("For " + insulin.friendlyName + " (insulin peak: " + insulin.peak + ") insulin divisor is: " + ins_val + "; ");
val dynISFadjust = SafeParse.stringToDouble(sp.getString(R.string.key_DynISFAdjust, "100")) / 100.0
tdd *= dynISFadjust
var variableSensitivity = 1800 / (tdd * (ln((glucoseStatus.glucose / insulinDivisor) + 1)))
variableSensitivity = Round.roundTo(variableSensitivity, 0.1)
if (dynISFadjust != 1.0) {
// console.log("TDD adjusted to " + TDD + " using adjustment factor of " + dynISFadjust + "; ");
}
// console.log("Current sensitivity for predictions is " + variable_sens + " based on current bg");
this.profile.put("variable_sens", variableSensitivity)
this.profile.put("insulinDivisor", insulinDivisor)
this.profile.put("TDD", tdd)
if (sp.getBoolean(R.string.key_adjust_sensitivity, false) && tdd7D != null)
autosensData.put("ratio", tddLast24H / tdd7D)
else
autosensData.put("ratio", 1.0)
this.microBolusAllowed = microBolusAllowed
smbAlwaysAllowed = advancedFiltering
currentTime = now

View file

@ -109,7 +109,7 @@ class ObjectivesExamDialog : DaggerDialogFragment() {
task.answered = result
if (!result) {
task.disabledTo = dateUtil.now() + T.hours(1).msecs()
context?.let { it1 -> ToastUtils.showToastInUiThread(it1, R.string.wronganswer) }
context?.let { it1 -> ToastUtils.infoToast(it1, R.string.wronganswer) }
} else task.disabledTo = 0
updateGui()
rxBus.send(EventObjectivesUpdateGui())

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.general.autotune
import android.content.Context
import android.graphics.Paint
import android.graphics.Typeface
import android.os.Bundle
@ -282,6 +283,7 @@ class AutotuneFragment : DaggerFragment() {
binding.tuneLastrun.setOnClickListener {
if (!autotunePlugin.calculationRunning) {
autotunePlugin.loadLastRun()
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
updateGui()
}
}
@ -444,11 +446,12 @@ class AutotuneFragment : DaggerFragment() {
setTextAppearance(android.R.style.TextAppearance_Material_Medium)
})
autotunePlugin.tunedProfile?.let { tuned ->
layout.addView(toTableRowHeader())
layout.addView(toTableRowHeader(context))
val tuneInsulin = sp.getBoolean(R.string.key_autotune_tune_insulin_curve, false)
if (tuneInsulin) {
layout.addView(
toTableRowValue(
context,
rh.gs(R.string.insulin_peak),
autotunePlugin.pumpProfile.localInsulin.peak.toDouble(),
tuned.localInsulin.peak.toDouble(),
@ -457,6 +460,7 @@ class AutotuneFragment : DaggerFragment() {
)
layout.addView(
toTableRowValue(
context,
rh.gs(R.string.dia),
Round.roundTo(autotunePlugin.pumpProfile.localInsulin.dia, 0.1),
Round.roundTo(tuned.localInsulin.dia, 0.1),
@ -466,13 +470,14 @@ class AutotuneFragment : DaggerFragment() {
}
layout.addView(
toTableRowValue(
context,
rh.gs(R.string.isf_short),
Round.roundTo(autotunePlugin.pumpProfile.isf / toMgDl, 0.001),
Round.roundTo(tuned.isf / toMgDl, 0.001),
isfFormat
)
)
layout.addView(toTableRowValue(rh.gs(R.string.ic_short), Round.roundTo(autotunePlugin.pumpProfile.ic, 0.001), Round.roundTo(tuned.ic, 0.001), "%.2f"))
layout.addView(toTableRowValue(context, rh.gs(R.string.ic_short), Round.roundTo(autotunePlugin.pumpProfile.ic, 0.001), Round.roundTo(tuned.ic, 0.001), "%.2f"))
layout.addView(
TextView(context).apply {
text = rh.gs(R.string.basal)
@ -481,7 +486,7 @@ class AutotuneFragment : DaggerFragment() {
setTextAppearance(android.R.style.TextAppearance_Material_Medium)
}
)
layout.addView(toTableRowHeader(true))
layout.addView(toTableRowHeader(context,true))
var totalPump = 0.0
var totalTuned = 0.0
for (h in 0 until tuned.basal.size) {
@ -489,9 +494,9 @@ class AutotuneFragment : DaggerFragment() {
val time = df.format(h.toLong()) + ":00"
totalPump += autotunePlugin.pumpProfile.basal[h]
totalTuned += tuned.basal[h]
layout.addView(toTableRowValue(time, autotunePlugin.pumpProfile.basal[h], tuned.basal[h], "%.3f", tuned.basalUntuned[h].toString()))
layout.addView(toTableRowValue(context, time, autotunePlugin.pumpProfile.basal[h], tuned.basal[h], "%.3f", tuned.basalUntuned[h].toString()))
}
layout.addView(toTableRowValue("", totalPump, totalTuned, "%.3f", " "))
layout.addView(toTableRowValue(context, "", totalPump, totalTuned, "%.3f", " "))
}
}
)
@ -502,7 +507,7 @@ class AutotuneFragment : DaggerFragment() {
}
}
private fun toTableRowHeader(basal: Boolean = false): TableRow =
private fun toTableRowHeader(context: Context, basal: Boolean = false): TableRow =
TableRow(context).also { header ->
val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT).apply { weight = 1f }
header.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT).apply { gravity = Gravity.CENTER_HORIZONTAL }
@ -533,7 +538,7 @@ class AutotuneFragment : DaggerFragment() {
})
}
private fun toTableRowValue(hour: String, inputValue: Double, tunedValue: Double, format: String = "%.3f", missing: String = ""): TableRow =
private fun toTableRowValue(context: Context, hour: String, inputValue: Double, tunedValue: Double, format: String = "%.3f", missing: String = ""): TableRow =
TableRow(context).also { row ->
val percentValue = Round.roundTo(tunedValue / inputValue * 100 - 100, 1.0).toInt().toString() + "%"
val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT).apply { weight = 1f }

View file

@ -35,10 +35,8 @@ open class AutotuneIob @Inject constructor(
private val profileFunction: ProfileFunction,
private val sp: SP,
private val dateUtil: DateUtil,
private val activePlugin: ActivePlugin,
private val autotuneFS: AutotuneFS
) {
private var nsTreatments = ArrayList<NsTreatment>()
private var dia: Double = Constants.defaultDIA
var boluses: ArrayList<Bolus> = ArrayList()
@ -54,7 +52,11 @@ open class AutotuneIob @Inject constructor(
startBG = from
endBG = to
nsTreatments.clear()
meals.clear()
boluses.clear()
tempBasals = ArrayList<TemporaryBasal>()
if (profileFunction.getProfile(from - range()) == null)
return
initializeBgreadings(from, to)
initializeTreatmentData(from - range(), to)
initializeTempBasalData(from - range(), to, tunedProfile)
@ -91,8 +93,6 @@ open class AutotuneIob @Inject constructor(
aapsLogger.debug(LTag.AUTOTUNE, "Check BG date: BG Size: " + glucose.size + " OldestBG: " + dateUtil.dateAndTimeAndSecondsString(oldestBgDate) + " to: " + dateUtil.dateAndTimeAndSecondsString(to))
val tmpCarbs = repository.getCarbsDataFromTimeToTimeExpanded(from, to, false).blockingGet()
aapsLogger.debug(LTag.AUTOTUNE, "Nb treatments after query: " + tmpCarbs.size)
meals.clear()
boluses.clear()
var nbCarbs = 0
for (i in tmpCarbs.indices) {
val tp = tmpCarbs[i]
@ -138,23 +138,17 @@ open class AutotuneIob @Inject constructor(
//nsTreatment is used only for export data
private fun initializeExtendedBolusData(from: Long, to: Long, tunedProfile: ATProfile) {
val extendedBoluses = repository.getExtendedBolusDataFromTimeToTime(from, to, false).blockingGet()
val pumpInterface = activePlugin.activePump
if (pumpInterface.isFakingTempsByExtendedBoluses) {
for (i in extendedBoluses.indices) {
val eb = extendedBoluses[i]
if (eb.isValid)
for (i in extendedBoluses.indices) {
val eb = extendedBoluses[i]
if (eb.isValid)
if (eb.isEmulatingTempBasal) {
profileFunction.getProfile(eb.timestamp)?.let {
toSplittedTimestampTB(eb.toTemporaryBasal(it), tunedProfile)
}
}
} else {
for (i in extendedBoluses.indices) {
val eb = extendedBoluses[i]
if (eb.isValid) {
} else {
nsTreatments.add(NsTreatment(eb))
boluses.addAll(convertToBoluses(eb))
}
}
}
}
@ -381,9 +375,11 @@ open class AutotuneIob @Inject constructor(
}
}
TherapyEvent.Type.COMBO_BOLUS ->
extendedBolus?.let {
val profile = profileFunction.getProfile(it.timestamp)
it.toJson(true, profile!!, dateUtil)
extendedBolus?.let { ebr ->
val profile = profileFunction.getProfile(ebr.timestamp)
profile?.let {
ebr.toJson(true, it, dateUtil)
}
}
TherapyEvent.Type.CORRECTION_BOLUS -> bolusTreatment?.toJson(true, dateUtil)
TherapyEvent.Type.CARBS_CORRECTION -> carbsTreatment?.toJson(true, dateUtil)

View file

@ -162,6 +162,15 @@ class AutotunePlugin @Inject constructor(
log("Tune day " + (i + 1) + " of " + daysBack + " (" + currentCalcDay + " of " + calcDays + ")")
tunedProfile?.let { it ->
autotuneIob.initializeData(from, to, it) //autotuneIob contains BG and Treatments data from history (<=> query for ns-treatments and ns-entries)
if (autotuneIob.boluses.size == 0) {
result = rh.gs(R.string.autotune_error)
log("No basal data on day ${i + 1}")
autotuneFS.exportResult(result)
autotuneFS.exportLogAndZip(lastRun)
rxBus.send(EventAutotuneUpdateGui())
calculationRunning = false
return
}
autotuneFS.exportEntries(autotuneIob) //<=> ns-entries.yyyymmdd.json files exported for results compare with oref0 autotune on virtual machine
autotuneFS.exportTreatments(autotuneIob) //<=> ns-treatments.yyyymmdd.json files exported for results compare with oref0 autotune on virtual machine (include treatments ,tempBasal and extended
preppedGlucose = autotunePrep.categorize(it) //<=> autotune.yyyymmdd.json files exported for results compare with oref0 autotune on virtual machine

View file

@ -9,6 +9,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.Event
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.extensions.durationInMinutes
import info.nightscout.androidaps.extensions.safeQueryBroadcastReceivers
import info.nightscout.androidaps.extensions.toStringFull
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui
@ -17,16 +18,16 @@ import info.nightscout.androidaps.plugins.general.nsclient.data.DeviceStatusData
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
import info.nightscout.androidaps.receivers.ReceiverStatusStore
import info.nightscout.androidaps.receivers.Intents
import info.nightscout.androidaps.receivers.ReceiverStatusStore
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
import javax.inject.Singleton
@ -64,21 +65,18 @@ class DataBroadcastPlugin @Inject constructor(
private val disposable = CompositeDisposable()
override fun onStart() {
super.onStart()
disposable.add(rxBus
.toObservable(EventOpenAPSUpdateGui::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
)
disposable.add(rxBus
.toObservable(EventAutosensCalculationFinished::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
)
disposable.add(rxBus
.toObservable(EventOverviewBolusProgress::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
)
disposable += rxBus
.toObservable(EventOpenAPSUpdateGui::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventAutosensCalculationFinished::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventOverviewBolusProgress::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({ sendData(it) }, fabricPrivacy::logException)
}
override fun onStop() {
@ -186,7 +184,7 @@ class DataBroadcastPlugin @Inject constructor(
}
private fun sendBroadcast(intent: Intent) {
val receivers: List<ResolveInfo> = context.packageManager.queryBroadcastReceivers(intent, 0)
val receivers: List<ResolveInfo> = context.packageManager.safeQueryBroadcastReceivers(intent, 0)
for (resolveInfo in receivers)
resolveInfo.activityInfo.packageName?.let {
intent.setPackage(it)

View file

@ -1,8 +1,6 @@
package info.nightscout.androidaps.plugins.general.maintenance
import ch.qos.logback.classic.LoggerContext
import info.nightscout.androidaps.annotations.OpenForTesting
import org.slf4j.LoggerFactory
import javax.inject.Inject
import javax.inject.Singleton
@ -11,7 +9,9 @@ import javax.inject.Singleton
*/
@OpenForTesting
@Singleton
class LoggerUtils @Inject constructor() {
class LoggerUtils @Inject constructor(
val prefFileListProvider: PrefFileListProvider
) {
var suffix = ".log.zip"
@ -21,9 +21,15 @@ class LoggerUtils @Inject constructor() {
*
* @return
*/
/*
This is failing after slf4j update to 2.0.0
It would be better to find a way to read the value from xml
So far replaced by static value
val logDirectory: String
get() {
val lc = LoggerFactory.getILoggerFactory() as LoggerContext
return lc.getProperty("EXT_FILES_DIR")
}
*/
val logDirectory get() = prefFileListProvider.logsPath
}

View file

@ -940,6 +940,7 @@ class DataSyncSelectorImplementation @Inject constructor(
val lastChange = sp.getLong(R.string.key_local_profile_last_change, 0)
if (lastChange == 0L) return
if (lastChange > lastSync) {
if (localProfilePlugin.profile?.allProfilesValid != true) return
val profileJson = localProfilePlugin.profile?.data ?: return
nsClientPlugin.nsClientService?.dbAdd("profile", profileJson, DataSyncSelector.PairProfileStore(profileJson, dateUtil.now()), "")
}

View file

@ -88,7 +88,7 @@ class NSClientAddUpdateWorker(
.also { result ->
result.inserted.forEach {
uel.log(
Action.BOLUS, Sources.NSClient,
Action.BOLUS, Sources.NSClient, it.notes,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount)
)
@ -124,7 +124,7 @@ class NSClientAddUpdateWorker(
.also { result ->
result.inserted.forEach {
uel.log(
Action.CARBS, Sources.NSClient,
Action.CARBS, Sources.NSClient, it.notes,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
@ -140,7 +140,7 @@ class NSClientAddUpdateWorker(
}
result.updated.forEach {
uel.log(
Action.CARBS, Sources.NSClient,
Action.CARBS, Sources.NSClient, it.notes,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)

View file

@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.general.nsclient
import android.os.Bundle
import android.view.*
import android.widget.ScrollView
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.entities.UserEntry.Action
@ -22,7 +24,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
class NSClientFragment : DaggerFragment() {
class NSClientFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var nsClientPlugin: NSClientPlugin
@Inject lateinit var sp: SP
@ -35,10 +37,10 @@ class NSClientFragment : DaggerFragment() {
companion object {
const val ID_MENU_CLEAR_LOG = 6
const val ID_MENU_RESTART = 7
const val ID_MENU_SEND_NOW = 8
const val ID_MENU_FULL_SYNC = 9
const val ID_MENU_CLEAR_LOG = 507
const val ID_MENU_RESTART = 508
const val ID_MENU_SEND_NOW = 509
const val ID_MENU_FULL_SYNC = 510
}
private val disposable = CompositeDisposable()
@ -52,7 +54,7 @@ class NSClientFragment : DaggerFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
NsClientFragmentBinding.inflate(inflater, container, false).also {
_binding = it
setHasOptionsMenu(true)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -73,18 +75,15 @@ class NSClientFragment : DaggerFragment() {
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
if (isResumed) {
menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clearlog)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_RESTART, 0, rh.gs(R.string.restart)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_SEND_NOW, 0, rh.gs(R.string.deliver_now)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_FULL_SYNC, 0, rh.gs(R.string.full_sync)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clearlog)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_RESTART, 0, rh.gs(R.string.restart)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_SEND_NOW, 0, rh.gs(R.string.deliver_now)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_FULL_SYNC, 0, rh.gs(R.string.full_sync)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
ID_MENU_CLEAR_LOG -> {
nsClientPlugin.clearLog()

View file

@ -54,6 +54,8 @@ import javax.inject.Singleton
"predBGs": {
"IOB": [116, 114, 112, 110, 109, 107, 106, 105, 105, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 107]
},
"sensitivityRatio": 0.81,
"variable_sens": 137.3,
"COB": 0,
"IOB": -0.035,
"reason": "COB: 0, Dev: -18, BGI: 0.43, ISF: 216, Target: 99; Eventual BG 105 > 99 but Min. Delta -2.60 < Exp. Delta 0.1; setting current basal of 0.4 as temp. Suggested rate is same as profile rate, no temp basal is active, doing nothing",

View file

@ -67,6 +67,7 @@ import info.nightscout.androidaps.skins.SkinProvider
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.JsonHelper
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.TrendCalculator
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
@ -120,7 +121,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
@Inject lateinit var repository: AppRepository
@Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider
@Inject lateinit var overviewData: OverviewData
@Inject lateinit var overviewPlugin: OverviewPlugin
@Inject lateinit var automationPlugin: AutomationPlugin
@Inject lateinit var bgQualityCheckPlugin: BgQualityCheckPlugin
@ -380,7 +380,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
dexcomMediator.findDexcomPackageName()?.let {
openCgmApp(it)
}
?: ToastUtils.showToastInUiThread(activity, rh.gs(R.string.dexcom_app_not_installed))
?: ToastUtils.infoToast(activity, rh.gs(R.string.dexcom_app_not_installed))
}
}
@ -396,9 +396,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
)
}
?: ToastUtils.showToastInUiThread(activity, rh.gs(R.string.dexcom_app_not_installed))
?: ToastUtils.infoToast(activity, rh.gs(R.string.dexcom_app_not_installed))
} catch (e: ActivityNotFoundException) {
ToastUtils.showToastInUiThread(activity, rh.gs(R.string.g5appnotdetected))
ToastUtils.infoToast(activity, rh.gs(R.string.g5appnotdetected))
}
}
}
@ -417,7 +417,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
uel.log(Action.ACCEPTS_TEMP_BASAL, Sources.Overview)
(context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager?)?.cancel(Constants.notificationID)
rxBus.send(EventMobileToWear(EventData.CancelNotification(dateUtil.now())))
Thread { loop.acceptChangeRequest() }.run()
Thread { loop.acceptChangeRequest() }.start()
binding.buttonsLayout.acceptTempButton.visibility = View.GONE
})
})
@ -545,7 +545,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
// **** Various treatment buttons ****
binding.buttonsLayout.carbsButton.visibility =
((!activePlugin.activePump.pumpDescription.storesCarbInfo || pump.isInitialized() && !pump.isSuspended()) && profile != null
(/*(!activePlugin.activePump.pumpDescription.storesCarbInfo || pump.isInitialized() && !pump.isSuspended()) &&*/ profile != null
&& sp.getBoolean(R.string.key_show_carbs_button, true)).toVisibility()
binding.buttonsLayout.treatmentButton.visibility = (!loop.isDisconnected && pump.isInitialized() && !pump.isSuspended() && profile != null
&& sp.getBoolean(R.string.key_show_treatment_button, false)).toVisibility()
@ -603,7 +603,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
private fun processAps() {
val pump = activePlugin.activePump
val profile = profileFunction.getProfile()
// aps mode
val closedLoopEnabled = constraintChecker.isClosedLoopAllowed()
@ -682,21 +681,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
binding.infoLayout.apsModeText.visibility = View.GONE
}
}
// Show variable sensitivity
val request = loop.lastRun?.request
if (request is DetermineBasalResultSMB) {
val isfMgdl = profile?.getIsfMgdl()
val variableSens = request.variableSens
if (variableSens != isfMgdl && variableSens != null && isfMgdl != null) {
binding.infoLayout.variableSensitivity.text =
String.format(
Locale.getDefault(), "%1$.1f→%2$.1f",
Profile.toUnits(isfMgdl, isfMgdl * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()),
Profile.toUnits(variableSens, variableSens * Constants.MGDL_TO_MMOLL, profileFunction.getUnits())
)
binding.infoLayout.variableSensitivity.visibility = View.VISIBLE
} else binding.infoLayout.variableSensitivity.visibility = View.GONE
} else binding.infoLayout.variableSensitivity.visibility = View.GONE
} else {
//nsclient
binding.infoLayout.apsMode.visibility = View.GONE
@ -827,7 +811,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
}
fun updateProfile() {
private fun updateProfile() {
val profile = profileFunction.getProfile()
runOnUiThread {
_binding ?: return@runOnUiThread
@ -885,7 +869,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
}
fun updateTime() {
private fun updateTime() {
_binding ?: return
binding.infoLayout.time.text = dateUtil.timeString(dateUtil.now())
// Status lights
@ -915,7 +899,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
)
}
fun updateIobCob() {
private fun updateIobCob() {
val iobText = overviewData.iobText(iobCobCalculator)
val iobDialogText = overviewData.iobDialogText(iobCobCalculator)
val displayText = overviewData.cobInfo(iobCobCalculator).displayText(rh, dateUtil, buildHelper.isEngineeringMode())
@ -999,6 +983,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
val pump = activePlugin.activePump
val graphData = GraphData(injector, binding.graphsLayout.bgGraph, overviewData)
val menuChartSettings = overviewMenus.setting
if (menuChartSettings.isEmpty()) return
graphData.addInRangeArea(overviewData.fromTime, overviewData.endTime, defaultValueHelper.determineLowLine(), defaultValueHelper.determineHighLine())
graphData.addBgReadings(menuChartSettings[0][OverviewMenus.CharType.PRE.ordinal], context)
if (buildHelper.isDev()) graphData.addBucketedData()
@ -1084,7 +1069,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
private fun updateSensitivity() {
_binding ?: return
if (sp.getBoolean(R.string.key_openapsama_useautosens, false) && constraintChecker.isAutosensModeEnabled().value()) {
if (constraintChecker.isAutosensModeEnabled().value()) {
binding.infoLayout.sensitivityIcon.setImageResource(R.drawable.ic_swap_vert_black_48dp_green)
} else {
binding.infoLayout.sensitivityIcon.setImageResource(R.drawable.ic_x_swap_vert)
@ -1094,6 +1079,24 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overviewData.lastAutosensData(iobCobCalculator)?.let { autosensData ->
String.format(Locale.ENGLISH, "%.0f%%", autosensData.autosensResult.ratio * 100)
} ?: ""
// Show variable sensitivity
val profile = profileFunction.getProfile()
val request = loop.lastRun?.request
val isfMgdl = profile?.getIsfMgdl()
val variableSens =
if (config.APS && request is DetermineBasalResultSMB) request.variableSens ?: 0.0
else if (config.NSCLIENT) JsonHelper.safeGetDouble(nsDeviceStatus.getAPSResult(injector).json, "variable_sens")
else 0.0
if (variableSens != isfMgdl && variableSens != 0.0 && isfMgdl != null) {
binding.infoLayout.variableSensitivity.text =
String.format(
Locale.getDefault(), "%1$.1f→%2$.1f",
Profile.toUnits(isfMgdl, isfMgdl * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()),
Profile.toUnits(variableSens, variableSens * Constants.MGDL_TO_MMOLL, profileFunction.getUnits())
)
binding.infoLayout.variableSensitivity.visibility = View.VISIBLE
} else binding.infoLayout.variableSensitivity.visibility = View.GONE
}
private fun updatePumpStatus() {

View file

@ -69,14 +69,16 @@ class OverviewMenus @Inject constructor(
private var _setting: MutableList<Array<Boolean>> = ArrayList()
val setting: List<Array<Boolean>>
get() = _setting.toMutableList() // implicitly does a list copy
@Synchronized get() = _setting.toMutableList() // implicitly does a list copy
@Synchronized
private fun storeGraphConfig() {
val sts = Gson().toJson(_setting)
sp.putString(R.string.key_graphconfig, sts)
aapsLogger.debug(sts)
}
@Synchronized
fun loadGraphConfig() {
val sts = sp.getString(R.string.key_graphconfig, "")
if (sts.isNotEmpty()) {
@ -115,7 +117,7 @@ class OverviewMenus @Inject constructor(
val used = arrayListOf<Int>()
for (g in 0 until numOfGraphs) {
if (g != 0 && g < numOfGraphs) {
if (g != 0) {
val dividerItem = popup.menu.add(Menu.NONE, g, Menu.NONE, "------- ${rh.gs(R.string.graph_menu_divider_header)} $g -------")
dividerItem.isCheckable = true
dividerItem.isChecked = true
@ -150,36 +152,38 @@ class OverviewMenus @Inject constructor(
}
popup.setOnMenuItemClickListener {
try {
// id < 100 graph header - divider 1, 2, 3 .....
when {
it.itemId == SCALE_ID -> {
// do nothing, submenu
}
synchronized(this) {
try {
// id < 100 graph header - divider 1, 2, 3 .....
when {
it.itemId == SCALE_ID -> {
// do nothing, submenu
}
it.itemId > SCALE_ID && it.itemId < SCALE_ID + 100 -> {
val hours = it.itemId - SCALE_ID // 6,12,....
rxBus.send(EventScale(hours))
}
it.itemId > SCALE_ID && it.itemId < SCALE_ID + 100 -> {
val hours = it.itemId - SCALE_ID // 6,12,....
rxBus.send(EventScale(hours))
}
it.itemId == numOfGraphs -> {
// add new empty
_setting.add(Array(CharType.values().size) { false })
}
it.itemId == numOfGraphs -> {
// add new empty
_setting.add(Array(CharType.values().size) { false })
}
it.itemId < 100 -> {
// remove graph
_setting.removeAt(it.itemId)
}
it.itemId < 100 -> {
// remove graph
_setting.removeAt(it.itemId)
}
else -> {
val graphNumber = it.itemId / 100 - 1
val item = it.itemId % 100
_setting[graphNumber][item] = !it.isChecked
else -> {
val graphNumber = it.itemId / 100 - 1
val item = it.itemId % 100
_setting[graphNumber][item] = !it.isChecked
}
}
} catch (exception: Exception) {
fabricPrivacy.logException(exception)
}
} catch (exception: Exception) {
fabricPrivacy.logException(exception)
}
storeGraphConfig()
setupChartMenu(context, chartButton)

View file

@ -44,10 +44,11 @@ class StatusLightHandler @Inject constructor(
handleAge(careportal_pb_age, TherapyEvent.Type.PUMP_BATTERY_CHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0)
}
if (!config.NSCLIENT) {
val insulinUnit = rh.gs(R.string.insulin_unit_shortname)
if (pump.model() == PumpType.OMNIPOD_EROS || pump.model() == PumpType.OMNIPOD_DASH) {
handleOmnipodReservoirLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U")
handleOmnipodReservoirLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, insulinUnit)
} else {
handleLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U")
handleLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, insulinUnit)
}
if (bgSource.sensorBatteryLevel != -1)
handleLevel(careportal_sensor_battery_level, R.string.key_statuslights_sbat_critical, 5.0, R.string.key_statuslights_sbat_warning, 20.0, bgSource.sensorBatteryLevel.toDouble(), "%")

View file

@ -56,7 +56,7 @@ class GraphData(
addSeries(overviewData.bgReadingGraphSeries)
if (addPredictions) addSeries(overviewData.predictionsGraphSeries)
overviewData.bgReadingGraphSeries.setOnDataPointTapListener { _, dataPoint ->
if (dataPoint is GlucoseValueDataPoint) ToastUtils.showToastInUiThread(context, dataPoint.label)
if (dataPoint is GlucoseValueDataPoint) ToastUtils.infoToast(context, dataPoint.label)
}
}
@ -93,14 +93,14 @@ class GraphData(
maxY = maxOf(maxY, overviewData.maxTreatmentsValue)
addSeries(overviewData.treatmentsSeries)
overviewData.treatmentsSeries.setOnDataPointTapListener { _, dataPoint ->
if (dataPoint is BolusDataPoint) ToastUtils.showToastInUiThread(context, dataPoint.label)
if (dataPoint is BolusDataPoint) ToastUtils.infoToast(context, dataPoint.label)
}
}
fun addEps(context: Context?, scale: Double) {
addSeries(overviewData.epsSeries)
overviewData.epsSeries.setOnDataPointTapListener { _, dataPoint ->
if (dataPoint is EffectiveProfileSwitchDataPoint) ToastUtils.showToastInUiThread(context, dataPoint.data.originalCustomizedName)
if (dataPoint is EffectiveProfileSwitchDataPoint) ToastUtils.infoToast(context, dataPoint.data.originalCustomizedName)
}
overviewData.epsScale.multiplier = maxY * scale / overviewData.maxEpsValue
}

View file

@ -8,11 +8,11 @@ import android.os.IBinder
import dagger.android.DaggerService
import info.nightscout.androidaps.events.EventAppExit
import info.nightscout.androidaps.interfaces.NotificationHolder
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject
@ -59,7 +59,7 @@ class DummyService : DaggerService() {
aapsLogger.debug(LTag.CORE, "onDestroy")
disposable.clear()
super.onDestroy()
stopForeground(true)
stopForeground(STOP_FOREGROUND_REMOVE)
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {

View file

@ -190,7 +190,7 @@ class SmsCommunicatorPlugin @Inject constructor(
?: return Result.failure(workDataOf("Error" to "missing input data"))
val format = bundle.getString("format")
?: return Result.failure(workDataOf("Error" to "missing format in input data"))
val pdus = bundle["pdus"] as Array<*>
@Suppress("DEPRECATION") val pdus = bundle["pdus"] as Array<*>
for (pdu in pdus) {
val message = SmsMessage.createFromPdu(pdu as ByteArray, format)
smsCommunicatorPlugin.processSms(Sms(message))

View file

@ -1,7 +1,6 @@
package info.nightscout.androidaps.plugins.general.wear
import android.content.Context
import android.content.Intent
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventAutosensCalculationFinished
@ -10,14 +9,14 @@ import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataHandlerMobile
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobile
import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.sharedPreferences.SP
@ -37,7 +36,8 @@ class WearPlugin @Inject constructor(
private val fabricPrivacy: FabricPrivacy,
private val rxBus: RxBus,
private val context: Context,
private val dataHandlerMobile: DataHandlerMobile
private val dataHandlerMobile: DataHandlerMobile,
val dataLayerListenerServiceMobileHelper: DataLayerListenerServiceMobileHelper
) : PluginBase(
PluginDescription()
@ -57,7 +57,7 @@ class WearPlugin @Inject constructor(
override fun onStart() {
super.onStart()
context.startService(Intent(context, DataLayerListenerServiceMobile::class.java))
dataLayerListenerServiceMobileHelper.startService(context)
disposable += rxBus
.toObservable(EventDismissBolusProgressIfRunning::class.java)
.observeOn(aapsSchedulers.io)
@ -94,6 +94,6 @@ class WearPlugin @Inject constructor(
override fun onStop() {
disposable.clear()
super.onStop()
context.stopService(Intent(context, DataLayerListenerServiceMobile::class.java))
dataLayerListenerServiceMobileHelper.stopService(context)
}
}

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.general.wear.wearintegration
import android.os.Binder
import android.os.Handler
import android.os.HandlerThread
import com.google.android.gms.tasks.Tasks
@ -10,14 +11,12 @@ import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.events.EventMobileToWear
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui
import info.nightscout.androidaps.receivers.ReceiverStatusStore
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.wizard.QuickWizard
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
@ -38,9 +37,7 @@ class DataLayerListenerServiceMobile : WearableListenerService() {
@Inject lateinit var loop: Loop
@Inject lateinit var wearPlugin: WearPlugin
@Inject lateinit var sp: SP
@Inject lateinit var quickWizard: QuickWizard
@Inject lateinit var config: Config
@Inject lateinit var nsDeviceStatus: NSDeviceStatus
@Inject lateinit var receiverStatusStore: ReceiverStatusStore
@Inject lateinit var repository: AppRepository
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@ -48,6 +45,11 @@ class DataLayerListenerServiceMobile : WearableListenerService() {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var aapsSchedulers: AapsSchedulers
inner class LocalBinder : Binder() {
fun getService(): DataLayerListenerServiceMobile = this@DataLayerListenerServiceMobile
}
private val dataClient by lazy { Wearable.getDataClient(this) }
private val messageClient by lazy { Wearable.getMessageClient(this) }
private val capabilityClient by lazy { Wearable.getCapabilityClient(this) }

View file

@ -0,0 +1,62 @@
package info.nightscout.androidaps.plugins.general.wear.wearintegration
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.IBinder
import info.nightscout.androidaps.interfaces.NotificationHolder
import javax.inject.Inject
import javax.inject.Singleton
/*
This code replaces following
val alarm = Intent(context, DataLayerListenerServiceMobile::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
it fails randomly with error
Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.DataLayerListenerServiceMobile}
*/
@Singleton
class DataLayerListenerServiceMobileHelper @Inject constructor(
private val notificationHolder: NotificationHolder
) {
fun startService(context: Context) {
val connection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
// The binder of the service that returns the instance that is created.
val binder: DataLayerListenerServiceMobile.LocalBinder = service as DataLayerListenerServiceMobile.LocalBinder
val dataLayerListenerServiceMobile: DataLayerListenerServiceMobile = binder.getService()
context.startForegroundService(Intent(context, DataLayerListenerServiceMobile::class.java))
// This is the key: Without waiting Android Framework to call this method
// inside Service.onCreate(), immediately call here to post the notification.
dataLayerListenerServiceMobile.startForeground(notificationHolder.notificationID, notificationHolder.notification)
// Release the connection to prevent leaks.
context.unbindService(this)
}
override fun onServiceDisconnected(name: ComponentName?) {
}
}
try {
context.bindService(Intent(context, DataLayerListenerServiceMobile::class.java), connection, Context.BIND_AUTO_CREATE)
} catch (ignored: RuntimeException) {
// This is probably a broadcast receiver context even though we are calling getApplicationContext().
// Just call startForegroundService instead since we cannot bind a service to a
// broadcast receiver context. The service also have to call startForeground in
// this case.
context.startForegroundService(Intent(context, DataLayerListenerServiceMobile::class.java))
}
}
fun stopService(context: Context) {
context.stopService(Intent(context, DataLayerListenerServiceMobile::class.java))
}
}

View file

@ -369,7 +369,7 @@ class IobCobCalculatorPlugin @Inject constructor(
@Synchronized
private fun scheduleHistoryDataChange(event: EventNewHistoryData) {
// if there is nothing scheduled or asking reload deeper to the past
if (scheduledEvent == null || event.oldDataTimestamp < (scheduledEvent?.oldDataTimestamp) ?: 0L) {
if (scheduledEvent == null || event.oldDataTimestamp < (scheduledEvent?.oldDataTimestamp ?: 0L)) {
// cancel waiting task to prevent sending multiple posts
scheduledHistoryPost?.cancel(false)
// prepare task for execution in 1 sec

View file

@ -91,7 +91,7 @@ open class VirtualPumpPlugin @Inject constructor(
it.basalStep = 0.01
it.basalMinimumRate = 0.01
it.isRefillingCapable = true
it.storesCarbInfo = false
//it.storesCarbInfo = false
it.is30minBasalRatesCapable = true
}

View file

@ -4,6 +4,8 @@ import android.os.Bundle
import android.util.SparseArray
import android.view.*
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
@ -39,7 +41,7 @@ import io.reactivex.rxjava3.kotlin.plusAssign
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class BGSourceFragment : DaggerFragment() {
class BGSourceFragment : DaggerFragment(), MenuProvider {
@Inject lateinit var rxBus: RxBus
@Inject lateinit var fabricPrivacy: FabricPrivacy
@ -66,7 +68,7 @@ class BGSourceFragment : DaggerFragment() {
actionHelper = ActionModeHelper(rh, activity, this)
actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { handler -> removeSelected(handler) }
setHasOptionsMenu(true)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -104,13 +106,8 @@ class BGSourceFragment : DaggerFragment() {
super.onPause()
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
actionHelper.onCreateOptionsMenu(menu, inflater)
}
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
actionHelper.onPrepareOptionsMenu(menu)
}
@ -121,8 +118,9 @@ class BGSourceFragment : DaggerFragment() {
_binding = null
}
override fun onOptionsItemSelected(item: MenuItem) =
actionHelper.onOptionsItemSelected(item)
override fun onMenuItemSelected(item: MenuItem) =
if (actionHelper.onOptionsItemSelected(item)) true
else super.onContextItemSelected(item)
inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List<GlucoseValue>) : RecyclerView.Adapter<RecyclerViewAdapter.GlucoseValuesViewHolder>() {
@ -198,6 +196,7 @@ class BGSourceFragment : DaggerFragment() {
R.string.poctech -> Sources.PocTech
R.string.tomato -> Sources.Tomato
R.string.glunovo -> Sources.Glunovo
R.string.intelligo -> Sources.Intelligo
R.string.xdrip -> Sources.Xdrip
R.string.aidex -> Sources.Aidex
else -> Sources.Unknown

View file

@ -19,13 +19,19 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction
import info.nightscout.androidaps.extensions.fromConstant
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.extensions.safeGetInstalledPackages
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.receivers.DataWorker
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.XDripBroadcast
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
@ -244,7 +250,7 @@ class DexcomPlugin @Inject constructor(
fun findDexcomPackageName(): String? {
val packageManager = context.packageManager
for (packageInfo in packageManager.getInstalledPackages(0)) {
for (packageInfo in packageManager.safeGetInstalledPackages(0)) {
if (PACKAGE_NAMES.contains(packageInfo.packageName)) return packageInfo.packageName
}
return null

View file

@ -89,80 +89,84 @@ class GlunovoPlugin @Inject constructor(
private fun handleNewData() {
if (!isEnabled()) return
context.contentResolver.query(contentUri, null, null, null, null)?.let { cr ->
val glucoseValues = mutableListOf<CgmSourceTransaction.TransactionGlucoseValue>()
val calibrations = mutableListOf<CgmSourceTransaction.Calibration>()
cr.moveToFirst()
try {
context.contentResolver.query(contentUri, null, null, null, null)?.let { cr ->
val glucoseValues = mutableListOf<CgmSourceTransaction.TransactionGlucoseValue>()
val calibrations = mutableListOf<CgmSourceTransaction.Calibration>()
cr.moveToFirst()
while (!cr.isAfterLast) {
val timestamp = cr.getLong(0)
val value = cr.getDouble(1) //value in mmol/l...
val curr = cr.getDouble(2)
while (!cr.isAfterLast) {
val timestamp = cr.getLong(0)
val value = cr.getDouble(1) //value in mmol/l...
val curr = cr.getDouble(2)
// bypass already processed
if (timestamp < sp.getLong(R.string.key_last_processed_glunovo_timestamp, 0L)) {
cr.moveToNext()
continue
}
// bypass already processed
if (timestamp < sp.getLong(R.string.key_last_processed_glunovo_timestamp, 0L)) {
cr.moveToNext()
continue
}
if (timestamp > dateUtil.now() || timestamp == 0L) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data date/time $timestamp")
cr.moveToNext()
continue
}
if (timestamp > dateUtil.now() || timestamp == 0L) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data date/time $timestamp")
cr.moveToNext()
continue
}
if (value < 2 || value > 25) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data value (value out of bounds) $value")
cr.moveToNext()
continue
}
if (value < 2 || value > 25) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data value (value out of bounds) $value")
cr.moveToNext()
continue
}
if (curr != 0.0)
glucoseValues += CgmSourceTransaction.TransactionGlucoseValue(
timestamp = timestamp,
value = value * Constants.MMOLL_TO_MGDL,
raw = 0.0,
noise = null,
trendArrow = GlucoseValue.TrendArrow.NONE,
sourceSensor = GlucoseValue.SourceSensor.GLUNOVO_NATIVE
)
else
calibrations.add(
CgmSourceTransaction.Calibration(
if (curr != 0.0)
glucoseValues += CgmSourceTransaction.TransactionGlucoseValue(
timestamp = timestamp,
value = value,
glucoseUnit = TherapyEvent.GlucoseUnit.MMOL
value = value * Constants.MMOLL_TO_MGDL,
raw = 0.0,
noise = null,
trendArrow = GlucoseValue.TrendArrow.NONE,
sourceSensor = GlucoseValue.SourceSensor.GLUNOVO_NATIVE
)
)
sp.putLong(R.string.key_last_processed_glunovo_timestamp, timestamp)
cr.moveToNext()
}
cr.close()
else
calibrations.add(
CgmSourceTransaction.Calibration(
timestamp = timestamp,
value = value,
glucoseUnit = TherapyEvent.GlucoseUnit.MMOL
)
)
sp.putLong(R.string.key_last_processed_glunovo_timestamp, timestamp)
cr.moveToNext()
}
cr.close()
if (glucoseValues.isNotEmpty() || calibrations.isNotEmpty())
repository.runTransactionForResult(CgmSourceTransaction(glucoseValues, calibrations, null))
.doOnError {
aapsLogger.error(LTag.DATABASE, "Error while saving values from Glunovo App", it)
}
.blockingGet()
.also { savedValues ->
savedValues.inserted.forEach {
xDripBroadcast.send(it)
aapsLogger.debug(LTag.DATABASE, "Inserted bg $it")
if (glucoseValues.isNotEmpty() || calibrations.isNotEmpty())
repository.runTransactionForResult(CgmSourceTransaction(glucoseValues, calibrations, null))
.doOnError {
aapsLogger.error(LTag.DATABASE, "Error while saving values from Glunovo App", it)
}
savedValues.calibrationsInserted.forEach { calibration ->
calibration.glucose?.let { glucosevalue ->
uel.log(
UserEntry.Action.CALIBRATION,
UserEntry.Sources.Dexcom,
ValueWithUnit.Timestamp(calibration.timestamp),
ValueWithUnit.TherapyEventType(calibration.type),
ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString)
)
.blockingGet()
.also { savedValues ->
savedValues.inserted.forEach {
xDripBroadcast.send(it)
aapsLogger.debug(LTag.DATABASE, "Inserted bg $it")
}
savedValues.calibrationsInserted.forEach { calibration ->
calibration.glucose?.let { glucosevalue ->
uel.log(
UserEntry.Action.CALIBRATION,
UserEntry.Sources.Dexcom,
ValueWithUnit.Timestamp(calibration.timestamp),
ValueWithUnit.TherapyEventType(calibration.type),
ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString)
)
}
aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration")
}
aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration")
}
}
}
} catch (e: SecurityException) {
aapsLogger.error(LTag.CORE, "Exception", e)
}
}

View file

@ -0,0 +1,193 @@
package info.nightscout.androidaps.plugins.source
import android.content.Context
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Handler
import android.os.HandlerThread
import android.util.Log
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.entities.TherapyEvent
import info.nightscout.androidaps.database.entities.UserEntry
import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.extensions.safeGetInstalledPackages
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.XDripBroadcast
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class IntelligoPlugin @Inject constructor(
injector: HasAndroidInjector,
resourceHelper: ResourceHelper,
aapsLogger: AAPSLogger,
private val sp: SP,
private val context: Context,
private val repository: AppRepository,
private val xDripBroadcast: XDripBroadcast,
private val dateUtil: DateUtil,
private val uel: UserEntryLogger,
private val fabricPrivacy: FabricPrivacy
) : PluginBase(
PluginDescription()
.mainType(PluginType.BGSOURCE)
.fragmentClass(BGSourceFragment::class.java.name)
.pluginIcon(R.drawable.ic_intelligo)
.pluginName(R.string.intelligo)
.preferencesId(R.xml.pref_bgsource)
.shortName(R.string.intelligo)
.description(R.string.description_source_intelligo),
aapsLogger, resourceHelper, injector
), BgSource {
private val handler = Handler(HandlerThread(this::class.java.simpleName + "Handler").also { it.start() }.looper)
private lateinit var refreshLoop: Runnable
private val contentUri: Uri = Uri.parse("content://$AUTHORITY/$TABLE_NAME")
init {
refreshLoop = Runnable {
try {
handleNewData()
} catch (e: Exception) {
fabricPrivacy.logException(e)
aapsLogger.error("Error while processing data", e)
}
val lastReadTimestamp = sp.getLong(R.string.key_last_processed_intelligo_timestamp, 0L)
val differenceToNow = INTERVAL - (dateUtil.now() - lastReadTimestamp) % INTERVAL + T.secs(10).msecs()
handler.postDelayed(refreshLoop, differenceToNow)
}
}
private val disposable = CompositeDisposable()
override fun onStart() {
super.onStart()
handler.postDelayed(refreshLoop, T.secs(30).msecs()) // do not start immediately, app may be still starting
}
override fun onStop() {
super.onStop()
handler.removeCallbacks(refreshLoop)
disposable.clear()
}
private fun handleNewData() {
if (!isEnabled()) return
for (pack in context.packageManager.safeGetInstalledPackages(PackageManager.GET_PROVIDERS)) {
val providers = pack.providers
if (providers != null) {
for (provider in providers) {
Log.d("Example", "provider: " + provider.authority)
}
}
}
context.contentResolver.query(contentUri, null, null, null, null)?.let { cr ->
val glucoseValues = mutableListOf<CgmSourceTransaction.TransactionGlucoseValue>()
val calibrations = mutableListOf<CgmSourceTransaction.Calibration>()
cr.moveToFirst()
while (!cr.isAfterLast) {
val timestamp = cr.getLong(0)
val value = cr.getDouble(1) //value in mmol/l...
val curr = cr.getDouble(2)
// bypass already processed
if (timestamp < sp.getLong(R.string.key_last_processed_intelligo_timestamp, 0L)) {
cr.moveToNext()
continue
}
if (timestamp > dateUtil.now() || timestamp == 0L) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data date/time $timestamp")
cr.moveToNext()
continue
}
if (value < 2 || value > 25) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data value (value out of bounds) $value")
cr.moveToNext()
continue
}
if (curr != 0.0)
glucoseValues += CgmSourceTransaction.TransactionGlucoseValue(
timestamp = timestamp,
value = value * Constants.MMOLL_TO_MGDL,
raw = 0.0,
noise = null,
trendArrow = GlucoseValue.TrendArrow.NONE,
sourceSensor = GlucoseValue.SourceSensor.INTELLIGO_NATIVE
)
else
calibrations.add(
CgmSourceTransaction.Calibration(
timestamp = timestamp,
value = value,
glucoseUnit = TherapyEvent.GlucoseUnit.MMOL
)
)
sp.putLong(R.string.key_last_processed_intelligo_timestamp, timestamp)
cr.moveToNext()
}
cr.close()
if (glucoseValues.isNotEmpty() || calibrations.isNotEmpty())
repository.runTransactionForResult(CgmSourceTransaction(glucoseValues, calibrations, null))
.doOnError {
aapsLogger.error(LTag.DATABASE, "Error while saving values from IntelliGO App", it)
}
.blockingGet()
.also { savedValues ->
savedValues.inserted.forEach {
xDripBroadcast.send(it)
aapsLogger.debug(LTag.DATABASE, "Inserted bg $it")
}
savedValues.calibrationsInserted.forEach { calibration ->
calibration.glucose?.let { glucoseValue ->
uel.log(
UserEntry.Action.CALIBRATION,
UserEntry.Sources.Dexcom,
ValueWithUnit.Timestamp(calibration.timestamp),
ValueWithUnit.TherapyEventType(calibration.type),
ValueWithUnit.fromGlucoseUnit(glucoseValue, calibration.glucoseUnit.toString)
)
}
aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration")
}
}
}
}
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =
glucoseValue.sourceSensor == GlucoseValue.SourceSensor.INTELLIGO_NATIVE && sp.getBoolean(R.string.key_dexcomg5_nsupload, false)
companion object {
@Suppress("SpellCheckingInspection")
const val AUTHORITY = "alexpr.co.uk.infinivocgm.intelligo.cgm_db.CgmExternalProvider"
//const val AUTHORITY = "alexpr.co.uk.infinivocgm.cgm_db.CgmExternalProvider/"
const val TABLE_NAME = "CgmReading"
const val INTERVAL = 180000L // 3 min
}
}

View file

@ -232,10 +232,10 @@ class CommandQueueImplementation @Inject constructor(
var carbsRunnable = Runnable { }
val originalCarbs = detailedBolusInfo.carbs
if ((detailedBolusInfo.carbs > 0) &&
if ((detailedBolusInfo.carbs > 0) /*&&
(!activePlugin.activePump.pumpDescription.storesCarbInfo ||
detailedBolusInfo.carbsDuration != 0L ||
(detailedBolusInfo.carbsTimestamp ?: detailedBolusInfo.timestamp) > dateUtil.now())
(detailedBolusInfo.carbsTimestamp ?: detailedBolusInfo.timestamp) > dateUtil.now())*/
) {
carbsRunnable = Runnable {
aapsLogger.debug(LTag.PUMPQUEUE, "Going to store carbs")

View file

@ -8,6 +8,8 @@ import android.os.SystemClock
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.safeDisable
import info.nightscout.androidaps.extensions.safeEnable
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueue
import info.nightscout.androidaps.interfaces.Config
@ -77,10 +79,8 @@ class QueueThread internal constructor(
pump.disconnect("watchdog")
SystemClock.sleep(1000)
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.let { bluetoothAdapter ->
bluetoothAdapter.disable()
SystemClock.sleep(1000)
bluetoothAdapter.enable()
SystemClock.sleep(1000)
bluetoothAdapter.safeDisable(1000)
bluetoothAdapter.safeEnable(1000)
}
//start over again once after watchdog barked
//Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT);

View file

@ -5,15 +5,17 @@ import android.content.Context
import android.content.Intent
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.androidaps.events.EventBTChange
import info.nightscout.androidaps.extensions.safeGetParcelableExtra
import info.nightscout.androidaps.plugins.bus.RxBus
import javax.inject.Inject
class BTReceiver : DaggerBroadcastReceiver() {
@Inject lateinit var rxBus: RxBus
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
val device: BluetoothDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) ?: return
val device = intent.safeGetParcelableExtra(BluetoothDevice.EXTRA_DEVICE, BluetoothDevice::class.java) ?: return
when (intent.action) {
BluetoothDevice.ACTION_ACL_CONNECTED ->

View file

@ -33,7 +33,7 @@ class SWHtmlLink(injector: HasAndroidInjector) : SWItem(injector, Type.HTML_LINK
val context = layout.context
l = TextView(context)
l?.id = View.generateViewId()
l?.autoLinkMask = Linkify.ALL
l?.autoLinkMask = Linkify.WEB_URLS
if (textLabel != null) l?.text = textLabel else l?.setText(label!!)
layout.addView(l)
}

View file

@ -50,12 +50,20 @@ class AndroidPermission @Inject constructor(
}
if (test) {
if (activity is DaggerAppCompatActivityWithResult)
activity.requestMultiplePermissions.launch(permissions)
try {
activity.requestMultiplePermissions.launch(permissions)
} catch (ignored: IllegalStateException) {
ToastUtils.errorToast(activity, rh.gs(R.string.error_asking_for_permissions))
}
}
if (testBattery) {
try {
if (activity is DaggerAppCompatActivityWithResult)
activity.callForBatteryOptimization.launch(null)
try {
activity.callForBatteryOptimization.launch(null)
} catch (ignored: IllegalStateException) {
ToastUtils.errorToast(activity, rh.gs(R.string.error_asking_for_permissions))
}
} catch (e: ActivityNotFoundException) {
permissionBatteryOptimizationFailed = true
OKDialog.show(activity, rh.gs(R.string.permission), rh.gs(R.string.alert_dialog_permission_battery_optimization_failed)) { activity.recreate() }
@ -145,8 +153,10 @@ class AndroidPermission @Inject constructor(
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
// Show alert dialog to the user saying a separate permission is needed
// Launch the settings activity if the user prefers
val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + activity.packageName))
val intent = Intent(
Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + activity.packageName)
)
activity.startActivity(intent)
}
}

View file

@ -6,18 +6,19 @@ import android.os.Bundle
import info.nightscout.androidaps.R
import info.nightscout.androidaps.annotations.OpenForTesting
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.extensions.safeQueryBroadcastReceivers
import info.nightscout.androidaps.interfaces.GlucoseUnit
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.receivers.Intents
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.androidaps.receivers.Intents
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import java.text.SimpleDateFormat
import java.util.*
import java.util.Locale
import javax.inject.Inject
import javax.inject.Singleton
@ -41,13 +42,13 @@ class XDripBroadcast @Inject constructor(
intent.putExtras(bundle)
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
context.sendBroadcast(intent)
val q = context.packageManager.queryBroadcastReceivers(intent, 0)
return if (q.size < 1) {
ToastUtils.showToastInUiThread(context, rh.gs(R.string.xdripnotinstalled))
val q = context.packageManager.safeQueryBroadcastReceivers(intent, 0)
return if (q.isEmpty()) {
ToastUtils.errorToast(context, R.string.xdripnotinstalled)
aapsLogger.debug(rh.gs(R.string.xdripnotinstalled))
false
} else {
ToastUtils.showToastInUiThread(context, rh.gs(R.string.calibrationsent))
ToastUtils.errorToast(context, R.string.calibrationsent)
aapsLogger.debug(rh.gs(R.string.calibrationsent))
true
}
@ -74,8 +75,8 @@ class XDripBroadcast @Inject constructor(
val intent = Intent(Intents.XDRIP_PLUS_NS_EMULATOR)
intent.putExtras(bundle).addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
context.sendBroadcast(intent)
val receivers = context.packageManager.queryBroadcastReceivers(intent, 0)
if (receivers.size < 1) {
val receivers = context.packageManager.safeQueryBroadcastReceivers(intent, 0)
if (receivers.isEmpty()) {
//NSUpload.log.debug("No xDrip receivers found. ")
aapsLogger.debug(LTag.BGSOURCE, "No xDrip receivers found.")
} else {
@ -150,7 +151,7 @@ class XDripBroadcast @Inject constructor(
}
private fun broadcast(intent: Intent) {
context.packageManager.queryBroadcastReceivers(intent, 0).forEach { resolveInfo ->
context.packageManager.safeQueryBroadcastReceivers(intent, 0).forEach { resolveInfo ->
resolveInfo.activityInfo.packageName?.let {
intent.setPackage(it)
context.sendBroadcast(intent)

View file

@ -204,7 +204,7 @@ class Widget : AppWidgetProvider() {
}
}
fun updateProfile(views: RemoteViews) {
private fun updateProfile(views: RemoteViews) {
val profileTextColor =
profileFunction.getProfile()?.let {
if (it is ProfileSealed.EPS) {
@ -226,7 +226,7 @@ class Widget : AppWidgetProvider() {
}
private fun updateSensitivity(views: RemoteViews) {
if (sp.getBoolean(R.string.key_openapsama_useautosens, false) && constraintChecker.isAutosensModeEnabled().value())
if (constraintChecker.isAutosensModeEnabled().value())
views.setImageViewResource(R.id.sensitivity_icon, R.drawable.ic_swap_vert_black_48dp_green)
else
views.setImageViewResource(R.id.sensitivity_icon, R.drawable.ic_x_swap_vert)
@ -256,7 +256,7 @@ class Widget : AppWidgetProvider() {
internal fun updateWidget(context: Context) {
context.sendBroadcast(Intent().also {
it.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, AppWidgetManager.getInstance(context).getAppWidgetIds(ComponentName(context, Widget::class.java)))
it.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, AppWidgetManager.getInstance(context)?.getAppWidgetIds(ComponentName(context, Widget::class.java)))
it.action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
})
}

View file

@ -60,12 +60,13 @@ class CalculationWorkflow @Inject constructor(
private val overviewData: OverviewData
get() = (iobCobCalculator as IobCobCalculatorPlugin).overviewData
enum class ProgressData(val pass: Int, val percentOfTotal: Int) {
enum class ProgressData(private val pass: Int, val percentOfTotal: Int) {
PREPARE_BASAL_DATA(0, 5),
PREPARE_TEMPORARY_TARGET_DATA(1, 5),
PREPARE_TREATMENTS_DATA(2, 5),
IOB_COB_OREF(3, 75),
PREPARE_IOB_AUTOSENS_DATA(4, 10);
IOB_COB_OREF(3, 74),
PREPARE_IOB_AUTOSENS_DATA(4, 10),
DRAW(5, 1);
fun finalPercent(progress: Int): Int {
var total = 0

View file

@ -7,6 +7,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
import javax.inject.Inject
class UpdateGraphWorker(
@ -26,6 +27,7 @@ class UpdateGraphWorker(
overviewPlugin.overviewBus.send(EventUpdateOverviewGraph("UpdateGraphWorker"))
else
rxBus.send(EventUpdateOverviewGraph("UpdateGraphWorker"))
rxBus.send(EventIobCalculationProgress(CalculationWorkflow.ProgressData.DRAW, 100, null))
return Result.success()
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -11,17 +11,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/noprofile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/noprofileset"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?attr/alarmColor"
android:textStyle="bold"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -82,8 +71,7 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_height="300dp">
<com.jjoe64.graphview.GraphView
android:id="@+id/bg_graph"
@ -112,4 +100,4 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -271,6 +271,16 @@
</LinearLayout>
<TextView
android:id="@+id/notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="10dp"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry"
tools:text="Notes" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View file

@ -500,7 +500,6 @@
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Verhoog sensitiwiteit vir tydelike doelwitte > = 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Lae tydelike doelwitte verlaag sensitiwiteit</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Laer sensitiwiteit vir tydelike doelwitte < 100]]></string>
<string name="careportal_removestartedevents">Skoon AndroidAPS begin</string>
<string name="storedsettingsfound">Gestoorde instellings gevind</string>
<string name="allow_hardware_pump_text">Aandag: As jy aktiveer en koppel aan \'n hardeware pomp, AndroidAPS sal die basale instellings uit die profiel aan die pomp kopieer, die bestaande basale koers gestoor op die pomp sal oorskryf word. Maak seker jy het die korrekte basale instelling in AndroidAPS. As jy nie seker is of nie die basale instellings wil oorskryf op jou pomp, druk Kanselleer en herhaal oorskakel na die pomp op \'n later tyd.</string>
<string name="error_adding_treatment_title">Behandeling data onvolledig</string>

View file

@ -644,7 +644,6 @@
<string name="resistance_lowers_target_summary">Когато се установи резистентност, намалява целевата глюкоза.</string>
<string name="sensitivity_raises_target_title">Чувствителността увеличава целта</string>
<string name="sensitivity_raises_target_summary">Когато се установи чувствителност, повишаване на целевата глюкоза</string>
<string name="careportal_removestartedevents"> AndroidAPS стартира</string>
<string name="storedsettingsfound">Открити са предишни настройки</string>
<string name="allow_hardware_pump_text">Внимание: Ако активирате и свържете с хардуерна помпа, AndroidAPS ще копира основните настройки от профила в помпата, като презапише съществуващата базова скорост, съхранявана на помпата. Уверете се, че имате правилните основни настройки в AndroidAPS. Ако не сте сигурни или не искате да презапишете основните настройки на помпата, натиснете Cancel и повторете превключването към помпата по-късно.</string>
<string name="error_adding_treatment_title">Данните за лечението не са пълни</string>

View file

@ -656,6 +656,8 @@
<string name="description_source_poctech">Získávat glykémie z aplikace Poctech</string>
<string name="glunovo">Glunovo</string>
<string name="description_source_glunovo">Získávat glykémie z aplikace Glunovo</string>
<string name="intelligo">Intelligo</string>
<string name="description_source_intelligo">Přijímat hodnoty z aplikace Intelligo</string>
<string name="description_source_tomato">Přijímat hodnoty glykémií z Tomato aplikace (MiaoMiao zařízení)</string>
<string name="high_temptarget_raises_sensitivity_title">Vysoký dočasný cíl zvýší senzitivitu</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Zvýšení senzitivity pro dočasné cíle >= 5.5]]></string>
@ -665,7 +667,7 @@
<string name="resistance_lowers_target_summary">Je-li zjištěna rezistence, sníží nastavenou cílovou glykémii</string>
<string name="sensitivity_raises_target_title">Citlivost zvyšuje cíl</string>
<string name="sensitivity_raises_target_summary">Je-li zjištěna vyšší citlivost, zvýší nastavenou cílovou glykémii</string>
<string name="careportal_removestartedevents">Vyčistit události \"AndroidAPS restartován\"</string>
<string name="careportal_removestartedevents">Odebrat záznamy spuštěné AAPS</string>
<string name="show_invalidated">Zobrazit neplatné</string>
<string name="hide_invalidated">Skrýt zneplatněné</string>
<string name="remove_items">Odstranit položky</string>
@ -1044,4 +1046,6 @@
<string name="blocked_by_charging">Zablokováno možností nabíjení</string>
<string name="blocked_by_connectivity">Zablokováno možností připojení</string>
<string name="no_watch_connected">(Žádné hodinky nejsou připojeny)</string>
<string name="error_asking_for_permissions">Chyba žádosti o oprávnění</string>
<string name="dynisf_adjust_sensitivity">Upravit citlivost a glykémii</string>
</resources>

View file

@ -123,6 +123,7 @@
<string name="sensitivity_cannula">Notering af kanyleskift vil nulstille Autosens ratio tilbage til 100%.</string>
<string name="sensitivity_time">Nogle af plugin mulighederne har konfigurerbare tidsintervaller, der kan indstilles af brugeren.</string>
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
<string name="sensitivity_hint2">https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens</string>
<string name="wrongcarbs_label">Kulhydrat indtastningsfejl</string>
<string name="wrongcarbs_whattodo">Hvad gør du, hvis du har lavet en forkert kulhydrat indtastning?</string>
<string name="wrongcarbs_treatmentstab">Slet den forkerte indtastning i Behandlinger og indtast korrekte nye kulhydrat værdier.</string>
@ -135,6 +136,19 @@
<string name="wronginsulin_compare">Sammenlign værdier i AndroidAPS og pumpehistorik (hvis pumpen understøtter dette).</string>
<string name="wronginsulin_prime">Bolus en del af din beregnede \"glemte\" insulin med enten sprøjter / pen eller brug af en kanylefyldning.</string>
<string name="wronginsulin_donothing">Gør ingenting og tillad AndroidAPS at rette op på højt blodsukker.</string>
<string name="cob_label">Kulhydrater om bord (COB)</string>
<string name="cob_question">Hvordan ændring af ISF værdi påvirker COB beregning?</string>
<string name="cob_longer">Ved øget ISF, vil kulhydrater være længere tid om at absorberes</string>
<string name="cob_shorter">Ved øget ISF, vil kulhydrater være kortere tid om at absorberes</string>
<string name="cob_no_effect">Øget ISF vil ikke påvirke absorbering af beregnet kulhydrat</string>
<string name="cob2_question">Hvordan ændring af IC værdi påvirker COB beregning?</string>
<string name="cob2_longer">Ved øget IC, vil kulhydrater være længere tid om at absorberes</string>
<string name="cob2_shorter">Ved øget IC, vil kulhydrater være kortere tid om at absorberes</string>
<string name="cob2_no_effect">Øget IC vil ikke påvirke absorbering af beregnet kulhydrat</string>
<string name="cob3_question">Hvordan skift af profil procent påvirker COB beregning?</string>
<string name="cob3_longer">Ved indstilling af profil til 150%, vil kulhydrater være længere tid om at absorberes</string>
<string name="cob3_shorter">Ved indstilling af profil til 150%, vil kulhydrater være kortere tid om at absorberes</string>
<string name="cob3_no_effect">Ved indstilling af profil til 150%, påvirkes absorbering af beregnet kulhydrat ikke</string>
<string name="iob_label">Insulin om bord (IOB)</string>
<string name="iob_value">IOB-værdi påvirkes af midlertidige basaler.</string>
<string name="iob_hightemp">Høj midlertidlig basal vil ikke blive givet, når dit blodsukker er under målet.</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Behandlings sikkerhed</string>
<string name="treatmentssafety_maxbolus_title">Maks tilladt bolus [IE]</string>
<string name="treatmentssafety_maxcarbs_title">Maks tilladte kulhydrater [g]</string>
<string name="treatmentssafety_lgsThreshold_title">BS under værdi for LGS grænse</string>
<string name="nav_preferences_plugin">%1$s indstillinger</string>
<string name="nav_preferences">Indstillinger</string>
<string name="nav_refreshtreatments">Opdater behandlinger fra NS</string>
@ -432,12 +433,15 @@
<string name="ns_localbroadcasts_title">Aktiver lokale udsendelser.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamisk ISF</string>
<string name="DynISFAdjust_title" formatted="false">DynamiskISF-justeringsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Justeringsfaktor for DynamiskISF. Indstil mere end 100% for mere aggressive korrektionsdoser og mindre end 100% for mindre aggressive korrektioner.</string>
<string name="enableuam">Aktiver UAM</string>
<string name="enablesmb">Aktiver SMB</string>
<string name="enablesmb_summary">Brug Super Mikro Boluser i stedet for midlertidig basal for hurtigere handling</string>
<string name="enableuam_summary">Detektering af uanmeldte måltider</string>
<string name="insulin_oref_peak">IOB Kurve Peak-Tid</string>
<string name="insulin_peak_time">Spidstidspunkt [min]</string>
<string name="insulin_peak">Top</string>
<string name="free_peak_oref">Free-Peak Oref</string>
<string name="rapid_acting_oref">Rapid-Acting Oref</string>
<string name="ultrarapid_oref">Ultra-Rapid Oref</string>
@ -589,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Denne værdi kaldes Max IOB i OpenAPS kontekst\nOpenAPS vil ikke tilføje mere insulin, hvis den aktuelle IOB er større end denne værdi</string>
<string name="absorption_cutoff_title">Måltid max absorptionstid [h]</string>
<string name="absorption_cutoff_summary">Tid hvor ethvert måltid betragtes som absorberet. Resterende kulhydrater vil blive afskåret.</string>
<string name="treatmentssafety_lgsThreshold_summary">BS værdi under hvilken insulin er suspenderet. Standard værdi bruger standard målmodel. Bruger kan indstille værdi mellem 60 mg/dl (3,3 mmol/l) og 100 mg/dl (5,5 mmol/l). Værdier under 65/3,6 resulterer i brug af standardmodel</string>
<string name="overview_show_notes_field_in_dialogs_title">Vis notefelt i behandlingsdialoger</string>
<string name="next_button">Næste</string>
<string name="previous_button">Forrige</string>
@ -601,7 +606,11 @@
<string name="secondcarbsincrement">Anden kulhydratstigning</string>
<string name="thirdcarbsincrement">Tredje kulhydratstigning</string>
<string name="cgm">CGM</string>
<string name="ns_cellular">Brug mobilforbindelse</string>
<string name="ns_wifi">Brug Wi-Fi-forbindelse</string>
<string name="ns_wifi_ssids">WiFi SSID</string>
<string name="ns_charging">Under opladning</string>
<string name="ns_battery">På batteri</string>
<string name="connectionsettings_title">Indstillinger for forbindelse</string>
<string name="ns_wifi_allowedssids">Tilladte SSID\'er (semikolon separeret)</string>
<string name="ns_allowroaming">Tillad forbindelse i roaming</string>
@ -656,7 +665,6 @@
<string name="resistance_lowers_target_summary">Når der påvises resistens, sænkes målglukosen</string>
<string name="sensitivity_raises_target_title">Følsomhed hæver midlertidige mål</string>
<string name="sensitivity_raises_target_summary">Når der påvises følsomhed, skal målglukosen hæves</string>
<string name="careportal_removestartedevents">Ren AndroidAPS startet</string>
<string name="show_invalidated">Vis ugyldige</string>
<string name="hide_invalidated">Skjul ugyldige</string>
<string name="remove_items">Fjern elementer</string>
@ -675,6 +683,8 @@
<string name="error_adding_treatment_message">En behandling (insulin: %1$.2f, kulhydrater: %2$d, kl: %3$s) kunne ikke tilføjes til behandlinger. Tjek og tilføj venligst en note manuelt efter behov.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), forsinkelse: %3$d m</string>
<string name="openaps_noasdata">Ingen tilgængelige autosens data</string>
<string name="log_files">Logfiler</string>
<string name="miscellaneous">Diverse</string>
<string name="nav_logsettings">Log indstillinger</string>
<string name="resettodefaults">Nulstil til standardindstillinger</string>
<string name="nsmalfunction">NSClient funktionsfejl. Overvej NS og NSClient genstart.</string>
@ -767,6 +777,11 @@
<string name="invalidpct">Ugyldig angivelse af %</string>
<string name="average">Gennemsnit</string>
<string name="tir">Tid i målområde</string>
<string name="day_tir">Dags TIR</string>
<string name="night_tir">Nat TIR</string>
<string name="detailed_14_days">Detaljerede 14 dage</string>
<string name="std_deviation">SD: %1$s</string>
<string name="hba1c">HbA1c: </string>
<string name="activitymonitor">Aktivitetsovervågning</string>
<string name="doyouwantresetstats">Ønsker du at nulstille aktivitetsstatistik?</string>
<string name="statistics">Statistikker</string>
@ -953,6 +968,7 @@
<string name="wear_action_tempt_max_bg_error">Max-BS udenfor området!</string>
<string name="wear_action_tempt_manual_range_message">Midlertidigt mål:\nMin: %1$s\nMax: %2$s\nVarighed: %3$s</string>
<string name="wear_action_tempt_manual_message">Midlertigt mål:\nMål: %1$s\nVarighed: %2$s</string>
<string name="wear_action_tempt_preset_message">Midlertigt mål:\nGrund: %1$s\nMål: %2$s\nVarighed: %3$s</string>
<string name="quick_wizard_message">Hurtigguide: %1$s\nInsulin: %2$.2fE\nKH: %3$dg</string>
<string name="wizard_result">Guide:\nInsulin: %1$.2fE\nKH: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Vis post på enhed:</string>
@ -961,9 +977,11 @@
<string name="wizard_no_active_profile">Ingen aktiv profil angivet!</string>
<string name="wizard_no_cob">Ukendt COB! BG læsning mangler eller nylig app genstart?</string>
<string name="wizard_carbs_constraint">KH begrænsninger overtrådt!</string>
<string name="wizard_explain_calc">Beregner (IC: %1$.1f, ISF: %2$.1f)</string>
<string name="wizard_explain_carbs">Kulhydrater: %1$.2fE</string>
<string name="wizard_explain_cob">COB: %1$.0fg %2$.2fE</string>
<string name="wizard_explain_bg">BS: %1$.2fE</string>
<string name="wizard_explain_iob">IOB: %1$.2fE</string>
<string name="wizard_explain_superbolus">Superbolus: %1$.2fE</string>
<string name="wizard_explain_trend">15\' trend: %1$.2fE</string>
<string name="wizard_explain_percent">Procent: %1$.2fE x %2$d%% ≈ %3$.2fE</string>
@ -990,6 +1008,10 @@
<string name="count_selected">%1$d valgt</string>
<string name="sort_label">Sortér</string>
<string name="dialog_canceled">Dialog annulleret</string>
<string name="veryLow" comment="below 3.1">Meget lav</string>
<string name="low" comment="3.1-3.9">Lav</string>
<string name="high" comment="10.0-13.9">Høj</string>
<string name="veryHigh" comment="above 13.9">Meget høj</string>
<string name="below" comment="below &quot;in range&quot;">Under</string>
<string name="in_range">Inden for området</string>
<string name="above" comment="above &quot;in range&quot;">Over</string>
@ -998,6 +1020,12 @@
<string name="widget_description">AndroidAPS widget</string>
<string name="configure">Indstil gennemsigtighed</string>
<string name="loop_status">Loop status</string>
<string name="graph_scale">Graf skala</string>
<string name="profile1">Profil 1</string>
<string name="profile2">Profil 2</string>
<string name="login">Log ind</string>
<string name="remove_all">Fjern alle</string>
<string name="reset_start">Nulstil start</string>
<string name="a11y_otp_qr_code">QR-kode til opsætning af engangs kodeord</string>
<string name="a11y_open_settings">Åbn indstillinger</string>
<string name="a11y_set_carb_timer">indstil KH alarm</string>
@ -1007,8 +1035,12 @@
<string name="a11y_only_on_watch">kun på ur</string>
<string name="a11y_only_on_phone">kun på telefon</string>
<string name="a11y_drag_and_drop_handle">træk og slip håndtering</string>
<string name="search">Søg</string>
<!-- Aidex Cgms -->
<string name="aidex">GlucoRx Aidex</string>
<string name="aidex_short">Aidex</string>
<string name="description_source_aidex">Modtag BG-værdier fra GlucoRx Aidex CGMS.</string>
<string name="blocked_by_charging">Blokeret af opladningsmuligheder</string>
<string name="blocked_by_connectivity">Blokeret af forbindelsesmuligheder</string>
<string name="no_watch_connected">(Intet ur forbundet)</string>
</resources>

View file

@ -104,9 +104,11 @@
<string name="troubleshooting_wheretoask">Wo kannst Du nach Hilfe für AndroidAPS suchen?</string>
<string name="troubleshooting_fb">Du kannst in der AndroidAPS-Facebook-Gruppe um Rat bitten.</string>
<string name="troubleshooting_wiki">Du solltest die AndroidAPS-Dokumentation lesen (und wiederholt lesen).</string>
<string name="troubleshooting_gitter">Im Discord Channel AndroidAPS kannst Du bei technischen Problemen oder Fragestellungen um Hilfe bitten.</string>
<string name="troubleshooting_yourendo">Du solltest Deine Diabetesklinik / Deinen Diabetologen fragen.</string>
<string name="troubleshooting_hint1">https://androidaps.readthedocs.io/en/latest/CROWDIN/de/Installing-AndroidAPS/Update-to-new-version.html#problembehandlung</string>
<string name="troubleshooting_hint2">https://www.facebook.com/groups/loopedDE/</string>
<string name="troubleshooting_hint3">https://discord.gg/4fQUWHZ4Mw</string>
<string name="insulin_label">Insulin-Plugins</string>
<string name="insulin_ultrarapid">Welches Insulin kann mit dem Ultra-Rapid-Oref-Plugin verwendet werden?</string>
<string name="insulin_fiasp">Fiasp®</string>
@ -121,6 +123,7 @@
<string name="sensitivity_cannula">Das Protokollieren eines Kanülenwechsels setzt das Autosens Verhältnis wieder auf 100% zurück.</string>
<string name="sensitivity_time">Einige der Plugin-Optionen haben konfigurierbare Zeiträume, die vom Benutzer eingestellt werden können.</string>
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/CROWDIN/de/Configuration/Sensitivity-detection-and-COB.html</string>
<string name="sensitivity_hint2">https://androidaps.readthedocs.io/de/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens</string>
<string name="wrongcarbs_label">Fehler bei der KH-Eingabe</string>
<string name="wrongcarbs_whattodo">Was sollst Du tun, wenn Du einen falschen KH-Eintrag gemacht hast?</string>
<string name="wrongcarbs_treatmentstab">Lösche die falsche Eingabe in der Behandlung und gib den richtigen neuen Kohlehydratwert ein.</string>
@ -133,6 +136,19 @@
<string name="wronginsulin_compare">Vergleiche die Werte der Historie in AAPS und Deiner Pumpe (wenn die Pumpe diese Funktion bietet).</string>
<string name="wronginsulin_prime">Gib einen Teil-Bolus des \'nicht erhaltenen\' Insulins mit Spritze / Pen oder durch Befüllen der Kanüle.</string>
<string name="wronginsulin_donothing">Unternimm nichts und lass AndroidAPS die entstehenden hohen Glukosewerte korrigieren.</string>
<string name="cob_label">KH an Board (COB)</string>
<string name="cob_question">Wie beeinflusst das Ändern des ISF-Wertes die COB-Berechnung?</string>
<string name="cob_longer">Steigende ISF absorbiert Kohlenhydrate länger</string>
<string name="cob_shorter">Steigende ISF absorbiert Kohlenhydrate kürzer</string>
<string name="cob_no_effect">Steigende ISF verändert die Dauer für die Kohlenhydrataufnahme nicht</string>
<string name="cob2_question">Wie beeinflusst das Ändern des ISF-Wertes die COB-Berechnung?</string>
<string name="cob2_longer">Steigende IC absorbiert Kohlenhydrate länger</string>
<string name="cob2_shorter">Steigende IC absorbiert Kohlenhydrate kürzer</string>
<string name="cob2_no_effect">Steigende IC verändert die Zeit für die Kohlenhydrataufnahme nicht</string>
<string name="cob3_question">Wie beeinflusst die Änderung des Profil-Prozentsatzes die COB-Berechnung?</string>
<string name="cob3_longer">Die Einstellung des Profils auf 150% verlängert die Zeit für Kohlenhydrataufnahme</string>
<string name="cob3_shorter">Die Einstellung des Profils auf 150% verkürzt die Zeit für Kohlenhydrataufnahme</string>
<string name="cob3_no_effect">Die Einstellung des Profils auf 150% verändert die Zeit für die Kohlenhydrataufnahme nicht</string>
<string name="iob_label">Aktives Insulin (IOB)</string>
<string name="iob_value">IOB wird von den abgegebenen temporären Basalraten beeinflusst.</string>
<string name="iob_hightemp">Eine hohe temporäre Basalrate wird nicht abgegeben, wenn der BZ unterhalb des Zielwerts liegt.</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Sicherheitseinstellungen der Behandlungen</string>
<string name="treatmentssafety_maxbolus_title">Max. erlaubter Bolus [IE]</string>
<string name="treatmentssafety_maxcarbs_title">Max. erlaubte Kohlenhydrate [g]</string>
<string name="treatmentssafety_lgsThreshold_title">BG-Pegel, unterhalb dessen die Aussetzung wegen niedriger Glukoseaussetzung eintritt</string>
<string name="nav_preferences_plugin">%1$s-Einstellungen</string>
<string name="nav_preferences">Einstellungen</string>
<string name="nav_refreshtreatments">Behandlungen von NS aktualisieren</string>
@ -25,6 +26,7 @@
<string name="description_ns_client">Synchronisiert deine Daten mit Nightscout</string>
<string name="description_ama">Stand des Algorithmus in 2017</string>
<string name="description_smb">Der aktuellste Algorithmus für erfahrene Nutzer</string>
<string name="description_smb_dynamic_isf">Neuester Algorithmus für fortgeschrittene Benutzer mit dynamischer/automatischer ISF</string>
<string name="description_overview">Zeigt den aktuellen Status deines Loops und Schaltflächen für die geläufigsten Aktionen an</string>
<string name="description_persistent_notification">Zeigt eine fortlaufende Benachrichtigung mit einer kurzen Übersicht darüber, was dein Loop derzeit tut</string>
<string name="description_profile_local">Definiere ein Profil, was auch offline verfügbar ist.</string>
@ -264,6 +266,7 @@
<string name="configbuilder_shortname">KONF</string>
<string name="loop_shortname">LOOP</string>
<string name="oaps_shortname">OAPS</string>
<string name="dynisf_shortname">DYNISF</string>
<string name="localprofile_shortname">LP</string>
<string name="overview_shortname">HOME</string>
<string name="virtualpump_shortname">VP</string>
@ -430,12 +433,15 @@
<string name="ns_localbroadcasts_title">Aktiviere lokale Broadcasts</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamischer ISF</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF Anpassungsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Anpassungsfaktor für DynamicISF. Stelle mehr als 100 % für aggressivere Korrekturdosen ein, und weniger als 100 % für weniger aggressive Korrekturen.</string>
<string name="enableuam">Aktiviere UAM</string>
<string name="enablesmb">Aktiviere SMB</string>
<string name="enablesmb_summary">Benutze Super-Mikro-Boli anstelle von temporären Basalraten, um eine schnellere Wirkung zu erreichen.</string>
<string name="enableuam_summary">Erkennung von unangekündigten Mahlzeiten</string>
<string name="insulin_oref_peak">Wirkungshoch der IOB-Kurve</string>
<string name="insulin_peak_time">Wirkungshoch [min]</string>
<string name="insulin_peak">Gipfel</string>
<string name="free_peak_oref">Free-Peak Oref</string>
<string name="rapid_acting_oref">Rapid-Acting Oref</string>
<string name="ultrarapid_oref">Ultra-Rapid Oref</string>
@ -497,6 +503,7 @@
<string name="negativeonly">Nur negative</string>
<string name="overview_editquickwizard_usecob">COB Berechnung</string>
<string name="overview_editquickwizard_usetemptarget">Temporäres Ziel Berechnung</string>
<string name="overview_editquickwizard_usepercentage">Prozentuale Berechnung</string>
<string name="loopenabled">Loop aktiviert</string>
<string name="apsselected">APS ausgewählt</string>
<string name="nsclienthaswritepermission">Nightscout-Client hat Schreibrechte</string>
@ -586,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Diesen Wert nennt OpenAPS MaxIOB.\nSolange dieser Wert überschritten wird, wird AndroidAPS kein Insulin abgeben.</string>
<string name="absorption_cutoff_title">Maximale Dauer der Essens-Resorption [h]</string>
<string name="absorption_cutoff_summary">Zeit, nach der jede Mahlzeit mit Sicherheit absorbiert ist. Verbleibende Kohlenhydrate werden danach nicht mehr berücksichtigt.</string>
<string name="treatmentssafety_lgsThreshold_summary">Der BG-Wert, unter dem die Insulinzuführung ausgesetzt wird. Der Standardwert verwendet das Standard-Zielmodell. Der Benutzer kann einen Wert zwischen 60mg/dl (3.3 mmol/l) und 100mg/dl (5.5mmol/l) setzen. Werte unterhalb 65/3.6 führen zur Verwendung des Standardmodells</string>
<string name="overview_show_notes_field_in_dialogs_title">Zeige Feld für Notizen in den Behandlungsdialogen</string>
<string name="next_button">Weiter</string>
<string name="previous_button">Zurück</string>
@ -598,7 +606,11 @@
<string name="secondcarbsincrement">Zweite KH-Erhöhung</string>
<string name="thirdcarbsincrement">Dritte KH-Erhöhung</string>
<string name="cgm">CGM</string>
<string name="ns_cellular">Mobilfunkverbindung verwenden</string>
<string name="ns_wifi">WLAN Verbindung verwenden</string>
<string name="ns_wifi_ssids">WLAN SSID</string>
<string name="ns_charging">Während des Ladevorgangs</string>
<string name="ns_battery">Bei Batteriebetrieb</string>
<string name="connectionsettings_title">Verbindungs-Einstellungen</string>
<string name="ns_wifi_allowedssids">Erlaubte SSIDs (durch Semikolon getrennt)</string>
<string name="ns_allowroaming">Erlaube Verbindung bei Roaming</string>
@ -653,8 +665,10 @@
<string name="resistance_lowers_target_summary">Wenn Resistenz festgestellt wird, senke den Glukose-Zielwert</string>
<string name="sensitivity_raises_target_title">Empfindlichkeit erhöht den Zielwert</string>
<string name="sensitivity_raises_target_summary">Wenn eine höhere Empfindlichkeit festgestellt wird, wird der Glukose-Zielwert erhöht.</string>
<string name="careportal_removestartedevents">\"AndroidAPS gestartet\" Ereignisse löschen</string>
<string name="show_invalidated">Zeige Ungültige</string>
<string name="hide_invalidated">Verstecke Ungültige</string>
<string name="remove_items">Objekte entfernen</string>
<string name="sort_items">Einträge sortieren</string>
<string name="storedsettingsfound">Gespeicherte Einstellungen gefunden</string>
<string name="allow_hardware_pump_text">WARNUNG: Wenn Du eine echte Pumpe aktivierst und anschließt, kopiert AndroidAPS die Basaleinstellungen vom aktiven Profil zur Pumpe (und behält sie bei). Die Einstellungen in der Pumpe werden hierbei überschrieben. Wenn Du Dir nicht sicher bist oder die Basaleinstellungen in der Pumpe nicht überschreiben möchten, drücke \"Abbrechen\" und vollziehe den Wechsel zur Pumpe später.</string>
<string name="error_adding_treatment_title">Behandlungsdaten unvollständig</string>
@ -669,6 +683,8 @@
<string name="error_adding_treatment_message">Der Eintrag (Insulin: %1$.2f, Kohlenhydrate: %2$d, um: %3$s) konnte nicht als Behandlung gespeichert werden. Bitte überprüfe die aktuelle Liste und füge, falls notwendig, den Datensatz manuell hinzu.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), Verzögerung: %3$d m</string>
<string name="openaps_noasdata">Keine Autosens-Daten verfügbar</string>
<string name="log_files">Log Dateien</string>
<string name="miscellaneous">Verschiedenes</string>
<string name="nav_logsettings">Log-Einstellungen</string>
<string name="resettodefaults">Auf Standardwerte zurücksetzen</string>
<string name="nsmalfunction">NSClient Störung. Ziehe einen Neustart von NS und NSClient in Betracht.</string>
@ -762,6 +778,11 @@ Unerwartetes Verhalten.</string>
<string name="invalidpct">Ungültige % Eingabe</string>
<string name="average">Durchschnitt</string>
<string name="tir">TIR</string>
<string name="day_tir">Tages TIR</string>
<string name="night_tir">Nacht TIR</string>
<string name="detailed_14_days">Detaillierte 14 Tage</string>
<string name="std_deviation">SD: %1$s</string>
<string name="hba1c">HbA1c: </string>
<string name="activitymonitor">Aktivitätsmonitor</string>
<string name="doyouwantresetstats">Willst Du die Aktivitätsstatistik zurücksetzen?</string>
<string name="statistics">Statistiken</string>
@ -802,6 +823,7 @@ Unerwartetes Verhalten.</string>
<string name="smscommunicator_otp_install_info">Installiere auf jedem Follower-Phone eine Authenticator-App, die RFC 6238 TOTP-Token unterstützt. Beliebte kostenlose Apps sind:\n Authy\n Google Authenticator\n LastPass Authenticator\n FreeOTP Authenticator</string>
<string name="smscommunicator_otp_reset_warning">Wenn Du den Authentifikator zurücksetzt werden alle bestehenden Authentifikatoren ungültig. Du musst sie dann neu einrichten!</string>
<string name="overview_show_predictions">Predictions (Vorhersagen)</string>
<string name="overview_show_treatments">Behandlungen</string>
<string name="overview_show_deviationslope">Steigung der Abweichung</string>
<string name="authorizationfailed">Autorisierung fehlgeschlagen</string>
<string name="overview_show_absinsulin">Gesamtinsulin</string>
@ -871,6 +893,8 @@ Unerwartetes Verhalten.</string>
<string name="ns_receive_profile_switch_summary">Profilwechsel akzeptieren, die in NS oder NSClient eingegeben wurden</string>
<string name="ns_receive_offline_event">APS Offline-Ereignisse empfangen</string>
<string name="ns_receive_offline_event_summary">APS Offline-Ereignisse akzeptieren, die über NS oder NSClient eingegeben wurden</string>
<string name="ns_receive_tbr_eb">TBR und EB empfangen</string>
<string name="ns_receive_tbr_eb_summary">Akzeptiere TBR und EB, die von einer anderen Instanz eingegeben wurden</string>
<string name="ns_receive_insulin">Insulin abrufen</string>
<string name="ns_receive_insulin_summary">Insulin akzeptieren, das in NS oder NSClient eingegeben wurden</string>
<string name="ns_receive_carbs">Kohlenhydrate abrufen</string>
@ -889,9 +913,11 @@ Unerwartetes Verhalten.</string>
<string name="error_in_isf_values">Fehler in ISF-Werten</string>
<string name="run_question">%s ausführen?</string>
<string name="invalid_profile_not_accepted">Ungültiges Profil %1$s wurde von NS nicht akzeptiert</string>
<string name="view">Ansicht</string>
<string name="errors">Fehler</string>
<string name="ns_sync_slow">Hochladen verlangsamen</string>
<string name="data_status">Status BZ-Daten</string>
<string name="remove_bg_readings">BG-Werte entfernen</string>
<string name="statuslights_cannula_age">Kanülenalter</string>
<string name="statuslights_patch_pump_age">Alter Patchpumpe</string>
<string name="patch_pump">Patch-Pumpe</string>
@ -929,7 +955,46 @@ Unerwartetes Verhalten.</string>
<string name="a11y_delete_current_profile">aktuelles Profil löschen</string>
<string name="a11y_add_new_to_list">neu zur Liste hinzufügen</string>
<!-- Theme switcher dark and light mode-->
<string name="theme_switcher_summary">Wähle das dunkle, helle oder das Systemdesign</string>
<string name="app_color_scheme">App Farbschema</string>
<string name="dark_theme">Dunkles Design</string>
<string name="light_theme">Helles Design</string>
<string name="follow_system_theme">Systemdesign verwenden</string>
<!-- WEAR OS-->
<string name="wear_action_tempt_preset_error">Temp-Target unbekannte Voreinstellung: %1$s</string>
<string name="wear_action_tempt_cancel_message">Ausführung des Temp-Targets abbrechen?</string>
<string name="wear_action_tempt_unit_error">Verschiedene Einheiten werden auf Uhr und Telefon verwendet!</string>
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - abbrechen des laufenden Temp-Targets?</string>
<string name="wear_action_tempt_min_bg_error">Min-BG ist außerhalb des Bereichs!</string>
<string name="wear_action_tempt_max_bg_error">Max-BG ist außerhalb des Bereichs!</string>
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDauer: %3$s</string>
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDauer: %2$s</string>
<string name="wear_action_tempt_preset_message">Temp-Target:\nGrund: %1$s\nTarget: %2$s\nDauer: %3$s</string>
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
<string name="wizard_result">Calc. Wizard:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Zeige Eintrag auf dem Gerät:</string>
<string name="quick_wizard_not_available">Ausgewählter Quickwizard nicht mehr verfügbar, bitte aktualisiere die Kachel</string>
<string name="wizard_no_actual_bg">Kein aktueller BG liegt als Basis zur Berechnung vor!</string>
<string name="wizard_no_active_profile">Kein aktives Profil gesetzt!</string>
<string name="wizard_no_cob">Unbekannter COB! BG-Wert fehlt oder wurde App vor kurzem neu gestartet?</string>
<string name="wizard_carbs_constraint">Die Kohlenhydrateinschränkung wurde überschritten!</string>
<string name="wizard_explain_calc">Calc (IC: %1$.1f, ISF: %2$.1f)</string>
<string name="wizard_explain_carbs">Kohlenhydrate: %1$.2fU</string>
<string name="wizard_explain_cob">COB: %1$.0fg %2$.2fU</string>
<string name="wizard_explain_bg">BZ: %1$.2fU</string>
<string name="wizard_explain_iob">IOB: %1$.2fU</string>
<string name="wizard_explain_superbolus">Superbolus: %1$.2fU</string>
<string name="wizard_explain_trend">15\' Trend: %1$.2fU</string>
<string name="wizard_explain_percent">Prozent: %1$.2fU x %2$d%% ≈ %3$.2fU</string>
<string name="wizard_constraint_bolus_size">Verletzung der Bolusbeschränkung!\nKann %1$.2fU nicht abgeben</string>
<string name="wizard_explain_tt">TempT: %1$s</string>
<string name="wizard_explain_tt_to">%1$s zu %2$s</string>
<string name="wizard_pump_not_available">Keine Pumpe verfügbar!</string>
<string name="wear_unknown_action_string">Unbekannter Actionbefehl:</string>
<string name="overview_editquickwizard_percentage">Prozentsatz</string>
<string name="app_default">Standardwert der Anwendung</string>
<string name="show_invalidated_records">Zeige ungültige / gelöschte Einträge</string>
<string name="hide_invalidated_records">Verberge ungültige / gelöschte Einträge</string>
<string name="select_profile">Profil zum Bearbeiten auswählen</string>
<string name="refresh_from_nightscout">Aktualisiere von Nightscout</string>
<string name="remove_selected_items">Ausgewähltes Objekt löschen</string>
@ -938,8 +1003,47 @@ Unerwartetes Verhalten.</string>
<string name="tempt_targets">Temporäre Ziele</string>
<string name="carbs_and_bolus">Kohlenhydrate &amp; Bolus</string>
<string name="confirm_remove_multiple_items">Sind Sie sicher, dass Sie diese(s) %1$d Element(e) löschen möchten?</string>
<string name="no_records_available">Keine Datensätze verfügbar</string>
<string name="hide_loop">Verberge Loop</string>
<string name="show_loop">Zeige Loop an</string>
<string name="count_selected">%1$d ausgewählt</string>
<string name="sort_label">Sortieren</string>
<string name="dialog_canceled">Dialog abgebrochen</string>
<string name="veryLow" comment="below 3.1">Sehr niedrig</string>
<string name="low" comment="3.1-3.9">Niedrig</string>
<string name="high" comment="10.0-13.9">Hoch</string>
<string name="veryHigh" comment="above 13.9">Sehr hoch</string>
<string name="below" comment="below &quot;in range&quot;">Unter</string>
<string name="in_range">Im Zielbereich</string>
<string name="above" comment="above &quot;in range&quot;">Über</string>
<string name="show_loop_records">Zeige Loop Datensätze</string>
<string name="show_hide_records">Verberge Loop Datensätze</string>
<string name="widget_description">AndroidAPS Widget</string>
<string name="configure">Deckkraft konfigurieren</string>
<string name="loop_status">Loop Status</string>
<string name="graph_scale">Diagrammskala</string>
<string name="profile1">Profil 1</string>
<string name="profile2">Profil 2</string>
<string name="login">Login</string>
<string name="remove_all">Alle entfernen</string>
<string name="reset_start">Start zurücksetzen</string>
<string name="a11y_otp_qr_code">QR Code für einmaliges Passwort einrichten</string>
<string name="a11y_open_settings">Einstellungen öffnen</string>
<string name="a11y_set_carb_timer">setze Alarm für KH Timer</string>
<string name="device_all">Alle</string>
<string name="device_phone">Smartphone</string>
<string name="device_watch">Smartwatch</string>
<string name="a11y_only_on_watch">nur auf Uhr</string>
<string name="a11y_only_on_phone">nur auf Telefon</string>
<string name="a11y_drag_and_drop_handle">Drag and Drop Handle</string>
<string name="search">Suche</string>
<!-- Aidex Cgms -->
<string name="aidex">GlucoRx Aidex</string>
<string name="aidex_short">Aidex</string>
<string name="description_source_aidex">Erhalte BG-Werte von GlucoRx Aidex CGMS.</string>
<string name="blocked_by_charging">Blockiert durch Ladeoptionen</string>
<string name="blocked_by_connectivity">Blockiert durch Verbindungsoptionen</string>
<string name="no_watch_connected">(keine Uhr verbunden)</string>
<string name="error_asking_for_permissions">Fehler beim Anfordern der Erlaubnis</string>
<string name="dynisf_adjust_sensitivity">Empfindlichkeit und BZ anpassen</string>
</resources>

View file

@ -502,7 +502,6 @@
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Αύξηση ευαισθησίας για προσωρινό στόχο > = 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Ο χαμηλός προσωρινός στόχος μειώνει την ευαισθησία</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Χαμηλότερη ευαισθησία για προσωρινό στόχο < 100]]></string>
<string name="careportal_removestartedevents">Ξεκίνησε το AndroidAPS καθαρό</string>
<string name="storedsettingsfound">Βρέθηκαν αποθηκευμένες ρυθμίσεις</string>
<string name="allow_hardware_pump_text">Προσοχή: Εάν ενεργοποιήσετε και συνδεθείτε με μια αντλία, το AndroidAPS θα αντιγράψει τις ρυθμίσεις βασικού από το προφίλ στην αντλία, αντικαθιστώντας τον υπάρχων βασικό ρυθμό της αντλίας. Βεβαιωθείτε ότι έχετε τον σωστό βασικό ρυθμό στο AndroidAPS. Εάν δεν είστε βέβαιοι ή δεν θέλετε να αντικαταστήσετε τον βασικό ρυθμό στην αντλία σας, πατήστε Άκυρο και επαναλάβετε εναλλαγή προς την αντλία σε μεταγενέστερο χρόνο.</string>
<string name="error_adding_treatment_title">Ελλιπή δεδομένα θεραπείας</string>

View file

@ -656,6 +656,8 @@
<string name="description_source_poctech">Recibir los valores de glucosa de Poctech</string>
<string name="glunovo">Glunovo</string>
<string name="description_source_glunovo">Recibir los valores de glucosa de la aplicación Glunovo</string>
<string name="intelligo">Intelligo</string>
<string name="description_source_intelligo">Recibir los valores de glucosa de Intelligo</string>
<string name="description_source_tomato">Recibir los valores de glucosa de Tomato App (MiaoMiao) </string>
<string name="high_temptarget_raises_sensitivity_title">Objetivo temporal elevado aumenta sensibilidad</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Aumentar la sensibilidad para objetivos temporales >= 100]]></string>
@ -665,7 +667,7 @@
<string name="resistance_lowers_target_summary">Cuando se detecta resistencia a la insulina, disminuye el objetivo de glucosa</string>
<string name="sensitivity_raises_target_title">Sensibilidad aumenta el objetivo</string>
<string name="sensitivity_raises_target_summary">Cuando se detecta sensibilidad a la insulina, aumenta el objetivo de glucosa</string>
<string name="careportal_removestartedevents">Comenzar la limpieza de AndroidAPS</string>
<string name="careportal_removestartedevents">Eliminar registros de inicio de AAPS</string>
<string name="show_invalidated">Mostrar invalidados</string>
<string name="hide_invalidated">Ocultar invalidados</string>
<string name="remove_items">Eliminar elementos</string>
@ -1044,4 +1046,6 @@
<string name="blocked_by_charging">Bloqueado por opciones de carga</string>
<string name="blocked_by_connectivity">Bloqueado por opciones de conectividad</string>
<string name="no_watch_connected">(Ningún reloj conectado)</string>
<string name="error_asking_for_permissions">Error al solicitar permisos</string>
<string name="dynisf_adjust_sensitivity">Ajustar sensibilidad y glucosa</string>
</resources>

View file

@ -657,6 +657,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="description_source_poctech">Recevoir les glycémies depuis l\'app Poctech</string>
<string name="glunovo">Glunovo</string>
<string name="description_source_glunovo">Recevoir des valeurs de l\'application Glunovo</string>
<string name="intelligo">Intelligo</string>
<string name="description_source_intelligo">Recevoir des valeurs depuis l\'application Intelligo</string>
<string name="description_source_tomato">Recevoir les valeurs de glycémie de l\'application Tomato (appareil MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">Cible temp. haute élève la sensibilité</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Augmente la Sensibilité pour les cibles temporaires >= 100]]></string>
@ -666,7 +668,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="resistance_lowers_target_summary">Quand une résistance est détectée, baisse de la glycémie cible</string>
<string name="sensitivity_raises_target_title">Sensibilité augmente la cible</string>
<string name="sensitivity_raises_target_summary">Quand une sensibilité est détectée, augmentation de la glycémie cible</string>
<string name="careportal_removestartedevents">Réinitialiser AndroidAPS</string>
<string name="careportal_removestartedevents">Suppr. entrées \"Démarrage AAPS\"</string>
<string name="show_invalidated">Montrer les entrées invalides</string>
<string name="hide_invalidated">Masquer les entrées invalides</string>
<string name="remove_items">Supprimer des entrées</string>
@ -1044,4 +1046,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="blocked_by_charging">Bloqué par les options de recharge</string>
<string name="blocked_by_connectivity">Bloqué par les options de connectivité</string>
<string name="no_watch_connected">(Pas de montre connectée)</string>
<string name="error_asking_for_permissions">Erreur lors de la demande des autorisations</string>
<string name="dynisf_adjust_sensitivity">Ajuster la sensibilité et la glycémie</string>
</resources>

View file

@ -3,184 +3,6 @@
<!-- <string name="fi_lang" translatable="false">Finnish</string> -->
<!-- <string name="he_lang" translatable="false">Hebrew</string> -->
<!-- <string name="ja_lang" translatable="false">Japanese</string> -->
<string name="nav_preferences_plugin">%1$s Sainroghanna</string>
<string name="nav_preferences">Sainroghanna</string>
<string name="reset_db_confirm">An bhfuil tú cinnte gur mian leat an bhunachair sonraí a athshocrú?</string>
<string name="nav_exit">Scoir</string>
<string name="description_source_mm640g">Luachanna BG a fháil ón 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Sonraí a íoslódáil ó Nightscout</string>
<string name="description_source_xdrip">Luachanna BG a fháil ó xDrip+.</string>
<string name="treatments_insulin_label_string">Inslin:</string>
<string name="treatments_carbs_label_string">Carbí:</string>
<string name="treatments_iob_label_string">IOB:</string>
<string name="sms_iob">IOB:</string>
<string name="treatments_iobtotal_label_string">Lomlán IOB:</string>
<string name="tempbasals_realduration_label_string">Fad:</string>
<string name="tempbasals_netratio_label_string">Cóimheas:</string>
<string name="tempbasals_netinsulin_label_string">Ins:</string>
<string name="tempbasals_iob_label_string">IOB:</string>
<string name="tempbasals_iobtotal_label_string">Lomlán IOB:</string>
<string name="treatments_wizard_bg_label">BG</string>
<string name="treatments_wizard_tt_label">TT</string>
<string name="treatments_wizard_carbs_label">Carbí</string>
<string name="treatments_wizard_correction_label">Cear</string>
<string name="openapsma_run">Reáchtáil anois</string>
<string name="openapsma_lastrun_label">Reáchtáil deiridh</string>
<string name="openapsma_glucosestatus_label">Glúcóis stádas</string>
<string name="openapsma_profile_label">Próifíl</string>
<string name="result">Toradh</string>
<string name="result_insulin_carbs">Toradh: %1$s %2$s</string>
<string name="delta">Deilte</string>
<string name="sms_delta">Deilte:</string>
<string name="treatments">Cóireálacha</string>
<string name="configbuilder_pump">Caidéil</string>
<string name="configbuilder_profile">Próifíl</string>
<string name="configbuilder_aps">APS</string>
<string name="configbuilder_general">Ginearálta</string>
<string name="constraints">Srianta</string>
<string name="configbuilder_loop">Lúb</string>
<string name="loop_aps_label">APS</string>
<string name="overview_calculator_label">Áireamhán</string>
<string name="sms_bolus">Bólas:</string>
<string name="sms_basal">Bunaidh:</string>
<string name="configbuilder_bgsource">Foinse BG</string>
<string name="xdrip">xDrip+</string>
<string name="apsmode_title">APS mód</string>
<string name="closedloop">Lúb dúnta</string>
<string name="openloop">Lúb oscailte</string>
<string name="disabledloop">Lúb díchumasaithe</string>
<string name="treatments_wizard_basaliob_label">Bunaidh IOB</string>
<string name="careportal_newnstreatment_other">Eile</string>
<string name="careportal_newnstreatment_sensor">Braiteoir</string>
<string name="careportal_newnstreatment_duration_label">Fad</string>
<string name="careportal_newnstreatment_glucosetype">Glúcóis cineál</string>
<string name="exported">Easpórtáil Socruithe</string>
<string name="export_to">Socruithe Easpórtáil chun</string>
<string name="nav_export">Socruithe Easpórtáil</string>
<string name="nav_import">Socruithe Iompórtáil</string>
<string name="check_preferences_import_btn">Iompórtáil</string>
<string name="save">Sábháil</string>
<string name="reloadprofile">Athlódáil próifíl</string>
<string name="smscommunicator_loophasbeendisabled">Is lúb díchumasaithe</string>
<string name="smscommunicator_loophasbeenenabled">Is lúb cumasaithe</string>
<string name="smscommunicator_loopisenabled">Is lúb cumasaithe</string>
<string name="smscommunicator_tempbasalcancelfailed">Cealú TBR teip</string>
<string name="overview_editquickwizard_carbs">Carbí:</string>
<string name="overview_editquickwizard_valid">Bailí:</string>
<string name="overview_editquickwizardlistactivity_add">Cuir</string>
<string name="overview_quickwizard_item_edit_button">In eagar</string>
<string name="correctionbous">Cear</string>
<string name="actions">Gníomhartha</string>
<string name="button1">Cnaipe 1</string>
<string name="button2">Cnaipe 2</string>
<string name="button3">Cnaipe 3</string>
<string name="units_colon">Aonaid:</string>
<string name="units">Aonaid</string>
<string name="dia">DIA</string>
<string name="sms_actualbg">BG:</string>
<string name="sms_lastbg">GF deiridh:</string>
<string name="MM640g">MM640g</string>
<string name="sms_minago">%1$dnóim ó shin</string>
<string name="openapsama">OpenAPS AMA</string>
<string name="actions_shortname">GNÍ</string>
<string name="loop_shortname">LÚB</string>
<string name="oaps_shortname">OAPS</string>
<string name="overview_shortname">BAILE</string>
<string name="wear_shortname">WEAR</string>
<string name="smscommunicator_shortname">SMS</string>
<string name="profile">Próifíl</string>
<string name="overview_calibration">Calabrú</string>
<string name="pumpsuspended">Caidéil ar fionraí</string>
<string name="executing">Feidhmiú</string>
<string name="nsclientinternal_url">URL:</string>
<string name="restart">Atosaigh</string>
<string name="deliver_now">Seachadadh anois</string>
<string name="status">Stádas:</string>
<string name="patientage">Othar cineál</string>
<string name="child">Páiste</string>
<string name="teenage">Déagóirí</string>
<string name="adult">Duine fásta</string>
<string name="patient_name">Ainm cineál</string>
<string name="Glimp">Glimp</string>
<string name="loopsuspended">Lúb ar fionraí</string>
<string name="loopsuspendedfor">Ar fionraí (%1$d nóim)</string>
<string name="suspendloopfor1h">Fionraí lúb do 1 u</string>
<string name="suspendloopfor2h">Fionraí lúb do 2 u</string>
<string name="suspendloopfor3h">Fionraí lúb do 3 u</string>
<string name="suspendloopfor10h">Fionraí lúb do 10 u</string>
<string name="disconnectpump">Dhícheangal Caidéil</string>
<string name="disconnectpumpfor15m">Dhícheangal Caidéil do 15 nóim</string>
<string name="disconnectpumpfor30m">Dhícheangal Caidéil do 30 nóim</string>
<string name="disconnectpumpfor1h">Dhícheangal Caidéil do 1 u</string>
<string name="disconnectpumpfor2h">Dhícheangal Caidéil do 2 u</string>
<string name="disconnectpumpfor3h">Dhícheangal Caidéil do 3 u</string>
<string name="duration15m">15 nóim</string>
<string name="duration30m">30 nóim</string>
<string name="duration1h">1 uair</string>
<string name="duration2h">2 uair</string>
<string name="duration3h">3 uair</string>
<string name="duration10h">10 uair</string>
<string name="resume">Atosú</string>
<string name="smscommunicator_loopsuspended">Lúb ar fionraí</string>
<string name="smscommunicator_loopresumed">Lúb atógáil</string>
<string name="treatments_wizard_cob_label">COB</string>
<string name="ultrafastactinginsulincomment">Fiasp</string>
<string name="insulin_shortname">INS</string>
<string name="basal_shortname">BUN</string>
<string name="activity_shortname">GNÍ</string>
<string name="nav_about">Faoi</string>
<string name="xdripstatus_shortname">xds</string>
<string name="careportal_sensor_label">Braiteoir</string>
<string name="careportal_insulin_label">Inslin</string>
<string name="careportal_pb_label">Caidéil ceallraí</string>
<string name="careportal_age_label">aois:</string>
<string name="ns_alarmoptions">Aláraim roghanna</string>
<string name="openaps">OpenAPS</string>
<string name="openaps_short">OAPS</string>
<string name="basal_short">BUN</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="rapid_acting_oref">Rapid-Acting Oref</string>
<string name="lyumjev">Lyumjev</string>
<string name="careportal_newnstreatment_percentage_label">Céatadán</string>
<string name="activity_duration">Gníomhaíocht fad</string>
<string name="activity_target">Gníomhaíocht sprioc</string>
<string name="food">Bia</string>
<string name="shortgramm">g</string>
<string name="shortkilojoul">kJ</string>
<string name="loopenabled">Lúb cumasaithe</string>
<string name="apsselected">APS roghnaithe</string>
<string name="overview_insulin_label">Inslin</string>
<string name="overview_buttons_selection">Cnaipi</string>
<string name="overview_cgm">CGM</string>
<string name="temptargetshort">TT</string>
<string name="category">Catagóir</string>
<string name="overview_show_activity">Gníomhaíocht</string>
<string name="overview_show_basals">Bunaidhi</string>
<string name="food_short">Bia</string>
<string name="next_button">Ar Aghaidh</string>
<string name="previous_button">Roimhe seo</string>
<string name="cgm">CGM</string>
<string name="ns_wifi_ssids">WiFi SSID</string>
<string name="wear_general_settings">Socruithe Ginearálta</string>
<string name="poctech">Poctech</string>
<string name="treatments_wizard_total_label">Lomlán</string>
<string name="profile_total">== ∑ %1$s A</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="tidepool">Tidepool</string>
<string name="tidepool_shortname">TDP</string>
<string name="twohours">2u</string>
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
<string name="format_percent">%1$d%%</string>
<string name="unit_minute_short">nóim</string>
<string name="profile_name">Ainm Próifíle:</string>
<string name="unitsnosemicolon">Aonaid</string>
<string name="dia_short">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="randombg_short">BG</string>
<!-- SMS Communicator & OTP Authenticator -->
<!-- Theme switcher dark and light mode-->
<!-- WEAR OS-->

View file

@ -656,6 +656,8 @@
<string name="description_source_poctech">Ricevi valori glicemia da app Poctech</string>
<string name="glunovo">Glunovo</string>
<string name="description_source_glunovo">Ricevi valori glicemia da app Glunovo</string>
<string name="intelligo">Intelligo</string>
<string name="description_source_intelligo">Ricevi valori da app Intelligo</string>
<string name="description_source_tomato">Ricevi valori glicemia da app Tomato (dispositivo MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">Temp-Target \"alto\" aumenta la sensibilità</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Aumenta la sensibilità per temp-target >= 100]]></string>
@ -665,7 +667,7 @@
<string name="resistance_lowers_target_summary">Quando viene rilevata resistenza, ridurre la glicemia target</string>
<string name="sensitivity_raises_target_title">La sensibilità aumenta il target</string>
<string name="sensitivity_raises_target_summary">Quando viene rilevata sensibilità, aumentare la glicemia target</string>
<string name="careportal_removestartedevents">Rimuovi gli eventi \"AndroidAPS avviato\"</string>
<string name="careportal_removestartedevents">Rimuovi le voci \"AAPS avviato\"</string>
<string name="show_invalidated">Mostra invalidato</string>
<string name="hide_invalidated">Nascondi invalidato</string>
<string name="remove_items">Rimuovi elementi</string>
@ -1044,4 +1046,6 @@
<string name="blocked_by_charging">Bloccato dalle opzioni di ricarica</string>
<string name="blocked_by_connectivity">Bloccato dalle opzioni di connettività</string>
<string name="no_watch_connected">(Nessuno smartwatch connesso)</string>
<string name="error_asking_for_permissions">Errore nel richiedere le autorizzazioni</string>
<string name="dynisf_adjust_sensitivity">Regola sensibilità e BG</string>
</resources>

View file

@ -656,6 +656,8 @@
<string name="description_source_poctech">קבלת ערכי סוכר מיישום Poctech</string>
<string name="glunovo">Glunovo</string>
<string name="description_source_glunovo">קבלת ערכי סוכר מיישום Glunovo</string>
<string name="intelligo">Intelligo</string>
<string name="description_source_intelligo">קבלת ערכי סוכר מיישום Intelligo</string>
<string name="description_source_tomato">קבלת ערכי סוכר מאפליקציית Tomato (התקן MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">ערך מטרה זמני גבוה מעלה את הרגישות</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[הגבר רגישות עבור ערך מטרה זמני >= 100]]></string>
@ -665,7 +667,8 @@
<string name="resistance_lowers_target_summary">כשמזוהה תנגודת, הורד את ערך המטרה של הגלוקוז</string>
<string name="sensitivity_raises_target_title">רגישות מעלה את ערך המטרה</string>
<string name="sensitivity_raises_target_summary">כשמזוהה רגישות, הגדל את ערך המטרה של הגלוקוז</string>
<string name="careportal_removestartedevents">מחק אירועי \"AndroidAPS Started\"</string>
<string name="show_invalidated">הצג פסולים</string>
<string name="hide_invalidated">הסתר פסולים</string>
<string name="remove_items">הסר פריטים</string>
<string name="sort_items">מיין פריטים</string>
<string name="storedsettingsfound">נמצאו הגדרות שמורות</string>
@ -1040,4 +1043,6 @@
<string name="blocked_by_charging">חסום ע\"י הגדרות טעינה</string>
<string name="blocked_by_connectivity">חסום ע\"י הגדרות חיבור</string>
<string name="no_watch_connected">(השעון לא מחובר)</string>
<string name="error_asking_for_permissions">שגיאה בעת בקשת הרשאות</string>
<string name="dynisf_adjust_sensitivity">כיוונון הרגישות והסוכר בדם</string>
</resources>

View file

@ -639,7 +639,6 @@
<string name="resistance_lowers_target_summary">저항성이 감지되면, 목표 혈당을 낮춥니다.</string>
<string name="sensitivity_raises_target_title">민감성이 목표 올리기</string>
<string name="sensitivity_raises_target_summary">민감성이 감지되면, 목표 혈당을 높입니다.</string>
<string name="careportal_removestartedevents">\"AndroidAPS 시작\" 기록 삭제하기</string>
<string name="storedsettingsfound">저장된 설정이 있습니다.</string>
<string name="allow_hardware_pump_text">주의: 활성화하고 펌프에 연결하게되면, AndroidAPS는 프로파일의 Basal설정을 복사해서 기존에 펌프에 저장되어 있던 Basal설정을 덮어쓰게 될것입니다. AndroidAPS의 Basal설정이 올바른지 반드시 확인하세요. 만약 확실치 않거나 Basal설정을 덮어씌우길 원치않는다면, 취소버튼을 누르고 나중에 다시 연결하세요.</string>
<string name="error_adding_treatment_title">관리 데이터가 불완전합니다</string>

View file

@ -651,7 +651,6 @@
<string name="resistance_lowers_target_summary">Kai nustatoma rezistencija, tikslinė gliukozės vertė sumažinama</string>
<string name="sensitivity_raises_target_title">Jautrumas didina tikslą</string>
<string name="sensitivity_raises_target_summary">Kai aptinkamas padidėjęs jautrumas insulinui, tikslinis gliukozės lygis padidinamas</string>
<string name="careportal_removestartedevents">Ištrinti \"AndroidAPS paleista\" įrašus</string>
<string name="storedsettingsfound">Rasti išsaugoti nustatymai</string>
<string name="allow_hardware_pump_text">Dėmesio: jei aktyvuosite ir prijungsite prie aparatinės pompos, AndroidAPS nukopijuos bazės nustatymus iš profilio į pompą, pakeisdamas esančius nustatymus pompoje. Įsitikinkite, kad turimi bazės nustatymai AndroidAPS yra teisingi. Jei nesate tikri arba nenorite iš naujo keisti bazės nustatymų jūsų pompoje, paspauskite atšaukti ir pakartokite prijungimą prie pompos kitą kartą.</string>
<string name="error_adding_treatment_title">Terapijos duomenys nepilni</string>

View file

@ -665,7 +665,6 @@
<string name="resistance_lowers_target_summary">Wanneer insulineresistentie wordt gedetecteerd, wordt het BG streefdoel verlaagd</string>
<string name="sensitivity_raises_target_title">Gevoeligheid verhoogt het doel</string>
<string name="sensitivity_raises_target_summary">Wanneer insulinegevoeligheid wordt gedetecteerd, wordt het BG streefdoel verhoogd</string>
<string name="careportal_removestartedevents">Verwijder AndroidAPS start-meldingen</string>
<string name="show_invalidated">Toon ongeldig</string>
<string name="hide_invalidated">Verberg ongeldig</string>
<string name="remove_items">Items verwijderen</string>

View file

@ -665,7 +665,7 @@
<string name="resistance_lowers_target_summary">Hvis resistens oppdages vil det redusere BS målverdi</string>
<string name="sensitivity_raises_target_title">Sensitivitet øker BS målverdi</string>
<string name="sensitivity_raises_target_summary">Når systemet oppdager økt insulinsensitivitet, vil BS målverdi økes</string>
<string name="careportal_removestartedevents">Basis AndroidAPS startet</string>
<string name="careportal_removestartedevents">Fjern oppføringer startet av AAPS</string>
<string name="show_invalidated">Vis ugyldige oppføringer</string>
<string name="hide_invalidated">Skjul ugyldige oppføringer</string>
<string name="remove_items">Fjern oppføringer</string>
@ -1044,4 +1044,6 @@
<string name="blocked_by_charging">Blokkert på grunn av ladealternativer</string>
<string name="blocked_by_connectivity">Blokkert på grunn av tilkoblingsalternativer</string>
<string name="no_watch_connected">(Ingen klokke tilkoblet)</string>
<string name="error_asking_for_permissions">Feil under spørring etter tillatelser</string>
<string name="dynisf_adjust_sensitivity">Juster sensitivitet og BS</string>
</resources>

View file

@ -652,7 +652,6 @@
<string name="resistance_lowers_target_summary">Po wykryciu oporności obniża się docelowy poziom cukru</string>
<string name="sensitivity_raises_target_title">Wrażliwość podnosi docelowy poziom glukozy</string>
<string name="sensitivity_raises_target_summary">Po zwiększeniu wrażliwości zwiększ docelowy poziom glukozy</string>
<string name="careportal_removestartedevents">Wyczyść zdarzenia \"Start AndroidAPS\"</string>
<string name="storedsettingsfound">Znaleziono zapisane ustawienia</string>
<string name="allow_hardware_pump_text">Uwaga: Jeśli aktywujesz połączenie z pompą inną niż wirtualna, AndroidAPS skopiuje ustawienia bazy do profilu pompy, zastępując istniejące ustawienia w niej zapisane. Upewnij się, że ustawienia bazy w AndroidAPS są poprawne. Jeśli nie jesteś pewien lub nie chcesz nadpisywać podstawowych ustawień pompy, naciśnij przycisk anuluj i połącz ponownie w innym czasie.</string>
<string name="error_adding_treatment_title">Niekompletne dane leczenie</string>

View file

@ -552,7 +552,7 @@
<string name="smbnotallowedinopenloopmode">SMB não permitido no modo open loop</string>
<string name="food_short">Alimentos</string>
<string name="reset">repor</string>
<string name="openapssmb_maxiob_title">Máximo total IOS OpenAPS não pode superar [U]</string>
<string name="openapssmb_maxiob_title">Máximo total de IOB OpenAPS não pode superar [U]</string>
<string name="openapssmb_maxiob_summary">Este valor é chamado de Max IOB em contexto de OpenAPS\nOpenAPS não adicionará mais insulina se o IOB atual for maior que este valor</string>
<string name="absorption_cutoff_title">Tempo máx. absorção refeição [h]</string>
<string name="absorption_cutoff_summary">Hora em que qualquer refeição é considerada absorvida. Restantes hidratos de carbono serão cortados.</string>
@ -616,7 +616,6 @@
<string name="resistance_lowers_target_summary">Quando a resistência for detectada, diminui o alvo de glicose</string>
<string name="sensitivity_raises_target_title">Sensibilidade aumenta o alvo</string>
<string name="sensitivity_raises_target_summary">Quando a sensibilidade é detectada, aumenta o alvo glicose</string>
<string name="careportal_removestartedevents">Limpar AndroidAPS iniciado</string>
<string name="sort_items">Ordenar itens</string>
<string name="storedsettingsfound">Configurações encontradas</string>
<string name="allow_hardware_pump_text">Atenção: Se conectar à sua bomba física e ativar o perfil, o AndroidAPS irá copiar as definições desse perfil para as definições da bomba, apagando o memorizado na bomba. Por favor verifique que o que preencheu no perfil do app tem os mesmos valores que estão na bomba. Em caso contrário pressione imediatamente cancelar e corrija antes de voltar a ligar à bomba.</string>

View file

@ -651,7 +651,6 @@
<string name="resistance_lowers_target_summary">Quando a resistência for detectada, diminui o alvo de glicose</string>
<string name="sensitivity_raises_target_title">Sensibilidade aumenta o alvo</string>
<string name="sensitivity_raises_target_summary">Quando a sensibilidade é detectada, aumenta o alvo glicose</string>
<string name="careportal_removestartedevents">Limpar AndroidAPS iniciado</string>
<string name="storedsettingsfound">Definições armazenadas encontradas</string>
<string name="allow_hardware_pump_text">Atenção: Se conectar à sua bomba física e activar o perfil, a AndroidAPS irá copiar as definições desse perfil para as definições da bomba, apagando o perfil memorizado na bomba. Por favor verifique se o que preencheu no perfil da app tem os mesmos valores que estão na bomba. Caso contrário pressione imediatamente cancelar e corrija antes de voltar a ligar à bomba.</string>
<string name="error_adding_treatment_title">Dados tratamento incompletos</string>

View file

@ -651,7 +651,6 @@
<string name="resistance_lowers_target_summary">Când e detectata rezistență la insulină, coboară targetul</string>
<string name="sensitivity_raises_target_title">Sensibilitatea la insulină crește targetul</string>
<string name="sensitivity_raises_target_summary">Când este detectată sensibilitate la insulină, crește targetul</string>
<string name="careportal_removestartedevents">AndroidAPS pornit curat</string>
<string name="storedsettingsfound">Au fost găsite setări stocate</string>
<string name="allow_hardware_pump_text">Atenție: Dacă activați și conectați o pompă fizică, AndroidAPS va copia setările bazalelor din profilurile din aplicație în pompă, suprascriindu-le pe cele existente deja în pompă. Asigurați-vă că aveți setările corecte ale bazalelor în AndroidAPS. Dacă aveți dubii sau nu doriți suprascrierea setărilor bazalelor existente în pompă, apăsați butonul de anulare și repetați acțiunea mai târziu.</string>
<string name="error_adding_treatment_title">Date incomplete despre tratament</string>

View file

@ -665,7 +665,7 @@
<string name="resistance_lowers_target_summary">При обнаружении сопротивляемости целевой уровень гликемии понижается</string>
<string name="sensitivity_raises_target_title">Чувствительность поднимает цель</string>
<string name="sensitivity_raises_target_summary">При обнаружении чувствительности целевой уровень глюкозы повышается</string>
<string name="careportal_removestartedevents">AndroidAPS перезапущен</string>
<string name="careportal_removestartedevents">Удалить начатые записи AAPS</string>
<string name="show_invalidated">Показать недействительные</string>
<string name="hide_invalidated">Скрыть недействительные</string>
<string name="remove_items">Удалить элементы</string>
@ -1043,4 +1043,6 @@
<string name="blocked_by_charging">Заблокировано опциями зарядки</string>
<string name="blocked_by_connectivity">Заблокировано настройками подключения</string>
<string name="no_watch_connected">(Часы не подключены)</string>
<string name="error_asking_for_permissions">Ошибка при запросе разрешения</string>
<string name="dynisf_adjust_sensitivity">Настроить чувствительность относительно ГК</string>
</resources>

View file

@ -665,7 +665,7 @@
<string name="resistance_lowers_target_summary">Ak je zistená rezistancia, znížiť cieľovú hladinu glykémie</string>
<string name="sensitivity_raises_target_title">Citlivosť zvyšuje cieľ</string>
<string name="sensitivity_raises_target_summary">Ak je zistená vyššia citlivosť, zvýši cieľovú hladinu glykémie</string>
<string name="careportal_removestartedevents">Vymazať udalosti \"AndroidAPS reštartovaný\"</string>
<string name="careportal_removestartedevents">Odstrániť všetky záznamy AAPS spustený</string>
<string name="show_invalidated">Zobraziť neplatné</string>
<string name="hide_invalidated">Skryť zneplatnené</string>
<string name="remove_items">Odstrániť položky</string>
@ -1044,4 +1044,6 @@
<string name="blocked_by_charging">Zablokované možnosti nabíjania</string>
<string name="blocked_by_connectivity">Zablokované možnosti pripojenia</string>
<string name="no_watch_connected">(Žiadne hodinky nie sú pripojené)</string>
<string name="error_asking_for_permissions">Chyba pri žiadosti o oprávnenie</string>
<string name="dynisf_adjust_sensitivity">Upraviť citlivosť a glykémiu</string>
</resources>

View file

@ -656,7 +656,6 @@ Eversense-appen.</string>
<string name="resistance_lowers_target_summary">Om systemet upptäcker tillfällig insulinresistens, sänk mål-BG för att på så sätt tillåta mer insulin</string>
<string name="sensitivity_raises_target_title">Insulinkänslighet höjer mål-BG</string>
<string name="sensitivity_raises_target_summary">Om systemet upptäcker tillfällig insulinkänslighet, höj mål-BG för att på så sätt minska insulindoseringen</string>
<string name="careportal_removestartedevents">Rensa alla \"AndroidAPS startad\"</string>
<string name="storedsettingsfound">Tidigare sparade inställningar hittade</string>
<string name="allow_hardware_pump_text">Varning: Om du aktiverar och ansluter en pump, kommer AndroidAPS skriva över pumpens basalprofil med den aktiva profilen i AndroidAPS. Se till att ha rätt inställningar i appen innan du ansluter. Om du är osäker, tryck på Avbryt och anslut pumpen på nytt vid ett senare tillfälle.</string>
<string name="error_adding_treatment_title">Behandlingsdata ofullständigt</string>

View file

@ -666,7 +666,7 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="resistance_lowers_target_summary">Direnç tespit edildiğinde KŞ hedefini düşürün</string>
<string name="sensitivity_raises_target_title">Duyarlılık hedefi yükseltir</string>
<string name="sensitivity_raises_target_summary">Hassasiyet tespit edildiğinde, KŞ hedefini yükseltin</string>
<string name="careportal_removestartedevents">Temiz AndroidAPS başladı</string>
<string name="careportal_removestartedevents">AAPS tarafından başlatılmış girdileri kaldırın</string>
<string name="show_invalidated">Geçersiz olanları göster</string>
<string name="hide_invalidated">Geçersiz olanları gizle</string>
<string name="remove_items">Öğeleri kaldır</string>
@ -1045,4 +1045,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="blocked_by_charging">Şarj seçenekleri tarafından engellendi</string>
<string name="blocked_by_connectivity">Bağlantı seçenekleri tarafından engellendi</string>
<string name="no_watch_connected">(Saat Bağlı Değil)</string>
<string name="error_asking_for_permissions">İzin istenirken hata</string>
<string name="dynisf_adjust_sensitivity">Duyarlılığı ve KŞ\'ni ayarlayın</string>
</resources>

View file

@ -657,7 +657,6 @@
<string name="resistance_lowers_target_summary">当检测到胰岛素抵抗时,降低血糖的目标值。</string>
<string name="sensitivity_raises_target_title">敏感时提高目标</string>
<string name="sensitivity_raises_target_summary">当检测到胰岛素敏感时,提高血糖的目标值。</string>
<string name="careportal_removestartedevents">Clean AndroidAPS 启动了</string>
<string name="show_invalidated">显示无效项</string>
<string name="hide_invalidated">隐藏失效项</string>
<string name="remove_items">删除项目</string>

Some files were not shown because too many files have changed in this diff Show more