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

This commit is contained in:
Philoul 2022-06-30 01:03:30 +02:00
commit 7a31057707
229 changed files with 2183 additions and 2018 deletions

View file

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

View file

@ -218,7 +218,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
//*********************************************************************************
console.error("---------------------------------------------------------");
console.error( " Dynamic ISF version Beta 1.5 ");
console.error( " Dynamic ISF version Beta 1.6.4 ");
console.error("---------------------------------------------------------");
@ -247,39 +247,50 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
/*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 TDD = (tdd7 * 0.4) + (tdd_pump * 0.6);
console.error("Pump extrapolated TDD = "+tdd_pump+"; ");
//if (tdd7 > 0){
if ( tdd_pump > tdd7 && now < 5 || now < 7 && TDD < ( 0.8 * tdd7 ) ){
TDD = ( 0.8 * tdd7 );
console.log("Excess or too low insulin from pump so TDD set to "+TDD+" based on 75% of TDD7; ");
rT.reason += "TDD: " +TDD+ " due to low or high tdd from pump; ";
}
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 );
else if (tdd_pump > (1.75 * tdd7)){
TDD = tdd7;
console.error("TDD set to TDD7 due to high pump usage reported. TDD = "+TDD+"; ");
rT.reason += "TDD set to TDD7 due to high pump usage reported. TDD = "+TDD+"; ";
}
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");
else if (tdd_pump < (0.33 * tdd7)){
TDD = (tdd7 * 0.25) + (tdd_pump * 0.75);
console.error("TDD weighted to pump due to low insulin usage. TDD = "+TDD+"; ");
rT.reason += "TDD weighted to pump due to low insulin usage. TDD = "+TDD+"; ";
}
//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+"; ");
else {
console.log("TDD = " +TDD+ " based on standard pump 60/tdd7 40 split; ");
rT.reason += "TDD: " +TDD+ " based on standard pump 60/tdd7 40 split; ";
}
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;
} else {
ins_val = 75; // rapid peak: 75
}
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;
var dynISFadjust = ( dynISFadjust / 100 );
var TDD = (dynISFadjust * TDD);
var variable_sens = (277700 / ( TDD * bg));
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+"; ");
@ -314,7 +325,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
console.log("ISF from "+variable_sens+" to "+sens+ "due to temp target; ");
}
else {
sensitivityRatio = ( tdd_24 / tdd7 );
sensitivityRatio = ( meal_data.TDD24 / tdd7 );
}
if (sensitivityRatio > 1) {
sensitivityRatio = Math.min(sensitivityRatio, profile.autosens_max);
@ -501,8 +512,14 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
return rT;
}
// min_bg of 90 -> threshold of 65, 100 -> 70 110 -> 75, and 130 -> 85
// min_bg of 90 -> threshold of 65, 100 -> 70 110 -> 75, and 130 -> 85, or if specified by user, take that value
var lgsThreshold = profile.lgsThreshold;
var threshold = min_bg - 0.5*(min_bg-40);
var oldThreshold = threshold;
if (lgsThreshold >= 65 && lgsThreshold <= 120 && lgsThreshold > threshold) {
threshold = lgsThreshold;
}
console.error("Threshold set from " + convert_bg(oldThreshold, profile) + " to " + convert_bg(threshold, profile) + "; ");
//console.error(reservoir_data);
@ -808,23 +825,26 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
console.log("EventualBG is" +eventualBG+" ;");
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 = ( 277700 / (TDD * ((eventualBG * 0.5) + (bg * 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;";
var future_sens = ( 1800 / (Math.log((((eventualBG * 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;";
}
else if( glucose_status.delta > 0 && eventualBG > target_bg ) {
var future_sens = ( 277700 / (TDD * 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 = ( 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;";
var future_sens = ( 1800 / (Math.log((eventualBG/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;";
}
var future_sens = round(future_sens,1);
future_sens = round(future_sens,1);

View file

@ -350,7 +350,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
}
}
if (pref is EditTextPreference) {
if (pref.getKey().contains("password") || pref.getKey().contains("pin") || pref.getKey().contains("secret")) {
if (pref.getKey().contains("password") || pref.getKey().contains("pin") || pref.getKey().contains("secret") || pref.getKey().contains("token")) {
pref.setSummary("******")
} else if (pref.text != null) {
pref.dialogMessage = pref.dialogMessage

View file

@ -16,12 +16,12 @@ import info.nightscout.androidaps.dependencyInjection.AutotuneModule
import info.nightscout.androidaps.diaconn.di.DiaconnG8Module
import info.nightscout.androidaps.insight.di.InsightDatabaseModule
import info.nightscout.androidaps.insight.di.InsightModule
import info.nightscout.androidaps.plugin.general.openhumans.dagger.OpenHumansModule
import info.nightscout.androidaps.plugin.general.openhumans.di.OpenHumansModule
import info.nightscout.androidaps.plugins.pump.common.di.PumpCommonModule
import info.nightscout.androidaps.plugins.pump.common.di.RileyLinkModule
import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule
import info.nightscout.androidaps.plugins.pump.omnipod.dash.dagger.OmnipodDashModule
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodErosModule
import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule
import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule
import info.nightscout.shared.di.SharedModule
import javax.inject.Singleton

View file

@ -143,7 +143,7 @@ class CarbsDialog : DialogFragmentWithDate() {
)
val plus1text = toSignedString(sp.getInt(R.string.key_carbs_button_increment_1, FAV1_DEFAULT))
binding.plus1.text = plus1text
binding.plus1.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus1text
binding.plus1.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus1text
binding.plus1.setOnClickListener {
binding.carbs.value = max(
0.0, binding.carbs.value
@ -155,7 +155,7 @@ class CarbsDialog : DialogFragmentWithDate() {
val plus2text = toSignedString(sp.getInt(R.string.key_carbs_button_increment_2, FAV2_DEFAULT))
binding.plus2.text = plus2text
binding.plus2.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus2text
binding.plus2.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus2text
binding.plus2.setOnClickListener {
binding.carbs.value = max(
0.0, binding.carbs.value
@ -166,7 +166,7 @@ class CarbsDialog : DialogFragmentWithDate() {
}
val plus3text = toSignedString(sp.getInt(R.string.key_carbs_button_increment_3, FAV3_DEFAULT))
binding.plus3.text = plus3text
binding.plus2.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus3text
binding.plus2.contentDescription = rh.gs(R.string.treatments_wizard_carbs_label) + " " + plus3text
binding.plus3.setOnClickListener {
binding.carbs.value = max(
0.0, binding.carbs.value
@ -179,7 +179,7 @@ class CarbsDialog : DialogFragmentWithDate() {
setOnValueChangedListener { eventTime: Long ->
run {
val timeOffset = ((eventTime - eventTimeOriginal) / (1000 * 60)).toDouble()
binding.time.value = timeOffset
if (_binding != null) binding.time.value = timeOffset
}
}
@ -250,7 +250,8 @@ class CarbsDialog : DialogFragmentWithDate() {
val hypoSelected = binding.hypoTt.isChecked
if (hypoSelected)
actions.add(
rh.gs(R.string.temptargetshort) + ": " + (DecimalFormatter.to1Decimal(hypoTT) + " " + unitLabel + " (" + rh.gs(R.string.format_mins, hypoTTDuration) + ")").formatColor( context,
rh.gs(R.string.temptargetshort) + ": " + (DecimalFormatter.to1Decimal(hypoTT) + " " + unitLabel + " (" + rh.gs(R.string.format_mins, hypoTTDuration) + ")").formatColor(
context,
rh,
R.attr.tempTargetConfirmation
)
@ -258,7 +259,7 @@ class CarbsDialog : DialogFragmentWithDate() {
val timeOffset = binding.time.value.toInt()
if (useAlarm && carbs > 0 && timeOffset > 0)
actions.add(rh.gs(R.string.alarminxmin, timeOffset).formatColor(context , rh, R.attr.infoColor))
actions.add(rh.gs(R.string.alarminxmin, timeOffset).formatColor(context, rh, R.attr.infoColor))
val duration = binding.duration.value.toInt()
if (duration > 0)
actions.add(rh.gs(R.string.duration) + ": " + duration + rh.gs(R.string.shorthour))
@ -385,7 +386,7 @@ class CarbsDialog : DialogFragmentWithDate() {
override fun onResume() {
super.onResume()
if(!queryingProtection) {
if (!queryingProtection) {
queryingProtection = true
activity?.let { activity ->
val cancelFail = {

View file

@ -72,7 +72,7 @@ class WizardDialog : DaggerDialogFragment() {
private var wizard: BolusWizard? = null
private var calculatedPercentage = 100.0
private var calculatedCorrection = 0.0
private var correctionPercent = false
private var usePercentage = false
private var carbsPassedIntoWizard = 0.0
private var notesPassedIntoWizard = ""
private var okClicked: Boolean = false // one shot guards
@ -157,7 +157,7 @@ class WizardDialog : DaggerDialogFragment() {
?: 0.0, 0.0, maxCarbs.toDouble(), 1.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher
)
if (correctionPercent) {
if (usePercentage) {
calculatedPercentage = sp.getInt(R.string.key_boluswizard_percentage, 100).toDouble()
binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher)
binding.correctionInput.value = calculatedPercentage
@ -176,6 +176,7 @@ class WizardDialog : DaggerDialogFragment() {
handler.post { initDialog() }
calculatedPercentage = sp.getInt(R.string.key_boluswizard_percentage, 100).toDouble()
binding.percentUsed.text = rh.gs(R.string.format_percent, sp.getInt(R.string.key_boluswizard_percentage, 100))
binding.percentUsed.visibility = (sp.getInt(R.string.key_boluswizard_percentage, 100) != 100 || usePercentage).toVisibility()
// ok button
binding.okcancel.ok.setOnClickListener {
if (okClicked) {
@ -227,8 +228,8 @@ class WizardDialog : DaggerDialogFragment() {
run {
sp.putBoolean(rh.gs(R.string.key_wizard_correction_percent), isChecked)
binding.correctionUnit.text = if (isChecked) "%" else rh.gs(R.string.insulin_unit_shortname)
correctionPercent = binding.correctionPercent.isChecked
if (correctionPercent) {
usePercentage = binding.correctionPercent.isChecked
if (usePercentage) {
binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher)
binding.correctionInput.customContentDescription = rh.gs(R.string.a11_correction_percentage)
} else {
@ -239,7 +240,7 @@ class WizardDialog : DaggerDialogFragment() {
binding.correctionInput.customContentDescription = rh.gs(R.string.a11_correction_units)
}
binding.correctionInput.updateA11yDescription()
binding.correctionInput.value = if (correctionPercent) calculatedPercentage else Round.roundTo(calculatedCorrection, bolusStep)
binding.correctionInput.value = if (usePercentage) calculatedPercentage else Round.roundTo(calculatedCorrection, bolusStep)
}
}
// profile
@ -320,8 +321,8 @@ class WizardDialog : DaggerDialogFragment() {
private fun loadCheckedStates() {
binding.bgTrendCheckbox.isChecked = sp.getBoolean(R.string.key_wizard_include_trend_bg, false)
binding.cobCheckbox.isChecked = sp.getBoolean(R.string.key_wizard_include_cob, false)
correctionPercent = sp.getBoolean(R.string.key_wizard_correction_percent, false)
binding.correctionPercent.isChecked = correctionPercent
usePercentage = sp.getBoolean(R.string.key_wizard_correction_percent, false)
binding.correctionPercent.isChecked = usePercentage
}
private fun valueToUnitsToString(value: Double, units: String): String =
@ -370,8 +371,6 @@ class WizardDialog : DaggerDialogFragment() {
binding.iobInsulin.text = rh.gs(R.string.formatinsulinunits, -bolusIob.iob - basalIob.basaliob)
calculateInsulin()
binding.percentUsed.visibility = (sp.getInt(R.string.key_boluswizard_percentage, 100) != 100 || correctionPercent).toVisibility()
}
}

View file

@ -192,6 +192,11 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.profile.put("sens", profile.getIsfMgdl())
this.profile.put("max_daily_safety_multiplier", sp.getInt(R.string.key_openapsama_max_daily_safety_multiplier, 3))
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))
@ -222,7 +227,9 @@ 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("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)
@ -263,9 +270,13 @@ 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("TDDPUMP", tddCalculator.calculateDaily().totalAmount)
this.mealData.put("TDDLast24", tddCalculator.calculate24Daily().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)
if (constraintChecker.isAutosensModeEnabled().value()) {
autosensData.put("ratio", autosensDataRatio)

View file

@ -2,7 +2,9 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
import info.nightscout.androidaps.utils.T
import javax.inject.Inject
@ -10,14 +12,21 @@ import javax.inject.Inject
class Objective6(injector: HasAndroidInjector) : Objective(injector, "maxiob", R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate) {
@Inject lateinit var constraintChecker: ConstraintChecker
@Inject lateinit var safetyPlugin: SafetyPlugin
init {
tasks.add(MinimumDurationTask(this, T.days(1).msecs()))
tasks.add(object : Task(this, R.string.maxiobset) {
override fun isCompleted(): Boolean {
val maxIOB = constraintChecker.getMaxIOBAllowed().value()
return maxIOB > 0
}
})
tasks.add(
object : Task(this, R.string.closedmodeenabled) {
override fun isCompleted(): Boolean = sp.getString(R.string.key_aps_mode, "open") == "closed"
})
tasks.add(
object : Task(this, R.string.maxiobset) {
override fun isCompleted(): Boolean {
val maxIOB = constraintChecker.getMaxIOBAllowed().value()
return maxIOB > 0
}
})
}
}

View file

@ -18,37 +18,37 @@ import dagger.android.HasAndroidInjector
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.LocalInsulin
import info.nightscout.androidaps.data.ProfileSealed
import info.nightscout.androidaps.database.entities.UserEntry
import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.databinding.AutotuneFragmentBinding
import info.nightscout.androidaps.dialogs.ProfileViewerDialog
import info.nightscout.androidaps.extensions.runOnUiThread
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.autotune.data.ATProfile
import info.nightscout.androidaps.plugins.general.autotune.events.EventAutotuneUpdateGui
import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin
import info.nightscout.androidaps.plugins.profile.local.events.EventLocalProfileChanged
import info.nightscout.androidaps.data.LocalInsulin
import info.nightscout.androidaps.data.ProfileSealed
import info.nightscout.androidaps.database.entities.UserEntry
import info.nightscout.androidaps.database.entities.ValueWithUnit
import info.nightscout.androidaps.extensions.runOnUiThread
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.MidnightTime
import info.nightscout.androidaps.utils.Round
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.SafeParse
import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import org.json.JSONObject
//import org.slf4j.LoggerFactory
import java.text.DecimalFormat
import java.util.*
import javax.inject.Inject
class AutotuneFragment : DaggerFragment() {
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var autotunePlugin: AutotunePlugin
@Inject lateinit var autotuneFS: AutotuneFS
@ -61,13 +61,16 @@ class AutotuneFragment : DaggerFragment() {
@Inject lateinit var rh: ResourceHelper
@Inject lateinit var rxBus: RxBus
@Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var aapsSchedulers: AapsSchedulers
private var disposable: CompositeDisposable = CompositeDisposable()
//private val log = LoggerFactory.getLogger(AutotunePlugin::class.java)
private var _binding: AutotuneFragmentBinding? = null
private lateinit var profileStore: ProfileStore
private var profileName = ""
private lateinit var profile: ATProfile
private var profile: ATProfile? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
@ -88,12 +91,13 @@ class AutotuneFragment : DaggerFragment() {
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 ->
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?:currentProfile, LocalInsulin(""), injector)
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector)
}
binding.tuneDays.setParams(
savedInstanceState?.getDouble("tunedays")
?: defaultValue, 1.0, 30.0, 1.0, DecimalFormat("0"), false, null, textWatcher)
?: defaultValue, 1.0, 30.0, 1.0, DecimalFormat("0"), false, null, textWatcher
)
binding.autotuneRun.setOnClickListener {
val daysBack = SafeParse.stringToInt(binding.tuneDays.text)
autotunePlugin.calculationRunning = true
@ -105,11 +109,10 @@ class AutotuneFragment : DaggerFragment() {
updateGui()
}
binding.profileList.onItemClickListener = AdapterView.OnItemClickListener { _, _, _, _ ->
if (!autotunePlugin.calculationRunning)
{
if (!autotunePlugin.calculationRunning) {
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
profileFunction.getProfile()?.let { currentProfile ->
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?:currentProfile, LocalInsulin(""), injector)
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector)
}
autotunePlugin.selectedProfile = profileName
resetParam()
@ -120,7 +123,7 @@ class AutotuneFragment : DaggerFragment() {
binding.autotuneCopylocal.setOnClickListener {
val localName = rh.gs(R.string.autotune_tunedprofile_name) + " " + dateUtil.dateAndTimeString(autotunePlugin.lastRun)
val circadian = sp.getBoolean(R.string.key_autotune_circadian_ic_isf, false)
autotunePlugin.tunedProfile?.let { tunedProfile ->
autotunePlugin.tunedProfile?.let { tunedProfile ->
showConfirmation(requireContext(),
rh.gs(R.string.autotune_copy_localprofile_button),
rh.gs(R.string.autotune_copy_local_profile_message) + "\n" + localName + " " + dateUtil.dateAndTimeString(autotunePlugin.lastRun),
@ -204,13 +207,13 @@ class AutotuneFragment : DaggerFragment() {
binding.autotuneCompare.setOnClickListener {
val pumpProfile = autotunePlugin.pumpProfile
val circadian = sp.getBoolean(R.string.key_autotune_circadian_ic_isf, false)
val tunedprofile = if (circadian) autotunePlugin.tunedProfile?.circadianProfile else autotunePlugin.tunedProfile?.profile
val tunedProfile = if (circadian) autotunePlugin.tunedProfile?.circadianProfile else autotunePlugin.tunedProfile?.profile
ProfileViewerDialog().also { pvd ->
pvd.arguments = Bundle().also {
it.putLong("time", dateUtil.now())
it.putInt("mode", ProfileViewerDialog.Mode.PROFILE_COMPARE.ordinal)
it.putString("customProfile", pumpProfile.profile.toPureNsJson(dateUtil).toString())
it.putString("customProfile2", tunedprofile?.toPureNsJson(dateUtil).toString())
it.putString("customProfile2", tunedProfile?.toPureNsJson(dateUtil).toString())
it.putString("customProfileUnits", profileFunction.getUnits().asText)
it.putString("customProfileName", pumpProfile.profilename + "\n" + rh.gs(R.string.autotune_tunedprofile_name))
}
@ -270,10 +273,8 @@ class AutotuneFragment : DaggerFragment() {
super.onResume()
disposable += rxBus
.toObservable(EventAutotuneUpdateGui::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
updateGui()
}, { fabricPrivacy.logException(it) })
.observeOn(aapsSchedulers.main)
.subscribe({ updateGui() }, fabricPrivacy::logException)
checkNewDay()
updateGui()
}
@ -291,7 +292,7 @@ class AutotuneFragment : DaggerFragment() {
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 ->
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?:currentProfile, LocalInsulin(""), injector)
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector)
}
val profileList: ArrayList<CharSequence> = profileStore.getProfileList()
profileList.add(0, rh.gs(R.string.active))
@ -315,17 +316,18 @@ class AutotuneFragment : DaggerFragment() {
autotunePlugin.calculationRunning -> {
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_during_run)
}
autotunePlugin.lastRunSuccess -> {
binding.autotuneCopylocal.visibility = View.VISIBLE
binding.autotuneUpdateProfile.visibility = autotunePlugin.updateButtonVisibility
binding.autotuneRevertProfile.visibility = if (autotunePlugin.updateButtonVisibility == View.VISIBLE) View.GONE else View.VISIBLE
binding.autotuneProfileswitch.visibility = View.VISIBLE
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_after_run)
binding.autotuneCopylocal.visibility = View.VISIBLE
binding.autotuneUpdateProfile.visibility = autotunePlugin.updateButtonVisibility
binding.autotuneRevertProfile.visibility = if (autotunePlugin.updateButtonVisibility == View.VISIBLE) View.GONE else View.VISIBLE
binding.autotuneProfileswitch.visibility = View.VISIBLE
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_after_run)
binding.autotuneCompare.visibility = View.VISIBLE
}
else -> {
if (profile.isValid)
binding.autotuneRun.visibility = View.VISIBLE
binding.autotuneRun.visibility = (profile?.isValid == true).toVisibility()
binding.autotuneCheckInputProfile.visibility = View.VISIBLE
}
}
@ -335,10 +337,9 @@ class AutotuneFragment : DaggerFragment() {
private fun checkNewDay() {
val runToday = autotunePlugin.lastRun > MidnightTime.calc(dateUtil.now() - autotunePlugin.autotuneStartHour * 3600 * 1000L) + autotunePlugin.autotuneStartHour * 3600 * 1000L
if (runToday && autotunePlugin.result != "")
{
if (runToday && autotunePlugin.result != "") {
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_after_run)
} else if (!runToday || autotunePlugin.result.isEmpty()) { //if new day reinit result, default days, warning and button's visibility
} else if (!runToday || autotunePlugin.result.isEmpty()) { //if new day re-init result, default days, warning and button's visibility
resetParam(!runToday)
}
}
@ -348,17 +349,18 @@ class AutotuneFragment : DaggerFragment() {
var nl = ""
if (profileFunction.getProfile() == null) {
warning = rh.gs(R.string.profileswitch_ismissing)
return warning
return warning
}
profileFunction.getProfile()?.let { currentProfile ->
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?:currentProfile, LocalInsulin(""), injector)
if (!profile.isValid) return rh.gs(R.string.autotune_profile_invalid)
if (profile.icSize > 1) {
warning += nl + rh.gs(R.string.autotune_ic_warning, profile.icSize, profile.ic)
nl = "\n"
}
if (profile.isfSize > 1) {
warning += nl + rh.gs(R.string.autotune_isf_warning, profile.isfSize, Profile.fromMgdlToUnits(profile.isf, profileFunction.getUnits()), profileFunction.getUnits().asText)
profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector).also { profile ->
if (!profile.isValid) return rh.gs(R.string.autotune_profile_invalid)
if (profile.icSize > 1) {
warning += nl + rh.gs(R.string.autotune_ic_warning, profile.icSize, profile.ic)
nl = "\n"
}
if (profile.isfSize > 1) {
warning += nl + rh.gs(R.string.autotune_isf_warning, profile.isfSize, Profile.fromMgdlToUnits(profile.isf, profileFunction.getUnits()), profileFunction.getUnits().asText)
}
}
}
return warning
@ -376,7 +378,10 @@ class AutotuneFragment : DaggerFragment() {
}
private val textWatcher = object : TextWatcher {
override fun afterTextChanged(s: Editable) { updateGui() }
override fun afterTextChanged(s: Editable) {
updateGui()
}
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (binding.tuneDays.text.isNotEmpty()) {
@ -387,7 +392,9 @@ class AutotuneFragment : DaggerFragment() {
autotunePlugin.lastNbDays = binding.tuneDays.text
resetParam(false)
}
} catch (e:Exception) { }
} catch (e: Exception) {
fabricPrivacy.logException(e)
}
}
}
}
@ -469,7 +476,7 @@ class AutotuneFragment : DaggerFragment() {
}
}
private fun toTableRowHeader(basal:Boolean = false): TableRow =
private fun toTableRowHeader(basal: Boolean = false): TableRow =
TableRow(context).also { header ->
val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT).apply { weight = 1f }
header.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT).apply { gravity = Gravity.CENTER_HORIZONTAL }
@ -500,7 +507,7 @@ class AutotuneFragment : DaggerFragment() {
})
}
private fun toTableRowValue(hour: String, inputValue: Double, tunedValue: Double, format:String = "%.3f", missing: String = ""): TableRow =
private fun toTableRowValue(hour: String, inputValue: Double, tunedValue: Double, format: String = "%.3f", missing: String = ""): TableRow =
TableRow(context).also { row ->
val percentValue = Round.roundTo(tunedValue / inputValue * 100 - 100, 1.0).toInt().toString() + "%"
val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT).apply { weight = 1f }

View file

@ -148,7 +148,7 @@ class MaintenancePlugin @Inject constructor(
* @return
*/
private fun constructName(): String {
return "AndroidAPS_LOG_" + Date().time + loggerUtils.suffix
return "AndroidAPS_LOG_" + System.currentTimeMillis() + loggerUtils.suffix
}
private fun zip(zipFile: File?, files: List<File>) {

View file

@ -28,6 +28,7 @@ import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.JsonHelper
import info.nightscout.androidaps.utils.JsonHelper.safeGetLong
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.utils.XDripBroadcast
import info.nightscout.shared.sharedPreferences.SP
import java.util.concurrent.TimeUnit
import javax.inject.Inject
@ -49,6 +50,7 @@ class NSClientAddUpdateWorker(
@Inject lateinit var rxBus: RxBus
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin
@Inject lateinit var xDripBroadcast: XDripBroadcast
override fun doWork(): Result {
val treatments = dataWorker.pickupJSONArray(inputData.getLong(DataWorker.STORE_KEY, -1))
@ -85,14 +87,16 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.BOLUS, Sources.NSClient,
uel.log(
Action.BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount)
)
aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it")
}
result.invalidated.forEach {
uel.log(Action.BOLUS_REMOVED, Sources.NSClient,
uel.log(
Action.BOLUS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount)
)
@ -119,21 +123,24 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.CARBS, Sources.NSClient,
uel.log(
Action.CARBS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it")
}
result.invalidated.forEach {
uel.log(Action.CARBS_REMOVED, Sources.NSClient,
uel.log(
Action.CARBS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it")
}
result.updated.forEach {
uel.log(Action.CARBS, Sources.NSClient,
uel.log(
Action.CARBS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
@ -157,8 +164,8 @@ class NSClientAddUpdateWorker(
virtualPumpPlugin.fakeDataDetected = true
}
when {
insulin > 0 || carbs > 0 -> Any()
eventType == TherapyEvent.Type.TEMPORARY_TARGET.text ->
insulin > 0 || carbs > 0 -> Any()
eventType == TherapyEvent.Type.TEMPORARY_TARGET.text ->
if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) || config.NSCLIENT) {
temporaryTargetFromJson(json)?.let { temporaryTarget ->
repository.runTransactionForResult(SyncNsTemporaryTargetTransaction(temporaryTarget))
@ -169,7 +176,8 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach { tt ->
uel.log(Action.TT, Sources.NSClient,
uel.log(
Action.TT, Sources.NSClient,
ValueWithUnit.TherapyEventTTReason(tt.reason),
ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL),
ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget },
@ -178,7 +186,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryTarget $tt")
}
result.invalidated.forEach { tt ->
uel.log(Action.TT_REMOVED, Sources.NSClient,
uel.log(
Action.TT_REMOVED, Sources.NSClient,
ValueWithUnit.TherapyEventTTReason(tt.reason),
ValueWithUnit.Mgdl(tt.lowTarget),
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
@ -187,7 +196,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryTarget $tt")
}
result.ended.forEach { tt ->
uel.log(Action.CANCEL_TT, Sources.NSClient,
uel.log(
Action.CANCEL_TT, Sources.NSClient,
ValueWithUnit.TherapyEventTTReason(tt.reason),
ValueWithUnit.Mgdl(tt.lowTarget),
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
@ -204,7 +214,7 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing TT json $json")
}
eventType == TherapyEvent.Type.NOTE.text && json.isEffectiveProfileSwitch() -> // replace this by new Type when available in NS
eventType == TherapyEvent.Type.NOTE.text && json.isEffectiveProfileSwitch() -> // replace this by new Type when available in NS
if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) {
effectiveProfileSwitchFromJson(json, dateUtil)?.let { effectiveProfileSwitch ->
repository.runTransactionForResult(SyncNsEffectiveProfileSwitchTransaction(effectiveProfileSwitch))
@ -215,13 +225,17 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.PROFILE_SWITCH, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp))
uel.log(
Action.PROFILE_SWITCH, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp)
)
aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it")
}
result.invalidated.forEach {
uel.log(Action.PROFILE_SWITCH_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp))
uel.log(
Action.PROFILE_SWITCH_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp)
)
aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it")
}
result.updatedNsId.forEach {
@ -230,34 +244,34 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing EffectiveProfileSwitch json $json")
}
eventType == TherapyEvent.Type.BOLUS_WIZARD.text ->
if (config.NSCLIENT) {
bolusCalculatorResultFromJson(json)?.let { bolusCalculatorResult ->
repository.runTransactionForResult(SyncNsBolusCalculatorResultTransaction(bolusCalculatorResult))
.doOnError {
aapsLogger.error(LTag.DATABASE, "Error while saving BolusCalculatorResult", it)
ret = Result.failure(workDataOf("Error" to it.toString()))
eventType == TherapyEvent.Type.BOLUS_WIZARD.text ->
bolusCalculatorResultFromJson(json)?.let { bolusCalculatorResult ->
repository.runTransactionForResult(SyncNsBolusCalculatorResultTransaction(bolusCalculatorResult))
.doOnError {
aapsLogger.error(LTag.DATABASE, "Error while saving BolusCalculatorResult", it)
ret = Result.failure(workDataOf("Error" to it.toString()))
}
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(
Action.BOLUS_CALCULATOR_RESULT, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
)
aapsLogger.debug(LTag.DATABASE, "Inserted BolusCalculatorResult $it")
}
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.BOLUS_CALCULATOR_RESULT, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
)
aapsLogger.debug(LTag.DATABASE, "Inserted BolusCalculatorResult $it")
}
result.invalidated.forEach {
uel.log(Action.BOLUS_CALCULATOR_RESULT_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
)
aapsLogger.debug(LTag.DATABASE, "Invalidated BolusCalculatorResult $it")
}
result.updatedNsId.forEach {
aapsLogger.debug(LTag.DATABASE, "Updated nsId BolusCalculatorResult $it")
}
result.invalidated.forEach {
uel.log(
Action.BOLUS_CALCULATOR_RESULT_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
)
aapsLogger.debug(LTag.DATABASE, "Invalidated BolusCalculatorResult $it")
}
} ?: aapsLogger.error("Error parsing BolusCalculatorResult json $json")
}
result.updatedNsId.forEach {
aapsLogger.debug(LTag.DATABASE, "Updated nsId BolusCalculatorResult $it")
}
}
} ?: aapsLogger.error("Error parsing BolusCalculatorResult json $json")
eventType == TherapyEvent.Type.CANNULA_CHANGE.text ||
eventType == TherapyEvent.Type.INSULIN_CHANGE.text ||
eventType == TherapyEvent.Type.SENSOR_CHANGE.text ||
@ -267,7 +281,7 @@ class NSClientAddUpdateWorker(
eventType == TherapyEvent.Type.QUESTION.text ||
eventType == TherapyEvent.Type.EXERCISE.text ||
eventType == TherapyEvent.Type.NOTE.text ||
eventType == TherapyEvent.Type.PUMP_BATTERY_CHANGE.text ->
eventType == TherapyEvent.Type.PUMP_BATTERY_CHANGE.text ->
if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) {
therapyEventFromJson(json)?.let { therapyEvent ->
repository.runTransactionForResult(SyncNsTherapyEventTransaction(therapyEvent))
@ -285,18 +299,18 @@ class NSClientAddUpdateWorker(
result.inserted.forEach { therapyEvent ->
uel.log(action, Sources.NSClient,
therapyEvent.note ?: "",
ValueWithUnit.Timestamp(therapyEvent.timestamp),
ValueWithUnit.TherapyEventType(therapyEvent.type),
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?:0.0,therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }
ValueWithUnit.Timestamp(therapyEvent.timestamp),
ValueWithUnit.TherapyEventType(therapyEvent.type),
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }
)
aapsLogger.debug(LTag.DATABASE, "Inserted TherapyEvent $therapyEvent")
}
result.invalidated.forEach { therapyEvent ->
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
therapyEvent.note ?: "",
ValueWithUnit.Timestamp(therapyEvent.timestamp),
ValueWithUnit.TherapyEventType(therapyEvent.type),
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?:0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }
ValueWithUnit.Timestamp(therapyEvent.timestamp),
ValueWithUnit.TherapyEventType(therapyEvent.type),
ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }
)
aapsLogger.debug(LTag.DATABASE, "Invalidated TherapyEvent $therapyEvent")
}
@ -309,7 +323,7 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing TherapyEvent json $json")
}
eventType == TherapyEvent.Type.COMBO_BOLUS.text ->
eventType == TherapyEvent.Type.COMBO_BOLUS.text ->
if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) {
extendedBolusFromJson(json)?.let { extendedBolus ->
repository.runTransactionForResult(SyncNsExtendedBolusTransaction(extendedBolus))
@ -320,7 +334,8 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.EXTENDED_BOLUS, Sources.NSClient,
uel.log(
Action.EXTENDED_BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
@ -329,7 +344,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Inserted ExtendedBolus $it")
}
result.invalidated.forEach {
uel.log(Action.EXTENDED_BOLUS_REMOVED, Sources.NSClient,
uel.log(
Action.EXTENDED_BOLUS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
@ -338,7 +354,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Invalidated ExtendedBolus $it")
}
result.ended.forEach {
uel.log(Action.CANCEL_EXTENDED_BOLUS, Sources.NSClient,
uel.log(
Action.CANCEL_EXTENDED_BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
@ -355,7 +372,7 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing ExtendedBolus json $json")
}
eventType == TherapyEvent.Type.TEMPORARY_BASAL.text ->
eventType == TherapyEvent.Type.TEMPORARY_BASAL.text ->
if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) {
temporaryBasalFromJson(json)?.let { temporaryBasal ->
repository.runTransactionForResult(SyncNsTemporaryBasalTransaction(temporaryBasal))
@ -366,7 +383,8 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.TEMP_BASAL, Sources.NSClient,
uel.log(
Action.TEMP_BASAL, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@ -374,7 +392,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it")
}
result.invalidated.forEach {
uel.log(Action.TEMP_BASAL_REMOVED, Sources.NSClient,
uel.log(
Action.TEMP_BASAL_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@ -382,7 +401,8 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryBasal $it")
}
result.ended.forEach {
uel.log(Action.CANCEL_TEMP_BASAL, Sources.NSClient,
uel.log(
Action.CANCEL_TEMP_BASAL, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@ -398,7 +418,7 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing TemporaryBasal json $json")
}
eventType == TherapyEvent.Type.PROFILE_SWITCH.text ->
eventType == TherapyEvent.Type.PROFILE_SWITCH.text ->
if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) {
profileSwitchFromJson(json, dateUtil, activePlugin)?.let { profileSwitch ->
repository.runTransactionForResult(SyncNsProfileSwitchTransaction(profileSwitch))
@ -409,13 +429,17 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
uel.log(Action.PROFILE_SWITCH, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp))
uel.log(
Action.PROFILE_SWITCH, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp)
)
aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it")
}
result.invalidated.forEach {
uel.log(Action.PROFILE_SWITCH_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp))
uel.log(
Action.PROFILE_SWITCH_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp)
)
aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it")
}
result.updatedNsId.forEach {
@ -424,7 +448,7 @@ class NSClientAddUpdateWorker(
}
} ?: aapsLogger.error("Error parsing ProfileSwitch json $json")
}
eventType == TherapyEvent.Type.APS_OFFLINE.text ->
eventType == TherapyEvent.Type.APS_OFFLINE.text ->
if (sp.getBoolean(R.string.key_ns_receive_offline_event, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) {
offlineEventFromJson(json)?.let { offlineEvent ->
repository.runTransactionForResult(SyncNsOfflineEventTransaction(offlineEvent))
@ -435,21 +459,24 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach { oe ->
uel.log(Action.LOOP_CHANGE, Sources.NSClient,
uel.log(
Action.LOOP_CHANGE, Sources.NSClient,
ValueWithUnit.OfflineEventReason(oe.reason),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
)
aapsLogger.debug(LTag.DATABASE, "Inserted OfflineEvent $oe")
}
result.invalidated.forEach { oe ->
uel.log(Action.LOOP_REMOVED, Sources.NSClient,
uel.log(
Action.LOOP_REMOVED, Sources.NSClient,
ValueWithUnit.OfflineEventReason(oe.reason),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
)
aapsLogger.debug(LTag.DATABASE, "Invalidated OfflineEvent $oe")
}
result.ended.forEach { oe ->
uel.log(Action.LOOP_CHANGE, Sources.NSClient,
uel.log(
Action.LOOP_CHANGE, Sources.NSClient,
ValueWithUnit.OfflineEventReason(oe.reason),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt())
)
@ -472,7 +499,8 @@ class NSClientAddUpdateWorker(
val enteredBy = JsonHelper.safeGetString(json, "enteredBy", "")
val notes = JsonHelper.safeGetString(json, "notes", "")
if (date > now - 15 * 60 * 1000L && notes.isNotEmpty()
&& enteredBy != sp.getString("careportal_enteredby", "AndroidAPS")) {
&& enteredBy != sp.getString("careportal_enteredby", "AndroidAPS")
) {
val defaultVal = config.NSCLIENT
if (sp.getBoolean(R.string.key_ns_announcements, defaultVal)) {
val announcement = Notification(Notification.NS_ANNOUNCEMENT, notes, Notification.ANNOUNCEMENT, 60)
@ -482,6 +510,7 @@ class NSClientAddUpdateWorker(
}
}
nsClientPlugin.updateLatestDateReceivedIfNewer(latestDateInReceivedData)
xDripBroadcast.sendTreatments(treatments)
return ret
}

View file

@ -14,6 +14,7 @@ import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.events.EventAppExit
import info.nightscout.androidaps.events.EventConfigBuilderChange
import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.DataSyncSelector
import info.nightscout.androidaps.interfaces.ResourceHelper
@ -47,8 +48,6 @@ import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.JsonHelper.safeGetString
import info.nightscout.androidaps.utils.JsonHelper.safeGetStringAllowNull
import info.nightscout.androidaps.utils.T.Companion.mins
import info.nightscout.androidaps.utils.XDripBroadcast
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
@ -83,7 +82,6 @@ class NSClientService : DaggerService() {
@Inject lateinit var dataWorker: DataWorker
@Inject lateinit var dataSyncSelector: DataSyncSelector
@Inject lateinit var repository: AppRepository
@Inject lateinit var xDripBroadcast: XDripBroadcast
companion object {
@ -473,7 +471,6 @@ class NSClientService : DaggerService() {
.setInputData(dataWorker.storeInputData(profileStoreJson))
.build()
)
xDripBroadcast.sendProfile(profileStoreJson)
}
}
if (data.has("treatments")) {
@ -492,7 +489,6 @@ class NSClientService : DaggerService() {
.setInputData(dataWorker.storeInputData(addedOrUpdatedTreatments))
.build()
)
xDripBroadcast.sendTreatments(addedOrUpdatedTreatments)
}
}
if (data.has("devicestatus")) {
@ -536,7 +532,6 @@ class NSClientService : DaggerService() {
.setInputData(dataWorker.storeInputData(sgvs))
.build()
)
xDripBroadcast.sendSgvs(sgvs)
}
}
rxBus.send(EventNSClientNewLog("LAST", dateUtil.dateAndTimeString(latestDateInReceivedData)))

View file

@ -207,8 +207,8 @@ class OverviewData @Inject constructor(
* IOB, COB
*/
fun bolusIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromBolus().round(fabricPrivacy)
fun basalIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round(fabricPrivacy)
fun bolusIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromBolus().round()
fun basalIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round()
fun cobInfo(iobCobCalculator: IobCobCalculator): CobInfo = iobCobCalculator.getCobInfo(true, "Overview COB")
val lastCarbsTime: Long

View file

@ -51,7 +51,11 @@ import info.nightscout.androidaps.plugins.constraints.bgQualityCheck.BgQualityCh
import info.nightscout.androidaps.plugins.general.automation.AutomationPlugin
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity
import info.nightscout.androidaps.plugins.general.overview.events.*
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewIobCob
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
@ -66,7 +70,6 @@ import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.TrendCalculator
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.interfaces.BuildHelper
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.ui.SingleClickButton
@ -236,10 +239,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
.debounce(1L, TimeUnit.SECONDS)
.observeOn(aapsSchedulers.main)
.subscribe({ updateGraph() }, fabricPrivacy::logException)
disposable += activePlugin.activeOverview.overviewBus
.toObservable(EventUpdateOverviewPumpStatus::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({ updatePumpStatus() }, fabricPrivacy::logException)
disposable += activePlugin.activeOverview.overviewBus
.toObservable(EventUpdateOverviewNotification::class.java)
.observeOn(aapsSchedulers.main)
@ -308,7 +307,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
handler.postDelayed(refreshLoop, 60 * 1000L)
refreshAll()
handler.post { refreshAll() }
updatePumpStatus()
updateCalcProgress()
}

View file

@ -6,11 +6,7 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.*
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Overview
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
@ -21,7 +17,6 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
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
@ -175,46 +170,4 @@ class OverviewPlugin @Inject constructor(
.storeDouble(R.string.key_statuslights_bat_critical, sp, rh)
.storeInt(R.string.key_boluswizard_percentage, sp, rh)
}
/*
@Volatile
var runningRefresh = false
override fun refreshLoop(from: String) {
if (runningRefresh) return
runningRefresh = true
overviewBus.send(EventUpdateOverviewNotification(from))
loadIobCobResults(from)
overviewBus.send(EventUpdateOverviewProfile(from))
overviewBus.send(EventUpdateOverviewBg(from))
overviewBus.send(EventUpdateOverviewTime(from))
overviewBus.send(EventUpdateOverviewTemporaryBasal(from))
overviewBus.send(EventUpdateOverviewExtendedBolus(from))
overviewBus.send(EventUpdateOverviewTemporaryTarget(from))
loadAsData(from)
overviewData.preparePredictions(from)
overviewData.prepareBasalData(from)
overviewData.prepareTemporaryTargetData(from)
overviewData.prepareTreatmentsData(from)
overviewData.prepareIobAutosensData(from)
overviewBus.send(EventUpdateOverviewGraph(from))
overviewBus.send(EventUpdateOverviewIobCob(from))
aapsLogger.debug(LTag.UI, "refreshLoop finished")
runningRefresh = false
}
@Suppress("SameParameterValue")
private fun loadAll(from: String) {
loadBg(from)
loadProfile(from)
loadTemporaryTarget(from)
loadIobCobResults(from)
loadAsData(from)
overviewData.prepareBasalData(from)
overviewData.prepareTemporaryTargetData(from)
overviewData.prepareTreatmentsData(from)
// prepareIobAutosensData(from)
// preparePredictions(from)
overviewBus.send(EventUpdateOverviewGraph(from))
aapsLogger.debug(LTag.UI, "loadAll finished")
}
*/
}

View file

@ -1,5 +0,0 @@
package info.nightscout.androidaps.plugins.general.overview.events
import info.nightscout.androidaps.events.Event
class EventUpdateOverviewPumpStatus(val from: String) : Event()

View file

@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Gluco
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.receivers.ReceiverStatusStore
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.wizard.BolusWizard
@ -73,7 +74,8 @@ class DataHandlerMobile @Inject constructor(
private val uel: UserEntryLogger,
private val activePlugin: ActivePlugin,
private val commandQueue: CommandQueue,
private val fabricPrivacy: FabricPrivacy
private val fabricPrivacy: FabricPrivacy,
private val alarmSoundServiceHelper: AlarmSoundServiceHelper
) {
private val disposable = CompositeDisposable()
@ -260,6 +262,13 @@ class DataHandlerMobile @Inject constructor(
}
lastBolusWizard = null
}, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventData.SnoozeAlert::class.java)
.observeOn(aapsSchedulers.io)
.subscribe({
aapsLogger.debug(LTag.WEAR, "SnoozeAlert received $it from ${it.sourceNodeId}")
alarmSoundServiceHelper.stopService(context, "Muted from wear")
}, fabricPrivacy::logException)
}
private fun handleTddStatus() {

View file

@ -8,12 +8,11 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.*
import info.nightscout.androidaps.extensions.toStringShort
import info.nightscout.androidaps.interfaces.*
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DecimalFormatter
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
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
@ -123,8 +122,8 @@ class StatusLinePlugin @Inject constructor(
status += activeTemp.toStringShort() + " "
}
//IOB
val bolusIob = iobCobCalculator.calculateIobFromBolus().round(fabricPrivacy)
val basalIob = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round(fabricPrivacy)
val bolusIob = iobCobCalculator.calculateIobFromBolus().round()
val basalIob = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round()
status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U"
if (sp.getBoolean(R.string.key_xdripstatus_detailediob, true)) {
status += ("("

View file

@ -8,6 +8,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.HardLimits
import org.json.JSONObject
import javax.inject.Inject
import javax.inject.Singleton
@ -19,8 +20,9 @@ class InsulinLyumjevPlugin @Inject constructor(
profileFunction: ProfileFunction,
rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config) {
config: Config,
hardLimits: HardLimits
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits) {
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_LYUMJEV
override val friendlyName get(): String = rh.gs(R.string.lyumjev)

View file

@ -6,12 +6,12 @@ import info.nightscout.androidaps.data.Iob
import info.nightscout.androidaps.database.embedments.InsulinConfiguration
import info.nightscout.androidaps.database.entities.Bolus
import info.nightscout.androidaps.interfaces.*
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.shared.logging.AAPSLogger
import kotlin.math.exp
import kotlin.math.pow
@ -27,7 +27,8 @@ abstract class InsulinOrefBasePlugin(
val profileFunction: ProfileFunction,
val rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
config: Config,
val hardLimits: HardLimits
) : PluginBase(
PluginDescription()
.mainType(PluginType.INSULIN)
@ -43,18 +44,18 @@ abstract class InsulinOrefBasePlugin(
override val dia
get(): Double {
val dia = userDefinedDia
return if (dia >= MIN_DIA) {
return if (dia >= hardLimits.minDia()) {
dia
} else {
sendShortDiaNotification(dia)
MIN_DIA
hardLimits.minDia()
}
}
open fun sendShortDiaNotification(dia: Double) {
if (System.currentTimeMillis() - lastWarned > 60 * 1000) {
lastWarned = System.currentTimeMillis()
val notification = Notification(Notification.SHORT_DIA, String.format(notificationPattern, dia, MIN_DIA), Notification.URGENT)
val notification = Notification(Notification.SHORT_DIA, String.format(notificationPattern, dia, hardLimits.minDia()), Notification.URGENT)
rxBus.send(EventNewNotification(notification))
}
}
@ -65,12 +66,13 @@ abstract class InsulinOrefBasePlugin(
open val userDefinedDia: Double
get() {
val profile = profileFunction.getProfile()
return profile?.dia ?: MIN_DIA
return profile?.dia ?: hardLimits.minDia()
}
override fun iobCalcForTreatment(bolus: Bolus, time: Long, dia: Double): Iob {
assert(dia != 0.0)
assert(peak != 0)
val result = Iob()
val peak = peak
if (bolus.amount != 0.0) {
val bolusTime = bolus.timestamp
val t = (time - bolusTime) / 1000.0 / 60.0
@ -80,9 +82,9 @@ abstract class InsulinOrefBasePlugin(
if (t < td) {
val tau = tp * (1 - tp / td) / (1 - 2 * tp / td)
val a = 2 * tau / td
val S = 1 / (1 - a + (1 + a) * exp(-td / tau))
result.activityContrib = bolus.amount * (S / tau.pow(2.0)) * t * (1 - t / td) * exp(-t / tau)
result.iobContrib = bolus.amount * (1 - S * (1 - a) * ((t.pow(2.0) / (tau * td * (1 - a)) - t / tau - 1) * Math.exp(-t / tau) + 1))
val s = 1 / (1 - a + (1 + a) * exp(-td / tau))
result.activityContrib = bolus.amount * (s / tau.pow(2.0)) * t * (1 - t / td) * exp(-t / tau)
result.iobContrib = bolus.amount * (1 - s * (1 - a) * ((t.pow(2.0) / (tau * td * (1 - a)) - t / tau - 1) * exp(-t / tau) + 1))
}
}
return result
@ -95,17 +97,12 @@ abstract class InsulinOrefBasePlugin(
get(): String {
var comment = commentStandardText()
val userDia = userDefinedDia
if (userDia < MIN_DIA) {
comment += "\n" + rh.gs(R.string.dia_too_short, userDia, MIN_DIA)
if (userDia < hardLimits.minDia()) {
comment += "\n" + rh.gs(R.string.dia_too_short, userDia, hardLimits.minDia())
}
return comment
}
override abstract val peak: Int
abstract override val peak: Int
abstract fun commentStandardText(): String
companion object {
const val MIN_DIA = 5.0
}
}

View file

@ -10,6 +10,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.sharedPreferences.SP
import org.json.JSONObject
import javax.inject.Inject
@ -26,8 +27,9 @@ class InsulinOrefFreePeakPlugin @Inject constructor(
profileFunction: ProfileFunction,
rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config) {
config: Config,
hardLimits: HardLimits
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits) {
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_FREE_PEAK

View file

@ -8,6 +8,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.HardLimits
import org.json.JSONObject
import javax.inject.Inject
import javax.inject.Singleton
@ -22,8 +23,9 @@ class InsulinOrefRapidActingPlugin @Inject constructor(
profileFunction: ProfileFunction,
rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config) {
config: Config,
hardLimits: HardLimits
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits) {
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_RAPID_ACTING
override val friendlyName get(): String = rh.gs(R.string.rapid_acting_oref)

View file

@ -8,6 +8,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.HardLimits
import org.json.JSONObject
import javax.inject.Inject
import javax.inject.Singleton
@ -22,8 +23,9 @@ class InsulinOrefUltraRapidActingPlugin @Inject constructor(
profileFunction: ProfileFunction,
rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config) {
config: Config,
hardLimits: HardLimits
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits) {
override val id get(): Insulin.InsulinType = Insulin.InsulinType.OREF_ULTRA_RAPID_ACTING
override val friendlyName get(): String = rh.gs(R.string.ultrarapid_oref)

View file

@ -481,6 +481,7 @@ class IobCobCalculatorPlugin @Inject constructor(
val profile = profileFunction.getProfile() ?: return total
val dia = profile.dia
val divisor = sp.getDouble(R.string.key_openapsama_bolussnooze_dia_divisor, 2.0)
assert(divisor > 0)
val boluses = repository.getBolusesDataFromTime(toTime - range(), true).blockingGet()

View file

@ -461,6 +461,7 @@ class LocalProfilePlugin @Inject constructor(
@Inject lateinit var sp: SP
@Inject lateinit var config: Config
@Inject lateinit var localProfilePlugin: LocalProfilePlugin
@Inject lateinit var xDripBroadcast: XDripBroadcast
init {
(context.applicationContext as HasAndroidInjector).androidInjector().inject(this)
@ -469,6 +470,7 @@ class LocalProfilePlugin @Inject constructor(
override fun doWork(): Result {
val profileJson = dataWorker.pickupJSONObject(inputData.getLong(DataWorker.STORE_KEY, -1))
?: return Result.failure(workDataOf("Error" to "missing input data"))
xDripBroadcast.sendProfile(profileJson)
if (sp.getBoolean(R.string.key_ns_receive_profile_store, true) || config.NSCLIENT) {
val store = ProfileStore(injector, profileJson, dateUtil)
val createdAt = store.getStartDate()

View file

@ -115,11 +115,11 @@ class NSClientSourcePlugin @Inject constructor(
@Suppress("SpellCheckingInspection")
override fun doWork(): Result {
var ret = Result.success()
if (!nsClientSourcePlugin.isEnabled() && !sp.getBoolean(R.string.key_ns_receive_cgm, false)) return Result.success(workDataOf("Result" to "Sync not enabled"))
val sgvs = dataWorker.pickupJSONArray(inputData.getLong(DataWorker.STORE_KEY, -1))
?: return Result.failure(workDataOf("Error" to "missing input data"))
xDripBroadcast.sendSgvs(sgvs)
if (!nsClientSourcePlugin.isEnabled() && !sp.getBoolean(R.string.key_ns_receive_cgm, false))
return Result.success(workDataOf("Result" to "Sync not enabled"))
try {
var latestDateInReceivedData: Long = 0

View file

@ -8,15 +8,13 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.AppRepository
import info.nightscout.androidaps.database.entities.GlucoseValue
import info.nightscout.androidaps.database.transactions.CgmSourceTransaction
import info.nightscout.androidaps.interfaces.BgSource
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.interfaces.PluginDescription
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.interfaces.*
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.XDripBroadcast
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
import info.nightscout.androidaps.utils.extensions.isRunningTest
import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
@ -33,7 +31,9 @@ class RandomBgPlugin @Inject constructor(
aapsLogger: AAPSLogger,
private val sp: SP,
private val repository: AppRepository,
private val xDripBroadcast: XDripBroadcast
private val xDripBroadcast: XDripBroadcast,
private val virtualPumpPlugin: VirtualPumpPlugin,
private val buildHelper: BuildHelper
) : PluginBase(
PluginDescription()
.mainType(PluginType.BGSOURCE)
@ -89,8 +89,8 @@ class RandomBgPlugin @Inject constructor(
}
override fun specialEnableCondition(): Boolean {
// return isRunningTest() || virtualPumpPlugin.isEnabled() && buildHelper.isEngineeringMode()
return true
return isRunningTest() || virtualPumpPlugin.isEnabled() && buildHelper.isEngineeringMode()
// return true
}
private fun handleNewData() {

View file

@ -321,9 +321,9 @@ class CommandQueueImplementation @Inject constructor(
}
@Synchronized
override fun cancelAllBoluses() {
override fun cancelAllBoluses(id: Long) {
if (!isRunning(CommandType.BOLUS)) {
rxBus.send(EventDismissBolusProgressIfRunning(PumpEnactResult(injector).success(true).enacted(false), null))
rxBus.send(EventDismissBolusProgressIfRunning(PumpEnactResult(injector).success(true).enacted(false), id))
}
removeAll(CommandType.BOLUS)
removeAll(CommandType.SMB_BOLUS)
@ -598,12 +598,12 @@ class CommandQueueImplementation @Inject constructor(
if (detailedBolusInfo.context != null) {
val bolusProgressDialog = BolusProgressDialog()
bolusProgressDialog.setInsulin(detailedBolusInfo.insulin)
bolusProgressDialog.setTimestamp(detailedBolusInfo.timestamp)
bolusProgressDialog.setId(detailedBolusInfo.id)
bolusProgressDialog.show((detailedBolusInfo.context as AppCompatActivity).supportFragmentManager, "BolusProgress")
} else {
val i = Intent()
i.putExtra("insulin", detailedBolusInfo.insulin)
i.putExtra("timestamp", detailedBolusInfo.timestamp)
i.putExtra("id", detailedBolusInfo.id)
i.setClass(context, BolusProgressHelperActivity::class.java)
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)

View file

@ -26,7 +26,7 @@ class CommandBolus(
val r = activePlugin.activePump.deliverTreatment(detailedBolusInfo)
if (r.success) carbsRunnable.run()
BolusProgressDialog.bolusEnded = true
rxBus.send(EventDismissBolusProgressIfRunning(r, detailedBolusInfo.timestamp))
rxBus.send(EventDismissBolusProgressIfRunning(r, detailedBolusInfo.id))
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}")
callback?.result(r)?.run()
}

View file

@ -99,41 +99,9 @@ class TddCalculator @Inject constructor(
return result
}
fun calculateDaily(): TotalDailyDose {
val startTime = MidnightTime.calc(dateUtil.now())
val endTime = dateUtil.now()
val tdd = TotalDailyDose(timestamp = startTime)
//val result = TotalDailyDose()
repository.getBolusesDataFromTimeToTime(startTime, endTime, true).blockingGet()
.filter { it.type != Bolus.Type.PRIMING }
.forEach { t ->
tdd.bolusAmount += t.amount
}
repository.getCarbsDataFromTimeToTimeExpanded(startTime, endTime, true).blockingGet().forEach { t ->
tdd.carbs += t.amount
}
val calculationStep = T.mins(5).msecs()
for (t in startTime until endTime step calculationStep) {
val tbr = iobCobCalculator.getTempBasalIncludingConvertedExtended(t)
val profile = profileFunction.getProfile(t) ?: continue
val absoluteRate = tbr?.convertedToAbsolute(t, profile) ?: profile.getBasal(t)
tdd.basalAmount += absoluteRate / 60.0 * 5.0
if (!activePlugin.activePump.isFakingTempsByExtendedBoluses) {
// they are not included in TBRs
val eb = iobCobCalculator.getExtendedBolus(t)
val absoluteEbRate = eb?.rate ?: 0.0
tdd.bolusAmount += absoluteEbRate / 60.0 * 5.0
}
}
tdd.totalAmount = tdd.bolusAmount + tdd.basalAmount
aapsLogger.debug(LTag.CORE, tdd.toString())
return tdd
}
fun calculate24Daily(): TotalDailyDose {
val startTime = dateUtil.now() - T.hours(hour = 24).msecs()
val endTime = dateUtil.now()
fun calculateDaily(startHours: Long, endHours: Long): TotalDailyDose {
val startTime = dateUtil.now() + T.hours(hour = startHours).msecs()
val endTime = dateUtil.now() + T.hours(hour = endHours).msecs()
val tdd = TotalDailyDose(timestamp = startTime)
repository.getBolusesDataFromTimeToTime(startTime, endTime, true).blockingGet()
.filter { it.type != Bolus.Type.PRIMING }

View file

@ -8,6 +8,8 @@ import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.Paint
import android.os.Handler
import android.os.HandlerThread
import android.view.View
import android.widget.RemoteViews
import dagger.android.HasAndroidInjector
@ -26,7 +28,6 @@ import info.nightscout.androidaps.plugins.general.overview.OverviewData
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.TrendCalculator
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
@ -53,6 +54,7 @@ class Widget : AppWidgetProvider() {
@Inject lateinit var sp: SP
@Inject lateinit var constraintChecker: ConstraintChecker
private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper)
private val intentAction = "OpenApp"
override fun onReceive(context: Context, intent: Intent?) {
@ -88,16 +90,17 @@ class Widget : AppWidgetProvider() {
views.setOnClickPendingIntent(R.id.widget_layout, pendingIntent)
views.setInt(R.id.widget_layout, "setBackgroundColor", Color.argb(alpha, 0, 0, 0))
updateBg(views)
updateTemporaryBasal(views)
updateExtendedBolus(views)
updateIobCob(views)
updateTemporaryTarget(views)
updateProfile(views)
updateSensitivity(views)
// Instruct the widget manager to update the widget
appWidgetManager.updateAppWidget(appWidgetId, views)
handler.post {
updateBg(views)
updateTemporaryBasal(views)
updateExtendedBolus(views)
updateIobCob(views)
updateTemporaryTarget(views)
updateProfile(views)
updateSensitivity(views)
// Instruct the widget manager to update the widget
appWidgetManager.updateAppWidget(appWidgetId, views)
}
}
private fun updateBg(views: RemoteViews) {

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Bezpečnost zadání ošetřeni</string>
<string name="treatmentssafety_maxbolus_title">Maximální povolený bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Maximální počet sacharidů [g]</string>
<string name="treatmentssafety_lgsThreshold_title">Hodnota glykémie pro zastavení inzulínu</string>
<string name="nav_preferences_plugin">Nastavení pluginu %1$s</string>
<string name="nav_preferences">Nastavení</string>
<string name="nav_refreshtreatments">Obnovit ošetření z NS</string>
@ -432,8 +433,8 @@
<string name="ns_localbroadcasts_title">Povolení odesílaní</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamická ISF</string>
<string name="DynISFAdjust_title">Korekční faktor pro DynamicISF v %%</string>
<string name="DynISFAdjust_summary">Korekční faktor pro DynamicISF. Pro agresivnější korekční dávky nastavte hodnoty větší než 100%%, a pro méně agresivní korekce menší než 100%%.</string>
<string name="DynISFAdjust_title" formatted="false">Korekční faktor pro DynamicISF v %</string>
<string name="DynISFAdjust_summary" formatted="false">Korekční faktor pro DynamicISF. Pro agresivnější korekční dávky nastavte hodnoty vyšší než 100 %, pro méně agresivní korekce nižší než 100 %.</string>
<string name="enableuam">Povolit UAM</string>
<string name="enablesmb">Povolit SMB</string>
<string name="enablesmb_summary">Použít super mikro bolusy místo dočasných bazálů pro zrychlení účinku</string>
@ -592,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Tato hodnota je v kontextu OpenAPS nazývána Max IOB.\nOpenAPS nikdy nepřidá inzulín, pokud je současné IOB větší než tato hodnota</string>
<string name="absorption_cutoff_title">Maximální doba absorpce sacharidů [h]</string>
<string name="absorption_cutoff_summary">Doba, po které jsou všechny sacharidy považovány za strávené. Zbylé budou oříznuty.</string>
<string name="treatmentssafety_lgsThreshold_summary">Hodnota glykémie, při níž bude vydávání inzulinu zastaveno. Výchozí hodnota využívá standardní cílový model. Uživatel může nastavit hodnoty od 3,3 mmol/l do 5,5 mmol/l. Při hodnotách pod 3,6 mmol/l se použije výchozí model. </string>
<string name="overview_show_notes_field_in_dialogs_title">Zobrazovat kolonku poznámky v dialozích ošetření</string>
<string name="next_button">Další</string>
<string name="previous_button">Zpět</string>

View file

@ -432,8 +432,6 @@
<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">DynamicISF-justeringsfaktor %%</string>
<string name="DynISFAdjust_summary">Justeringsfaktor for Dynamisk ISF. 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>
@ -956,7 +954,6 @@
<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:\Grund: %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>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Seguridad de tratamientos</string>
<string name="treatmentssafety_maxbolus_title">Máximo bolo permitido [U]</string>
<string name="treatmentssafety_maxcarbs_title">Máximos carbohidratos permitidos [g]</string>
<string name="treatmentssafety_lgsThreshold_title">Nivel de glucosa por debajo de valor LGS (Suspensión por glucosa baja)</string>
<string name="nav_preferences_plugin">Preferencias de %1$s</string>
<string name="nav_preferences">Preferencias</string>
<string name="nav_refreshtreatments">Actualizar los tratamientos desde Nightscout</string>
@ -432,8 +433,8 @@
<string name="ns_localbroadcasts_title">Habilitar la emisión de mensajes localmente.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">ISF Dinámico</string>
<string name="DynISFAdjust_title">Factor de ajuste de ISF Dinámico %</string>
<string name="DynISFAdjust_summary">Porcentaje del factor de ajuste de ISF Dinámico\nValor predeterminado: 100\nEstablecer valores por encima del 100%% para que el algoritmo aplique correcciones más agresivas y valores por debajo del 100%% para correcciones menos agresivas.</string>
<string name="DynISFAdjust_title" formatted="false">Factor de ajuste de ISF Dinámico %</string>
<string name="DynISFAdjust_summary" formatted="false">Porcentaje del factor de ajuste de ISF Dinámico\nValor predeterminado: 100\nEstablecer valores por encima del 100% para que el algoritmo aplique correcciones más agresivas y valores por debajo del 100% para correcciones menos agresivas.</string>
<string name="enableuam">Activar UAM</string>
<string name="enablesmb">Activar SMB</string>
<string name="enablesmb_summary">Usar microbolos en lugar de basales temporales, para corregir más rápidamente</string>
@ -592,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Este valor se denomina \"Max IOB\", en el contexto de OpenAPS\nOpenAPS no podrá superar esta cantidad de insulina activa (IOB)</string>
<string name="absorption_cutoff_title">Tiempo máximo de absorción de la comida [h]</string>
<string name="absorption_cutoff_summary">Tiempo en el que cualquier comida se considera absorbida. Los carbohidratos restantes serán cortados. </string>
<string name="treatmentssafety_lgsThreshold_summary">Valor de glucosa por debajo del cual se suspende la administración de insulina. El valor predeterminado utiliza el modelo de objetivo estándar. El usuario puede establecer un valor entre 60mg/dl (3. mmol/l) y 100mg/dl (5.5mmol/l). Valores por debajo de 65/3.6 usan el modelo predeterminado</string>
<string name="overview_show_notes_field_in_dialogs_title">Mostrar el campo notas en diálogos de tratamientos</string>
<string name="next_button">Siguiente</string>
<string name="previous_button">Anterior</string>
@ -968,7 +970,7 @@
<string name="wear_action_tempt_max_bg_error">¡Glucosa máxima fuera de rango!</string>
<string name="wear_action_tempt_manual_range_message">Objetivo temporal:\nMin: %1$s\nMax: %2$s\nDuración: %3$s</string>
<string name="wear_action_tempt_manual_message">Objetivo temporal:\nObjetivo: %1$s\nDuración: %2$s</string>
<string name="wear_action_tempt_preset_message">ObjetivoTemporal:\Razón: %1$s\nObjetivo: %2$s\nDuración: %3$s</string>
<string name="wear_action_tempt_preset_message">ObjetivoTemporal:\nRazón: %1$s\nObjetivo: %2$s\nDuración: %3$s</string>
<string name="quick_wizard_message">Asistente Rápido: %1$s\nInsulina: %2$.2fU\nCarbohidratos: %3$dg</string>
<string name="wizard_result">Calc. Asistente:\nInsulina: %1$.2fU\nCarbohidratos: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Mostrar entrada en dispositivo:</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Traitements de sécurité</string>
<string name="treatmentssafety_maxbolus_title">Maximum Bolus autorisé [U]</string>
<string name="treatmentssafety_maxcarbs_title">Maximum de Glucides autorisé [g]</string>
<string name="treatmentssafety_lgsThreshold_title">Glycémie au-dessous de laquelle se déclenche l\'Arrêt Glycémie Basse</string>
<string name="nav_preferences_plugin">Préférences de %1$s</string>
<string name="nav_preferences">Préférences</string>
<string name="nav_refreshtreatments">Actualiser les données depuis NS</string>
@ -433,8 +434,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="ns_localbroadcasts_title">Activer les transmissions locales</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">SI dynamique</string>
<string name="DynISFAdjust_title">Facteur d\'ajustement SI dynamique %%</string>
<string name="DynISFAdjust_summary">Facteur d\'ajustement pour SI dynamique. Définissez plus de 100 %% pour des corrections plus agressives et moins de 100 %% pour des corrections moins agressives.</string>
<string name="enableuam">Activer RNS</string>
<string name="enablesmb">Activer SMB</string>
<string name="enablesmb_summary">Utiliser les Super Micro Bolus au lieu des débits de base temporaires pour une action rapide</string>
@ -593,6 +592,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="openapssmb_maxiob_summary">Cette valeur est appelée Max IA (Insuline Active) dans le contaxte OpenAPS\nOpenAPS najoutera pas plus dinsuline si l\'IA (Insuline Active) actuelle est supérieure à cette valeur</string>
<string name="absorption_cutoff_title">Durée maximale dabsorption pour un repas [h]</string>
<string name="absorption_cutoff_summary">Durée où nimporte quel repas est considéré absorbé. Les glucides restants ne seront pas pris en compte.</string>
<string name="treatmentssafety_lgsThreshold_summary">Valeur glycémique au-dessous de laquelle l\'injection de l\'insuline est suspendu. La valeur par défaut utilise le modèle standard de la cible. L\'utilisateur peut choisir entre 60mg/dl (3.3mmol/l) et 100mg/dl (5.5mmol/l). Les valeurs au-dessous de 65/3.6 déclenchent l\'utilisation du modèle standard</string>
<string name="overview_show_notes_field_in_dialogs_title">Affiche les notes dans les dialogues</string>
<string name="next_button">Suivant</string>
<string name="previous_button">Préc</string>
@ -968,7 +968,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="wear_action_tempt_max_bg_error">Gly maxi hors limite!</string>
<string name="wear_action_tempt_manual_range_message">Cible temporaire:\nMin: %1$s\nMax : %2$s\nDurée : %3$s</string>
<string name="wear_action_tempt_manual_message">Cible temporaire:\nCible: %1$s\nDurée: %2$s</string>
<string name="wear_action_tempt_preset_message">Cible temporaire:\nRaison: %1$s\nCible : %2$s\nDurée : %3$s</string>
<string name="quick_wizard_message">Assistant: %1$s\nInsuline : %2$.2fU\nGlucides : %3$dg</string>
<string name="wizard_result">Assistant Calc :\nInsuline : %1$.2fU\nGlucides : %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Afficher l\'entrée sur l\'appareil :</string>

View file

@ -123,6 +123,7 @@
<string name="sensitivity_cannula">La registrazione di un cambio cannula ripristinerà il rapporto Autosens al 100%.</string>
<string name="sensitivity_time">Alcune opzioni del plugin hanno intervalli di tempo configurabili che possono essere impostati dall\'utente.</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">Errori inserimento CHO</string>
<string name="wrongcarbs_whattodo">Cosa dovresti fare se hai fatto un inserimento non corretto di carboidrati?</string>
<string name="wrongcarbs_treatmentstab">Eliminare nei Trattamenti l\'inserimento non corretto e immettere il nuovo valore CHO.</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Sicurezza trattamenti</string>
<string name="treatmentssafety_maxbolus_title">Max bolo consentito [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max CHO consentiti [g]</string>
<string name="treatmentssafety_lgsThreshold_title">Glicemia sotto la quale si attiva la sospensione per glicemia bassa</string>
<string name="nav_preferences_plugin">%1$s Preferenze</string>
<string name="nav_preferences">Preferenze</string>
<string name="nav_refreshtreatments">Aggiorna trattamenti da NS</string>
@ -432,14 +433,15 @@
<string name="ns_localbroadcasts_title">Abilita trasmissioni locali</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">ISF Dinamico</string>
<string name="DynISFAdjust_title">%% fattore di regolazione ISF dinamico</string>
<string name="DynISFAdjust_summary">Fattore di regolazione per ISF dinamico. Imposta più del 100%% per correzioni più aggressive, meno del 100%% per correzioni meno aggressive.</string>
<string name="DynISFAdjust_title" formatted="false">Fattore di regolazione per ISF Dinamico (%)</string>
<string name="DynISFAdjust_summary" formatted="false">Fattore di regolazione per ISF Dinamico. Imposta più del 100% per dosi di correzione più aggressive e meno del 100% per correzioni meno aggressive.</string>
<string name="enableuam">Abilita UAM</string>
<string name="enablesmb">Abilita SMB</string>
<string name="enablesmb_summary">Usa super-micro-boli al posto della basale temporanea per un\'azione più veloce</string>
<string name="enableuam_summary">Rilevamento dei pasti non annunciati</string>
<string name="insulin_oref_peak">Tempo picco Curva IOB</string>
<string name="insulin_peak_time">Tempo del picco [min]</string>
<string name="insulin_peak">Picco</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>
@ -591,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Questo valore è chiamato Max IOB nel contesto OpenAPS\nOpenAPS non aggiungerà ulteriore insulina se IOB corrente è maggiore di questo valore</string>
<string name="absorption_cutoff_title">Max tempo assorbimento pasto [h]</string>
<string name="absorption_cutoff_summary">Tempo entro il quale ogni pasto si considera assorbito. Eventuali carboidrati rimanenti verranno tagliati fuori.</string>
<string name="treatmentssafety_lgsThreshold_summary">Glicemia sotto la quale l\'erogazione d\'insulina è sospesa. Il valore predefinito utilizza il modello target standard. L\'utente può impostare un valore compreso tra 60 mg/dl (3.3mmol/l) e 100mg/dl (5.5mmol/l). Con valori inferiori a 65/3.6 viene usato il modello predefinito</string>
<string name="overview_show_notes_field_in_dialogs_title">Finestre tratt.nto: mostra campo note</string>
<string name="next_button">Avanti</string>
<string name="previous_button">Indietro</string>
@ -603,7 +606,11 @@
<string name="secondcarbsincrement">Secondo incremento di CHO</string>
<string name="thirdcarbsincrement">Terzo incremento di CHO</string>
<string name="cgm">CGM</string>
<string name="ns_cellular">Usa connessione cellulare</string>
<string name="ns_wifi">Usa connessione WiFi</string>
<string name="ns_wifi_ssids">WiFi SSID</string>
<string name="ns_charging">Durante la ricarica</string>
<string name="ns_battery">Utilizzo batteria</string>
<string name="connectionsettings_title">Impostazioni connessione</string>
<string name="ns_wifi_allowedssids">SSID ammessi (separati da punto e virgola)</string>
<string name="ns_allowroaming">Consenti connessione in roaming</string>
@ -678,6 +685,8 @@
<string name="error_adding_treatment_message">Un trattamento (insulina: %1$.2f, carboidrati: %2$d, a: %3$s) non può essere aggiunto ai trattamenti. Controlla e aggiungi il record necessario.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), ritardo: %3$d m</string>
<string name="openaps_noasdata">Nessun dato autosens disponibile</string>
<string name="log_files">File di log</string>
<string name="miscellaneous">Miscellanea</string>
<string name="nav_logsettings">Impostazioni Log</string>
<string name="resettodefaults">Ripristina valori predefiniti</string>
<string name="nsmalfunction">Malfunzionamento NSClient. Considera il riavvio di NS e NSClient.</string>
@ -770,6 +779,11 @@
<string name="invalidpct">Inserimento % non valido</string>
<string name="average">Media</string>
<string name="tir">TIR</string>
<string name="day_tir">TIR giorno</string>
<string name="night_tir">TIR notte</string>
<string name="detailed_14_days">Dettaglio 14 giorni</string>
<string name="std_deviation">SD: %1$s</string>
<string name="hba1c">HbA1c: </string>
<string name="activitymonitor">Monitor attività</string>
<string name="doyouwantresetstats">Vuoi resettare le statistiche sull\'attività?</string>
<string name="statistics">Statistiche</string>
@ -956,7 +970,6 @@
<string name="wear_action_tempt_max_bg_error">Max-BG fuori range!</string>
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDurata: %3$s</string>
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDurata: %2$s</string>
<string name="wear_action_tempt_preset_message">Temptarget:\Motivo: %1$s\nTarget: %2$s\nDurata: %3$s</string>
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulina: %2$.2fU\nCHO: %3$dg</string>
<string name="wizard_result">Calc. Wizard:\nInsulina: %1$.2fU\nCHO: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Mostra voce sul dispositivo:</string>
@ -965,9 +978,11 @@
<string name="wizard_no_active_profile">Nessun profilo attivo!</string>
<string name="wizard_no_cob">Valore COB sconosciuto! Lettura BG mancante o recente riavvio dell\'app?</string>
<string name="wizard_carbs_constraint">Violazione vincolo CHO!</string>
<string name="wizard_explain_calc">Calc (IC: %1$.1f, ISF: %2$.1f)</string>
<string name="wizard_explain_carbs">CHO: %1$.2fU</string>
<string name="wizard_explain_cob">COB: %1$.0fg %2$.2fU</string>
<string name="wizard_explain_bg">BG: %1$.2fU</string>
<string name="wizard_explain_iob">IOB: %1$.2fU</string>
<string name="wizard_explain_superbolus">Superbolo: %1$.2fU</string>
<string name="wizard_explain_trend">Trend di 15\': %1$.2fU</string>
<string name="wizard_explain_percent">Percentuale: %1$.2fU x %2$d%% ≈ %3$.2fU</string>
@ -994,6 +1009,10 @@
<string name="count_selected">%1$d selezionati</string>
<string name="sort_label">Ordina</string>
<string name="dialog_canceled">Finestra di dialogo cancellata</string>
<string name="veryLow" comment="below 3.1">Molto basso</string>
<string name="low" comment="3.1-3.9">Basso</string>
<string name="high" comment="10.0-13.9">Alto</string>
<string name="veryHigh" comment="above 13.9">Molto alto</string>
<string name="below" comment="below &quot;in range&quot;">Sotto</string>
<string name="in_range">In range</string>
<string name="above" comment="above &quot;in range&quot;">Sopra</string>
@ -1001,6 +1020,13 @@
<string name="show_hide_records">Nascondi record di loop</string>
<string name="widget_description">Widget di AndroidAPS</string>
<string name="configure">Configura opacità</string>
<string name="loop_status">Stato loop</string>
<string name="graph_scale">Scala del grafico</string>
<string name="profile1">Profilo 1</string>
<string name="profile2">Profilo 2</string>
<string name="login">Login</string>
<string name="remove_all">Rimuovi tutto</string>
<string name="reset_start">Avvio reset</string>
<string name="a11y_otp_qr_code">Codice QR per configurare OTP</string>
<string name="a11y_open_settings">apri impostazioni</string>
<string name="a11y_set_carb_timer">imposta allarme timer CHO</string>
@ -1014,4 +1040,6 @@
<string name="aidex">GlucoRx Aidex</string>
<string name="aidex_short">GlucoRx Aidex</string>
<string name="description_source_aidex">Ricevi valori glicemia da CGM GlucoRx Aidex.</string>
<string name="blocked_by_charging">Bloccato dalle opzioni di ricarica</string>
<string name="blocked_by_connectivity">Bloccato dalle opzioni di connettività</string>
</resources>

View file

@ -123,6 +123,7 @@
<string name="sensitivity_cannula">רישום החלפת צינורית יאפס את היחס של Autosens בחזרה ל-100%.</string>
<string name="sensitivity_time">חלק מאפשרויות התוסף כוללות טווחי זמן הניתנים להגדרה ע\"י המשתמש.</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">שגיאות רישום פחמימות</string>
<string name="wrongcarbs_whattodo">מה לעשות אם טעיתם ברישום הפחמימות?</string>
<string name="wrongcarbs_treatmentstab">מחקו את הרשומה השגויה בטיפולים וציינו את ערך הפחמימות הנכון.</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">בטיחות טיפולים</string>
<string name="treatmentssafety_maxbolus_title">בולוס מקסימלי מותר [U]</string>
<string name="treatmentssafety_maxcarbs_title">מקסימום פחמימות מותר [g]</string>
<string name="treatmentssafety_lgsThreshold_title">רמת הסוכר נמוכה מסף ההשהיה עקב סוכר נמוך</string>
<string name="nav_preferences_plugin">העדפות %1$s</string>
<string name="nav_preferences">העדפות</string>
<string name="nav_refreshtreatments">רענן טיפול מ-Nightscout</string>
@ -432,14 +433,15 @@
<string name="ns_localbroadcasts_title">אפשר שידורים מקומיים.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">רגישות דינאמית</string>
<string name="DynISFAdjust_title">כיוונון פקטור הרגישות הדינאמית %%</string>
<string name="DynISFAdjust_summary">כיוונון פקטור הרגישות הדינאמית. קבעו יותר מ-100%% לקבלת תיקונים אגרסיביים יותר ופחות מ-100%% לקבלת תיקונים עדינים יותר.</string>
<string name="DynISFAdjust_title" formatted="false">כיוונון פקטור הרגישות הדינאמית %</string>
<string name="DynISFAdjust_summary" formatted="false">כיוונון פקטור הרגישות הדינאמית. הגדירו יותר מ-100% לקבלת תיקונים אגרסיביים יותר ופחות מ-100% לקבלת תיקונים עדינים יותר.</string>
<string name="enableuam">הפעלת UAM</string>
<string name="enablesmb">אפשר SMB</string>
<string name="enablesmb_summary">השתמש בסופר מיקרו בולוסים במקום בבזאלי זמני לפעילות מהירה יותר</string>
<string name="enableuam_summary">זיהוי של ארוחות לא מוכרזות</string>
<string name="insulin_oref_peak">שעת שיא של עקומת IOB</string>
<string name="insulin_peak_time">זמן שיא [min]</string>
<string name="insulin_peak">שיא</string>
<string name="free_peak_oref">Oref שיא חופשי</string>
<string name="rapid_acting_oref">Oref אינסולין מהיר</string>
<string name="ultrarapid_oref">Oref אינסולין אולטרה מהיר</string>
@ -591,6 +593,7 @@
<string name="openapssmb_maxiob_summary">ב-OpenAPS ערך זה נקרא מקסימום אינסולין פעיל (maxIOB). \nלא יוזרק עוד אינסולין אם כמות האינסולין הפעיל הנוכחי גדול מערך זה</string>
<string name="absorption_cutoff_title">זמן ספיגה מקסימלי של הארוחה [h]</string>
<string name="absorption_cutoff_summary">משך זמן בו כל ארוחה תחשב כנספגה. לא תהיה התחשבות בפחמימות שנותרו.</string>
<string name="treatmentssafety_lgsThreshold_summary">ערך הסוכר שמתחתיו מושעה הזרקת אינסולין. ערך ברירת המחדל משתמש במודל מטרה סטנדרטי. המשתמש יכול להגדיר ערך בין 60 ל-100 מג\"\\ד\"ל. ערכים מתחת ל-65 מביאים לשימוש במודל ברירת המחדל</string>
<string name="overview_show_notes_field_in_dialogs_title">הצגת שדות הערות בתיבות דו-שיח של טיפול</string>
<string name="next_button">הבא</string>
<string name="previous_button">הקודם</string>
@ -603,7 +606,11 @@
<string name="secondcarbsincrement">תוספת פחמימות שניה</string>
<string name="thirdcarbsincrement">תוספת פחמימות שלישית</string>
<string name="cgm">סנסור</string>
<string name="ns_cellular">השתמש באינטרנט סלולרי</string>
<string name="ns_wifi">השתמש בחיבור WiFi</string>
<string name="ns_wifi_ssids">WiFi SSID</string>
<string name="ns_charging">בזמן טעינה</string>
<string name="ns_battery">משתמש בסוללה</string>
<string name="connectionsettings_title">הגדרות חיבור</string>
<string name="ns_wifi_allowedssids">SSID מורשים (מופרדים בנקודה-פסיק)</string>
<string name="ns_allowroaming">אפשר חיבור בנדידה</string>
@ -770,6 +777,11 @@
<string name="invalidpct">רשומת אחוזים לא חוקית</string>
<string name="average">ממוצע</string>
<string name="tir">זמן בטווח</string>
<string name="day_tir">זמן בטווח ביום</string>
<string name="night_tir">זמן בטווח בלילה</string>
<string name="detailed_14_days">פירוט 14 יום</string>
<string name="std_deviation">סטיית תקן: %1$s</string>
<string name="hba1c">HbA1c: </string>
<string name="activitymonitor">מוניטור פעילות</string>
<string name="doyouwantresetstats">האם ברצונכם לאפס את הסטטיסטיקות הפעילות?</string>
<string name="statistics">סטטיסטיקה</string>
@ -880,6 +892,8 @@
<string name="ns_receive_profile_switch_summary">קבלת החלפות פרופיל שהוגדרו בנייטסקאוט או ב-NSClient</string>
<string name="ns_receive_offline_event">אחזר אירועים לא מקוונים</string>
<string name="ns_receive_offline_event_summary">קבל אירועים לא מקוונים שנרשמו דרך נייטסקאוט או NSClient</string>
<string name="ns_receive_tbr_eb">קבל מינון בזאלי זמני ובולוס מושהה</string>
<string name="ns_receive_tbr_eb_summary">קבל מינוני בזאלי זמני ובולוסים מושהים שהופעלו ממכשיר עוקב</string>
<string name="ns_receive_insulin">קבלת אינסולין</string>
<string name="ns_receive_insulin_summary">קבלת אינסולין שהוזן באמצעות נייטסקאוט או NSClient (הוא לא מוזרק, רק מחושב רק כאינסולין פעיל)</string>
<string name="ns_receive_carbs">קבלת פחמימות</string>
@ -946,12 +960,33 @@
<string name="light_theme">ערכת נושא בהירה</string>
<string name="follow_system_theme">השתמש בערכת הנושא של המכשיר</string>
<!-- WEAR OS-->
<string name="wear_action_tempt_cancel_message">מבטל ערך מטרה זמני נוכחי</string>
<string name="wear_action_tempt_unit_error">יחידות המידה שונות בין הטלפון והשעון!</string>
<string name="wear_action_tempt_min_bg_error">ערך הסוכר המינימלי מחוץ לטווח!</string>
<string name="wear_action_tempt_max_bg_error">ערך הסוכר המקסימלי מחוץ לטווח!</string>
<string name="wear_action_tempt_manual_range_message">ע\' מטרה זמני:\nמינ\': %1$s\nמקס\': %2$s\nמשך: %3$s</string>
<string name="wear_action_tempt_manual_message">ע\' מטרה זמני:\nמטרה: %1$s\n משך: %2$s</string>
<string name="quick_wizard_message">אשף מהיר: %1$s\n אינס\': %2$.2f יח\'\nפחמ\': %3$d גר\'</string>
<string name="wizard_result">מחשבון: %1$s\n אינס\': %2$.2f יח\'\nפחמ\': %3$d גר\'</string>
<string name="overview_editquickwizard_show_on_device">הצג רשומה על המכשיר:</string>
<string name="quick_wizard_not_available">האשף המהיר שנבחר אינו זמין, נא לרענן את האריח</string>
<string name="wizard_no_actual_bg">אין נתוני סוכר לביסוס חישוב!</string>
<string name="wizard_no_active_profile">לא הופעל פרופיל!</string>
<string name="wizard_no_cob">הפחמימות הפעילות לא ידועות! חסרות קריאות סוכר או שאותחל היישום לאחרונה?</string>
<string name="wizard_carbs_constraint">הפרת מגבלות פחמימה!</string>
<string name="wizard_explain_calc">מחשבון (IC: %1$.1f, ISF: %2$.1f)</string>
<string name="wizard_explain_carbs">פחמ\': %1$.2f יח\'</string>
<string name="wizard_explain_cob">פחמ\': %1$.0f גר\' %2$.2f יח\'</string>
<string name="wizard_explain_bg">סוכר: %1$.2f יח\'</string>
<string name="wizard_explain_iob">אינ\' פעיל: %1$.2f יח\'</string>
<string name="wizard_explain_superbolus">סופר בולוס: %1$.2f יח\'</string>
<string name="wizard_explain_trend">מגמת 15 דק\': %1$.2f יח\'</string>
<string name="wizard_explain_percent">אחוזים: %1$.2f יח\' x %2$d%% ≈ %3$.2f יח\'</string>
<string name="wizard_constraint_bolus_size">הופעלה מגבלת אינסולין!\nלא ניתן להזריק %1$.2f יח\'</string>
<string name="wizard_explain_tt">ע\' מטרה זמני: %1$s</string>
<string name="wizard_explain_tt_to">%1$s ל-%2$s</string>
<string name="wizard_pump_not_available">המשאבה אינה זמינה!</string>
<string name="wear_unknown_action_string">פקודה לא ידועה:</string>
<string name="overview_editquickwizard_percentage">אחוזים</string>
<string name="app_default">ברירת המחדל של היישום</string>
<string name="show_invalidated_records">הצג רשומות מבוטלות\\מחוקות</string>
@ -970,6 +1005,10 @@
<string name="count_selected">%1$d נבחרו</string>
<string name="sort_label">מיין</string>
<string name="dialog_canceled">דו-שיח בוטל</string>
<string name="veryLow" comment="below 3.1">נמוך מאוד</string>
<string name="low" comment="3.1-3.9">נמוך</string>
<string name="high" comment="10.0-13.9">גבוה</string>
<string name="veryHigh" comment="above 13.9">גבוה מאוד</string>
<string name="below" comment="below &quot;in range&quot;">מתחת</string>
<string name="in_range">בטווח</string>
<string name="above" comment="above &quot;in range&quot;">מעל</string>
@ -977,7 +1016,17 @@
<string name="show_hide_records">החבא רשומות לולאה</string>
<string name="widget_description">ווידג\'ט AndroidAPS</string>
<string name="configure">הגדרת אטימות</string>
<string name="loop_status">סטטוס הלולאה</string>
<string name="graph_scale">קנה מידה של הגרף</string>
<string name="profile1">פרופיל 1</string>
<string name="profile2">פרופיל 2</string>
<string name="login">התחברות</string>
<string name="remove_all">הסר הכל</string>
<string name="reset_start">אתחל התחלה</string>
<string name="a11y_otp_qr_code">ברקוד QR ליצירת סיסמה חד פעמית</string>
<string name="a11y_open_settings">פתח הגדרות</string>
<string name="a11y_set_carb_timer">הגדרת אזעקה טיימר פחמימות</string>
<string name="device_all">הכול</string>
<string name="device_phone">טלפון</string>
<string name="device_watch">שעון</string>
<string name="a11y_only_on_watch">על השעון בלבד</string>
@ -987,4 +1036,6 @@
<string name="aidex">GlucoRx Aidex</string>
<string name="aidex_short">Aidex</string>
<string name="description_source_aidex">קבלת נתוני סוכר מחיישני GlucoRx Aidex.</string>
<string name="blocked_by_charging">חסום ע\"י הגדרות טעינה</string>
<string name="blocked_by_connectivity">חסום ע\"י הגדרות חיבור</string>
</resources>

View file

@ -123,6 +123,7 @@
<string name="sensitivity_cannula">Het vastleggen van een canulewissel zet de Autosens-ratio terug naar 100%.</string>
<string name="sensitivity_time">Sommige van de plugins hebben configureerbare tijdbereiken die kunnen worden ingesteld door de gebruiker.</string>
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Configuration/Sensitivity-detection-and-COB.html</string>
<string name="sensitivity_hint2">https://androidaps.readthedocs.io/nl/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens</string>
<string name="wrongcarbs_label">Koolhydraatinvoerfouten</string>
<string name="wrongcarbs_whattodo">Wat moet u doen als u een onjuiste hoeveelheid koolhydraten hebt ingevoerd?</string>
<string name="wrongcarbs_treatmentstab">Verwijder het onjuiste record in Behandelingen en voer de juiste koolhydraten opnieuw in.</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Behandelingen veiligheid</string>
<string name="treatmentssafety_maxbolus_title">Max toegestane bolus [E]</string>
<string name="treatmentssafety_maxcarbs_title">Max toegestane koolhydraten [g]</string>
<string name="treatmentssafety_lgsThreshold_title">BG niveau waarbij lage glucose onderbreking wordt geactiveerd</string>
<string name="nav_preferences_plugin">%1$s Instellingen</string>
<string name="nav_preferences">Instellingen</string>
<string name="nav_refreshtreatments">Haal behandelingen op van NS</string>
@ -432,8 +433,8 @@
<string name="ns_localbroadcasts_title">Activeer locaal delen.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamische ISF</string>
<string name="DynISFAdjust_title">Dynamische ISF aanpassingsfactor %%</string>
<string name="DynISFAdjust_summary">Aanpassingsfactor voor Dynamische ISF. Stel meer dan 100%% in voor een agressievere correctie dosis en minder dan 100%% voor minder agressieve correcties.</string>
<string name="DynISFAdjust_title" formatted="false">Dynamische Isf aanpassingsfactor %</string>
<string name="DynISFAdjust_summary" formatted="false">Aanpassingsfactor voor DynamicISF. Stel meer dan 100% in voor een agressievere correctie en minder dan 100% voor minder agressieve correctie.</string>
<string name="enableuam">Activeer UAM</string>
<string name="enablesmb">Activeer SMB</string>
<string name="enablesmb_summary">SMB in plaats van tijdelijke basalen voor snellere reactie</string>
@ -592,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Deze waarde heet MAX IOB in OpenAPS context\nOpenAPS zal geen extra insuline toedienen als de actuele IOB onderstaande waarde overschreden heeft</string>
<string name="absorption_cutoff_title">Maximum maaltijd absorptie tijd [uur]</string>
<string name="absorption_cutoff_summary">Tijdspanne waarbinnen elke maaltijd volledig is opgenomen. Resterende KH worden niet mee gerekend.</string>
<string name="treatmentssafety_lgsThreshold_summary">BG waarde waarbij insuline afgifte wordt onderbroken. De standaard waarde gebruikt het standaard doelmodel. Gebruiker kan waarde instellen tussen 60 mg/dl (3.3 mmol/l) en 100mg/dl(5.6mmol/l). Waarden lager dan 65/3.6 resulteren in gebruik van het standaard model</string>
<string name="overview_show_notes_field_in_dialogs_title">Toon notities veld in behandeling dialoogvensters</string>
<string name="next_button">Volgende</string>
<string name="previous_button">Vorige</string>
@ -604,7 +606,11 @@
<string name="secondcarbsincrement">Tweede koolhydraten increment</string>
<string name="thirdcarbsincrement">Derde koolhydraten increment</string>
<string name="cgm">CGM</string>
<string name="ns_cellular">Mobiele verbinding gebruiken</string>
<string name="ns_wifi">Gebruik WiFi verbinding</string>
<string name="ns_wifi_ssids">WiFi SSID</string>
<string name="ns_charging">Tijdens opladen</string>
<string name="ns_battery">Op batterij</string>
<string name="connectionsettings_title">Verbindings instellingen</string>
<string name="ns_wifi_allowedssids">Toegelaten SSIDs (gescheiden door puntkomma)</string>
<string name="ns_allowroaming">Sta verbinding tijdens roaming toe</string>
@ -679,6 +685,8 @@
<string name="error_adding_treatment_message">Een Behandeling (insuline: %1$.2f, koolhydraten: %2$d, in: %3$s) niet konden worden toegevoegd aan Behandelingen. Gelieve te controleren en handmatig een record toe te voegen indien nodig.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), vertraging: %3$d m</string>
<string name="openaps_noasdata">Geen autosens-gegevens beschikbaar</string>
<string name="log_files">Logbestanden</string>
<string name="miscellaneous">Overige</string>
<string name="nav_logsettings">Log instellingen</string>
<string name="resettodefaults">Terug naar standaardinstellingen</string>
<string name="nsmalfunction">NSClient werkt niet goed. Overweg een herstart van NS en NSClient.</string>
@ -771,6 +779,11 @@
<string name="invalidpct">Ongeldig % invoer</string>
<string name="average">Gemiddelde</string>
<string name="tir">TIR</string>
<string name="day_tir">TIR overdag</string>
<string name="night_tir">TIR s\'nachts</string>
<string name="detailed_14_days">14 dagen details</string>
<string name="std_deviation">SD: %1$s</string>
<string name="hba1c">HbA1c: </string>
<string name="activitymonitor">Activiteitsmonitor</string>
<string name="doyouwantresetstats">Wil je de activiteitenstatistieken resetten?</string>
<string name="statistics">Statistieken</string>
@ -957,7 +970,6 @@
<string name="wear_action_tempt_max_bg_error">Max BG buiten bereik!</string>
<string name="wear_action_tempt_manual_range_message">Tijdelijk streefdoel:\nMin: %1$s\nMax: %2$s\nDuur: %3$s</string>
<string name="wear_action_tempt_manual_message">Tijdelijk streefdoel:\nDoel: %1$s\nDuur: %2$s</string>
<string name="wear_action_tempt_preset_message">Tijdelijk streefdoel:\Reden: %1$s\nDoel: %2$s\nDuur: %3$s</string>
<string name="quick_wizard_message">QuickWizard: %1$s\nInsuline: %2$.2fE\nKoolhy.: %3$dg</string>
<string name="wizard_result">Reken. Wizard:\nInsuline: %1$.2fE\nKoolhy.: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Toon invoer op apparaat:</string>
@ -997,6 +1009,10 @@
<string name="count_selected">%1$d geselecteerd</string>
<string name="sort_label">Sorteren</string>
<string name="dialog_canceled">Dialoog geannuleerd</string>
<string name="veryLow" comment="below 3.1">Zeer laag</string>
<string name="low" comment="3.1-3.9">Laag</string>
<string name="high" comment="10.0-13.9">Hoog</string>
<string name="veryHigh" comment="above 13.9">Zeer hoog</string>
<string name="below" comment="below &quot;in range&quot;">Onder</string>
<string name="in_range">Binnen bereik</string>
<string name="above" comment="above &quot;in range&quot;">Boven</string>
@ -1004,6 +1020,7 @@
<string name="show_hide_records">Verberg loop records</string>
<string name="widget_description">AndroidAPS widget</string>
<string name="configure">Configureer transparantie</string>
<string name="loop_status">Loop status</string>
<string name="graph_scale">Grafiek schaal</string>
<string name="profile1">Profiel 1</string>
<string name="profile2">Profiel 2</string>
@ -1023,4 +1040,6 @@
<string name="aidex">GlucoRx Aidex</string>
<string name="aidex_short">Aidex</string>
<string name="description_source_aidex">Ontvang BG waarden van GlucoRx Aidex CGMS.</string>
<string name="blocked_by_charging">Geblokkeerd door oplaad instellingen</string>
<string name="blocked_by_connectivity">Geblokkeerd door verbindings instellingen</string>
</resources>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Sikkerhet ved behandlinger</string>
<string name="treatmentssafety_maxbolus_title">Maks tillat bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Maks tillat karbo [g]</string>
<string name="treatmentssafety_lgsThreshold_title">BS er under terskelverdi slik at all insulintilførsel stoppes</string>
<string name="nav_preferences_plugin">%1$s innstillinger</string>
<string name="nav_preferences">Innstillinger</string>
<string name="nav_refreshtreatments">Oppdater behandlinger fra NS</string>
@ -432,8 +433,6 @@
<string name="ns_localbroadcasts_title">Aktiver lokale sendinger.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamisk ISF</string>
<string name="DynISFAdjust_title">DynamiskISF justeringsfaktor %%</string>
<string name="DynISFAdjust_summary">Justeringsfaktor for dynamisk ISF. Verdier over 100%% vil gi mer aggressive korreksjonsdoser, mens verdier under 100%% vil gi mildere korreksjonsdoser.</string>
<string name="enableuam">Aktiver UAM</string>
<string name="enablesmb">Aktiver SMB</string>
<string name="enablesmb_summary">Bruk Super Mikro Solen i stedet for temp basal for raskere resultat</string>
@ -592,6 +591,7 @@
<string name="openapssmb_maxiob_summary">Denne verdien kalles Maks IOB av OpenAPS\nOpenAPS vil ikke gi mere insulin hvis mengden insulin ombord (IOB) overstiger denne verdien</string>
<string name="absorption_cutoff_title">Maks absorpsjonstid for måltid [h]</string>
<string name="absorption_cutoff_summary">Etter denne tiden forventes det at måltidet er absorbert. Eventuelle gjenværende karbo vil tas ut av beregninger.</string>
<string name="treatmentssafety_lgsThreshold_summary">BS er under terskelverdi slik at all insulintilførsel stoppes. Mulighet for bruker å definere verdier mellom 3.3mmol/l (60mg/dl) og 5.5mmol/l (100mg/dl). Verdier under 3.6/65 bruker standard målverdier</string>
<string name="overview_show_notes_field_in_dialogs_title">Vis merknadsfelt i dialogvindu for Behandlinger</string>
<string name="next_button">Neste</string>
<string name="previous_button">Forrige</string>
@ -968,7 +968,6 @@
<string name="wear_action_tempt_max_bg_error">Maks-BS utenfor område!</string>
<string name="wear_action_tempt_manual_range_message">Temp target:\nMin: %1$s\nMaks: %2$s\nVarighet: %3$s</string>
<string name="wear_action_tempt_manual_message">TempTarget:\nMål: %1$s\nVarighet: %2$s</string>
<string name="wear_action_tempt_preset_message">TempTarget:\nMin: %1$s\nMål: %2$s\nVarighet: %3$s</string>
<string name="quick_wizard_message">QuickWizard: %1$s\ninsulin: %2$.2fE\nKarbo: %3$dg</string>
<string name="wizard_result">Kalk. Wizard:\nInsulin: %1$.2fE\nKarbo: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Vis oppføring på enhet:</string>

View file

@ -413,8 +413,6 @@
<string name="ns_localbroadcasts_title">Ativar partilha local.</string>
<string name="openapssmb">SMB OpenAPS</string>
<string name="openaps_smb_dynamic_isf">FSI Dinâmico</string>
<string name="DynISFAdjust_title">Fator de Ajuste FSI dinâmico %%</string>
<string name="DynISFAdjust_summary">Fator de ajuste para FSI dinâmico. Defina mais de 100%% para doses de correção mais agressivas e menos de 100%% para correções menos agressivas.</string>
<string name="enableuam">Ativar UAM</string>
<string name="enablesmb">Ativar SMB</string>
<string name="enablesmb_summary">Use Super Micro Boluses em vez de basal temp para uma ação mais rápida</string>
@ -865,7 +863,6 @@
<string name="wear_action_tempt_max_bg_error">Glicemia maxima fora da meta!</string>
<string name="wear_action_tempt_manual_range_message">Alvo temporário:\nMin: %1$s\nMax: %2$s\nDuração: %3$s</string>
<string name="wear_action_tempt_manual_message">Alvo temporário:\nTarget: %1$s\nDuration: %2$s</string>
<string name="wear_action_tempt_preset_message">Alvo temporário:\Reason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
<string name="quick_wizard_message">Assistente rápido: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
<string name="wizard_result">Calculadora:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Mostrar entrada no dispositivo:</string>

View file

@ -432,8 +432,6 @@
<string name="ns_localbroadcasts_title">Активировать локальную передачу</string>
<string name="openapssmb">Супер микро болюс OpenAPS</string>
<string name="openaps_smb_dynamic_isf">Динамический ISF</string>
<string name="DynISFAdjust_title">Коэффициент регулировки динамического диапазона чувствительности ISF %%</string>
<string name="DynISFAdjust_summary">Коэффициент корректировки динамического диапазона чувствительности ISF. Установите более 100%% для более агрессивных доз коррекции и менее 100%% для менее агрессивной коррекции.</string>
<string name="enableuam">Включить непредвиденный прием пищи UAM</string>
<string name="enablesmb">Включить супер микро болюс SMB</string>
<string name="enablesmb_summary">Для ускорения действия используйте супер микро болюсы SMB вместо временного базала</string>
@ -967,7 +965,6 @@
<string name="wear_action_tempt_max_bg_error">Макс ГК вне диапазона!</string>
<string name="wear_action_tempt_manual_range_message">ВремЦель:\nМин: %1$s\nМакс.: %2$s\nДлительность: %3$s</string>
<string name="wear_action_tempt_manual_message">ВремЦель:\nЦель: %1$s\nДлительность: %2$s</string>
<string name="wear_action_tempt_preset_message">ВремЦель:\Причина: %1$s\nЦель.: %2$s\nДлительность: %3$s</string>
<string name="quick_wizard_message">Мастер: %1$s\nИнсулин: %2$.2fЕд\nУгл: %3$dg</string>
<string name="wizard_result">Мастер:\nИнсулин: %1$.2fЕд\nУгл: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Показать запись на устройстве:</string>

View file

@ -6,6 +6,7 @@
<string name="treatmentssafety_title">Bezpečnosť zadania ošetrenia</string>
<string name="treatmentssafety_maxbolus_title">Maximálny povolený bolus [JI]</string>
<string name="treatmentssafety_maxcarbs_title">Maximálne povolené množstvo sacharidov [g]</string>
<string name="treatmentssafety_lgsThreshold_title">Hodnota glykémie, pri ktorej sa aktivuje LGS</string>
<string name="nav_preferences_plugin">Nastavenie pluginu %1$s</string>
<string name="nav_preferences">Nastavenia</string>
<string name="nav_refreshtreatments">Obnoviť ošetrenia z NS</string>
@ -432,8 +433,8 @@
<string name="ns_localbroadcasts_title">Povoliť lokálne vysielanie.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamická ISF</string>
<string name="DynISFAdjust_title">Korekčný faktor pre Dynamickú ISF v %%</string>
<string name="DynISFAdjust_summary">Korekčný faktor pre dynamickú ISF. Pre agresivnejšie korekčné dávky nastavte hodnoty väčšie ako 100%% a pre menej agresivne korekcie menšie než 100%%.</string>
<string name="DynISFAdjust_title" formatted="false">Korekčný faktor pre Dynamickú ISF v %</string>
<string name="DynISFAdjust_summary" formatted="false">Korekčný faktor pre dynamickú ISF. Pre agresivnejšie korekčné dávky nastavte hodnoty väčšie ako 100%, pre menej agresívne korekcie, menšie než 100%.</string>
<string name="enableuam">Povoliť UAM</string>
<string name="enablesmb">Povoliť SMB</string>
<string name="enablesmb_summary">Použiť Super Mikro Bolusy namiesto dočasných bazálov, pre zrýchleniu účinku</string>
@ -592,6 +593,7 @@
<string name="openapssmb_maxiob_summary">Táto hodnota je v kontexte OpenAPS nazývaná Max IOB.\nOpenAPS nikdy nepridá inzulín, pokiaľ je súčasné IOB väčšie, ako táto hodnota</string>
<string name="absorption_cutoff_title">Maximálna doba vstrebávania sacharidov [h]</string>
<string name="absorption_cutoff_summary">Doba, po ktorej sú všetky sacharidy považované za vstrebané. Zvyšné budú orezané.</string>
<string name="treatmentssafety_lgsThreshold_summary">Hodnota glykémie, pri ktorej bude podávanie inzulínu zastavené. Východzia hodnota využíva štandardný cieľový model. Užívateľ môže nastaviť hodnoty od 3,3 mmol/l do 5,5 mmol/l. Pri hodnotách pod 3,6 mmol/l se použije východzí model.</string>
<string name="overview_show_notes_field_in_dialogs_title">Zobrazovať kolónku poznámky v dialógoch ošetrení</string>
<string name="next_button">Ďalšia</string>
<string name="previous_button">Späť</string>
@ -968,7 +970,6 @@
<string name="wear_action_tempt_max_bg_error">Maximálna glykémia mimo rozsah!</string>
<string name="wear_action_tempt_manual_range_message">Doč. cieľ:\nMin: %1$s\nMax: %2$s\nTrvanie: %3$s</string>
<string name="wear_action_tempt_manual_message">Doč. cieľ:\nCieľ: %1$s\nTrvanie: %2$s</string>
<string name="wear_action_tempt_preset_message">Doč. cieľ:\nDôvod: %1$s\nCieľ: %2$s\nTrvanie: %3$s</string>
<string name="quick_wizard_message">Rýchly bolus: %1$s\nInzulín: %2$.2fJI\nSacharidy: %3$dg</string>
<string name="wizard_result">Kalkulačka: \nInzulín: %1$.2fJI\nSacharidy: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Zobraziť záznam na zariadení:</string>

View file

@ -941,7 +941,6 @@ Eversense-appen.</string>
<string name="wear_action_tempt_max_bg_error">Ogiltigt maximum BG!</string>
<string name="wear_action_tempt_manual_range_message">Temp-mål:\nMin: %1$s\nMax: %2$s\nVaraktighet: %3$s</string>
<string name="wear_action_tempt_manual_message">Temp-mål:\nMål: %1$s\nDuration: %2$s</string>
<string name="wear_action_tempt_preset_message">Temp-mål:\Orsak: %1$s\nMål: %2$s\nVaraktighet: %3$s</string>
<string name="quick_wizard_message">Snabbsteg: %1$s\nInsulin: %2$.2fU\nKolhydrater: %3$dg</string>
<string name="wizard_result">Kalkylator:\nInsulin: %1$.2fU\nKolhydrater: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Visa post på enhet:</string>

View file

@ -140,7 +140,7 @@
<string name="openapsma_maxbasal_title">Maks Ü/s geçici Bazal ayarlanabilir</string>
<string name="openapsma_maxbasal_summary">Bu değer OpenAPS\'te \"maksimum bazal\" olarak adlandırılır</string>
<string name="openapsma_maxiob_title">OpenAPS\'nin vermesine izin verilen maksimum bazal IOB (Aktif insülin) [U]</string>
<string name="openapsma_maxiob_summary">Bu değere OpenAPS bağlamında Max IOB denir.\nAPS\'de bir kerede verilebilen maksimum insülin [U] ü.</string>
<string name="openapsma_maxiob_summary">Bu değere OpenAPS bağlamında Maks IOB denir.\nAPS\'de bir kerede verilebilen maksimum insülin [U] ü.</string>
<string name="password_preferences_encrypt_prompt">Dışa aktarılan tercihleri şifrelemek için kullanılacak ana parola sorulacaktır.</string>
<string name="password_preferences_decrypt_prompt">İçe aktarılan tercihlerin şifresini çözmek için gerekli olan ana parola sorulacaktır.</string>
<string name="preferences_export_canceled">Aktarım iptal edildi! Tercihler dışa aktarılmadı!</string>
@ -283,7 +283,7 @@
<string name="openapsama_autosens_min_summary">Varsayılan değer: 0.7\nBu otoduyarlılık için diğer güvenlik önlemidir. Otoduyarlılığın bazal oranlarını ne kadar düşürebileceğini ve İnsülin Duyarlılık Faktörü ve KŞ hedeflerini ne kadar yüksek tutabileceğini gösterir.</string>
<string name="openapsama_autosens_adjusttargets">Otoduyarlılık, hedefleri de ayarlar</string>
<string name="openapsama_autosens_adjusttargets_summary">Varsayılan değer: true\nBu otoduyarlılığın İnsülin Duyarlılık Faktörü ve bazallara ek olarak KŞ hedeflerinin ayarlanmasında kullanılır.</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Varsayılan değer: 2\nYemek bolusu yaptıktan sonra bolus erteleme devreye girer, bu nedenle döngü, yeni yemek yediğinizde düşük geçici bazallar-hedefler ile etkileşime girmez. Buradaki örnek ve varsayılan 2\'dir; bu nedenle 3 saatlik bir DIA, bolus ertelemenin kademeli olarak 1,5 saat (3DIA/2) üzerinden aşamalı olarak sonlandırılacağı anlamına gelir.</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Varsayılan değer: 2\nYemek bolusu yaptıktan sonra bolus erteleme devreye girer, bu nedenle döngü, yeni yemek yediğinizde düşük geçici bazallar-hedefler ile etkileşime girmez. Buradaki örnek ve varsayılan 2\'dir; bu nedenle 3 saatlik bir İES, bolus ertelemenin kademeli olarak 1,5 saat (3İES/2) üzerinden aşamalı olarak sonlandırılacağı anlamına gelir.</string>
<string name="openapsama_min_5m_carbimpact_summary">Varsayılan değer: 3.0 (AMA) Gelişmiş Yemek Asistanı veya 8.0 (SMB) Super Micro Bolus. Bu 5 dakika başına varsayılan karbonhidrat emilimi için bir ayardır. Standart değer AMA için 3mg/dl/5dk aynı şekilde SMB 8mg/dl/5dk dir.
Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden daha fazla düştüğü veya beklenildiği kadar yükselmediği zamanlarda gelecekte yapılacak tahminlerde KŞ\'nin hesaplanmasında ne kadar karbonhidrat emilimi gerçekleşeceğini öngörür.</string>
<string name="openapsama_link_to_preferncejson_doc_txt">Dikkat!\nNormalde aşağıdaki bu değerleri değiştirmek zorunda değilsiniz. Lütfen burayı TIKLAYIN ve metni OKUYUN ve bu değerlerden herhangi birini değiştirmeden önce ANLADIĞINIZDAN emin olun.</string>
@ -433,8 +433,8 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="ns_localbroadcasts_title">Yerel yayınları etkinleştirin.</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dinamik İDF</string>
<string name="DynISFAdjust_title">DinamikİDF ayarlama faktörü %%</string>
<string name="DynISFAdjust_summary">DinamikİDF için ayarlama faktörü. Daha agresif düzeltme dozları için %%100\'den fazla ve de az agresif düzeltmeler için %%100\'den az ayarlayın.</string>
<string name="DynISFAdjust_title" formatted="false">DinamikİDF Ayar Faktörü %</string>
<string name="DynISFAdjust_summary" formatted="false">DinamikİDF için ayarlama faktörü. Daha agresif düzeltme dozları için %100\'den fazla ve daha az agresif düzeltmeler için %100\'den az ayarlayın.</string>
<string name="enableuam">UAM etkinleştir</string>
<string name="enablesmb">SMB (Super Micro Bolus) etkinleştir</string>
<string name="enablesmb_summary">Daha hızlı bir etki için geçici bazal yerine Super Micro Bolus kullanın</string>
@ -593,6 +593,7 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="openapssmb_maxiob_summary">Bu değer OpenAPS bağlamında Max IOB (Aktif İnsülin) olarak adlandırılır\nOpenAPS, mevcut IOB bu değerden daha büyükse daha fazla insülin eklemez</string>
<string name="absorption_cutoff_title">Besinin maksimum emilim süresi [h]</string>
<string name="absorption_cutoff_summary">Herhangi bir öğünün emildiği kabul edilen zaman. Kalan karbonhidratlar kesilecek.</string>
<string name="treatmentssafety_lgsThreshold_summary">Altına düştüğünde insülinin askıya alındığı KŞ değeri. Varsayılan değer, standart hedef modeli kullanır. Kullanıcı değeri 60mg/dl (3,3mmol/l) ile 100mg/dl(5.5mmol/l) arasında ayarlayabilir. 65/3,6\'nın altındaki değerler varsayılan modelin kullanılmasına neden olur</string>
<string name="overview_show_notes_field_in_dialogs_title">Tedavi diyaloglarında not alanını göster</string>
<string name="next_button">İleri</string>
<string name="previous_button">Önceki</string>
@ -969,7 +970,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="wear_action_tempt_max_bg_error">Maks-KŞ aralık dışında!</string>
<string name="wear_action_tempt_manual_range_message">Geçici Hedef:\nMin: %1$s\nMaks: %2$s\nSüre: %3$s</string>
<string name="wear_action_tempt_manual_message">Geçici Hedef:\nHedef: %1$s\nSüre: %2$s</string>
<string name="wear_action_tempt_preset_message">Geçici Hedef:\Neden: %1$s\nHedef: %2$s\nSüre: %3$s</string>
<string name="quick_wizard_message">Hızlı Asistan: %1$s\nİnsülin: %2$.2fU\nKarb: %3$dg</string>
<string name="wizard_result">Hesap Mak.:\nİnsulin: %1$.2fÜ\nKarb: %2$dg</string>
<string name="overview_editquickwizard_show_on_device">Girişi cihazda göster:</string>

View file

@ -432,8 +432,6 @@
<string name="ns_localbroadcasts_title">启用本地广播。</string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">动态ISF(胰岛素敏感系数)</string>
<string name="DynISFAdjust_title">动态ISF胰岛素敏系数调整比例 %%</string>
<string name="DynISFAdjust_summary">动态ISF的调整因子。设置100%%以上用于更积极的校正100%%以下则不那么积极校正。</string>
<string name="enableuam">启用 UAM</string>
<string name="enablesmb">启用微型大剂量</string>
<string name="enablesmb_summary">使用微型大剂量代替使用临时基础率,更快的干预</string>
@ -957,7 +955,6 @@
<string name="wear_action_tempt_max_bg_error">目标血糖最大值超出范围!</string>
<string name="wear_action_tempt_manual_range_message">临时目标:\n最小: %1$s\n最大: %2$s\n持续时间: %3$s</string>
<string name="wear_action_tempt_manual_message">临时目标:\n目标: %1$s\n持续时间: %2$s</string>
<string name="wear_action_tempt_preset_message">临时目标:\原因: %1$s\n目标: %2$s\n持续时间: %3$s</string>
<string name="quick_wizard_message">快速向导: %1$s\n胰岛素: %2$.2fU\n碳水: %3$d克</string>
<string name="wizard_result">计算. 向导:\n胰岛素: %1$.2fU\n碳水: %2$d克</string>
<string name="overview_editquickwizard_show_on_device">在设备上显示条目:</string>

View file

@ -58,6 +58,7 @@
<string name="treatmentssafety_title">Treatments safety</string>
<string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max allowed carbs [g]</string>
<string name="treatmentssafety_lgsThreshold_title">BG level below which low glucose suspend occurs</string>
<string name="nav_preferences_plugin">%1$s Preferences</string>
<string name="nav_preferences">Preferences</string>
<string name="nav_refreshtreatments">Refresh treatments from NS</string>
@ -162,7 +163,7 @@
<string name="apsmode_title">APS Mode</string>
<string name="closedloop">Closed Loop</string>
<string name="openloop">Open Loop</string>
<string name="lowglucosesuspend">Low Glucose Suspend</string>
<string name="lowglucosesuspend">Low Glucose Suspend</string>
<string name="disabledloop">Loop Disabled</string>
<string name="openloop_newsuggestion">New suggestion available</string>
<string name="carbssuggestion">Carbs Suggestion</string>
@ -519,8 +520,8 @@
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamic ISF</string>
<string name="key_DynISFAdjust" translatable="false">DynISFAdjust</string>
<string name="DynISFAdjust_title">DynamicISF Adjustment Factor %%</string>
<string name="DynISFAdjust_summary">Adjustment factor for DynamicISF. Set more than 100%% for more aggressive correction doses, and less than 100%% for less aggressive corrections.</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF Adjustment Factor %</string>
<string name="DynISFAdjust_summary" formatted="false">Adjustment factor for DynamicISF. Set more than 100% for more aggressive correction doses, and less than 100% for less aggressive corrections.</string>
<string name="key_use_smb" translatable="false">use_smb</string>
<string name="key_use_uam" translatable="false">use_uam</string>
<string name="key_smb_enable_carbs_suggestions_threshold" translatable="false">smb_enable_carbs_suggestions_threshold</string>
@ -701,6 +702,7 @@
<string name="smb_frequency_exceeded">A bolus was delivered within the last 3 minutes, skipping SMB</string>
<string name="basal_set_correctly">Basal set correctly</string>
<string name="key_treatmentssafety_maxbolus" translatable="false">treatmentssafety_maxbolus</string>
<string name="key_lgs_threshold" translatable="false">lgsThreshold</string>
<string name="limitingextendedbolus">Limiting extended bolus to %1$.1f U because of %2$s</string>
<string name="limitingcarbs">Limiting carbs to %1$d g because of %2$s</string>
<string name="limitingiob">Limiting IOB to %1$.1f U because of %2$s</string>
@ -720,6 +722,7 @@
<string name="openapssmb_maxiob_summary">This value is called Max IOB in OpenAPS context\nOpenAPS will not add more insulin if current IOB is greater than this value</string>
<string name="absorption_cutoff_title">Meal max absorption time [h]</string>
<string name="absorption_cutoff_summary">Time at which any meal is considered absorbed. Remaining carbs will be cut off.</string>
<string name="treatmentssafety_lgsThreshold_summary">BG value below which insulin is suspended. Default value uses standard target model. User can set value between 60mg/dl (3.3mmol/l) and 100mg/dl(5.5mmol/l). Values below 65/3.6 result in use of default model</string>
<string name="overview_show_notes_field_in_dialogs_title">Show notes field in treatment dialogs</string>
<string name="title_activity_setup_wizard" translatable="false">SetupWizardActivity</string>
<string name="next_button">Next</string>
@ -1172,7 +1175,7 @@
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
<string name="wear_action_tempt_preset_message">Temptarget:\Reason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
<string name="wear_action_tempt_preset_message">Temptarget:\nReason: %1$s\nTarget: %2$s\nDuration: %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">Show entry on device:</string>

View file

@ -36,6 +36,11 @@
android:summary="@string/ns_upload_summary"
android:title="@string/ns_upload" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_dexcomg5_nsupload"
android:title="@string/dexcomg5_nsupload_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_ns_receive_cgm"

View file

@ -39,6 +39,16 @@
validate:floatminNumber="1"
validate:testType="floatNumericRange" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="65"
android:inputType="numberDecimal"
android:dialogMessage="@string/treatmentssafety_lgsThreshold_summary"
android:key="@string/key_lgs_threshold"
android:title="@string/treatmentssafety_lgsThreshold_title"
validate:floatmaxNumber="120"
validate:floatminNumber="65"
validate:testType="bgRange" />
<SwitchPreference
android:defaultValue="false"
android:key="openapsama_useautosens"

View file

@ -6,9 +6,10 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.logging.AAPSLogger
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
@ -31,6 +32,7 @@ class InsulinLyumjevPluginTest {
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var aapsLogger: AAPSLogger
@Mock lateinit var config: Config
@Mock lateinit var hardLimits: HardLimits
private var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector {
@ -39,7 +41,7 @@ class InsulinLyumjevPluginTest {
@Before
fun setup() {
sut = InsulinLyumjevPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config)
sut = InsulinLyumjevPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits)
}
@Test

View file

@ -9,17 +9,17 @@ import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.insulin.InsulinOrefBasePlugin.Companion.MIN_DIA
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.logging.AAPSLogger
import org.json.JSONObject
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.mockito.Mock
import org.mockito.Mockito.`when`
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
@ -35,10 +35,9 @@ class InsulinOrefBasePluginTest {
profileFunction: ProfileFunction,
rxBus: RxBus,
aapsLogger: AAPSLogger,
config: Config
) : InsulinOrefBasePlugin(
injector, rh, profileFunction, rxBus, aapsLogger, config
) {
config: Config,
hardLimits: HardLimits
) : InsulinOrefBasePlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits) {
override fun sendShortDiaNotification(dia: Double) {
shortDiaNotificationSend = true
@ -62,13 +61,13 @@ class InsulinOrefBasePluginTest {
private lateinit var sut: InsulinBaseTest
@Mock lateinit var defaultValueHelper: DefaultValueHelper
@Mock lateinit var rh: ResourceHelper
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var rxBus: RxBus
@Mock lateinit var aapsLogger: AAPSLogger
@Mock lateinit var activePlugin: ActivePlugin
@Mock lateinit var config: Config
@Mock lateinit var hardLimits: HardLimits
private var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector {
@ -77,30 +76,23 @@ class InsulinOrefBasePluginTest {
@Before
fun setUp() {
sut = InsulinBaseTest(injector, rh, profileFunction, rxBus, aapsLogger, config)
sut = InsulinBaseTest(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits)
`when`(hardLimits.minDia()).thenReturn(5.0)
}
@Test
fun testGetDia() {
Assert.assertEquals(MIN_DIA, sut.dia, 0.0)
testUserDefinedDia = MIN_DIA + 1
Assert.assertEquals(MIN_DIA + 1, sut.dia, 0.0)
testUserDefinedDia = MIN_DIA - 1
Assert.assertEquals(MIN_DIA, sut.dia, 0.0)
Assert.assertEquals(5.0, sut.dia, 0.0)
testUserDefinedDia = 5.0 + 1
Assert.assertEquals(5.0 + 1, sut.dia, 0.0)
testUserDefinedDia = 5.0 - 1
Assert.assertEquals(5.0, sut.dia, 0.0)
Assert.assertTrue(shortDiaNotificationSend)
}
@Test
fun minDiaTes() {
Assert.assertEquals(5.0, MIN_DIA, 0.0001)
}
@Test
fun testIobCalcForTreatment() {
val treatment = Bolus(timestamp = 0, amount = 10.0, type = Bolus.Type.NORMAL)
val expected = Iob()
Assert.assertEquals(expected.iobContrib, sut.iobCalcForTreatment(treatment, 0, 0.0).iobContrib, 0.001)
Assert.assertEquals(expected.activityContrib, sut.iobCalcForTreatment(treatment, 0, 0.0).activityContrib, 0.001)
testPeak = 30
testUserDefinedDia = 4.0
val time = System.currentTimeMillis()

View file

@ -7,8 +7,9 @@ import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.sharedPreferences.SP
import org.junit.Assert.assertEquals
import org.junit.Before
@ -31,6 +32,7 @@ class InsulinOrefFreePeakPluginTest : TestBase() {
@Mock lateinit var rxBus: RxBus
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var config: Config
@Mock lateinit var hardLimits: HardLimits
private var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector {
@ -39,7 +41,7 @@ class InsulinOrefFreePeakPluginTest : TestBase() {
@Before
fun setup() {
sut = InsulinOrefFreePeakPlugin( injector, sp, rh, profileFunction, rxBus, aapsLogger, config)
sut = InsulinOrefFreePeakPlugin(injector, sp, rh, profileFunction, rxBus, aapsLogger, config, hardLimits)
}
@Test

View file

@ -6,9 +6,10 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.logging.AAPSLogger
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
@ -31,6 +32,7 @@ class InsulinOrefRapidActingPluginTest {
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var aapsLogger: AAPSLogger
@Mock lateinit var config: Config
@Mock lateinit var hardLimits: HardLimits
private var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector {
@ -39,7 +41,7 @@ class InsulinOrefRapidActingPluginTest {
@Before
fun setup() {
sut = InsulinOrefRapidActingPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config)
sut = InsulinOrefRapidActingPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits)
}
@Test

View file

@ -6,9 +6,10 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.interfaces.Insulin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.shared.logging.AAPSLogger
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
@ -31,6 +32,7 @@ class InsulinOrefUltraRapidActingPluginTest {
@Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var aapsLogger: AAPSLogger
@Mock lateinit var config: Config
@Mock lateinit var hardLimits: HardLimits
private var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector {
@ -39,7 +41,7 @@ class InsulinOrefUltraRapidActingPluginTest {
@Before
fun setup() {
sut = InsulinOrefUltraRapidActingPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config)
sut = InsulinOrefUltraRapidActingPlugin(injector, rh, profileFunction, rxBus, aapsLogger, config, hardLimits)
}
@Test

View file

@ -241,7 +241,7 @@ class CommandQueueImplementationTest : TestBaseWithProfile() {
Assert.assertEquals(2, commandQueue.size())
// when
commandQueue.cancelAllBoluses()
commandQueue.cancelAllBoluses(anyLong())
// then
Assert.assertEquals(0, commandQueue.size())

View file

@ -148,7 +148,7 @@ class AutomationPlugin @Inject constructor(
private fun storeToSP() {
val array = JSONArray()
val iterator = ArrayList(automationEvents).iterator()
val iterator = synchronized(this) { automationEvents.toMutableList().iterator() }
try {
while (iterator.hasNext()) {
val event = iterator.next()
@ -161,6 +161,7 @@ class AutomationPlugin @Inject constructor(
sp.putString(keyAutomationEvents, array.toString())
}
@Synchronized
private fun loadFromSP() {
automationEvents.clear()
val data = sp.getString(keyAutomationEvents, "")
@ -179,7 +180,7 @@ class AutomationPlugin @Inject constructor(
automationEvents.add(AutomationEvent(injector).fromJSON(event, 0))
}
@Synchronized internal fun processActions() {
internal fun processActions() {
var commonEventsEnabled = true
if (loop.isSuspended || !(loop as PluginBase).isEnabled()) {
aapsLogger.debug(LTag.AUTOMATION, "Loop deactivated")
@ -207,7 +208,7 @@ class AutomationPlugin @Inject constructor(
}
aapsLogger.debug(LTag.AUTOMATION, "processActions")
val iterator: MutableIterator<AutomationEvent> = automationEvents.iterator()
val iterator = synchronized(this) { automationEvents.toMutableList().iterator() }
while (iterator.hasNext()) {
val event = iterator.next()
if (event.isEnabled && !event.userAction && event.shouldRun())
@ -254,7 +255,7 @@ class AutomationPlugin @Inject constructor(
}
SystemClock.sleep(1100)
event.lastRun = dateUtil.now()
if (event.autoRemove) automationEvents.remove(event)
if (event.autoRemove) remove(event)
}
}
@ -299,9 +300,12 @@ class AutomationPlugin @Inject constructor(
}
@Synchronized
fun remove(event: AutomationEvent) {
automationEvents.remove(event)
}
fun at(index: Int) = automationEvents[index]
@Synchronized
fun size() = automationEvents.size
@Synchronized
@ -309,10 +313,9 @@ class AutomationPlugin @Inject constructor(
Collections.swap(automationEvents, fromPosition, toPosition)
}
@Synchronized
fun userEvents(): List<AutomationEvent> {
val list = mutableListOf<AutomationEvent>()
val iterator: MutableIterator<AutomationEvent> = automationEvents.iterator()
val iterator = synchronized(this) { automationEvents.toMutableList().iterator() }
while (iterator.hasNext()) {
val event = iterator.next()
if (event.userAction && event.isEnabled) list.add(event)

View file

@ -24,6 +24,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv
import info.nightscout.androidaps.services.LastLocationDataContainer
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.shared.logging.LTag
import info.nightscout.shared.sharedPreferences.SP
import org.json.JSONObject
import javax.inject.Inject
@ -78,51 +79,56 @@ abstract class Trigger(val injector: HasAndroidInjector) {
.toString()
fun instantiate(obj: JSONObject): Trigger {
val type = obj.getString("type")
val data = obj.getJSONObject("data")
//val clazz = Class.forName(type).kotlin
//return (clazz.primaryConstructor?.call(injector) as Trigger).fromJSON(data?.toString() ?: "")
return when (type) {
TriggerAutosensValue::class.java.name, // backward compatibility
TriggerAutosensValue::class.java.simpleName -> TriggerAutosensValue(injector).fromJSON(data.toString())
TriggerBg::class.java.name,
TriggerBg::class.java.simpleName -> TriggerBg(injector).fromJSON(data.toString())
TriggerBolusAgo::class.java.name,
TriggerBolusAgo::class.java.simpleName -> TriggerBolusAgo(injector).fromJSON(data.toString())
TriggerBTDevice::class.java.name,
TriggerBTDevice::class.java.simpleName -> TriggerBTDevice(injector).fromJSON(data.toString())
TriggerIob::class.java.name,
TriggerIob::class.java.simpleName -> TriggerIob(injector).fromJSON(data.toString())
TriggerCOB::class.java.name,
TriggerCOB::class.java.simpleName -> TriggerCOB(injector).fromJSON(data.toString())
TriggerConnector::class.java.name,
TriggerConnector::class.java.simpleName -> TriggerConnector(injector).fromJSON(data.toString())
TriggerDelta::class.java.name,
TriggerDelta::class.java.simpleName -> TriggerDelta(injector).fromJSON(data.toString())
TriggerDummy::class.java.name,
TriggerDummy::class.java.simpleName -> TriggerDummy(injector).fromJSON(data.toString())
TriggerIob::class.java.name,
TriggerIob::class.java.simpleName -> TriggerIob(injector).fromJSON(data.toString())
TriggerLocation::class.java.name,
TriggerLocation::class.java.simpleName -> TriggerLocation(injector).fromJSON(data.toString())
TriggerProfilePercent::class.java.name,
TriggerProfilePercent::class.java.simpleName -> TriggerProfilePercent(injector).fromJSON(data.toString())
TriggerPumpLastConnection::class.java.name,
TriggerPumpLastConnection::class.java.simpleName -> TriggerPumpLastConnection(injector).fromJSON(data.toString())
TriggerRecurringTime::class.java.name,
TriggerRecurringTime::class.java.simpleName -> TriggerRecurringTime(injector).fromJSON(data.toString())
TriggerTempTarget::class.java.name,
TriggerTempTarget::class.java.simpleName -> TriggerTempTarget(injector).fromJSON(data.toString())
TriggerTempTargetValue::class.java.name,
TriggerTempTargetValue::class.java.simpleName -> TriggerTempTargetValue(injector).fromJSON(data.toString())
TriggerTime::class.java.name,
TriggerTime::class.java.simpleName -> TriggerTime(injector).fromJSON(data.toString())
TriggerTimeRange::class.java.name,
TriggerTimeRange::class.java.simpleName -> TriggerTimeRange(injector).fromJSON(data.toString())
TriggerWifiSsid::class.java.name,
TriggerWifiSsid::class.java.simpleName -> TriggerWifiSsid(injector).fromJSON(data.toString())
else -> TriggerConnector(injector)
try {
val type = obj.getString("type")
val data = obj.getJSONObject("data")
//val clazz = Class.forName(type).kotlin
//return (clazz.primaryConstructor?.call(injector) as Trigger).fromJSON(data?.toString() ?: "")
return when (type) {
TriggerAutosensValue::class.java.name, // backward compatibility
TriggerAutosensValue::class.java.simpleName -> TriggerAutosensValue(injector).fromJSON(data.toString())
TriggerBg::class.java.name,
TriggerBg::class.java.simpleName -> TriggerBg(injector).fromJSON(data.toString())
TriggerBolusAgo::class.java.name,
TriggerBolusAgo::class.java.simpleName -> TriggerBolusAgo(injector).fromJSON(data.toString())
TriggerBTDevice::class.java.name,
TriggerBTDevice::class.java.simpleName -> TriggerBTDevice(injector).fromJSON(data.toString())
TriggerIob::class.java.name,
TriggerIob::class.java.simpleName -> TriggerIob(injector).fromJSON(data.toString())
TriggerCOB::class.java.name,
TriggerCOB::class.java.simpleName -> TriggerCOB(injector).fromJSON(data.toString())
TriggerConnector::class.java.name,
TriggerConnector::class.java.simpleName -> TriggerConnector(injector).fromJSON(data.toString())
TriggerDelta::class.java.name,
TriggerDelta::class.java.simpleName -> TriggerDelta(injector).fromJSON(data.toString())
TriggerDummy::class.java.name,
TriggerDummy::class.java.simpleName -> TriggerDummy(injector).fromJSON(data.toString())
TriggerIob::class.java.name,
TriggerIob::class.java.simpleName -> TriggerIob(injector).fromJSON(data.toString())
TriggerLocation::class.java.name,
TriggerLocation::class.java.simpleName -> TriggerLocation(injector).fromJSON(data.toString())
TriggerProfilePercent::class.java.name,
TriggerProfilePercent::class.java.simpleName -> TriggerProfilePercent(injector).fromJSON(data.toString())
TriggerPumpLastConnection::class.java.name,
TriggerPumpLastConnection::class.java.simpleName -> TriggerPumpLastConnection(injector).fromJSON(data.toString())
TriggerRecurringTime::class.java.name,
TriggerRecurringTime::class.java.simpleName -> TriggerRecurringTime(injector).fromJSON(data.toString())
TriggerTempTarget::class.java.name,
TriggerTempTarget::class.java.simpleName -> TriggerTempTarget(injector).fromJSON(data.toString())
TriggerTempTargetValue::class.java.name,
TriggerTempTargetValue::class.java.simpleName -> TriggerTempTargetValue(injector).fromJSON(data.toString())
TriggerTime::class.java.name,
TriggerTime::class.java.simpleName -> TriggerTime(injector).fromJSON(data.toString())
TriggerTimeRange::class.java.name,
TriggerTimeRange::class.java.simpleName -> TriggerTimeRange(injector).fromJSON(data.toString())
TriggerWifiSsid::class.java.name,
TriggerWifiSsid::class.java.simpleName -> TriggerWifiSsid(injector).fromJSON(data.toString())
else -> TriggerConnector(injector)
}
} catch (e: Exception) {
aapsLogger.error(LTag.AUTOMATION, "Error parsing $obj")
}
return TriggerConnector(injector)
}
fun createAddButton(context: Context, trigger: TriggerConnector): ImageButton =

View file

@ -120,4 +120,7 @@
<string name="confirm_remove_multiple_items">Sicuro di voler eliminare %1$d elementi</string>
<string name="sort_label">Ordina</string>
<string name="system_automation">Automazione sistema</string>
<string name="run_automations">Esegui automazioni</string>
<string name="add_automation">Aggiungi regola</string>
<string name="remove_sort">Rimuovi/ordina</string>
</resources>

View file

@ -120,4 +120,7 @@
<string name="confirm_remove_multiple_items">Weet je zeker dat je %1$d items wilt verwijderen</string>
<string name="sort_label">Sorteren</string>
<string name="system_automation">Systeem automatisering</string>
<string name="run_automations">Automatisering uitvoeren</string>
<string name="add_automation">Regel toevoegen</string>
<string name="remove_sort">Verwijderen/sorteren</string>
</resources>

View file

@ -10,7 +10,7 @@ buildscript {
room_version = '2.4.2'
lifecycle_version = '2.4.1'
dagger_version = '2.42'
coroutines_version = '1.6.2'
coroutines_version = '1.6.3'
activity_version = '1.4.0'
fragmentktx_version = '1.4.1'
ormLite_version = '4.46'
@ -50,7 +50,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View file

@ -566,7 +566,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints {
return new PumpEnactResult(getInjector()).success(true).enacted(false);
}
EventOverviewBolusProgress.Treatment treatment = new EventOverviewBolusProgress.Treatment(0.0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB);
EventOverviewBolusProgress.Treatment treatment = new EventOverviewBolusProgress.Treatment(0.0, 0,detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.getId());
EventOverviewBolusProgress.INSTANCE.setT(treatment);
// start bolus delivery

View file

@ -9,7 +9,7 @@ class BolusProgressHelperActivity : DialogAppCompatActivity() {
BolusProgressDialog()
.setHelperActivity(this)
.setInsulin(intent.getDoubleExtra("insulin", 0.0))
.setTimestamp(intent.getLongExtra("timestamp", 0L))
.setId(intent.getLongExtra("id", 0L))
.show(supportFragmentManager, "BolusProgress")
}
}

View file

@ -14,6 +14,8 @@ import info.nightscout.androidaps.utils.T
class DetailedBolusInfo {
val id = System.currentTimeMillis()
// Requesting parameters for driver
@JvmField var insulin = 0.0
@JvmField var carbs = 0.0

View file

@ -10,7 +10,7 @@ import org.json.JSONException
import org.json.JSONObject
@Suppress("SpellCheckingInspection")
class IobTotal(val time: Long) : DataPointWithLabelInterface {
class IobTotal(val time: Long) : DataPointWithLabelInterface {
var iob = 0.0
var activity = 0.0
@ -51,15 +51,15 @@ class IobTotal(val time: Long) : DataPointWithLabelInterface {
return this
}
fun round(fabricPrivacy: FabricPrivacy? = null): IobTotal {
iob = Round.roundTo(iob, 0.001, fabricPrivacy)
activity = Round.roundTo(activity, 0.0001, fabricPrivacy)
bolussnooze = Round.roundTo(bolussnooze, 0.0001, fabricPrivacy)
basaliob = Round.roundTo(basaliob, 0.001, fabricPrivacy)
netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001, fabricPrivacy)
hightempinsulin = Round.roundTo(hightempinsulin, 0.001, fabricPrivacy)
netInsulin = Round.roundTo(netInsulin, 0.001, fabricPrivacy)
extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001, fabricPrivacy)
fun round(): IobTotal {
iob = Round.roundTo(iob, 0.001)
activity = Round.roundTo(activity, 0.0001)
bolussnooze = Round.roundTo(bolussnooze, 0.0001)
basaliob = Round.roundTo(basaliob, 0.001)
netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001)
hightempinsulin = Round.roundTo(hightempinsulin, 0.001)
netInsulin = Round.roundTo(netInsulin, 0.001)
extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001)
return this
}

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.dialogs
import android.content.res.Resources
import android.os.Bundle
import android.os.SystemClock
import android.view.LayoutInflater
@ -16,15 +15,15 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.interfaces.CommandQueue
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
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.overview.events.EventDismissBolusProgressIfRunning
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.interfaces.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject
@ -49,12 +48,12 @@ class BolusProgressDialog : DaggerDialogFragment() {
private var running = true
private var amount = 0.0
var timestamp: Long = 0L
var id: Long = 0L
private var state: String? = null
private var helpActivity: BolusProgressHelperActivity? = null
fun setTimestamp(timestamp: Long): BolusProgressDialog {
this.timestamp = timestamp
fun setId(id: Long): BolusProgressDialog {
this.id = id
return this
}
@ -75,17 +74,12 @@ class BolusProgressDialog : DaggerDialogFragment() {
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
dialog?.window?.requestFeature(Window.FEATURE_NO_TITLE)
dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
isCancelable = false
dialog?.setCanceledOnTouchOutside(false)
val theme: Resources.Theme? = context?.theme
theme?.applyStyle(R.style.AppTheme_NoActionBar, true)
context?.theme?.applyStyle(R.style.AppTheme_NoActionBar, true)
_binding = DialogBolusprogressBinding.inflate(inflater, container, false)
return binding.root
@ -94,7 +88,8 @@ class BolusProgressDialog : DaggerDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
savedInstanceState?.let {
amount = it.getDouble("amount")
timestamp = it.getLong("timestamp")
id = it.getLong("id")
state = it.getString("state") ?: rh.gs(R.string.waitingforpump)
}
binding.title.text = rh.gs(R.string.goingtodeliver, amount)
binding.stop.setOnClickListener {
@ -103,11 +98,9 @@ class BolusProgressDialog : DaggerDialogFragment() {
binding.stoppressed.visibility = View.VISIBLE
binding.stop.visibility = View.INVISIBLE
uel.log(Action.CANCEL_BOLUS, Sources.Overview, state)
commandQueue.cancelAllBoluses()
commandQueue.cancelAllBoluses(id)
}
val defaultState = rh.gs(R.string.waitingforpump)
binding.progressbar.max = 100
state = savedInstanceState?.getString("state", defaultState) ?: defaultState
binding.status.text = state
stopPressed = false
}
@ -134,22 +127,24 @@ class BolusProgressDialog : DaggerDialogFragment() {
.toObservable(EventDismissBolusProgressIfRunning::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
aapsLogger.debug(LTag.PUMP, "Running timestamp $timestamp. Close request timestamp ${it.bolusTimestamp}")
if (it.bolusTimestamp == null || it.bolusTimestamp == timestamp)
aapsLogger.debug(LTag.PUMP, "Running id $id. Close request id ${it.id}")
if (it.id == null || it.id == id)
if (running) dismiss()
}, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventOverviewBolusProgress::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
aapsLogger.debug(LTag.UI, "Status: ${it.status} Percent: ${it.percent}")
binding.status.text = it.status
binding.progressbar.progress = it.percent
if (it.percent == 100) {
binding.stop.visibility = View.INVISIBLE
scheduleDismiss()
if (it.t?.id == id) {
aapsLogger.debug(LTag.UI, "Status: ${it.status} Percent: ${it.percent}")
binding.status.text = it.status
binding.progressbar.progress = it.percent
if (it.percent == 100) {
binding.stop.visibility = View.INVISIBLE
scheduleDismiss()
}
state = it.status
}
state = it.status
}, fabricPrivacy::logException)
}
@ -177,7 +172,7 @@ class BolusProgressDialog : DaggerDialogFragment() {
super.onSaveInstanceState(outState)
outState.putString("state", state)
outState.putDouble("amount", amount)
outState.putLong("timestamp", timestamp)
outState.putLong("id", id)
}
override fun onDestroyView() {

View file

@ -17,7 +17,7 @@ interface CommandQueue {
fun independentConnect(reason: String, callback: Callback?)
fun bolusInQueue(): Boolean
fun bolus(detailedBolusInfo: DetailedBolusInfo, callback: Callback?): Boolean
fun cancelAllBoluses()
fun cancelAllBoluses(id: Long)
fun stopPump(callback: Callback?)
fun startPump(callback: Callback?)
fun setTBROverNotification(callback: Callback?, enable: Boolean)

View file

@ -188,6 +188,9 @@ interface Profile {
if (isMmol(anyBg)) toUnitsString(anyBg * Constants.MMOLL_TO_MGDL, anyBg, profileFunction.getUnits())
else toUnitsString(anyBg, anyBg * Constants.MGDL_TO_MMOLL, profileFunction.getUnits())
fun toMgdl(value: Double): Double =
if (isMgdl(value)) value else value * Constants.MMOLL_TO_MGDL
fun toMgdl(value: Double, units: GlucoseUnit): Double =
if (units == GlucoseUnit.MGDL) value else value * Constants.MMOLL_TO_MGDL

View file

@ -5,7 +5,7 @@ import java.text.SimpleDateFormat
import java.util.*
class EventNSClientNewLog(var action: String, var logText: String) : Event() {
var date = Date()
var date = System.currentTimeMillis()
private var timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault())

View file

@ -3,4 +3,4 @@ package info.nightscout.androidaps.plugins.general.overview.events
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.events.Event
class EventDismissBolusProgressIfRunning(val result: PumpEnactResult?, val bolusTimestamp: Long?) : Event()
class EventDismissBolusProgressIfRunning(val result: PumpEnactResult?, val id: Long?) : Event()

View file

@ -4,7 +4,7 @@ import info.nightscout.androidaps.events.Event
object EventOverviewBolusProgress : Event() {
data class Treatment constructor(@JvmField var insulin: Double = 0.0, @JvmField var carbs: Int = 0, @JvmField var isSMB: Boolean)
data class Treatment constructor(var insulin: Double = 0.0, var carbs: Int = 0, var isSMB: Boolean, var id: Long)
var status = ""
var t: Treatment? = null

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.utils
import android.os.Bundle
import java.math.BigDecimal
import java.security.InvalidParameterException
import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.floor
@ -12,16 +13,10 @@ import kotlin.math.roundToLong
*/
object Round {
fun roundTo(x: Double, step: Double, fabricPrivacy: FabricPrivacy? = null): Double = try {
if (x == 0.0) 0.0
fun roundTo(x: Double, step: Double): Double {
if (x.isNaN()) throw InvalidParameterException("Parameter is NaN")
return if (x == 0.0) 0.0
else BigDecimal.valueOf((x / step).roundToLong()).multiply(BigDecimal.valueOf(step)).toDouble()
} catch (e: Exception) {
fabricPrivacy?.logCustom("Error_roundTo", Bundle().apply {
putDouble("x", x)
putDouble("step", step)
putString("stacktrace", e.stackTraceToString())
})
0.0
}
fun floorTo(x: Double, step: Double): Double =

View file

@ -42,6 +42,7 @@
<string name="carbs">CHO</string>
<string name="invalidprofile">Profilo non valido !!!</string>
<string name="noprofileset">NESSUN PROFILO IMPOSTATO</string>
<string name="active"><![CDATA[<Active>]]></string>
<string name="date">Data</string>
<string name="units_label">Unità</string>
<string name="dia_label">DIA</string>
@ -441,6 +442,52 @@
<string name="a11y_file">file</string>
<string name="a11y_user">utente</string>
<!-- Autotune -->
<string name="autotune">Autotune</string>
<string name="autotune_description">Aiuto per potenziali regolazioni del profilo (ISF, rapporto CHO e velocità basali)</string>
<string name="autotune_shortname">AT</string>
<string name="autotune_settings">Impostazioni Autotune</string>
<string name="autotune_auto_title">Automazione cambio profilo</string>
<string name="autotune_auto_summary">Se abilitato, Autotune si aggiornerà automaticamente e passerà al profilo di input dopo il calcolo da una regola di automazione.</string>
<string name="autotune_categorize_uam_as_basal_title">Classifica UAM come basale</string>
<string name="autotune_categorize_uam_as_basal_summary">Abilita solo se hai inserito in modo affidabile tutti i carboidrati assunti, con questa opzione aumenti improvvisi individuati da Autotune verranno usati per consigliare modifiche alla velocità basale.</string>
<string name="autotune_tune_insulin_curve_title">Regola la curva dell\'insulina</string>
<string name="autotune_tune_insulin_curve_summary">Abilita solo se usi free-peak. Questa opzione regolerà la durata di picco e DIA</string>
<string name="autotune_default_tune_days_title">Numero di giorni di dati</string>
<string name="autotune_circadian_ic_isf_title">Applica il risultato medio in IC/ISF circadiano</string>
<string name="autotune_circadian_ic_isf_summary">Autotune non regolerà le variazioni circadiane, questa opzione applica solo la regolazione media di IC e ISF al tuo profilo di input circadiano</string>
<string name="autotune_additional_log_title">Includi più informazioni di log per il debug</string>
<string name="autotune_additional_log_summary">Attiva solo se richiesto dallo sviluppatore per inviare ulteriori informazioni di log per aiutare il debug del plugin Autotune</string>
<string name="autotune_default_tune_days_summary">Numero predefinito di giorni di dati da elaborare da Autotune (fino a 30)</string>
<string name="autotune_tunedprofile_name">Regolato</string>
<string name="autotune_profile">Profilo :</string>
<string name="autotune_tune_days">Giorni regolazione :</string>
<string name="autotune_last_run">Ultima esecuzione :</string>
<string name="autotune_warning">Avviso :</string>
<string name="autotune_select_profile">Seleziona il profilo da regolare</string>
<string name="autotune_ic_warning">Il profilo selezionato ha %1$d valori IC. Autotune userà %2$.2f g/U</string>
<string name="autotune_isf_warning">Il profilo selezionato ha %1$d valori ISF. Autotune userà %2$.1f %3$s/U</string>
<string name="autotune_error">Errore nei dati di input, prova a eseguire di nuovo Autotune o ridurre il numero di giorni</string>
<string name="autotune_warning_during_run">Il calcolo di Autotune è iniziato, attendi</string>
<string name="autotune_warning_after_run">Controlla attentamente i risultati prima di utilizzarli!</string>
<string name="autotune_partial_result">Risultato parziale giorno %1$d / %2$d regolato</string>
<string name="autotune_result">Risultato: %1$s</string>
<string name="autotune_param">Param</string>
<string name="autotune_percent">%</string>
<string name="autotune_missing">Mancante</string>
<string name="autotune_profile_name">Profilo Autotune %1$s</string>
<string name="autotune_run">Esegui Autotune</string>
<string name="autotune_check_input_profile_button">Controlla il profilo di input</string>
<string name="autotune_compare_profile">Compara profili</string>
<string name="autotune_copy_localprofile_button">Copia nel profilo locale</string>
<string name="autotune_update_input_profile_button">Aggiorna il profilo di input</string>
<string name="autotune_revert_input_profile_button">Ripristina il profilo di input</string>
<string name="autotune_copy_local_profile_message">Creare un nuovo profilo locale da questo profilo Autotune?</string>
<string name="autotune_update_local_profile_message">Aggiornare il profilo %1$s con il profilo Autotune?</string>
<string name="autotune_revert_local_profile_message">Ripristinare il profilo %1$s con il profilo di input?</string>
<string name="autotune_profile_invalid">Profilo non valido</string>
<string name="autotune_run_without_autoswitch">Autotune eseguito senza cambio profilo</string>
<string name="autotune_run_with_autoswitch">Autotune eseguito e profilo cambiato automaticamente</string>
<string name="autotune_run_with_error">Errore durante l\'ultima esecuzione di Autotune</string>
<plurals name="days">
<item quantity="one">%1$d giorno</item>
<item quantity="other">%1$d giorni</item>

View file

@ -42,6 +42,7 @@
<string name="carbs">Koolhydraten</string>
<string name="invalidprofile">Ongeldig profiel !!!</string>
<string name="noprofileset">Geen profiel ingesteld</string>
<string name="active"><![CDATA[<Huidig>]]></string>
<string name="date">Datum</string>
<string name="units_label">Eenheden</string>
<string name="dia_label">DIA</string>
@ -441,10 +442,52 @@
<string name="a11y_file">bestand</string>
<string name="a11y_user">gebruiker</string>
<!-- Autotune -->
<string name="autotune">Autotune</string>
<string name="autotune_description">Hulp voor potentiële aanpassingen van het profiel (ISF, koolhydraten en basale koersen)</string>
<string name="autotune_shortname">AT</string>
<string name="autotune_settings">Autotune instellingen</string>
<string name="autotune_auto_title">Automatisering Profiel Wissel</string>
<string name="autotune_auto_summary">Indien ingeschakeld, wordt Autotune automatisch bijgewerkt en overschakelen naar invoerprofiel na de berekening van een automatiseringsregel.</string>
<string name="autotune_categorize_uam_as_basal_title">UAM als basaal categoriseren</string>
<string name="autotune_categorize_uam_as_basal_summary">Alleen inschakelen als u betrouwbaar alle koolhydraten ingevoerd en hebt opgegeten, met deze optie zullen plotselinge stijgingen van Autotune worden gebruikt om wijzigingen in de basaalstand aan te bevelen.</string>
<string name="autotune_tune_insulin_curve_title">Insuline curve afstemmen</string>
<string name="autotune_tune_insulin_curve_summary">Alleen inschakelen als je vrije piek gebruikt. Deze optie zal piek en DIA duur afstemmen</string>
<string name="autotune_default_tune_days_title">Aantal dagen data</string>
<string name="autotune_circadian_ic_isf_title">Gemiddelde resultaat toepassen in circadiaan IC/ISF</string>
<string name="autotune_circadian_ic_isf_summary">Autotune zal de circadiaanse variaties niet afstemmen, deze optie past alleen de gemiddelde tuning van IC en ISF toe op uw circadiaanse invoerprofiel</string>
<string name="autotune_additional_log_title">Meer log-informatie voor foutopsporing toevoegen</string>
<string name="autotune_additional_log_summary">Schakel alleen in op verzoek van een onwikkelaar om meer log-informatie te sturen om Autotune plugin te helpen debuggen</string>
<string name="autotune_default_tune_days_summary">Standaard aantal dagen aan gegevens dat Autotune moet verwerken (tot 30)</string>
<string name="autotune_tunedprofile_name">Tuned</string>
<string name="autotune_profile">Profiel :</string>
<string name="autotune_tune_days">Afstemmen dagen :</string>
<string name="autotune_last_run">Laatste berekening :</string>
<string name="autotune_warning">Waarschuwing :</string>
<string name="autotune_select_profile">Selecteer profiel om aan te passen</string>
<string name="autotune_ic_warning">Het geselecteerde profiel heeft %1$d IC waarden. Autotune gebruikt %2$.2f g/E</string>
<string name="autotune_isf_warning">Het geselecteerde profiel heeft %1$d ISF waarden. Autotune gebruikt %2$.1f %3$s/E</string>
<string name="autotune_error">Fout in invoergegevens, probeer autotune opnieuw te starten of het aantal dagen te verminderen</string>
<string name="autotune_warning_during_run">Autotune berekening gestart, even geduld a.u.b.</string>
<string name="autotune_warning_after_run">Controleer de resultaten zorgvuldig voordat u het gebruikt!</string>
<string name="autotune_partial_result">Gedeeltelijk resultaat dag %1$d / %2$d afgestemd</string>
<string name="autotune_result">Resultaat: %1$s</string>
<string name="autotune_param">Parameter</string>
<string name="autotune_percent">%</string>
<string name="autotune_missing">Ontbreekt</string>
<string name="autotune_profile_name">Autotune profiel %1$s</string>
<string name="autotune_run">Autotune uitvoeren</string>
<string name="autotune_check_input_profile_button">Controleer invoerprofiel</string>
<string name="autotune_compare_profile">Vergelijk profielen</string>
<string name="autotune_copy_localprofile_button">Kopiëren naar lokaal profiel</string>
<string name="autotune_update_input_profile_button">Invoerprofiel bijwerken</string>
<string name="autotune_revert_input_profile_button">Invoerprofiel ongedaan maken</string>
<string name="autotune_copy_local_profile_message">Een lokaal profiel van dit Autotune profiel aanmaken?</string>
<string name="autotune_update_local_profile_message">Profiel %1$s bijwerken met Autotune Profiel?</string>
<string name="autotune_revert_local_profile_message">Profiel %1$s terugzetten met invoerprofiel?</string>
<string name="autotune_profile_invalid">Profiel ongeldig</string>
<string name="autotune_run_without_autoswitch">Autotune uitgevoerd zonder profiel aanpassing</string>
<string name="autotune_run_with_autoswitch">Autotune uitgevoerd en profiel automatisch gewisseld</string>
<string name="autotune_run_with_error">Fout tijdens laatste Autotune uitvoeren</string>
<plurals name="days">
<item quantity="one">%1$d dag</item>
<item quantity="other">%1$d dagen</item>

View file

@ -464,6 +464,8 @@
<string name="autotune_last_run">Последнее выполнение:</string>
<string name="autotune_warning">Внимание:</string>
<string name="autotune_select_profile">Выберите профиль для изменения</string>
<string name="autotune_ic_warning">Выбранный профиль имеет %1$d значений IC. Автоматически будет использоваться %2$.2f г/ед</string>
<string name="autotune_isf_warning">Выбранный профиль имеет %1$d значений ISF. Автоматически будет использоваться %2$.1f%3$s/ед</string>
<string name="autotune_error">Ошибка ввода данных, попробуйте запустить снова autotune или уменьшить количество дней</string>
<string name="autotune_warning_during_run">Идет настройка автоматизации, ждите</string>
<string name="autotune_warning_after_run">Перед использованием внимательно проверьте результаты!</string>

View file

@ -464,6 +464,8 @@
<string name="autotune_last_run">Posledné spustenie :</string>
<string name="autotune_warning">Upozornenie :</string>
<string name="autotune_select_profile">Vyberte profil pre ladenie</string>
<string name="autotune_ic_warning">Vybraný profil má %1$d hodnôt IC. Autotune bude používať %2$.2f g/JI</string>
<string name="autotune_isf_warning">Vybraný profil má %1$d hodnôt ISF. Autotune bude používať %2$.1f %3$s/JI</string>
<string name="autotune_error">Chyba vstupných dát, skúste znova spustiť Autotune, alebo znížte počet dní</string>
<string name="autotune_warning_during_run">Autotune spustený, prosím buďte trpezliví</string>
<string name="autotune_warning_after_run">Pred použitím výsledky starostlivo skontrolujte!</string>

View file

@ -245,7 +245,7 @@
<!---Nightscout client TitelColor -->
<item name="nsTitleColor">@color/defaultText</item>
<!---Icons in Loop area -->
<item name="profileColor">@color/white</item>
<item name="profileColor">@color/black</item>
<item name="crossTargetColor">@color/white</item>
</style>

View file

@ -122,7 +122,7 @@ class DanaRKoreanPlugin @Inject constructor(
detailedBolusInfo.insulin = constraintChecker.applyBolusConstraints(Constraint(detailedBolusInfo.insulin)).value()
if (detailedBolusInfo.carbs > 0) throw IllegalArgumentException()
return if (detailedBolusInfo.insulin > 0) {
val t = EventOverviewBolusProgress.Treatment(0.0, 0, detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB)
val t = EventOverviewBolusProgress.Treatment(0.0, 0, detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.id)
var connectionOK = false
if (detailedBolusInfo.insulin > 0)
connectionOK = sExecutionService.bolus(detailedBolusInfo.insulin, detailedBolusInfo.carbs.toInt(), detailedBolusInfo.carbsTimestamp

View file

@ -278,7 +278,7 @@ public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService {
if (!danaPump.getBolusStopped()) {
mSerialIOThread.sendMessage(start);
} else {
t.insulin = 0d;
t.setInsulin(0d);
return false;
}
while (!danaPump.getBolusStopped() && !start.getFailed()) {

View file

@ -185,16 +185,17 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
detailedBolusInfoStorage.add(detailedBolusInfo); // will be picked up on reading history
EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB);
EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.getId());
boolean connectionOK = false;
if (detailedBolusInfo.insulin > 0 || carbs > 0)
connectionOK = sExecutionService.bolus(detailedBolusInfo.insulin, (int) carbs, carbTimeStamp, t);
PumpEnactResult result = new PumpEnactResult(getInjector());
result.success(connectionOK && Math.abs(detailedBolusInfo.insulin - t.insulin) < pumpDescription.getBolusStep())
.bolusDelivered(t.insulin)
result.success(connectionOK && Math.abs(detailedBolusInfo.insulin - t.getInsulin()) < pumpDescription.getBolusStep())
.bolusDelivered(t.getInsulin())
.carbsDelivered(detailedBolusInfo.carbs);
if (!result.getSuccess())
result.comment(rh.gs(R.string.boluserrorcode, detailedBolusInfo.insulin, t.insulin, danaPump.getBolusStartErrorCode()));
result.comment(rh.gs(R.string.boluserrorcode, detailedBolusInfo.insulin, t.getInsulin(),
danaPump.getBolusStartErrorCode()));
else
result.comment(R.string.ok);
aapsLogger.debug(LTag.PUMP, "deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.getBolusDelivered());
@ -353,8 +354,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
insulin = constraintChecker.applyExtendedBolusConstraints(new Constraint<>(insulin)).value();
// needs to be rounded
int durationInHalfHours = Math.max(durationInMinutes / 30, 1);
insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep(),
null);
insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep());
PumpEnactResult result = new PumpEnactResult(getInjector());
if (danaPump.isExtendedInProgress() && Math.abs(danaPump.getExtendedBolusAmount() - insulin) < pumpDescription.getExtendedBolusStep()) {

View file

@ -362,7 +362,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService {
if (!danaPump.getBolusStopped()) {
mSerialIOThread.sendMessage(start);
} else {
t.insulin = 0d;
t.setInsulin(0d);
return false;
}
while (!danaPump.getBolusStopped() && !start.getFailed()) {

View file

@ -267,8 +267,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
insulin = constraintChecker.applyExtendedBolusConstraints(new Constraint<>(insulin)).value();
// needs to be rounded
int durationInHalfHours = Math.max(durationInMinutes / 30, 1);
insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep(),
null);
insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep());
PumpEnactResult result = new PumpEnactResult(getInjector());
if (danaPump.isExtendedInProgress() && Math.abs(danaPump.getExtendedBolusAmount() - insulin) < getPumpDescription().getExtendedBolusStep()) {

View file

@ -161,20 +161,20 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
public PumpEnactResult deliverTreatment(DetailedBolusInfo detailedBolusInfo) {
detailedBolusInfo.insulin = constraintChecker.applyBolusConstraints(new Constraint<>(detailedBolusInfo.insulin)).value();
if (detailedBolusInfo.insulin > 0 || detailedBolusInfo.carbs > 0) {
EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB);
EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.getId());
boolean connectionOK = false;
if (detailedBolusInfo.insulin > 0 || detailedBolusInfo.carbs > 0)
connectionOK = sExecutionService.bolus(detailedBolusInfo.insulin, (int) detailedBolusInfo.carbs, detailedBolusInfo.getCarbsTimestamp() != null ? detailedBolusInfo.getCarbsTimestamp() : detailedBolusInfo.timestamp, t);
PumpEnactResult result = new PumpEnactResult(getInjector());
result.success(connectionOK && Math.abs(detailedBolusInfo.insulin - t.insulin) < pumpDescription.getBolusStep())
.bolusDelivered(t.insulin)
result.success(connectionOK && Math.abs(detailedBolusInfo.insulin - t.getInsulin()) < pumpDescription.getBolusStep())
.bolusDelivered(t.getInsulin())
.carbsDelivered(detailedBolusInfo.carbs);
if (!result.getSuccess())
result.comment(rh.gs(R.string.boluserrorcode, detailedBolusInfo.insulin, t.insulin, danaPump.getBolusStartErrorCode()));
result.comment(rh.gs(R.string.boluserrorcode, detailedBolusInfo.insulin, t.getInsulin(), danaPump.getBolusStartErrorCode()));
else
result.comment(R.string.ok);
aapsLogger.debug(LTag.PUMP, "deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.getBolusDelivered());
detailedBolusInfo.insulin = t.insulin;
detailedBolusInfo.insulin = t.getInsulin();
detailedBolusInfo.timestamp = System.currentTimeMillis();
if (detailedBolusInfo.insulin > 0)
pumpSync.syncBolusWithPumpId(
@ -288,8 +288,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
double extendedRateToSet = absoluteRate - getBaseBasalRate();
extendedRateToSet = constraintChecker.applyBasalConstraints(new Constraint<>(extendedRateToSet), profile).value();
// needs to be rounded to 0.1
extendedRateToSet = Round.INSTANCE.roundTo(extendedRateToSet,
pumpDescription.getExtendedBolusStep() * 2, null); // *2 because of half hours
extendedRateToSet = Round.INSTANCE.roundTo(extendedRateToSet, pumpDescription.getExtendedBolusStep() * 2); // *2 because of half hours
// What is current rate of extended bolusing in u/h?
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Extended bolus in progress: " + (danaPump.isExtendedInProgress()) + " rate: " + danaPump.getExtendedBolusAbsoluteRate() + "U/h duration remaining: " + danaPump.getExtendedBolusRemainingMinutes() + "min");

View file

@ -219,7 +219,7 @@ public abstract class AbstractDanaRExecutionService extends DaggerService {
}
public void bolusStop() {
aapsLogger.debug(LTag.PUMP, "bolusStop >>>>> @ " + (danaPump.getBolusingTreatment() == null ? "" : danaPump.getBolusingTreatment().insulin));
aapsLogger.debug(LTag.PUMP, "bolusStop >>>>> @ " + (danaPump.getBolusingTreatment() == null ? "" : danaPump.getBolusingTreatment().getInsulin()));
MsgBolusStop stop = new MsgBolusStop(injector);
danaPump.setBolusStopForced(true);
if (isConnected()) {

View file

@ -290,7 +290,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
if (!danaPump.getBolusStopped()) {
mSerialIOThread.sendMessage(start);
} else {
t.insulin = 0d;
t.setInsulin(0d);
return false;
}
while (!danaPump.getBolusStopped() && !start.getFailed()) {
@ -322,7 +322,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
break;
}
// try to find real amount if bolusing was interrupted or comm failed
if (t.insulin != amount) {
if (t.getInsulin() != amount) {
disconnect("bolusingInterrupted");
long bolusDurationInMSec = (long) (amount * speed * 1000);
long expectedEnd = bolusStart + bolusDurationInMSec + 3000;
@ -340,7 +340,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
@Override
public void run() {
if (danaPump.getLastBolusTime() > System.currentTimeMillis() - 60 * 1000L) { // last bolus max 1 min old
t.insulin = danaPump.getLastBolusAmount();
t.setInsulin(danaPump.getLastBolusAmount());
aapsLogger.debug(LTag.PUMP, "Used bolus amount from history: " + danaPump.getLastBolusAmount());
} else {
aapsLogger.debug(LTag.PUMP, "Bolus amount in history too old: " + dateUtil.dateAndTimeString(danaPump.getLastBolusTime()));

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsupported_action_in_pump">Nepodporovaná akce v pumpě. Používejte pouze rozhraní AndroidAPS!</string>
</resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsupported_action_in_pump">Acción no soportada en la bomba. Usa sólo la interfaz de AndroidAPS</string>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsupported_action_in_pump">Action non prise en charge par la pompe. Utilisez uniquement linterface AndroidAPS!</string>
</resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsupported_action_in_pump">Azione non supportata nel micro. Usa solo l\'interfaccia di AndroidAPS!</string>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsupported_action_in_pump">פעולה שאינה נתמכת ע\"י המשאבה. נא להשתמש בממשק AndroidAPS בלבד!</string>
</resources>

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