Merge remote-tracking branch 'ns/dev' into eopatch2

This commit is contained in:
Milos Kozak 2022-09-08 15:37:26 +02:00
commit e42a21207b
259 changed files with 2778 additions and 1677 deletions

3
.gitignore vendored
View file

@ -19,3 +19,6 @@ app/.classpath
app/.settings/org.eclipse.buildship.core.prefs
wear/.classpath
wear/.settings/org.eclipse.buildship.core.prefs
app/nsclient/*
app/nsclient2/*
app/pumpcontrol/*

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

@ -3,9 +3,11 @@
<words>
<w>aaps</w>
<w>abcdef</w>
<w>accu</w>
<w>acked</w>
<w>actionstring</w>
<w>aidex</w>
<w>alarmack</w>
<w>allowednumbers</w>
<w>androidaps</w>
<w>autosens</w>
@ -26,11 +28,15 @@
<w>carbsreq</w>
<w>careportal</w>
<w>cellnovo</w>
<w>chek</w>
<w>clearalarm</w>
<w>crashlytics</w>
<w>danar</w>
<w>danars</w>
<w>dataset</w>
<w>datasets</w>
<w>dbadd</w>
<w>dbupdate</w>
<w>devicestatus</w>
<w>devicestatuses</w>
<w>devslope</w>
@ -39,12 +45,14 @@
<w>diaconn</w>
<w>enteredby</w>
<w>enteredinsulin</w>
<w>eopatch</w>
<w>eveningoutpost</w>
<w>eversense</w>
<w>extendedbolus</w>
<w>fileprovider</w>
<w>firebase</w>
<w>glimp</w>
<w>glunovo</w>
<w>gson</w>
<w>hmac</w>
<w>iage</w>
@ -79,12 +87,14 @@
<w>pred</w>
<w>profileswitch</w>
<w>pumpbtcomm</w>
<w>pumpcontrol</w>
<w>quickwizard</w>
<w>readstatus</w>
<w>realduration</w>
<w>refresheventsfromnightscout</w>
<w>rileylink</w>
<w>roboelectric</w>
<w>rozman</w>
<w>sgvs</w>
<w>shortgramm</w>
<w>sitechange</w>
@ -108,7 +118,8 @@
<w>tirs</w>
<w>totp</w>
<w>tunedays</w>
<w>uart</w>
<w>uart</w>
<w>urgentalarm</w>
<w>wizzardpage</w>
<w>xdrip</w>
<w>xstream</w>

View file

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

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

@ -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"
@ -291,10 +293,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,17 +308,7 @@ 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()
@ -369,7 +365,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,7 +199,7 @@ 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()
@ -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,12 +187,7 @@ 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()
@ -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,15 +287,7 @@ 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()

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,15 +218,7 @@ 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()

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,13 +229,7 @@ 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()

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,12 +157,7 @@ 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
@ -185,5 +182,4 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
else -> false
}
}

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

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)

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

@ -68,6 +68,7 @@ class OpenAPSSMBDynamicISFPlugin @Inject constructor(
.shortName(R.string.dynisf_shortname)
.preferencesId(R.xml.pref_openapssmbdynamicisf)
.setDefault(false)
.showInList(buildHelper.isEngineeringMode() && buildHelper.isDev())
}
override fun specialEnableCondition(): Boolean = buildHelper.isEngineeringMode() && buildHelper.isDev()

View file

@ -312,7 +312,7 @@ class ActionsFragment : DaggerFragment() {
for (customAction in customActions) {
if (!customAction.isEnabled) continue
val btn = SingleClickButton(currentContext, null, android.R.attr.buttonStyle)
val btn = SingleClickButton(currentContext, null, R.attr.customBtnStyle)
btn.text = rh.gs(customAction.name)
val layoutParams = LinearLayout.LayoutParams(

View file

@ -115,6 +115,7 @@ class AutotuneFragment : DaggerFragment() {
}
autotunePlugin.selectedProfile = profileName
resetParam()
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
}
updateGui()
}
@ -275,6 +276,7 @@ class AutotuneFragment : DaggerFragment() {
.observeOn(aapsSchedulers.main)
.subscribe({ updateGui() }, fabricPrivacy::logException)
checkNewDay()
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
updateGui()
}
@ -287,7 +289,6 @@ class AutotuneFragment : DaggerFragment() {
@Synchronized
private fun updateGui() {
_binding ?: return
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil)
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
profileFunction.getProfile()?.let { currentProfile ->
@ -387,7 +388,7 @@ class AutotuneFragment : DaggerFragment() {
try {
if (autotunePlugin.calculationRunning)
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
if (binding.tuneDays.value != autotunePlugin.lastNbDays.toDouble()) {
if (binding.tuneDays.text != autotunePlugin.lastNbDays) {
autotunePlugin.lastNbDays = binding.tuneDays.text
resetParam(false)
}

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

@ -61,6 +61,7 @@ class AutotunePlugin @Inject constructor(
.pluginName(R.string.autotune)
.shortName(R.string.autotune_shortname)
.preferencesId(R.xml.pref_autotune)
.showInList(buildHelper.isEngineeringMode() && buildHelper.isDev())
.description(R.string.autotune_description),
aapsLogger, resourceHelper, injector
), Autotune {
@ -133,6 +134,15 @@ class AutotunePlugin @Inject constructor(
log("Tune day " + (i + 1) + " of " + daysBack)
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

@ -5,6 +5,7 @@ import android.bluetooth.BluetoothManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.provider.Settings
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
@ -113,7 +114,7 @@ class ImportExportPrefsImpl @Inject constructor(
val n1 = Settings.System.getString(context.contentResolver, "bluetooth_name")
val n2 = Settings.Secure.getString(context.contentResolver, "bluetooth_name")
val n3 = try {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.name
} else null
} catch (e: Exception){

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

@ -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

@ -120,7 +120,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
@ -417,7 +416,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
})
})
@ -582,7 +581,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
for (event in events)
if (event.isEnabled && event.trigger.shouldRun())
context?.let { context ->
SingleClickButton(context).also {
SingleClickButton(context, null, R.attr.customBtnStyle).also {
it.setTextColor(rh.gac(context, R.attr.treatmentButton))
it.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10f)
it.layoutParams = LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 0.5f).also { l ->
@ -827,7 +826,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
}
fun updateProfile() {
private fun updateProfile() {
val profile = profileFunction.getProfile()
runOnUiThread {
_binding ?: return@runOnUiThread
@ -885,7 +884,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 +914,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 +998,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 +1084,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)

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
@ -134,8 +136,8 @@ class OverviewMenus @Inject constructor(
val item = popup.menu.add(Menu.NONE, m.ordinal + 100 * (g + 1), Menu.NONE, rh.gs(m.nameId))
val title = item.title
val s = SpannableString(" $title ")
s.setSpan(ForegroundColorSpan(rh.gac(context, m.attrTextId)), 0, s.length, 0)
s.setSpan(BackgroundColorSpan(rh.gac(context, m.attrId)), 0, s.length, 0)
s.setSpan(ForegroundColorSpan(rh.gac(m.attrTextId)), 0, s.length, 0)
s.setSpan(BackgroundColorSpan(rh.gac(m.attrId)), 0, s.length, 0)
item.title = s
item.isCheckable = true
item.isChecked = settingsCopy[g][m.ordinal]
@ -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

@ -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

@ -97,11 +97,11 @@ class IobCobOref1Worker(
val bucketedData = ads.bucketedData
val autosensDataTable = ads.autosensDataTable
if (bucketedData == null || bucketedData.size < 3) {
aapsLogger.debug(LTag.AUTOSENS, "Aborting calculation thread (No bucketed data available): ${data.from}")
aapsLogger.debug(LTag.AUTOSENS, {"Aborting calculation thread (No bucketed data available): ${data.from}"})
return Result.success(workDataOf("Error" to "Aborting calculation thread (No bucketed data available): ${data.from}"))
}
val prevDataTime = ads.roundUpTime(bucketedData[bucketedData.size - 3].timestamp)
aapsLogger.debug(LTag.AUTOSENS, "Prev data time: " + dateUtil.dateAndTimeString(prevDataTime))
aapsLogger.debug(LTag.AUTOSENS, {"Prev data time: " + dateUtil.dateAndTimeString(prevDataTime)})
var previous = autosensDataTable[prevDataTime]
// start from oldest to be able sub cob
for (i in bucketedData.size - 4 downTo 0) {
@ -156,15 +156,15 @@ class IobCobOref1Worker(
val hourAgoData = ads.getAutosensDataAtTime(hourAgo)
if (hourAgoData != null) {
val initialIndex = autosensDataTable.indexOfKey(hourAgoData.time)
aapsLogger.debug(LTag.AUTOSENS, ">>>>> bucketed_data.size()=" + bucketedData.size + " i=" + i + " hourAgoData=" + hourAgoData.toString())
aapsLogger.debug(LTag.AUTOSENS, { ">>>>> bucketed_data.size()=" + bucketedData.size + " i=" + i + " hourAgoData=" + hourAgoData.toString()})
var past = 1
try {
while (past < 12) {
val ad = autosensDataTable.valueAt(initialIndex + past)
aapsLogger.debug(LTag.AUTOSENS, ">>>>> past=" + past + " ad=" + ad?.toString())
aapsLogger.debug(LTag.AUTOSENS, {">>>>> past=" + past + " ad=" + ad?.toString()})
if (ad == null) {
aapsLogger.debug(LTag.AUTOSENS, autosensDataTable.toString())
aapsLogger.debug(LTag.AUTOSENS, bucketedData.toString())
aapsLogger.debug(LTag.AUTOSENS, {autosensDataTable.toString()})
aapsLogger.debug(LTag.AUTOSENS, {bucketedData.toString()})
//aapsLogger.debug(LTag.AUTOSENS, iobCobCalculatorPlugin.getBgReadingsDataTable().toString())
val notification = Notification(Notification.SEND_LOGFILES, rh.gs(R.string.sendlogfiles), Notification.LOW)
rxBus.send(EventNewNotification(notification))
@ -319,14 +319,12 @@ class IobCobOref1Worker(
if (bgTime < dateUtil.now()) autosensDataTable.put(bgTime, autosensData)
aapsLogger.debug(
LTag.AUTOSENS,
"Running detectSensitivity from: " + dateUtil.dateAndTimeString(oldestTimeWithData) + " to: " + dateUtil.dateAndTimeString(bgTime) + " lastDataTime:" + ads.lastDataTime(
dateUtil
)
{"Running detectSensitivity from: " + dateUtil.dateAndTimeString(oldestTimeWithData) + " to: " + dateUtil.dateAndTimeString(bgTime) + " lastDataTime:" + ads.lastDataTime(dateUtil)}
)
val sensitivity = activePlugin.activeSensitivity.detectSensitivity(ads, oldestTimeWithData, bgTime)
aapsLogger.debug(LTag.AUTOSENS, "Sensitivity result: $sensitivity")
autosensData.autosensResult = sensitivity
aapsLogger.debug(LTag.AUTOSENS, autosensData.toString())
aapsLogger.debug(LTag.AUTOSENS, {autosensData.toString()})
}
data.iobCobCalculator.ads = ads
Thread {
@ -335,7 +333,7 @@ class IobCobOref1Worker(
}.start()
} finally {
rxBus.send(EventIobCalculationProgress(CalculationWorkflow.ProgressData.IOB_COB_OREF, 100, data.cause))
aapsLogger.debug(LTag.AUTOSENS, "AUTOSENSDATA thread ended: ${data.from}")
aapsLogger.debug(LTag.AUTOSENS, {"AUTOSENSDATA thread ended: ${data.from}"})
profiler.log(LTag.AUTOSENS, "IobCobOref1Thread", start)
}
return Result.success()

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,7 +118,7 @@ class BGSourceFragment : DaggerFragment() {
_binding = null
}
override fun onOptionsItemSelected(item: MenuItem) =
override fun onMenuItemSelected(item: MenuItem) =
actionHelper.onOptionsItemSelected(item)
inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List<GlucoseValue>) : RecyclerView.Adapter<RecyclerViewAdapter.GlucoseValuesViewHolder>() {

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

@ -2,7 +2,6 @@ package info.nightscout.androidaps.utils
import android.Manifest
import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.bluetooth.BluetoothAdapter
import android.content.ActivityNotFoundException
import android.content.Context
@ -51,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() }
@ -95,13 +102,14 @@ class AndroidPermission @Inject constructor(
}
}
@SuppressLint("MissingPermission")
@Synchronized
fun notifyForBtConnectPermission(activity: FragmentActivity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// Manifest.permission.BLUETOOTH_CONNECT
if (permissionNotGranted(activity, "android.permission.BLUETOOTH_CONNECT") || permissionNotGranted(activity, "android.permission.BLUETOOTH_SCAN")) {
if (permissionNotGranted(activity, Manifest.permission.BLUETOOTH_CONNECT) || permissionNotGranted(activity, Manifest.permission.BLUETOOTH_SCAN)) {
val notification = NotificationWithAction(injector, Notification.PERMISSION_BT, rh.gs(R.string.needconnectpermission), Notification.URGENT)
notification.action(R.string.request) { askForPermission(activity, arrayOf("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT")) }
notification.action(R.string.request) { askForPermission(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT)) }
rxBus.send(EventNewNotification(notification))
} else {
activity.startActivity(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE))
@ -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

@ -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

@ -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

@ -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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">Pro oznámení vyžaduje aplikace oprávnění systémového okna</string>
<string name="needlocationpermission">Aplikace potřebuje oprávnění k přístupu k poloze kvůli skenování BT a WiFi identifikaci</string>
<string name="needstoragepermission">Aby bylo možné nahrávat logy a exportovat nastavení, je nutné pro aplikaci povolit oprávnění přístupu k úložišti</string>
<string name="needconnectpermission">Aplikace potřebuje oprávnění bluetooth</string>
<string name="request">Požadavek</string>
<string name="open_navigation">Otevřít menu</string>
<string name="close_navigation">Zavřít menu</string>
@ -666,7 +665,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>
@ -1045,4 +1044,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>
@ -636,7 +645,6 @@
<string name="needsystemwindowpermission">Applikationen mangler system vindues tilladelse til notifikationer</string>
<string name="needlocationpermission">Applikationen mangler lokations tilladelse til BT scanning og WIFI identifikation</string>
<string name="needstoragepermission">Applikationen mangler lagerstyrings tilladelse for at gemme logfiler og exporteringsindstillinger</string>
<string name="needconnectpermission">Applikationen kræver tilladelse til bluetooth</string>
<string name="request">Anmod</string>
<string name="open_navigation">Åbn navigation</string>
<string name="close_navigation">Luk navigation</string>
@ -657,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>
@ -676,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>
@ -768,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>
@ -954,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>
@ -962,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>
@ -991,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>
@ -999,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>
@ -1008,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>
@ -633,7 +645,6 @@
<string name="needsystemwindowpermission">Die App benötigt die Systemberechtigung für App-Benachrichtigungen</string>
<string name="needlocationpermission">Die App benötigt die Berechtigung für den Standort, um Bluetooth und WLAN nutzen zu können</string>
<string name="needstoragepermission">Die App benötigt Zugriffsrechte für den Speicher um Log-Dateien zu sichern und die Einstellungen zu exportieren.</string>
<string name="needconnectpermission">App benötigt Bluetooth-Berechtigung</string>
<string name="request">Anfordern</string>
<string name="open_navigation">Menü öffnen</string>
<string name="close_navigation">Menü schließen</string>
@ -654,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>
@ -670,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>
@ -763,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>
@ -803,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>
@ -872,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>
@ -890,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>
@ -930,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>
@ -939,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">La aplicación necesita permisos del sistema para poder mostrarse sobre otras aplicaciones, para las notificaciones</string>
<string name="needlocationpermission">La aplicación necesita permiso de ubicación para poder buscar dispositivos Bluetooth y redes WiFi</string>
<string name="needstoragepermission">La aplicación necesita permiso de almacenamiento para poder almacenar archivos de registro y valores de exportación</string>
<string name="needconnectpermission">La aplicación necesita permiso de bluetooth</string>
<string name="request">Solicitar</string>
<string name="open_navigation">Abrir navegación</string>
<string name="close_navigation">Cerrar navegación</string>
@ -666,7 +665,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>
@ -1045,4 +1044,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

@ -646,7 +646,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="needsystemwindowpermission">L\'application a besoin de l\'autorisation d\'accès à la fenêtre système pour les notifications</string>
<string name="needlocationpermission">L\'application a besoin de l\'autorisation de localisation pour l\'analyse BT et l\'identification WiFi</string>
<string name="needstoragepermission">L\'application a besoin d\'une autorisation de stockage pour pouvoir stocker les fichiers journaux et les paramètres d\'exportation</string>
<string name="needconnectpermission">L\'application a besoin de l\'autorisation Bluetooth</string>
<string name="request">Demande</string>
<string name="open_navigation">Ouvrir navigation</string>
<string name="close_navigation">Fermer navigation</string>
@ -667,7 +666,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>
@ -1045,4 +1044,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">L\'applicazione richiede l\'autorizzazione \"finestra di sistema\" per le notifiche</string>
<string name="needlocationpermission">L\'applicazione richiede l\'accesso alla posizione per la scansione bluetooth e l\'identificazione WiFi</string>
<string name="needstoragepermission">L\'applicazione richiede l\'accesso alla memoria per memorizzare i file di log ed esportare le impostazioni</string>
<string name="needconnectpermission">L\'applicazione richiede l\'autorizzazione bluetooth</string>
<string name="request">Richiesta</string>
<string name="open_navigation">Apri navigazione</string>
<string name="close_navigation">Chiudi navigazione</string>
@ -666,7 +665,6 @@
<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="show_invalidated">Mostra invalidato</string>
<string name="hide_invalidated">Nascondi invalidato</string>
<string name="remove_items">Rimuovi elementi</string>
@ -1045,4 +1043,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">האפליקציה צריכה הרשאת מערכת של חלונות לצורך התראות</string>
<string name="needlocationpermission">דרושה הרשאת מיקום עבור סריקת בלוטות\' וזיהוי WiFi</string>
<string name="needstoragepermission">דרושה הרשאת אחסון כדי שתוכלו לאחסן קובצי יומן והגדרות יצוא.</string>
<string name="needconnectpermission">האפליקציה צריכה הרשאה לבלוטות\'</string>
<string name="request">בקשה</string>
<string name="open_navigation">פתח ניווט</string>
<string name="close_navigation">סגור ניווט</string>
@ -666,7 +665,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>
@ -1041,4 +1041,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

@ -631,7 +631,6 @@
<string name="needsystemwindowpermission">Norint gauti pranešimus, programai reikalingas sisteminio lango leidimas</string>
<string name="needlocationpermission">Programai reikia vietos nustatymo leidimo, kad būtų galima naudoti Bluetooth ir WiFi</string>
<string name="needstoragepermission">Aplikacijai reikia leidimo prieigai prie saugyklos, kad galėtų išsaugoti žurnalo įrašus ir eksportavimo nustatymus</string>
<string name="needconnectpermission">Programai reikalinga Bluetooth prieigos teisė</string>
<string name="request">Užklausa</string>
<string name="open_navigation">Atidaryti meniu</string>
<string name="close_navigation">Uždaryti meniu</string>
@ -652,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>
@ -894,6 +892,7 @@
<string name="not_available_full">Negalimas</string>
<!-- Theme switcher dark and light mode-->
<!-- WEAR OS-->
<string name="sort_label">Rūšiuoti</string>
<string name="login">Prisijungti</string>
<!-- Aidex Cgms -->
</resources>

View file

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">Toepassing vereist systeemvenstermachtiging voor meldingen</string>
<string name="needlocationpermission">App heeft locatie toestemming nodig voor Bluetooth scan en WiFi identificatie</string>
<string name="needstoragepermission">Applicatie heeft toestemming nodig om log bestanden op te slaan en instellingen te exporteren</string>
<string name="needconnectpermission">Applicatie heeft Bluetooth toestemming nodig</string>
<string name="request">Verzoek</string>
<string name="open_navigation">Open navigatie</string>
<string name="close_navigation">Sluit navigatie</string>
@ -666,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">App trenger tillatelse til å bruke Varslinger for å vise meldinger</string>
<string name="needlocationpermission">App trenger tilgang til Posisjon for å søke etter Bluetooth og Wifi enheter</string>
<string name="needstoragepermission">App trenger tilgang til Lagring for lagre logg filer og eksportere innstillinger</string>
<string name="needconnectpermission">Appen trenger bluetooth tillatelse</string>
<string name="request">Forespørsel</string>
<string name="open_navigation">Åpne meny</string>
<string name="close_navigation">Lukk meny</string>
@ -666,7 +665,6 @@
<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="show_invalidated">Vis ugyldige oppføringer</string>
<string name="hide_invalidated">Skjul ugyldige oppføringer</string>
<string name="remove_items">Fjern oppføringer</string>
@ -1045,4 +1043,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

@ -244,6 +244,7 @@
<string name="wear">Oprogramowanie Wear (Smartwatch)</string>
<string name="resend_all_data">Prześlij ponownie wszystkie dane</string>
<string name="open_settings_on_wear">Otwórz ustawienia dla Wear</string>
<string name="basal_rate">Dawka bazowa</string>
<string name="basalvaluebelowminimum">Wartość bazy poniżej minimum. Nie ustawiono profilu!</string>
<string name="sms_actualbg">BG:</string>
<string name="sms_lastbg">Ostatnia BG:</string>
@ -631,7 +632,6 @@
<string name="needsystemwindowpermission">Aplikacja wymaga uprawnienia systemowego okna dla powiadomień</string>
<string name="needlocationpermission">Aplikacja wymaga dostępu do lokalizacji dla zarządzania bluetoothem i identyfikacją Wi-Fi</string>
<string name="needstoragepermission">Aplikacja wymaga zgody na zapis do pamięci, aby móc przechować pliki logów i eksportować ustawienia</string>
<string name="needconnectpermission">Aplikacja wymaga uprawnienia Bluetooth</string>
<string name="request">Żądanie</string>
<string name="open_navigation">Otwórz menu</string>
<string name="close_navigation">Zamknij menu</string>
@ -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>
@ -667,6 +666,7 @@
<string name="error_adding_treatment_message">Leczenie (insulina: %1$.2f, węglowodany: %2$d, czas:%3$s) nie mogą być dodane. Sprawdź i dodaj ręcznie rekord w razie potrzeby.</string>
<string name="generated_ecarbs_note">eWęgle: %1$d g (%2$d h), Opóźnienie: %3$d m</string>
<string name="openaps_noasdata">Brak dostępnych danych autosens</string>
<string name="log_files">Log files</string>
<string name="nav_logsettings">Ustawienia logów</string>
<string name="resettodefaults">Przywróć ustawienia domyślne</string>
<string name="nsmalfunction">Usterka NSClient. Spróbuj zrestartować NS i NSClient.</string>
@ -748,6 +748,8 @@
<string name="profilenamecontainsdot">Nazwa profilu zawiera kropki.\nTo nie jest obsługiwane przez NS.\nProfil nie zostanie przesyłany do NS.</string>
<string name="low_mark_comment">Dolna wartość zakresu docelowego (tylko do wyświetlania)</string>
<string name="high_mark_comment">Górna wartość zakresu docelowego (tylko do wyświetlania)</string>
<string name="age">Czas</string>
<string name="weight_label">Waga</string>
<string name="id">ID:</string>
<string name="submit">Wyślij</string>
<string name="mostcommonprofile">Najczęściej używany profil:</string>
@ -797,6 +799,7 @@
<string name="smscommunicator_otp_install_info">Na każdym telefonie śledzącym zainstalować aplikację uwierzytelniania obsługującą tokeny TOTP RFC 6238 Popularne darmowe aplikacje:\n • Authy\n • Google Authenticator\n • LastPass Authenticator\n • FreeOTP Authenticator</string>
<string name="smscommunicator_otp_reset_warning">Resetowanie uwierzytelniania powoduje, że wszystkie już ustawione uwierzytelnienia stają się niepoprawne (przestają działać). Trzeba będzie je jeszcze raz skonfigurować!</string>
<string name="overview_show_predictions">Prognozy poziomu</string>
<string name="overview_show_treatments">Zabiegi</string>
<string name="overview_show_deviationslope">Krzywa odchylenie</string>
<string name="authorizationfailed">Autoryzacja nie powiodła się</string>
<string name="overview_show_absinsulin">Cała insulina</string>
@ -896,6 +899,7 @@
<!-- WEAR OS-->
<string name="remove_selected_items">Usuń wybrane pozycje</string>
<string name="confirm_remove_multiple_items">Czy na pewno chcesz usunąć %1$d pozycji</string>
<string name="no_records_available">Brak wpisów</string>
<string name="count_selected">Wybrany %1$d</string>
<string name="sort_label">Sortuj</string>
<string name="login">Zaloguj się</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

@ -631,7 +631,6 @@
<string name="needsystemwindowpermission">Aplicação precisa de permissão de janela do sistema para notificações</string>
<string name="needlocationpermission">Aplicação necessita de permissão de localização para pesquisa Bluetooth e identificação Wi-Fi</string>
<string name="needstoragepermission">A aplicação precisa da permissão de armazenamento para poder armazenar ficheiros de registo e exportar definições</string>
<string name="needconnectpermission">Aplicação precisa de permissão Bluetooth</string>
<string name="request">Pedido</string>
<string name="open_navigation">Abrir a navegação</string>
<string name="close_navigation">Fechar a navegação</string>
@ -652,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

@ -631,7 +631,6 @@
<string name="needsystemwindowpermission">Aplicația are nevoie de permisiune la fereastra sistemului pentru a afișa notificări</string>
<string name="needlocationpermission">Aplicația are nevoie sa acceseze locația pentru scanare Bluetooth și identificare WiFi</string>
<string name="needstoragepermission">Aplicația are nevoie de permisiunea de a accesa unitatea de stocare pentru a scrie fișierele registru și pentru a exporta setările</string>
<string name="needconnectpermission">Aplicația are nevoie de permisiune Bluetooth</string>
<string name="request">Cerință</string>
<string name="open_navigation">Afișare navigație</string>
<string name="close_navigation">Închidere navigație</string>
@ -652,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">Приложению требуется разрешение системного окна для уведомлений</string>
<string name="needlocationpermission">Приложению требуется разрешение на доступ к местоположению для сканирования BT и идентификации WiFi</string>
<string name="needstoragepermission">Приложение требует разрешения на доступ к записи в память, чтобы хранить файлы журналов и настройки экспорта</string>
<string name="needconnectpermission">Приложению требуется разрешение Bluetooth</string>
<string name="request">Запрос</string>
<string name="open_navigation">Показать панель навигации</string>
<string name="close_navigation">рыть панель навигации</string>
@ -666,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>
@ -1044,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

@ -645,7 +645,6 @@
<string name="needsystemwindowpermission">Aplikácia vyžaduje pre oznámenia systémové oprávnenie</string>
<string name="needlocationpermission">Aplikácia vyžaduje oprávnenie polohy, pre vyhľadávanie BT a identifikáciu WiFi</string>
<string name="needstoragepermission">Aby bolo možné nahrávať logy a exportovať nastavenia, je nutné pre aplikáciu povoliť oprávnenie prístupu k úložisku</string>
<string name="needconnectpermission">Aplikácia vyžaduje povolenie bluetooth</string>
<string name="request">Požiadavka</string>
<string name="open_navigation">Otvoriť Menu</string>
<string name="close_navigation">Zavrieť Menu</string>
@ -666,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>
@ -1045,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

@ -636,7 +636,6 @@ Eversense-appen.</string>
<string name="needsystemwindowpermission">Applikationen behöver förhöjd behörighet för aviseringar</string>
<string name="needlocationpermission">Appen behöver platsåtkomst för bluetooth- och WiFi-identifiering</string>
<string name="needstoragepermission">Applikationen behöver lagringsbehörighet för att kunna lagra loggfiler och exportinställningar</string>
<string name="needconnectpermission">Applikationen behöver bluetooth-behörighet</string>
<string name="request">Begäran</string>
<string name="open_navigation">Öppna menyn</string>
<string name="close_navigation">Stäng menyn</string>
@ -657,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

@ -646,7 +646,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="needsystemwindowpermission">Uygulama, bildirimler için sistem iznine ihtiyaç duyuyor</string>
<string name="needlocationpermission">Uygulamanın BT taraması ve WiFi tanımlaması için konum iznine ihtiyacı var</string>
<string name="needstoragepermission">Uygulamanın, günlük dosyalarını saklayabilmesi ve ayarları dışa aktarabilmesi için depolama iznine ihtiyacı var</string>
<string name="needconnectpermission">Uygulama bluetooth iznine ihtiyac duyuyor</string>
<string name="request">İstek</string>
<string name="open_navigation">Navigasyonu aç</string>
<string name="close_navigation">Navigasyonu kapat</string>
@ -667,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>
@ -1046,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

@ -432,6 +432,7 @@
<string name="ns_localbroadcasts_title">启用本地广播。</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">动态ISF(胰岛素敏感系数)</string>
<string name="DynISFAdjust_summary" formatted="false">动态ISF的调整因子。设置100%以上用于更积极的校正100%以下则不那么积极校正。</string>
<string name="enableuam">启用 UAM</string>
<string name="enablesmb">启用微型大剂量</string>
<string name="enablesmb_summary">使用微型大剂量代替使用临时基础率,更快的干预</string>
@ -636,7 +637,6 @@
<string name="needsystemwindowpermission">应用程序需要悬浮窗权限用于发送通知。</string>
<string name="needlocationpermission">应用程序需要定位权限才能进行蓝牙扫描及WIFI识别。</string>
<string name="needstoragepermission">应用程序需要文件存储权限,才能存储日志文件及导出设置。</string>
<string name="needconnectpermission">应用程序需要蓝牙权限。</string>
<string name="request">请求</string>
<string name="open_navigation">打开导航栏</string>
<string name="close_navigation">关闭导航栏</string>
@ -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>

View file

@ -28,6 +28,7 @@
<item>@string/bg_lang</item>
<item>@string/cs_lang</item>
<item>@string/de_lang</item>
<item>@string/dk_lang</item>
<item>@string/fr_lang</item>
<item>@string/nl_lang</item>
<item>@string/es_lang</item>
@ -55,6 +56,7 @@
<item>bg</item>
<item>cs</item>
<item>de</item>
<item>dk</item>
<item>fr</item>
<item>nl</item>
<item>es</item>

View file

@ -9,6 +9,7 @@
<!-- <string name="fi_lang" translatable="false">Finnish</string> -->
<string name="fr_lang" translatable="false">French</string>
<string name="de_lang" translatable="false">German</string>
<string name="dk_lang" translatable="false">Danish</string>
<string name="el_lang" translatable="false">Greek</string>
<!-- <string name="he_lang" translatable="false">Hebrew</string> -->
<string name="zh_lang" translatable="false">Chinese</string>
@ -789,7 +790,6 @@
<string name="needsystemwindowpermission">Application needs system window permission for notifications</string>
<string name="needlocationpermission">Application needs location permission for BT scan and WiFi identification</string>
<string name="needstoragepermission">Application needs storage permission to be able store log files and export settings</string>
<string name="needconnectpermission">Application needs bluetooth permission</string>
<string name="request">Request</string>
<string name="open_navigation">Open navigation</string>
<string name="close_navigation">Close navigation</string>
@ -815,7 +815,7 @@
<string name="sensitivity_raises_target_title">Sensitivity raises target</string>
<string name="sensitivity_raises_target_summary">When sensitivity is detected, raise the target glucose</string>
<string name="key_keep_screen_on" translatable="false">keep_screen_on</string>
<string name="careportal_removestartedevents">Clean AndroidAPS started</string>
<string name="careportal_removestartedevents">Remove AAPS started entries</string>
<string name="show_invalidated">Show invalidated</string>
<string name="hide_invalidated">Hide invalidated</string>
<string name="remove_items">Remove items</string>
@ -1251,6 +1251,8 @@
<string name="blocked_by_charging">Blocked by charging options</string>
<string name="blocked_by_connectivity">Blocked by connectivity options</string>
<string name="no_watch_connected">(No Watch Connected)</string>
<string name="error_asking_for_permissions">Error asking for permissions</string>
<string name="key_adjust_sensitivity" translatable="false">dynisf_adjust_sensitivity</string>
<string name="dynisf_adjust_sensitivity">Adjust sensitivity and BG</string>
</resources>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="@string/key_autotune_plugin"
android:title="@string/autotune_settings"
@ -24,12 +26,19 @@
android:summary="@string/autotune_tune_insulin_curve_summary"
android:title="@string/autotune_tune_insulin_curve_title" />
-->
<EditTextPreference
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="5"
android:inputType="number"
android:key="@string/key_autotune_default_tune_days"
android:summary="@string/autotune_default_tune_days_summary"
android:title="@string/autotune_default_tune_days_title" />
android:title="@string/autotune_default_tune_days_title"
android:dialogMessage="@string/autotune_default_tune_days_summary"
android:digits="0123456789"
android:inputType="number"
android:selectAllOnFocus="true"
android:singleLine="true"
validate:maxNumber="30"
validate:minNumber="1"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"

View file

@ -30,7 +30,7 @@
<SwitchPreference
android:defaultValue="false"
android:key="openapsama_useautosens"
android:key="@string/key_openapsama_useautosens"
android:title="@string/openapsama_useautosens" />
<SwitchPreference

View file

@ -51,8 +51,8 @@
<SwitchPreference
android:defaultValue="false"
android:key="openapsama_useautosens"
android:title="@string/openapsama_useautosens" />
android:key="@string/key_adjust_sensitivity"
android:title="@string/dynisf_adjust_sensitivity" />
<SwitchPreference
android:defaultValue="false"

View file

@ -317,7 +317,6 @@ class AutotunePrepTest : TestBaseWithProfile() {
profileFunction,
sp,
dateUtil,
activePlugin,
autotuneFS
) {

View file

@ -5,11 +5,19 @@ import android.content.Context
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import android.util.SparseArray
import android.view.*
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.annotation.DrawableRes
import androidx.core.util.forEach
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -40,7 +48,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
class AutomationFragment : DaggerFragment(), OnStartDragListener {
class AutomationFragment : DaggerFragment(), OnStartDragListener, MenuProvider {
@Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var rh: ResourceHelper
@ -52,9 +60,9 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener {
companion object {
const val ID_MENU_ADD = 3
const val ID_MENU_RUN = 4
const val ID_MENU_EDIT_MOVE = 5
const val ID_MENU_ADD = 504
const val ID_MENU_RUN = 505
const val ID_MENU_EDIT_MOVE = 506
}
private var disposable: CompositeDisposable = CompositeDisposable()
@ -73,7 +81,6 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener {
actionHelper.setUpdateListHandler { binding.eventListView.adapter?.notifyDataSetChanged() }
actionHelper.setOnRemoveHandler { removeSelected(it) }
actionHelper.enableSort = true
setHasOptionsMenu(true)
return binding.root
}
@ -85,43 +92,38 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener {
binding.logView.movementMethod = ScrollingMovementMethod()
itemTouchHelper.attachToRecyclerView(binding.eventListView)
requireActivity().addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
if (isResumed) {
actionHelper.onCreateOptionsMenu(menu, inflater)
menu.removeItem(ID_MENU_ADD)
menu.removeItem(ID_MENU_RUN)
menu.add(Menu.FIRST, ID_MENU_ADD, 0, rh.gs(R.string.add_automation)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.run_automations)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_EDIT_MOVE, 0, rh.gs(R.string.remove_sort)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
actionHelper.onCreateOptionsMenu(menu, inflater)
menu.add(Menu.FIRST, ID_MENU_ADD, 0, rh.gs(R.string.add_automation)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_RUN, 0, rh.gs(R.string.run_automations)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.add(Menu.FIRST, ID_MENU_EDIT_MOVE, 0, rh.gs(R.string.remove_sort)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER)
menu.setGroupDividerEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
override fun onMenuItemSelected(item: MenuItem): Boolean =
if (actionHelper.onOptionsItemSelected(item)) true
else
when (item.itemId) {
ID_MENU_RUN -> {
Thread { automationPlugin.processActions() }.start()
true
}
ID_MENU_ADD -> {
add()
true
}
ID_MENU_EDIT_MOVE -> {
actionHelper.startAction()
true
}
else -> false
else when (item.itemId) {
ID_MENU_RUN -> {
Thread { automationPlugin.processActions() }.start()
true
}
ID_MENU_ADD -> {
add()
true
}
ID_MENU_EDIT_MOVE -> {
actionHelper.startAction()
true
}
else -> false
}
@SuppressLint("NotifyDataSetChanged")
@Synchronized
override fun onResume() {
@ -129,15 +131,11 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener {
disposable += rxBus
.toObservable(EventAutomationUpdateGui::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
updateGui()
}, fabricPrivacy::logException)
.subscribe({ updateGui() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventAutomationDataChanged::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
eventListAdapter.notifyDataSetChanged()
}, fabricPrivacy::logException)
.subscribe({ eventListAdapter.notifyDataSetChanged() }, fabricPrivacy::logException)
updateGui()
}

View file

@ -1,8 +1,12 @@
package info.nightscout.androidaps.plugins.general.automation.triggers
import android.Manifest
import android.bluetooth.BluetoothManager
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.widget.LinearLayout
import androidx.core.app.ActivityCompat
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.automation.R
@ -13,9 +17,9 @@ import info.nightscout.androidaps.plugins.general.automation.elements.InputDropd
import info.nightscout.androidaps.plugins.general.automation.elements.LayoutBuilder
import info.nightscout.androidaps.plugins.general.automation.elements.StaticLabel
import info.nightscout.androidaps.utils.JsonHelper
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.shared.logging.LTag
import org.json.JSONObject
import java.util.*
import javax.inject.Inject
class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) {
@ -74,12 +78,16 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) {
// Get the list of paired BT devices to use in dropdown menu
private fun devicesPaired(): ArrayList<CharSequence> {
val s = ArrayList<CharSequence>()
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.bondedDevices?.forEach { s.add(it.name) }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.bondedDevices?.forEach { s.add(it.name) }
} else {
ToastUtils.errorToast(context, context.getString(R.string.needconnectpermission))
}
return s
}
private fun eventExists(): Boolean {
automationPlugin.btConnects.forEach {
ArrayList(automationPlugin.btConnects).forEach {
if (btDevice.value == it.deviceName) {
if (comparator.value == ComparatorConnect.Compare.ON_CONNECT && it.state == EventBTChange.Change.CONNECT) return true
if (comparator.value == ComparatorConnect.Compare.ON_DISCONNECT && it.state == EventBTChange.Change.DISCONNECT) return true

View file

@ -123,4 +123,5 @@
<string name="run_automations">Kør automatisering</string>
<string name="add_automation">Tilføj regel</string>
<string name="remove_sort">Fjern/sorter</string>
<string name="stop_processing">Stop afvikling</string>
</resources>

View file

@ -113,5 +113,15 @@
<string name="automation_event">Automatisierungs-Ereignis</string>
<string name="reorder_label">Umsortieren</string>
<string name="user_action">Benutzeraktion</string>
<string name="remove_automation">Automatisierung entfernen</string>
<string name="sort_automation">Automation-Regeln sortieren</string>
<string name="remove_selected_items">Ausgewähltes Objekt löschen</string>
<string name="count_selected">%1$d ausgewählt</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="sort_label">Sortieren</string>
<string name="system_automation">System-Automatisierung</string>
<string name="run_automations">Automatisierungen ausführen</string>
<string name="add_automation">Regel hinzufügen</string>
<string name="remove_sort">Entfernen/sortieren</string>
<string name="stop_processing">Verarbeitung beenden</string>
</resources>

View file

@ -1,18 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="alarm_message">Aláram: %1$s</string>
<string name="suspendloopforXmin">Fionraí lúb do %1$d nóim</string>
<string name="iobcompared">IOB %1$s %2$.1f</string>
<string name="and">Agus</string>
<string name="or"></string>
<string name="delta">Deilte</string>
<string name="locationis">%1$s %2$s</string>
<string name="add_short">CUIR</string>
<string name="wifissidcompared">WiFi SSID %1$s %2$s</string>
<string name="deltacompared">%3$s %1$s %2$s</string>
<string name="glucose_u">Glúcóis [%1$s]:</string>
<string name="cobcompared">COB %1$s %2$.0f</string>
<string name="iob_u">IOB [U]:</string>
<string name="never">Riamh</string>
<string name="action">Gníomh:</string>
</resources>
<resources></resources>

View file

@ -123,4 +123,5 @@
<string name="run_automations">הפעל אוטומציות</string>
<string name="add_automation">הוספת כלל</string>
<string name="remove_sort">הסרה\\סידור</string>
<string name="stop_processing">עצור עיבוד</string>
</resources>

View file

@ -112,4 +112,5 @@
<string name="automation_event">Automatizuotas įvykis</string>
<string name="reorder_label">Pertvarkyti</string>
<string name="user_action">Vartotojo veiksmas</string>
<string name="sort_label">Rūšiuoti</string>
</resources>

View file

@ -90,7 +90,7 @@
<string name="latitude_short">Широта:</string>
<string name="longitude_short">Долгота:</string>
<string name="glucose_u">Гк %1$s]:</string>
<string name="target_u">Цель %1$d м</string>
<string name="target_u">Цель [%1$s]:</string>
<string name="lastboluslabel">Предыдущий болюс</string>
<string name="lastboluscompared">Время болюса %1$s %2$s мин назад</string>
<string name="triggercoblabel">Активн углеводы</string>

View file

@ -123,4 +123,5 @@
<string name="run_automations">Spustiť automatizácie</string>
<string name="add_automation">Pridať pravidlo</string>
<string name="remove_sort">Odstrániť/zoradiť</string>
<string name="stop_processing">Zastaviť spracovanie</string>
</resources>

View file

@ -7,14 +7,14 @@ buildscript {
rxjava_version = '3.1.5'
rxandroid_version = '3.0.0'
rxkotlin_version = '3.0.1'
room_version = '2.4.2'
lifecycle_version = '2.5.0'
dagger_version = '2.42'
room_version = '2.4.3'
lifecycle_version = '2.5.1'
dagger_version = '2.43'
coroutines_version = '1.6.4'
activity_version = '1.4.0'
fragmentktx_version = '1.4.1'
ormLite_version = '4.46'
gson_version = '2.9.0'
gson_version = '2.9.1'
nav_version = '2.4.2'
appcompat_version = '1.4.2'
material_version = '1.6.1'
@ -26,7 +26,7 @@ buildscript {
work_version = '2.7.1'
tink_version = '1.5.0'
json_version = '20220320'
joga_version = '2.10.14'
joda_version = '2.11.0.1'
junit_version = '4.13.2'
mockito_version = '4.4.0'
@ -51,8 +51,8 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
// NOTE: Do not place your application dependencies here; they belong
@ -67,7 +67,7 @@ buildscript {
plugins {
id "io.gitlab.arturbosch.detekt" version "1.21.0"
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
id 'org.barfuin.gradle.jacocolog' version '2.0.0'
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

View file

@ -4,6 +4,8 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import androidx.annotation.NonNull;
import org.monkey.d.ruffy.ruffy.driver.display.menu.BolusType;
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuBlink;
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuDate;
@ -39,11 +41,11 @@ public class Menu implements Parcelable{
MenuAttribute a = MenuAttribute.valueOf(attr);
Object o = null;
if (Integer.class.toString().equals(clas)) {
o = new Integer(value);
o = Integer.valueOf(value);
} else if (Double.class.toString().equals(clas)) {
o = new Double(value);
o = Double.valueOf(value);
} else if (Boolean.class.toString().equals(clas)) {
o = new Boolean(value);
o = Boolean.valueOf(value);
} else if (MenuDate.class.toString().equals(clas)) {
o = new MenuDate(value);
} else if (MenuTime.class.toString().equals(clas)) {
@ -70,14 +72,9 @@ public class Menu implements Parcelable{
}
}
public void setAttribute(MenuAttribute key, Object value)
{
attributes.put(key,value);
}
public List<MenuAttribute> attributes()
{
return new LinkedList<MenuAttribute>(attributes.keySet());
return new LinkedList<>(attributes.keySet());
}
public Object getAttribute(MenuAttribute key)
@ -104,17 +101,11 @@ public class Menu implements Parcelable{
String atr = a.toString();
Object o = attributes.get(a);
String clas = o.getClass().toString();
String v = o.toString();
if(atr != null && o != null && v != null) {
dest.writeString(atr);
dest.writeString(clas);
dest.writeString(v);
}
else
{
Log.e("Menu","null in write :/");
}
String clas = o != null ? o.getClass().toString() : "null";
String v = o != null ? o.toString() : " null";
dest.writeString(atr);
dest.writeString(clas);
dest.writeString(v);
}catch(Exception e)
{
Log.v("MenuOut","error in write",e);
@ -122,7 +113,7 @@ public class Menu implements Parcelable{
}
}
public static final Parcelable.Creator<Menu> CREATOR = new
Parcelable.Creator<Menu>() {
Parcelable.Creator<>() {
public Menu createFromParcel(Parcel in) {
return new Menu(in);
}
@ -132,7 +123,7 @@ public class Menu implements Parcelable{
}
};
@Override
@NonNull @Override
public String toString() {
return "Menu{" +
"type=" + type +

View file

@ -51,4 +51,10 @@
<string name="combo_tbr_count">Anzahl TBR</string>
<string name="bolusstopped">Bolus gestoppt</string>
<string name="bolusstopping">Bolus wird gestoppt</string>
<string name="pump_commerror_label">Komm. Fehleranzahl</string>
<string name="show_comm_error_count_title">Zeige Komm.-Fehleranzahl</string>
<string name="show_comm_error_count_summary">Zeigt die Fehleranzahl bei der Kommunikation mit Ruffy an. In den meisten Fällen zeigt eine Zahl höher als 0 an, dass Ruffy Kommunikationsprobleme vorliegen (ein Neustart kann erforderlich sein).</string>
<string name="combo_error_display_never">Nie</string>
<string name="combo_error_display_error">Bei Fehler</string>
<string name="combo_error_display_always">Immer</string>
</resources>

View file

@ -1,30 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="combo_programming_bolus">Cláir Caidéil bólas</string>
<string name="combo_pump_state_label">Stáit</string>
<string name="combo_pump_activity_label">Gníomhaíocht</string>
<string name="combo_no_pump_connection">Níl nasc le haghaidh %1$d nóim</string>
<string name="combo_tbr_remaining">%1$d%% (%2$d nóim fágtha)</string>
<string name="combo_pump_state_initializing">Tosaithe</string>
<string name="combo_pump_state_suspended_due_to_error">Ar fionraí ag earráid</string>
<string name="combo_pump_state_suspended_by_user">Ar fionraí ag úsáideoir</string>
<string name="combo_pump_state_running">Ag reáchtáil</string>
<string name="combo_pump_action_cancelling_tbr">Cealú BRS</string>
<string name="combo_pump_action_setting_tbr">Socrú BRS (%1$d%% / %2$d nóim)</string>
<string name="combo_pump_action_bolusing">Ag bólas (%1$.1f A)</string>
<string name="combo_pump_action_refreshing">Athnuaigh</string>
<string name="combo_pump_connected_now">Anois</string>
<string name="combo_activity_reading_pump_history">Léigh stair caidéil</string>
<string name="combo_activity_setting_basal_profile">Socrú próifíl bunaidh</string>
<string name="combo_pump_cartridge_low_warrning">Is leibhéal cartús íseal</string>
<string name="combo_pump_battery_low_warrning">Is ceallraí Caidéil íseal</string>
<string name="combo_reservoir_low">Íseal</string>
<string name="combo_reservoir_empty">Folamh</string>
<string name="combo_reservoir_normal">Gnáth</string>
<string name="combo_notification_check_time_date">Is nuashonrú gá clog Caidéil</string>
<string name="combo_actvity_reading_basal_profile">Léigh próifíl bunaidh</string>
<string name="combo_activity_checking_pump_state">Athnuaigh caidéil stáit</string>
<string name="combo_activity_checking_for_history_changes">Ag féachaint d\'athruithe stair</string>
<string name="bolusstopped">Bólas stopadh</string>
<string name="bolusstopping">Ag stopadh bólas</string>
</resources>
<resources></resources>

View file

@ -1,5 +1,5 @@
android {
compileSdkVersion 31
compileSdkVersion 33
defaultConfig {
minSdkVersion 28
targetSdkVersion 28

View file

@ -22,6 +22,18 @@ dependencies {
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
// This is necessary to prevent Gradle build errors like:
//
// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
//
// By explicitly adding these dependencies, the jetifier
// is forced to use the correct lifecycle version instead
// of automatically picking 2.3.1.
//
// See: https://stackoverflow.com/a/69832319/560774
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
}
allOpen {

View file

@ -8,6 +8,8 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<application android:supportsRtl="true">
<activity
android:name="info.nightscout.androidaps.activities.TDDStatsActivity"

View file

@ -31,17 +31,18 @@ fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject =
JSONObject()
.put("timeshift", timeshift)
.put("percentage", percentage)
.put("duration", T.msecs(duration).mins())
.put("profile", getCustomizedName())
.put("originalProfileName", profileName)
.also { // remove customization to store original profileJson in toPureNsJson call
timeshift = 0
percentage = 100
}
.put("originalDuration", duration)
.put("created_at", dateUtil.toISOString(timestamp))
.put("enteredBy", "openaps://" + "AndroidAPS")
.put("isValid", isValid)
.put("eventType", TherapyEvent.Type.PROFILE_SWITCH.text)
.put("duration", T.msecs(duration).mins())
.also { // remove customization to store original profileJson in toPureNsJson call
timeshift = 0
percentage = 100
}
.put("profileJson", ProfileSealed.PS(this).toPureNsJson(dateUtil).toString())
.also {
if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId)
@ -66,6 +67,7 @@ fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject =
fun profileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil, activePlugin: ActivePlugin): ProfileSwitch? {
val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null
val duration = JsonHelper.safeGetLong(jsonObject, "duration")
val originalDuration = JsonHelper.safeGetLongAllowNull(jsonObject, "originalDuration")
val timeshift = JsonHelper.safeGetLong(jsonObject, "timeshift")
val percentage = JsonHelper.safeGetInt(jsonObject, "percentage", 100)
val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true)
@ -93,10 +95,10 @@ fun profileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil, activePlug
icBlocks = profileSealed.icBlocks,
targetBlocks = profileSealed.targetBlocks,
glucoseUnit = ProfileSwitch.GlucoseUnit.fromConstant(profileSealed.units),
profileName = originalProfileName?: profileName,
timeshift = T.hours(timeshift).msecs(),
profileName = originalProfileName ?: profileName,
timeshift = timeshift,
percentage = percentage,
duration = T.mins(duration).msecs(),
duration = originalDuration ?: T.mins(duration).msecs(),
insulinConfiguration = profileSealed.insulinConfiguration,
isValid = isValid
).also {

View file

@ -96,12 +96,15 @@ interface Pump {
fun isThisProfileSet(profile: Profile): Boolean
/**
* @return timestamp of last connection to the pump
* @return timestamp of last connection to the pump in milliseconds
*/
fun lastDataTime(): Long
/**
* Currently running base basal rate [U/h]
*
* This _must not_ be affected by current pump states
* (TBRs, pump suspended/running etc.)
*/
val baseBasalRate: Double

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.general.maintenance
import android.content.Context
import android.os.Environment
import info.nightscout.androidaps.annotations.OpenForTesting
import info.nightscout.androidaps.core.R
@ -26,7 +27,8 @@ class PrefFileListProvider @Inject constructor(
private val config: Config,
private val encryptedPrefsFormat: EncryptedPrefsFormat,
private val storage: Storage,
private val versionCheckerUtils: VersionCheckerUtils
private val versionCheckerUtils: VersionCheckerUtils,
context: Context
) {
@Suppress("DEPRECATION")
private val path = File(Environment.getExternalStorageDirectory().toString())
@ -34,6 +36,7 @@ class PrefFileListProvider @Inject constructor(
private val exportsPath = File(path, "AAPS" + File.separator + "exports")
private val tempPath = File(path, "AAPS" + File.separator + "temp")
private val extraPath = File(path, "AAPS" + File.separator + "extra")
val logsPath: String = File(path, "AAPS" + File.separator + "logs" + File.separator + context.packageName).absolutePath
companion object {
@ -85,7 +88,7 @@ class PrefFileListProvider @Inject constructor(
return checkMetadata(encryptedPrefsFormat.loadMetadata(contents))
}
fun legacyFile(): File {
@Suppress("unused") fun legacyFile(): File {
return File(path, rh.gs(R.string.app_name) + "Preferences")
}

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.plugins.iob.iobCobCalculator
import androidx.collection.LongSparseArray
import androidx.collection.size
import info.nightscout.androidaps.annotations.OpenForTesting
import info.nightscout.androidaps.data.InMemoryGlucoseValue
import info.nightscout.androidaps.database.AppRepository
@ -41,7 +42,7 @@ class AutosensDataStore {
AutosensDataStore().also {
synchronized(dataLock) {
it.bgReadings = this.bgReadings.toMutableList()
it.autosensDataTable = this.autosensDataTable.clone()
it.autosensDataTable = LongSparseArray<AutosensData>(this.autosensDataTable.size).apply { putAll(this@AutosensDataStore.autosensDataTable) }
it.bucketedData = this.bucketedData?.toMutableList()
}
}
@ -57,7 +58,7 @@ class AutosensDataStore {
synchronized(autosensDataTable) {
for (index in autosensDataTable.size() - 1 downTo 0) {
if (autosensDataTable.keyAt(index) > time) {
aapsLogger.debug(LTag.AUTOSENS, "Removing from autosensDataTable: " + dateUtil.dateAndTimeAndSecondsString(autosensDataTable.keyAt(index)))
aapsLogger.debug(LTag.AUTOSENS) { "Removing from autosensDataTable: ${dateUtil.dateAndTimeAndSecondsString(autosensDataTable.keyAt(index))}" }
autosensDataTable.removeAt(index)
} else {
break
@ -135,10 +136,10 @@ class AutosensDataStore {
return null
}
return if (data.time < System.currentTimeMillis() - 11 * 60 * 1000) {
aapsLogger.debug(LTag.AUTOSENS, "AUTOSENSDATA null: data is old (" + reason + ") size()=" + autosensDataTable.size() + " lastData=" + dateUtil.dateAndTimeAndSecondsString(data.time))
aapsLogger.debug(LTag.AUTOSENS) { "AUTOSENSDATA null: data is old ($reason) size()=${autosensDataTable.size()} lastData=${dateUtil.dateAndTimeAndSecondsString(data.time)}" }
null
} else {
aapsLogger.debug(LTag.AUTOSENS, "AUTOSENSDATA ($reason) $data")
aapsLogger.debug(LTag.AUTOSENS) { "AUTOSENSDATA ($reason) $data" }
data
}
}
@ -164,7 +165,7 @@ class AutosensDataStore {
.compatGetBgReadingsDataFromTime(start, to + T.mins(2).msecs(), false)
.blockingGet()
.filter { it.value >= 39 }
aapsLogger.debug(LTag.AUTOSENS, "BG data loaded. Size: " + bgReadings.size + " Start date: " + dateUtil.dateAndTimeString(start) + " End date: " + dateUtil.dateAndTimeString(to))
aapsLogger.debug(LTag.AUTOSENS) { "BG data loaded. Size: ${bgReadings.size} Start date: ${dateUtil.dateAndTimeString(start)} End date: ${dateUtil.dateAndTimeString(to)}" }
createBucketedData(aapsLogger, dateUtil)
rxBus.send(EventBucketedDataCreated())
}
@ -184,13 +185,13 @@ class AutosensDataStore {
totalDiff += diff
diff = abs(diff)
if (diff > T.secs(30).msecs()) {
aapsLogger.debug(LTag.AUTOSENS, "Interval detection: values: " + bgReadings.size + " diff: " + diff / 1000 + "[s] is5minData: " + false)
aapsLogger.debug(LTag.AUTOSENS, "Interval detection: values: ${bgReadings.size} diff: ${diff / 1000}[s] is5minData: false")
return false
}
}
val averageDiff = totalDiff / bgReadings.size / 1000
val is5minData = averageDiff < 1
aapsLogger.debug(LTag.AUTOSENS, "Interval detection: values: " + bgReadings.size + " averageDiff: " + averageDiff + "[s] is5minData: " + is5minData)
aapsLogger.debug(LTag.AUTOSENS, "Interval detection: values: ${bgReadings.size} averageDiff: $averageDiff[s] is5minData: $is5minData")
return is5minData
}
}
@ -239,8 +240,7 @@ class AutosensDataStore {
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(5).msecs()
val adjustedTime = adjustToReferenceTime(currentTime)
// after adjusting time may be newer. In this case use T-5min
if (adjustedTime > currentTime) currentTime = adjustedTime - T.mins(5).msecs()
else currentTime = adjustedTime
currentTime = if (adjustedTime > currentTime) adjustedTime - T.mins(5).msecs() else adjustedTime
aapsLogger.debug("Adjusted time " + dateUtil.dateAndTimeAndSecondsString(currentTime))
//log.debug("First reading: " + new Date(currentTime).toLocaleString());
while (true) {
@ -270,7 +270,7 @@ class AutosensDataStore {
}
val bData: MutableList<InMemoryGlucoseValue> = ArrayList()
bData.add(InMemoryGlucoseValue(bgReadings[0]))
aapsLogger.debug(LTag.AUTOSENS, "Adding. bgTime: " + dateUtil.toISOString(bgReadings[0].timestamp) + " lastBgTime: " + "none-first-value" + " " + bgReadings[0].toString())
aapsLogger.debug(LTag.AUTOSENS) { "Adding. bgTime: ${dateUtil.toISOString(bgReadings[0].timestamp)} lastBgTime: none-first-value ${bgReadings[0]}" }
var j = 0
for (i in 1 until bgReadings.size) {
val bgTime = bgReadings[i].timestamp
@ -293,7 +293,7 @@ class AutosensDataStore {
val newBgReading = InMemoryGlucoseValue(nextBgTime, nextBg.roundToLong().toDouble(), true)
//console.error("Interpolated", bData[j]);
bData.add(newBgReading)
aapsLogger.debug(LTag.AUTOSENS, "Adding. bgTime: " + dateUtil.toISOString(bgTime) + " lastBgTime: " + dateUtil.toISOString(lastBgTime) + " " + newBgReading.toString())
aapsLogger.debug(LTag.AUTOSENS) { "Adding. bgTime: ${dateUtil.toISOString(bgTime)} lastBgTime: ${dateUtil.toISOString(lastBgTime)} $newBgReading" }
elapsedMinutes -= 5
lastBg = nextBg
lastBgTime = nextBgTime
@ -301,14 +301,14 @@ class AutosensDataStore {
j++
val newBgReading = InMemoryGlucoseValue(bgTime, bgReadings[i].value)
bData.add(newBgReading)
aapsLogger.debug(LTag.AUTOSENS, "Adding. bgTime: " + dateUtil.toISOString(bgTime) + " lastBgTime: " + dateUtil.toISOString(lastBgTime) + " " + newBgReading.toString())
aapsLogger.debug(LTag.AUTOSENS) { "Adding. bgTime: ${dateUtil.toISOString(bgTime)} lastBgTime: ${dateUtil.toISOString(lastBgTime)} $newBgReading" }
}
abs(elapsedMinutes) > 2 -> {
j++
val newBgReading = InMemoryGlucoseValue(bgTime, bgReadings[i].value)
bData.add(newBgReading)
aapsLogger.debug(LTag.AUTOSENS, "Adding. bgTime: " + dateUtil.toISOString(bgTime) + " lastBgTime: " + dateUtil.toISOString(lastBgTime) + " " + newBgReading.toString())
aapsLogger.debug(LTag.AUTOSENS) { "Adding. bgTime: ${dateUtil.toISOString(bgTime)} lastBgTime: ${dateUtil.toISOString(lastBgTime)} $newBgReading" }
}
else -> {
@ -327,7 +327,7 @@ class AutosensDataStore {
val previous = bData[i + 1]
val mSecDiff = current.timestamp - previous.timestamp
val adjusted = (mSecDiff - T.mins(5).msecs()) / 1000
aapsLogger.debug(LTag.AUTOSENS, "Adjusting bucketed data time. Current: " + dateUtil.dateAndTimeAndSecondsString(current.timestamp) + " to: " + dateUtil.dateAndTimeAndSecondsString(previous.timestamp + T.mins(5).msecs()) + " by " + adjusted + " sec")
aapsLogger.debug(LTag.AUTOSENS) { "Adjusting bucketed data time. Current: ${dateUtil.dateAndTimeAndSecondsString(current.timestamp)} to: ${dateUtil.dateAndTimeAndSecondsString(previous.timestamp + T.mins(5).msecs())} by $adjusted sec" }
if (abs(adjusted) > 90) {
// too big adjustment, fallback to non 5 min data
aapsLogger.debug(LTag.AUTOSENS, "Fallback to non 5 min data")
@ -354,5 +354,4 @@ class AutosensDataStore {
}
return if (count != 0) sum / count else 0.0
}
}

View file

@ -43,11 +43,10 @@ class BlePreCheck @Inject constructor(
}
// change after SDK = 31+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_CONNECT") != PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_SCAN") != PackageManager.PERMISSION_GRANTED
if (ContextCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED
) {
//ActivityCompat.requestPermissions(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_BLUETOOTH)
ActivityCompat.requestPermissions(activity, arrayOf("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT"), PERMISSION_REQUEST_BLUETOOTH)
ActivityCompat.requestPermissions(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_BLUETOOTH)
return false
}
}

View file

@ -74,7 +74,7 @@ class AlarmSoundService : DaggerService() {
if (intent?.hasExtra(ErrorHelperActivity.SOUND_ID) == true) resourceId = intent.getIntExtra(ErrorHelperActivity.SOUND_ID, R.raw.error)
player = MediaPlayer()
try {
val afd = rh.openRawResourceFd(resourceId) ?: return START_STICKY
val afd = rh.openRawResourceFd(resourceId) ?: return START_NOT_STICKY
player?.setDataSource(afd.fileDescriptor, afd.startOffset, afd.length)
afd.close()
player?.isLooping = true
@ -94,7 +94,7 @@ class AlarmSoundService : DaggerService() {
aapsLogger.error("Unhandled exception", e)
}
aapsLogger.debug(LTag.CORE, "onStartCommand End")
return START_STICKY
return START_NOT_STICKY
}
override fun onDestroy() {

View file

@ -27,15 +27,12 @@ class ActionModeHelper<T>(val rh: ResourceHelper, val activity: FragmentActivity
return parentClass == "SingleFragmentActivity"
}
val enableRemove: Boolean
private val enableRemove: Boolean
get() = onRemove != null
val isNoAction: Boolean
get() = actionMode == null && removeActionMode == null && sortActionMode == null
val isAction: Boolean
get() = actionMode != null
val isSorting: Boolean
get() = sortActionMode != null
@ -98,14 +95,6 @@ class ActionModeHelper<T>(val rh: ResourceHelper, val activity: FragmentActivity
return false
}
fun startSort(): Boolean {
if (sortActionMode == null) {
sortActionMode = activity?.startActionMode(SortActionModeCallback())
return true
}
return false
}
fun isSelected(position: Int) =
selectedItems.get(position) != null

View file

@ -0,0 +1,33 @@
package info.nightscout.androidaps.utils.ui
import android.Manifest
import kotlin.jvm.JvmOverloads
import android.bluetooth.BluetoothManager
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.util.AttributeSet
import androidx.core.app.ActivityCompat
import androidx.preference.ListPreference
import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.utils.ToastUtils
import java.util.*
class BluetoothDevicePreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ListPreference(context, attrs) {
init {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
val devices = Vector<CharSequence>()
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.let { bta ->
for (dev in bta.bondedDevices)
dev.name?.let { name -> devices.add(name) }
}
entries = devices.toTypedArray()
entryValues = devices.toTypedArray()
} else {
entries = emptyArray()
entryValues = emptyArray()
ToastUtils.errorToast(context, context.getString(R.string.needconnectpermission))
}
}
}

View file

@ -31,7 +31,6 @@
<string name="format_mins">%1$d мин</string>
<string name="pumpbusy">Помпата е заета</string>
<string name="connectionerror">Грешка при връзка с помпата</string>
<string name="youareonallowedlimit">Достигнахте лимита</string>
<string name="objectives">Цели</string>
<string name="close">Затвори</string>
<string name="please_wait">Моля изчакайте...</string>
@ -40,7 +39,6 @@
<string name="stoppressed">Натиснат е СТОП!</string>
<string name="stop">Стоп</string>
<string name="carbs">въглехидрати</string>
<string name="invalidprofile">Грешен профил !!!</string>
<string name="noprofileset">НЕ Е АКТИВИРАН ПРОФИЛ</string>
<string name="active"><![CDATA[<Активно>]]></string>
<string name="date">Дата</string>
@ -132,7 +130,6 @@
<string name="passwords_dont_match">Паролите не съвпадат</string>
<!-- Profile-->
<string name="basalprofilenotaligned">Базалните стойности не са за кръгли часове: %1$s</string>
<string name="minimalbasalvaluereplaced">Базалната стойност е заместена от минимално поддържаната стойност %1$s</string>
<string name="maximumbasalvaluereplaced">Базалната стойност е заместена от максимално поддържаната стойност %1$s</string>
<string name="profile_per_unit">/Е</string>
<string name="profile_ins_units_per_hour">Е</string>
@ -210,7 +207,6 @@
<string name="waitingforpumpresult">Изчаква резултат от помпата</string>
<string name="smb_shortname">SMB</string>
<!-- CarbsReq-->
<string name="carbsreq">%1$dгр допълнителни въглехидрати ще са необходими до %2$d минути</string>
<!-- TDDStatsActivity-->
<string name="stats">Статистика</string>
<string name="cumulative_tdd">Комулативна TDD</string>
@ -222,7 +218,6 @@
<string name="amount_days"># дни</string>
<string name="weight">Тегло</string>
<string name="warning_Message">Възможна неточност, ако сте използвали болус за презареждане!</string>
<string name="olddata_Message">Стари данни - натиснете \"ПРЕЗАРЕДИ\"</string>
<string name="tbb">Общо базален инсулин</string>
<string name="tbb2">ОБИ * 2</string>
<!-- Ntp-->
@ -289,6 +284,7 @@
<string name="sms" comment="26 characters max for translation">SMS</string>
<string name="basal">Базал</string>
<!-- Autotune -->
<string name="needconnectpermission">Апликацията изисква разрешение за bluetooth</string>
<plurals name="days">
<item quantity="one">%1$d дeн</item>
<item quantity="other">%1$d дни</item>

View file

@ -70,4 +70,5 @@
<!-- Command Queue + readStatus reasons -->
<string name="basal">Basal</string>
<!-- Autotune -->
<string name="needconnectpermission">L\'aplicació necessita el permís del bluethoot</string>
</resources>

View file

@ -31,7 +31,7 @@
<string name="format_mins">%1$d min</string>
<string name="pumpbusy">Pumpa je zaneprázdněna</string>
<string name="connectionerror">Chyba připojování pumpy</string>
<string name="youareonallowedlimit">Dosaženo limitu</string>
<string name="youareonallowedlimit">Byl dosažen povolený limit</string>
<string name="objectives">Cíle</string>
<string name="close">Zavřít</string>
<string name="please_wait">Počkejte prosím…</string>
@ -40,7 +40,7 @@
<string name="stoppressed">STISKNUTO STOP</string>
<string name="stop">Stop</string>
<string name="carbs">Sacharidy</string>
<string name="invalidprofile">Chybný profil !!!</string>
<string name="invalidprofile">Neplatný profil!</string>
<string name="noprofileset">ŽÁDNÝ PROFIL NENASTAVEN</string>
<string name="active"><![CDATA[<Aktivní>]]></string>
<string name="date">Datum</string>
@ -140,7 +140,7 @@
<string name="pin_dont_match">PIN kódy se neshodují</string>
<!-- Profile-->
<string name="basalprofilenotaligned">Hodnoty bazálů nejsou zarovnané na celé hodiny: %1$s</string>
<string name="minimalbasalvaluereplaced">Hodnota bazálu nahrazena minimální možnou: %1$s</string>
<string name="minimalbasalvaluereplaced">Hodnota bazálu byla nahrazena minimální možnou: %1$s</string>
<string name="maximumbasalvaluereplaced">Hodnota bazálu nahrazena maximální možnou: %1$s</string>
<string name="profile_per_unit">/U</string>
<string name="profile_ins_units_per_hour">U/h</string>
@ -233,7 +233,7 @@
<string name="amount_days">Dní</string>
<string name="weight">Váha</string>
<string name="warning_Message">Pravděpodobně nepřesné při používání bolusů k doplňování</string>
<string name="olddata_Message">Zastaralá data. Prosím načtěte je znovu</string>
<string name="olddata_Message">Zastaralá data. Klepněte na tlačítko „OBNOVIT“.</string>
<string name="tbb">Celk. denní bazál</string>
<string name="tbb2">CZB * 2</string>
<!-- Ntp-->
@ -397,7 +397,7 @@
<string name="valueoutofrange">»%1$s« je mimo pevně nastavené limity</string>
<string name="value_out_of_hard_limits">»%1$s« %2$.2f je mimo pevně nastavené limity</string>
<string name="basal_value">Hodnota bazálu</string>
<string name="nsclient_version_does_not_match">Verze NSClient se neshoduje s AndroidAPS. Aktualizujte prosím.</string>
<string name="nsclient_version_does_not_match">Verze NSClientu se neshoduje s verzí AndroidAPS. Aktualizujte prosím.</string>
<!-- Command Queue + readStatus reasons -->
<string name="bolus_u_min">BOLUS %1$.2f U</string>
<string name="carbs_g">SACHARIDY %1$d g</string>
@ -489,6 +489,7 @@
<string name="autotune_run_with_autoswitch">Autotune spuštěno, a profil automaticky přepnut</string>
<string name="autotune_run_with_error">Chyba při posledním spuštění Autotune</string>
<string name="autotune_run_cancelled">Byla zjištěna jiná běžící úloha Autotune, spuštění zrušeno</string>
<string name="needconnectpermission">Aplikace potřebuje oprávnění bluetooth</string>
<plurals name="days">
<item quantity="one">%1$d den</item>
<item quantity="few">%1$d dnů</item>

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