From a79393c65a7f0d9861e3ee66f7537cc2b598a931 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 4 Feb 2020 22:25:07 +0100 Subject: [PATCH 01/10] Log user actions --- .../androidaps/dialogs/CalibrationDialog.kt | 1 + .../androidaps/dialogs/CarbsDialog.kt | 5 +++++ .../nightscout/androidaps/dialogs/CareDialog.kt | 1 + .../dialogs/DialogFragmentWithDate.kt | 2 +- .../androidaps/dialogs/ErrorDialog.kt | 5 +++-- .../androidaps/dialogs/ExtendedBolusDialog.kt | 1 + .../nightscout/androidaps/dialogs/FillDialog.kt | 3 +++ .../androidaps/dialogs/InsulinDialog.kt | 3 +++ .../androidaps/dialogs/ProfileSwitchDialog.kt | 1 + .../androidaps/dialogs/TempBasalDialog.kt | 2 ++ .../androidaps/dialogs/TempTargetDialog.kt | 1 + .../androidaps/dialogs/TreatmentDialog.kt | 1 + .../plugins/general/actions/ActionsFragment.kt | 5 +++++ .../general/overview/OverviewFragment.java | 17 +++++++++++++++++ .../nightscout/androidaps/utils/BolusWizard.kt | 2 ++ 15 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt index 949e4e5fef..9503988dce 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt @@ -56,6 +56,7 @@ class CalibrationDialog : DialogFragmentWithDate() { if (bg > 0) { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.overview_calibration), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { + log.debug("USER ENTRY: CALIBRATION $bg") XdripCalibrations.confirmAndSendCalibration(bg, context) }) } diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt index de457068c5..1f0c6643c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt @@ -177,6 +177,7 @@ class CarbsDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { if (activitySelected) { + log.debug("USER ENTRY: TEMPTARGET ACTIVITY $activityTT duration: $activityTTDuration") val tempTarget = TempTarget() .date(eventTime) .duration(activityTTDuration) @@ -186,6 +187,7 @@ class CarbsDialog : DialogFragmentWithDate() { .high(Profile.toMgdl(activityTT, ProfileFunctions.getSystemUnits())) TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget) } else if (eatingSoonSelected) { + log.debug("USER ENTRY: TEMPTARGET EATING SOON $eatingSoonTT duration: $eatingSoonTTDuration") val tempTarget = TempTarget() .date(eventTime) .duration(eatingSoonTTDuration) @@ -195,6 +197,7 @@ class CarbsDialog : DialogFragmentWithDate() { .high(Profile.toMgdl(eatingSoonTT, ProfileFunctions.getSystemUnits())) TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget) } else if (hypoSelected) { + log.debug("USER ENTRY: TEMPTARGET HYPO $hypoTT duration: $hypoTTDuration") val tempTarget = TempTarget() .date(eventTime) .duration(hypoTTDuration) @@ -206,8 +209,10 @@ class CarbsDialog : DialogFragmentWithDate() { } if (carbsAfterConstraints > 0) { if (duration == 0) { + log.debug("USER ENTRY: CARBS $carbsAfterConstraints time: $time") CarbsGenerator.createCarb(carbsAfterConstraints, time, CareportalEvent.CARBCORRECTION, notes) } else { + log.debug("USER ENTRY: CARBS $carbsAfterConstraints time: $time duration: $duration") CarbsGenerator.generateCarbs(carbsAfterConstraints, time, duration, notes) NSUpload.uploadEvent(CareportalEvent.NOTE, time - 2000, MainApp.gs(R.string.generated_ecarbs_note, carbsAfterConstraints, duration, timeOffset)) } diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index 0e47049cf1..da4a091b1d 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -180,6 +180,7 @@ class CareDialog : DialogFragmentWithDate() { EventType.EXERCISE -> CareportalEvent.EXERCISE } careportalEvent.json = json.toString() + log.debug("USER ENTRY: CAREPORTAL ${careportalEvent.eventType} json: ${careportalEvent.json}") MainApp.getDbHelper().createOrUpdate(careportalEvent) NSUpload.uploadCareportalEntryToNS(json) }, null) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt index da45e77990..ecaea0bc81 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt @@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory import java.util.* abstract class DialogFragmentWithDate : DialogFragment() { - private val log = LoggerFactory.getLogger(DialogFragmentWithDate::class.java) + val log = LoggerFactory.getLogger(DialogFragmentWithDate::class.java) var eventTime = DateUtil.now() var eventTimeChanged = false diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt index 538a2ca483..c084df7bf3 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt @@ -36,6 +36,7 @@ class ErrorDialog : DialogFragment() { bundle.getString("title")?.let { title = it } sound = bundle.getInt("sound", R.raw.error) } + log.debug("Error dialog displayed") return inflater.inflate(R.layout.dialog_error, container, false) } @@ -44,11 +45,11 @@ class ErrorDialog : DialogFragment() { error_title.text = title overview_error_ok.setOnClickListener { - log.debug("Error dialog ok button pressed") + log.debug("USER ENTRY: Error dialog ok button pressed") dismiss() } overview_error_mute.setOnClickListener { - log.debug("Error dialog mute button pressed") + log.debug("USER ENTRY: Error dialog mute button pressed") stopAlarm() } startAlarm() diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index a717e79b49..dee77051fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -63,6 +63,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.extended_bolus), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { + log.debug("USER ENTRY: EXTENDED BOLUS $insulinAfterConstraint duration: $durationInMinutes") ConfigBuilderPlugin.getPlugin().commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() { override fun run() { if (!result.success) { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 273d0b800d..a840384de0 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -102,13 +102,16 @@ class FillDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.primefill), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { if (insulinAfterConstraints > 0) { + log.debug("USER ENTRY: PRIME BOLUS $insulinAfterConstraints") requestPrimeBolus(insulinAfterConstraints, notes) } if (siteChange) { + log.debug("USER ENTRY: SITE CHANGE") generateCareportalEvent(CareportalEvent.SITECHANGE, eventTime, notes) } if (insulinChange) { // add a second for case of both checked + log.debug("USER ENTRY: INSULIN CHANGE") generateCareportalEvent(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes) } }, null) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index d6f64d87f1..42bc395b8b 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -147,6 +147,7 @@ class InsulinDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.bolus), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { if (eatingSoonChecked) { + log.debug("USER ENTRY: TEMPTARGET EATING SOON $eatingSoonTT duration: $eatingSoonTTDuration") val tempTarget = TempTarget() .date(System.currentTimeMillis()) .duration(eatingSoonTTDuration) @@ -164,9 +165,11 @@ class InsulinDialog : DialogFragmentWithDate() { detailedBolusInfo.source = Source.USER detailedBolusInfo.notes = notes if (recordOnlyChecked) { + log.debug("USER ENTRY: BOLUS RECORD ONLY $insulinAfterConstraints") detailedBolusInfo.date = time TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false) } else { + log.debug("USER ENTRY: BOLUS $insulinAfterConstraints") detailedBolusInfo.date = DateUtil.now() ConfigBuilderPlugin.getPlugin().commandQueue.bolus(detailedBolusInfo, object : Callback() { override fun run() { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index 5df248593c..f594564a78 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -97,6 +97,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.careportal_profileswitch), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { + log.debug("USER ENTRY: PROFILE SWITCH $profile percent: $percent timeshift: $timeShift duration: $duration") ProfileFunctions.doProfileSwitch(profileStore, profile, duration.toInt(), percent, timeShift, eventTime) }) } diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index dc31349650..d821aec56b 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -104,8 +104,10 @@ class TempBasalDialog : DialogFragmentWithDate() { } } if (isPercentPump) { + log.debug("USER ENTRY: TEMP BASAL $percent% duration: $durationInMinutes") ConfigBuilderPlugin.getPlugin().commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback) } else { + log.debug("USER ENTRY: TEMP BASAL $absolute duration: $durationInMinutes") ConfigBuilderPlugin.getPlugin().commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback) } }) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 5408105a71..77cb0b6823 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -127,6 +127,7 @@ class TempTargetDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { + log.debug("USER ENTRY: TEMP TARGET $target duration: $duration") if (target == 0.0 || duration == 0.0) { val tempTarget = TempTarget() .date(eventTime) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 8667befaf2..565a65f54f 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -99,6 +99,7 @@ class TreatmentDialog : DialogFragmentWithDate() { if (insulinAfterConstraints > 0 || carbsAfterConstraints > 0) { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.overview_treatment_label), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { + log.debug("USER ENTRY: BOLUS insulin $insulin carbs: $carbs") val detailedBolusInfo = DetailedBolusInfo() if (insulinAfterConstraints == 0.0) detailedBolusInfo.eventType = CareportalEvent.CARBCORRECTION if (carbsAfterConstraints == 0) detailedBolusInfo.eventType = CareportalEvent.CORRECTIONBOLUS diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 4977cd6f9f..e68df84fdf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.dialogs.TempTargetDialog +import info.nightscout.androidaps.logging.L import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* @@ -34,9 +35,11 @@ import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.CompositeDisposable import kotlinx.android.synthetic.main.actions_fragment.* import kotlinx.android.synthetic.main.careportal_stats_fragment.* +import org.slf4j.LoggerFactory import java.util.* class ActionsFragment : Fragment() { + private val log = LoggerFactory.getLogger(L.CORE) private var disposable: CompositeDisposable = CompositeDisposable() @@ -67,6 +70,7 @@ class ActionsFragment : Fragment() { } actions_extendedbolus_cancel.setOnClickListener { if (TreatmentsPlugin.getPlugin().isInHistoryExtendedBoluslInProgress) { + log.debug("USER ENTRY: CANCEL EXTENDED BOLUS") ConfigBuilderPlugin.getPlugin().commandQueue.cancelExtended(object : Callback() { override fun run() { if (!result.success) { @@ -86,6 +90,7 @@ class ActionsFragment : Fragment() { } actions_canceltempbasal.setOnClickListener { if (TreatmentsPlugin.getPlugin().isTempBasalInProgress) { + log.debug("USER ENTRY: CANCEL TEMP BASAL") ConfigBuilderPlugin.getPlugin().commandQueue.cancelTempBasal(true, object : Callback() { override fun run() { if (!result.success) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java index 931cca544b..0976755f06 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java @@ -667,6 +667,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; final LoopPlugin loopPlugin = LoopPlugin.getPlugin(); if (item.getTitle().equals(MainApp.gs(R.string.disableloop))) { + log.debug("USER ENTRY: LOOP DISABLED"); loopPlugin.setPluginEnabled(PluginType.LOOP, false); loopPlugin.setFragmentVisible(PluginType.LOOP, false); ConfigBuilderPlugin.getPlugin().storeSettings("DisablingLoop"); @@ -682,6 +683,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, LoopPlugin.getPlugin().createOfflineEvent(24 * 60); // upload 24h, we don't know real duration return true; } else if (item.getTitle().equals(MainApp.gs(R.string.enableloop))) { + log.debug("USER ENTRY: LOOP ENABLED"); loopPlugin.setPluginEnabled(PluginType.LOOP, true); loopPlugin.setFragmentVisible(PluginType.LOOP, true); ConfigBuilderPlugin.getPlugin().storeSettings("EnablingLoop"); @@ -690,6 +692,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.gs(R.string.resume)) || item.getTitle().equals(MainApp.gs(R.string.reconnect))) { + log.debug("USER ENTRY: RESUME"); loopPlugin.suspendTo(0L); updateGUI("suspendmenu"); ConfigBuilderPlugin.getPlugin().getCommandQueue().cancelTempBasal(true, new Callback() { @@ -704,39 +707,48 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, LoopPlugin.getPlugin().createOfflineEvent(0); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor1h))) { + log.debug("USER ENTRY: SUSPEND 1h"); LoopPlugin.getPlugin().suspendLoop(60); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor2h))) { + log.debug("USER ENTRY: SUSPEND 2h"); LoopPlugin.getPlugin().suspendLoop(120); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor3h))) { + log.debug("USER ENTRY: SUSPEND 3h"); LoopPlugin.getPlugin().suspendLoop(180); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor10h))) { + log.debug("USER ENTRY: SUSPEND 10h"); LoopPlugin.getPlugin().suspendLoop(600); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor15m))) { + log.debug("USER ENTRY: DISCONNECT 15m"); LoopPlugin.getPlugin().disconnectPump(15, profile); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor30m))) { + log.debug("USER ENTRY: DISCONNECT 30m"); LoopPlugin.getPlugin().disconnectPump(30, profile); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor1h))) { + log.debug("USER ENTRY: DISCONNECT 1h"); LoopPlugin.getPlugin().disconnectPump(60, profile); SP.putBoolean(R.string.key_objectiveusedisconnect, true); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor2h))) { + log.debug("USER ENTRY: DISCONNECT 2h"); LoopPlugin.getPlugin().disconnectPump(120, profile); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor3h))) { + log.debug("USER ENTRY: DISCONNECT 3h"); LoopPlugin.getPlugin().disconnectPump(180, profile); updateGUI("suspendmenu"); return true; @@ -754,6 +766,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, if (manager != null) pvd.show(manager, "ProfileViewDialog"); } else if (item.getTitle().equals(MainApp.gs(R.string.eatingsoon))) { + log.debug("USER ENTRY: TEMP TARGET EATING SOON"); double target = Profile.toMgdl(DefaultValueHelper.determineEatingSoonTT(), ProfileFunctions.getSystemUnits()); TempTarget tempTarget = new TempTarget() .date(System.currentTimeMillis()) @@ -764,6 +777,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, .high(target); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } else if (item.getTitle().equals(MainApp.gs(R.string.activity))) { + log.debug("USER ENTRY: TEMP TARGET ACTIVITY"); double target = Profile.toMgdl(DefaultValueHelper.determineActivityTT(), ProfileFunctions.getSystemUnits()); TempTarget tempTarget = new TempTarget() .date(now()) @@ -774,6 +788,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, .high(target); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } else if (item.getTitle().equals(MainApp.gs(R.string.hypo))) { + log.debug("USER ENTRY: TEMP TARGET HYPO"); double target = Profile.toMgdl(DefaultValueHelper.determineHypoTT(), ProfileFunctions.getSystemUnits()); TempTarget tempTarget = new TempTarget() .date(now()) @@ -788,6 +803,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, if (manager != null) new TempTargetDialog().show(manager, "Overview"); } else if (item.getTitle().equals(MainApp.gs(R.string.cancel))) { + log.debug("USER ENTRY: TEMP TARGET CANCEL"); TempTarget tempTarget = new TempTarget() .source(Source.USER) .date(now()) @@ -907,6 +923,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun; if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.isChangeRequested()) { OKDialog.showConfirmation(context, MainApp.gs(R.string.pump_tempbasal_label), finalLastRun.constraintsProcessed.toSpanned(), () -> { + log.debug("USER ENTRY: ACCEPT TEMP BASAL"); hideTempRecommendation(); clearNotification(); LoopPlugin.getPlugin().acceptChangeRequest(); diff --git a/app/src/main/java/info/nightscout/androidaps/utils/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/BolusWizard.kt index 6d71a80ba1..ea4da238cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/BolusWizard.kt @@ -277,6 +277,7 @@ class BolusWizard @JvmOverloads constructor(val profile: Profile, OKDialog.showConfirmation(context, MainApp.gs(R.string.boluswizard), HtmlHelper.fromHtml(confirmMessage), Runnable { if (insulinAfterConstraints > 0 || carbs > 0) { if (useSuperBolus) { + log.debug("USER ENTRY: SUPERBOLUS TBR") val loopPlugin = LoopPlugin.getPlugin() if (loopPlugin.isEnabled(PluginType.LOOP)) { loopPlugin.superBolusTo(System.currentTimeMillis() + 2 * 60L * 60 * 1000) @@ -325,6 +326,7 @@ class BolusWizard @JvmOverloads constructor(val profile: Profile, detailedBolusInfo.boluscalc = nsJSON() detailedBolusInfo.source = Source.USER detailedBolusInfo.notes = notes + log.debug("USER ENTRY: BOLUS insulin $insulinAfterConstraints carbs: $carbs") if (detailedBolusInfo.insulin > 0 || ConfigBuilderPlugin.getPlugin().activePump?.pumpDescription?.storesCarbInfo == true) { ConfigBuilderPlugin.getPlugin().commandQueue.bolus(detailedBolusInfo, object : Callback() { override fun run() { From d5a7db8be73ff6ad9df33136c33d0ef827c39f00 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 4 Feb 2020 22:25:58 +0100 Subject: [PATCH 02/10] 2.6-dev-a --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index b5e47ec4ae..53b0398a43 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -109,7 +109,7 @@ android { targetSdkVersion 28 multiDexEnabled true versionCode 1500 - version "2.6-dev" + version "2.6-dev-a" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' From 7b984550ea198ebc4f052ed03cf227783965c04b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 4 Feb 2020 22:25:28 +0100 Subject: [PATCH 03/10] New Crowdin translations (#2423) * New translations strings.xml (Korean) * New translations objectives.xml (Korean) * New translations objectives.xml (Korean) * New translations strings.xml (Slovenian) * New translations insight_alert_codes.xml (Slovenian) * New translations insight_alert_descriptions.xml (Slovenian) * New translations insight_alert_titles.xml (Slovenian) * New translations insight_exceptions.xml (Slovenian) * New translations exam.xml (Slovenian) * New translations objectives.xml (Slovenian) * New translations strings.xml (Slovenian) * New translations strings.xml (French) * New translations strings.xml (Korean) * New translations exam.xml (Korean) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Russian) * New translations strings.xml (Korean) * New translations strings.xml (Korean) * New translations strings.xml (German) * New translations strings.xml (Italian) --- app/src/main/res/values-de-rDE/strings.xml | 5 +++++ app/src/main/res/values-it-rIT/strings.xml | 4 ++++ app/src/main/res/values-ko-rKR/exam.xml | 6 +++--- app/src/main/res/values-ko-rKR/objectives.xml | 8 ++++---- app/src/main/res/values-ko-rKR/strings.xml | 15 +++++++++----- app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-ru-rRU/strings.xml | 5 +++++ app/src/main/res/values-sl-rSI/exam.xml | 3 +++ .../res/values-sl-rSI/insight_alert_codes.xml | 3 +++ .../insight_alert_descriptions.xml | 3 +++ .../values-sl-rSI/insight_alert_titles.xml | 3 +++ .../res/values-sl-rSI/insight_exceptions.xml | 3 +++ app/src/main/res/values-sl-rSI/objectives.xml | 3 +++ app/src/main/res/values-sl-rSI/strings.xml | 20 +++++++++++++++++++ wear/src/main/res/values-fr-rFR/strings.xml | 2 +- wear/src/main/res/values-sl-rSI/strings.xml | 3 +++ 16 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 app/src/main/res/values-sl-rSI/exam.xml create mode 100644 app/src/main/res/values-sl-rSI/insight_alert_codes.xml create mode 100644 app/src/main/res/values-sl-rSI/insight_alert_descriptions.xml create mode 100644 app/src/main/res/values-sl-rSI/insight_alert_titles.xml create mode 100644 app/src/main/res/values-sl-rSI/insight_exceptions.xml create mode 100644 app/src/main/res/values-sl-rSI/objectives.xml create mode 100644 app/src/main/res/values-sl-rSI/strings.xml create mode 100644 wear/src/main/res/values-sl-rSI/strings.xml diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index ad2e7a7629..8673afb35a 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -946,6 +946,7 @@ Starte deine erste Zielsetzung Berechtigung Nach Berechtigung fragen + Die App benötigt die Systemberechtigung für App-Benachrichtigungen AndroidAPS benötigt die Standortfreigabe für den BT-Scan. AndroidAPS benötigt Zugriff auf den Speicher, um Log-Dateien speichern zu können. Anfordern @@ -1450,4 +1451,8 @@ Unerwartetes Verhalten. \"PhoneChecker\" Diagrammmenü AS + SMB Anfragezeit + SMB Ausführungszeit + Temp. BR Anfragezeit + Temp. BR Ausführungszeit diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 8f8afcf3b8..cbf0f50945 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -1449,4 +1449,8 @@ \"PhoneChecker\" Menu grafico AS + Tempo richiesta SMB + Tempo esecuzione SMB + Tempo richiesta basale temporanea + Tempo esecuzione basale temporanea diff --git a/app/src/main/res/values-ko-rKR/exam.xml b/app/src/main/res/values-ko-rKR/exam.xml index 2b76f2c396..dfdfb154d8 100644 --- a/app/src/main/res/values-ko-rKR/exam.xml +++ b/app/src/main/res/values-ko-rKR/exam.xml @@ -131,12 +131,12 @@ 변경사항을 적용하는데 프로파일에서 ISF 값 변경하는 것으로 충분합니다. https://androidaps.readthedocs.io/en/latest/CROWDIN/ko/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u https://androidaps.readthedocs.io/en/latest/CROWDIN/ko/Usage/Profiles.html - Topic: IC(인슐린 대 탄수화물) 비율 + 주제: IC(인슐린-탄수화물 비) 높은 IC 비율은 탄수화물 섭취시 인슐린이 보다 덜 주입되게 합니다. 낮은 IC 비율은 탄수화물 섭취시 인슐린이 보다 덜 주입되게 합니다. COB가 0 인 경우 IC 비율을 변경하면 혈당을 교정하기 위해 다른 양의 인슐린이 주입됩니다. - Bread Unit을 10g 혹은 12g으로 계산한다면 IC 값도 달라집니다. - IC의 의미는 다음과 같습니다: 1U의 인슐린에 대한 적정 Bread Unit 양 + 빵유닛(Bread Unit)을 10g 혹은 12g으로 계산한다면 IC 값도 달라집니다. + IC의 의미는 다음과 같습니다: 1U의 인슐린으로 얼마나 많은 빵유닛(Bread Units)이 처리되는지. https://androidaps.readthedocs.io/en/latest/CROWDIN/ko/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u 주제: 프로파일 변경 프로파일을 90%로 설정하면 어떻게 됩니까? diff --git a/app/src/main/res/values-ko-rKR/objectives.xml b/app/src/main/res/values-ko-rKR/objectives.xml index 4bc1ebbb35..08c2a7f8d8 100644 --- a/app/src/main/res/values-ko-rKR/objectives.xml +++ b/app/src/main/res/values-ko-rKR/objectives.xml @@ -28,13 +28,13 @@ 완료: %1$s AndroidAPS를 사용하는 방법을 배워봅니다 AndroidAPS에서 다양한 작업을 수행해보세요 - 10분동안 프로파일 90%를 설정해보세요(개요에서 프로파일명을 길게 눌러보세요) - 샤워한다고 가정하고 펌프를 1시간 동안 펌프를 일시중지하세요 (개요에서 Open Loop를 길게 눌러보세요) + 10분동안 프로파일 90%를 설정해보세요(홈에서 프로파일명을 길게 눌러보세요) + 샤워한다고 가정하고 펌프를 1시간 동안 펌프를 일시중지하세요 (홈에서 Open Loop를 길게 눌러보세요) ... 그리고 같은 방법으로 펌프를 재연결하세요 - 10분의 사용자정의 임시 목표를 생성해 보세요 (개요에서 본인의 현재 목표혈당을 길게 눌러보세요) + 사용자정의 임시 목표를 10분동안 실행해보세요 (홈에서 본인의 현재 목표혈당을 길게 눌러보세요) 구성관리자에서 실행 플러그인을 활성화하고 메뉴에서 표시되게 합니다 Loop 플러그인 내용을 표시합니다 - 개요의 혈당 차트를 길게 눌러 차트 시간을 변경하세요 + 홈의 혈당 차트를 길게 눌러 차트 시간을 변경하세요 입력 당신이 OpenAPS 사용자였고 당신의 NS가 최소 3개월의 Loop 데이터가 저장되어 있다면, objectives@androidaps.org로 메일을 보내 당신의 NS주소를 알려주시고 목표를 건너뛸 수 있는 코드를 요청하세요. 그리고 개발자로 부터 받은 코드를 입력하세요. 코드 인증 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index e4ecfc6ed9..066b4aee6b 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -273,7 +273,7 @@ 임시 목표 취소가 완료되었습니다 %1$.2fU 주입중 SMS 원격 명령 사용하기 - 체혈 + 채혈 센서 수동 임시 목표 @@ -641,7 +641,7 @@ 알리지 않은 식사 감지 IOB 커브 피크 시간 피크 시간 [min] - 자유-피크 Oref + 사용자지정-피크 Oref 초속효성 Oref 초-초속효성 Oref DIA %1$f는 너무 짧습니다. 대신 %2$f을 사용하세요! @@ -783,15 +783,15 @@ %1$.2f 시간 %1$d 분 - 항상 SMB를 사용합니다. + 항상 SMB 사용하기 Bolus와 독립적으로 항상 SMB를 사용합니다. G5처럼 잘 필터된 혈당소스와만 사용이 가능합니다. 탄수화물 이후 SMB를 사용합니다. 탄수화물 이후 6시간동안 SMB를 사용합니다, 0 COB이라도 적용됩니다. G5처럼 잘 필터된 혈당소스와만 사용이 가능합니다. COB와 SMB를 사용합니다. 활성화된 COB가 있으면 SMB를 사용합니다. - 임시 목표와 SMB를 사용합니다. + 임시 목표에서 SMB 사용하기 활성화된 임시 목표(식사직전, 운동)가 있으면 SMB를 사용합니다. - 높은임시 목표와 SMB를 사용합니다. + 높은 임시 목표에서 SMB 사용하기 활성화된 높은 임시 목표(운동)가 있으면 SMB를 사용합니다. 임시Basal 허용 음소거 @@ -946,6 +946,7 @@ 첫번째 목표를 시작하세요. 권한 권한 요청하기 + 알림에 대한 시스템 창 권한이 필요합니다 블루투스 스캔을 위해 위치 권한이 필요로 합니다. 로그 파일을 저장하기 위해 저장공간 권한이 필요로 합니다. 요청 @@ -1449,4 +1450,8 @@ \"전화확인\" 차트 메뉴 AS + SMB 요청시간 + SMB 실행시간 + 임시 Basal 요청시간 + 임시 Basal 실행시간 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index aecda3ee0e..1e7dd42d16 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1447,4 +1447,6 @@ Closed Loop desabilitado por causa da execução do Bólus Estendido BE \"VerificadorTelefone\" + Menu do Gráfico + AS diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index c717182dc4..860db5a999 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -948,6 +948,7 @@ Context | Edit Context Начните первую Цель Права доступа Запросить права доступа + Приложению требуется разрешение системного окна для уведомлений Приложение нуждается в разрешении на доступ к определению местоположения для сканирования bluetooth Приложение нуждается в разрешении доступа к хранению данных для хранения лог-файлов Запрос @@ -1451,4 +1452,8 @@ Context | Edit Context \"PhoneChecker\" Меню графика Авточувств + Время запроса микроболюса SMB + Время выполнения микроболюса SMB + Время запроса временной базальной скорости + Время выполнения временной базальной скорости diff --git a/app/src/main/res/values-sl-rSI/exam.xml b/app/src/main/res/values-sl-rSI/exam.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/exam.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/insight_alert_codes.xml b/app/src/main/res/values-sl-rSI/insight_alert_codes.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/insight_alert_codes.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/insight_alert_descriptions.xml b/app/src/main/res/values-sl-rSI/insight_alert_descriptions.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/insight_alert_descriptions.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/insight_alert_titles.xml b/app/src/main/res/values-sl-rSI/insight_alert_titles.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/insight_alert_titles.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/insight_exceptions.xml b/app/src/main/res/values-sl-rSI/insight_exceptions.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/insight_exceptions.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/objectives.xml b/app/src/main/res/values-sl-rSI/objectives.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/app/src/main/res/values-sl-rSI/objectives.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/values-sl-rSI/strings.xml b/app/src/main/res/values-sl-rSI/strings.xml new file mode 100644 index 0000000000..df88c88e20 --- /dev/null +++ b/app/src/main/res/values-sl-rSI/strings.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/values-fr-rFR/strings.xml b/wear/src/main/res/values-fr-rFR/strings.xml index 8318132564..27b90d0687 100644 --- a/wear/src/main/res/values-fr-rFR/strings.xml +++ b/wear/src/main/res/values-fr-rFR/strings.xml @@ -35,7 +35,7 @@ Afficher Min Passées Sombre Surbrillance Basale - Séparateur Noir + Séparateur Invisible Echelle Graphique 1 heure 2 heures diff --git a/wear/src/main/res/values-sl-rSI/strings.xml b/wear/src/main/res/values-sl-rSI/strings.xml new file mode 100644 index 0000000000..70489fbc5e --- /dev/null +++ b/wear/src/main/res/values-sl-rSI/strings.xml @@ -0,0 +1,3 @@ + + + From 42c2d89f987c8819c369940fad89d15568ade9db Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 6 Feb 2020 21:24:19 +0100 Subject: [PATCH 04/10] ask for overlay permission on android 10 only --- .../androidaps/utils/AndroidPermission.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.java b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.java index d884552ac4..41e26e8e3b 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.java +++ b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.java @@ -133,20 +133,20 @@ public class AndroidPermission { } public static synchronized void notifyForSystemWindowPermissions(Activity activity) { - if (!Settings.canDrawOverlays(activity)) { - NotificationWithAction notification = new NotificationWithAction(Notification.PERMISSION_SYSTEM_WINDOW, MainApp.gs(R.string.needsystemwindowpermission), Notification.URGENT); - notification.action(R.string.request, () -> { - // Check if Android Q or higher - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) { - // Show alert dialog to the user saying a separate permission is needed - // Launch the settings activity if the user prefers - Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, - Uri.parse("package:" + activity.getPackageName())); - activity.startActivity(intent); - } - }); - RxBus.INSTANCE.send(new EventNewNotification(notification)); - } else - RxBus.INSTANCE.send(new EventDismissNotification(Notification.PERMISSION_SYSTEM_WINDOW)); + // Check if Android Q or higher + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) { + if (!Settings.canDrawOverlays(activity)) { + NotificationWithAction notification = new NotificationWithAction(Notification.PERMISSION_SYSTEM_WINDOW, MainApp.gs(R.string.needsystemwindowpermission), Notification.URGENT); + notification.action(R.string.request, () -> { + // Show alert dialog to the user saying a separate permission is needed + // Launch the settings activity if the user prefers + Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, + Uri.parse("package:" + activity.getPackageName())); + activity.startActivity(intent); + }); + RxBus.INSTANCE.send(new EventNewNotification(notification)); + } else + RxBus.INSTANCE.send(new EventDismissNotification(Notification.PERMISSION_SYSTEM_WINDOW)); + } } } From 9098eb2da0661a6dc3e01341aa47884b208b9356 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 9 Feb 2020 13:04:49 +0100 Subject: [PATCH 05/10] save Careportal events directly to DB --- .../plugins/pump/insight/LocalInsightPlugin.java | 12 ++++++++++++ .../pump/medtronic/data/MedtronicHistoryData.java | 6 ++++++ .../plugins/source/SourceDexcomPlugin.kt | 15 +++++++++++++++ .../plugins/source/SourceEversensePlugin.java | 7 +++++++ 4 files changed, 40 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 5104e70fe8..afca125092 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -1524,6 +1524,12 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con data.put("created_at", DateUtil.toISOString(date)); data.put("eventType", CareportalEvent.NOTE); data.put("notes", note); + CareportalEvent careportalEvent = new CareportalEvent(); + careportalEvent.date = date; + careportalEvent.source = Source.USER; + careportalEvent.eventType = CareportalEvent.NOTE; + careportalEvent.json = data.toString(); + MainApp.getDbHelper().createOrUpdate(careportalEvent); NSUpload.uploadCareportalEntryToNS(data); } catch (JSONException e) { log.error("Unhandled exception", e); @@ -1552,6 +1558,12 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con if (!enteredBy.equals("")) data.put("enteredBy", enteredBy); data.put("created_at", DateUtil.toISOString(date)); data.put("eventType", event); + CareportalEvent careportalEvent = new CareportalEvent(); + careportalEvent.date = date; + careportalEvent.source = Source.USER; + careportalEvent.eventType = event; + careportalEvent.json = data.toString(); + MainApp.getDbHelper().createOrUpdate(careportalEvent); NSUpload.uploadCareportalEntryToNS(data); } catch (JSONException e) { log.error("Unhandled exception", e); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java index 11d1bad3d9..39c44167a2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java @@ -528,6 +528,12 @@ public class MedtronicHistoryData { if (!enteredBy.equals("")) data.put("enteredBy", enteredBy); data.put("created_at", DateUtil.toISOString(date)); data.put("eventType", event); + CareportalEvent careportalEvent = new CareportalEvent(); + careportalEvent.date = date; + careportalEvent.source = Source.USER; + careportalEvent.eventType = event; + careportalEvent.json = data.toString(); + MainApp.getDbHelper().createOrUpdate(careportalEvent); NSUpload.uploadCareportalEntryToNS(data); } catch (JSONException e) { LOG.error("Unhandled exception", e); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceDexcomPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceDexcomPlugin.kt index 633f16cf10..bf5661ad00 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceDexcomPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceDexcomPlugin.kt @@ -9,6 +9,8 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.RequestDexcomPermissionActivity import info.nightscout.androidaps.db.BgReading import info.nightscout.androidaps.db.CareportalEvent +import info.nightscout.androidaps.db.Source +import info.nightscout.androidaps.dialogs.CareDialog import info.nightscout.androidaps.interfaces.BgSourceInterface import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.PluginDescription @@ -96,6 +98,13 @@ object SourceDexcomPlugin : PluginBase(PluginDescription() jsonObject.put("glucoseType", "Finger") jsonObject.put("glucose", meter.getInt("meterValue")) jsonObject.put("units", Constants.MGDL) + + val careportalEvent = CareportalEvent() + careportalEvent.date = timestamp + careportalEvent.source = Source.USER + careportalEvent.eventType = CareportalEvent.BGCHECK + careportalEvent.json = jsonObject.toString() + MainApp.getDbHelper().createOrUpdate(careportalEvent) NSUpload.uploadCareportalEntryToNS(jsonObject) } } @@ -110,6 +119,12 @@ object SourceDexcomPlugin : PluginBase(PluginDescription() jsonObject.put("enteredBy", "AndroidAPS-Dexcom$sensorType") jsonObject.put("created_at", DateUtil.toISOString(sensorInsertionTime)) jsonObject.put("eventType", CareportalEvent.SENSORCHANGE) + val careportalEvent = CareportalEvent() + careportalEvent.date = sensorInsertionTime + careportalEvent.source = Source.USER + careportalEvent.eventType = CareportalEvent.SENSORCHANGE + careportalEvent.json = jsonObject.toString() + MainApp.getDbHelper().createOrUpdate(careportalEvent) NSUpload.uploadCareportalEntryToNS(jsonObject) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceEversensePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceEversensePlugin.java index 6f39e3d762..6d0067414a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceEversensePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/SourceEversensePlugin.java @@ -15,6 +15,7 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.CareportalEvent; +import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.interfaces.BgSourceInterface; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginDescription; @@ -143,6 +144,12 @@ public class SourceEversensePlugin extends PluginBase implements BgSourceInterfa data.put("glucoseType", "Finger"); data.put("glucose", calibrationGlucoseLevels[i]); data.put("units", Constants.MGDL); + CareportalEvent careportalEvent = new CareportalEvent(); + careportalEvent.date = calibrationTimestamps[i]; + careportalEvent.source = Source.USER; + careportalEvent.eventType = CareportalEvent.BGCHECK; + careportalEvent.json = data.toString(); + MainApp.getDbHelper().createOrUpdate(careportalEvent); NSUpload.uploadCareportalEntryToNS(data); } } catch (JSONException e) { From f111b731e75a86edafd2ddb8424a01b718691ab8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 9 Feb 2020 22:16:48 +0100 Subject: [PATCH 06/10] Improve SetupWizardTest to be runnable on real device --- app/build.gradle | 1 + .../nightscout/androidaps/EspressoHelper.kt | 8 +++ .../androidaps/SetupWizardActivityTest.kt | 61 +++++++++++-------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 53b0398a43..69ae9369cb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -315,6 +315,7 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test:rules:1.3.0-alpha03' androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' } diff --git a/app/src/androidTest/java/info/nightscout/androidaps/EspressoHelper.kt b/app/src/androidTest/java/info/nightscout/androidaps/EspressoHelper.kt index b50bb746fb..cf7118ebd2 100644 --- a/app/src/androidTest/java/info/nightscout/androidaps/EspressoHelper.kt +++ b/app/src/androidTest/java/info/nightscout/androidaps/EspressoHelper.kt @@ -4,6 +4,9 @@ import androidx.test.espresso.ViewAction import androidx.test.espresso.ViewInteraction import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector fun ViewInteraction.isDisplayed(): Boolean { try { @@ -25,3 +28,8 @@ fun ViewInteraction.waitAndPerform(viewActions: ViewAction): ViewInteraction? { return perform(viewActions) } +fun clickOkInDialog() { + val uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + val button = uiDevice.findObject(UiSelector().clickable(true).checkable(false).index(1)) + if (button.exists() && button.isEnabled) button.click() +} diff --git a/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt b/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt index dd1c0b12bc..a2742c2a34 100644 --- a/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt +++ b/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps - import android.os.SystemClock import android.view.View import android.view.ViewGroup @@ -9,12 +8,15 @@ import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.action.ViewActions.scrollTo -import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.matcher.ViewMatchers.withClassName +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withTagValue +import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest import androidx.test.rule.ActivityTestRule import androidx.test.rule.GrantPermissionRule -import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.interfaces.PluginType import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin @@ -39,7 +41,6 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith - @LargeTest @RunWith(AndroidJUnit4::class) class SetupWizardActivityTest { @@ -50,12 +51,12 @@ class SetupWizardActivityTest { @Rule @JvmField - var mGrantPermissionRule = - GrantPermissionRule.grant( - android.Manifest.permission.ACCESS_FINE_LOCATION, - android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, - android.Manifest.permission.WRITE_EXTERNAL_STORAGE - ) + var mGrantPermissionRule: GrantPermissionRule = + GrantPermissionRule.grant( + android.Manifest.permission.ACCESS_FINE_LOCATION, + android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, + android.Manifest.permission.WRITE_EXTERNAL_STORAGE + ) @Before fun clear() { @@ -74,9 +75,9 @@ adb shell settings put global transition_animation_scale 0 & adb shell settings put global animator_duration_scale 0 & */ - @Test fun setupWizardActivityTest() { + SP.clear() Assert.assertTrue(isRunningTest()) // Welcome page onView(withId(R.id.next_button)).perform(click()) @@ -86,7 +87,7 @@ adb shell settings put global animator_duration_scale 0 & // Agreement page onView(withText("I UNDERSTAND AND AGREE")).perform(scrollTo(), click()) onView(withId(R.id.next_button)).waitAndPerform(click()) - // Loction permission + // Location permission var askButton = onView(withText("Ask for permission")) if (askButton.isDisplayed()) { askButton.perform(scrollTo(), click()) @@ -99,6 +100,11 @@ adb shell settings put global animator_duration_scale 0 & onView(withText("OK")).perform(click()) onView(withId(R.id.next_button)).waitAndPerform(click()) } + // Import settings : skip of found + askButton = onView(withText("IMPORT SETTINGS")) + if (askButton.isDisplayed()) { + onView(withId(R.id.next_button)).waitAndPerform(click()) + } // Units selection onView(withText("mmol/L")).perform(scrollTo(), click()) onView(withId(R.id.next_button)).perform(click()) @@ -125,41 +131,44 @@ adb shell settings put global animator_duration_scale 0 & // Local profile - IC onView(withId(R.id.ic_tab)).perform(scrollTo(), click()) onView(Matchers.allOf(withTagValue(Matchers.`is`("IC-1-0")), isDisplayed())) - .perform(ViewActions.replaceText("2"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("2"), ViewActions.closeSoftKeyboard()) // Local profile - ISF onView(withId(R.id.isf_tab)).perform(scrollTo(), click()) onView(Matchers.allOf(withTagValue(Matchers.`is`("ISF-1-0")), isDisplayed())) - .perform(ViewActions.replaceText("3"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("3"), ViewActions.closeSoftKeyboard()) // Local profile - BAS onView(withId(R.id.basal_tab)).perform(scrollTo(), click()) onView(childAtPosition(Matchers.allOf(withId(R.id.localprofile_basal), childAtPosition(withClassName(Matchers.`is`("android.widget.LinearLayout")), 6)), 2)) - .perform(scrollTo(), click()) + .perform(scrollTo(), click()) onView(Matchers.allOf(withTagValue(Matchers.`is`("BASAL-1-0")), isDisplayed())) - .perform(ViewActions.replaceText("1.1"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("1.1"), ViewActions.closeSoftKeyboard()) onView(Matchers.allOf(withTagValue(Matchers.`is`("BASAL-1-1")), isDisplayed())) - .perform(ViewActions.replaceText("1.2"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("1.2"), ViewActions.closeSoftKeyboard()) onView(Matchers.allOf(withId(R.id.timelistedit_time), childAtPosition(childAtPosition(withId(R.id.localprofile_basal), 2), 0))) - .perform(scrollTo(), click()) + .perform(scrollTo(), click()) onData(Matchers.anything()).inAdapterView(childAtPosition(withClassName(Matchers.`is`("android.widget.PopupWindow\$PopupBackgroundView")), 0)).atPosition(13) - .perform(click()) + .perform(click()) // Local profile - TARGET onView(withId(R.id.target_tab)).perform(scrollTo(), click()) onView(Matchers.allOf(withTagValue(Matchers.`is`("TARGET-1-0")), isDisplayed())) - .perform(ViewActions.replaceText("6"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("6"), ViewActions.closeSoftKeyboard()) onView(Matchers.allOf(withTagValue(Matchers.`is`("TARGET-2-0")), isDisplayed())) - .perform(ViewActions.replaceText("6.5"), ViewActions.closeSoftKeyboard()) + .perform(ViewActions.replaceText("6.5"), ViewActions.closeSoftKeyboard()) onView(withText("Save")).perform(scrollTo(), click()) onView(Matchers.allOf(withId(R.id.localprofile_profileswitch), isDisplayed())) - .perform(scrollTo(), click()) + .perform(scrollTo(), click()) onView(allOf(withId(R.id.ok), isDisplayed())).perform(click()) - onView(Matchers.allOf(withText("OK"), isDisplayed())).perform(click()) + // confirm dialog + //onView(Matchers.allOf(withText("OK"), isDisplayed())).perform(click()) not working on real phone + clickOkInDialog() onView(withId(R.id.next_button)).waitAndPerform(click()) // Profile switch askButton = onView(withText("Do Profile Switch")) if (askButton.isDisplayed()) { askButton.perform(scrollTo(), click()) onView(allOf(withId(R.id.ok), isDisplayed())).perform(click()) - onView(Matchers.allOf(withText("OK"), isDisplayed())).perform(click()) + // onView(Matchers.allOf(withText("OK"), isDisplayed())).perform(click()) not working on real phone + clickOkInDialog() while (ProfileFunctions.getInstance().profile == null) SystemClock.sleep(100) onView(withId(R.id.next_button)).waitAndPerform(click()) } @@ -204,7 +213,7 @@ adb shell settings put global animator_duration_scale 0 & } private fun childAtPosition( - parentMatcher: Matcher, position: Int): Matcher { + parentMatcher: Matcher, position: Int): Matcher { return object : TypeSafeMatcher() { override fun describeTo(description: Description) { @@ -215,7 +224,7 @@ adb shell settings put global animator_duration_scale 0 & public override fun matchesSafely(view: View): Boolean { val parent = view.parent return parent is ViewGroup && parentMatcher.matches(parent) - && view == parent.getChildAt(position) + && view == parent.getChildAt(position) } } } From 0ff7702b1a29fa6016e3b3e9011094fc17e9b396 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 11 Feb 2020 17:06:30 +0100 Subject: [PATCH 07/10] RealPumpTest| --- app/build.gradle | 30 +++++ .../nightscout/androidaps/RealPumpTest.kt | 116 ++++++++++++++++++ .../nightscout/androidaps/MainActivity.java | 4 +- .../androidaps/interfaces/PluginBase.java | 2 +- .../plugins/source/RandomBgPlugin.kt | 6 +- .../androidaps/utils/EspressoTestHelper.kt | 10 ++ 6 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt diff --git a/app/build.gradle b/app/build.gradle index 69ae9369cb..7d622ed56f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -343,6 +343,36 @@ task full_clean(type: Delete) { delete file("src/main/jniLibs") } +// Run 'adb' shell command to clear application data of main app for 'debug' variant +task clearMainAppData(type: Exec) { + // we have to iterate to find the 'debug' variant to obtain a variant reference + android.applicationVariants.all { variant -> + if (variant.name == "fullDebug") { + def applicationId = [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join() + def clearDataCommand = ['adb', 'shell', 'pm', 'clear', applicationId] + println "Clearing application data of ${variant.name} variant: [${clearDataCommand}]" + def stdout = new ByteArrayOutputStream() + exec { + commandLine clearDataCommand + standardOutput = stdout + } + String result = stdout.toString().trim() + if (!result.startsWith("Success")) { + println result + throw new GradleException(clearDataCommand.join(" ")) + } + } + } +} +// Clear Application Data (once) before running instrumentation test +tasks.whenTaskAdded { task -> + // Both of these targets are equivalent today, although in future connectedCheck + // will also include connectedUiAutomatorTest (not implemented yet) + if(task.name == "connectedAndroidTest" || task.name == "connectedCheck"){ + task.dependsOn(clearMainAppData) + } +} + clean.dependsOn full_clean preBuild.dependsOn copyLibs diff --git a/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt b/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt new file mode 100644 index 0000000000..5463fbcd26 --- /dev/null +++ b/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt @@ -0,0 +1,116 @@ +package info.nightscout.androidaps + +import android.os.SystemClock +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.LargeTest +import androidx.test.rule.ActivityTestRule +import androidx.test.rule.GrantPermissionRule +import info.nightscout.androidaps.data.Profile +import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.PluginType +import info.nightscout.androidaps.interfaces.PumpInterface +import info.nightscout.androidaps.logging.L +import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin +import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin +import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin +import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin +import info.nightscout.androidaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin +import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin +import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin +import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin +import info.nightscout.androidaps.plugins.source.RandomBgPlugin +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.SP +import info.nightscout.androidaps.utils.isRunningTest +import org.json.JSONObject +import org.junit.Assert +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.slf4j.LoggerFactory + +@LargeTest +@RunWith(AndroidJUnit4::class) +class RealPumpTest { + + private val log = LoggerFactory.getLogger(L.CORE) + + companion object { + val pump: PumpInterface = DanaRv2Plugin.getPlugin() + const val R_PASSWORD = 1234 + const val R_SERIAL = "PBB00013LR_P" + } + + private val validProfile = "{\"dia\":\"6\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"10\"},{\"time\":\"2:00\",\"value\":\"11\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" + + @Rule + @JvmField + var mActivityTestRule = ActivityTestRule(MainActivity::class.java) + + @Rule + @JvmField + var mGrantPermissionRule: GrantPermissionRule = + GrantPermissionRule.grant( + android.Manifest.permission.ACCESS_FINE_LOCATION, + android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, + android.Manifest.permission.WRITE_EXTERNAL_STORAGE + ) + + @Before + fun clear() { + SP.clear() + SP.putBoolean(R.string.key_setupwizard_processed, true) + SP.putString(R.string.key_aps_mode, "closed") + MainApp.getDbHelper().resetDatabases() + MainApp.devBranch = false + } + + private fun preparePlugins() { + // Source + RandomBgPlugin.performPluginSwitch(true, PluginType.BGSOURCE) + // Profile + LocalProfilePlugin.performPluginSwitch(true, PluginType.PROFILE) + val profile = Profile(JSONObject(validProfile), Constants.MGDL) + Assert.assertTrue(profile.isValid("Test")) + LocalProfilePlugin.profiles.clear() + LocalProfilePlugin.numOfProfiles = 0 + val singleProfile = LocalProfilePlugin.SingleProfile().copyFrom(profile, "TestProfile") + LocalProfilePlugin.addProfile(singleProfile) + ProfileFunctions.doProfileSwitch(LocalProfilePlugin.createProfileStore(), "TestProfile", 0, 100, 0, DateUtil.now()) + // Insulin + InsulinOrefUltraRapidActingPlugin.getPlugin().performPluginSwitch(true, PluginType.INSULIN) + // Pump + SP.putInt(R.string.key_danar_password, R_PASSWORD) + SP.putString(R.string.key_danar_bt_name, R_SERIAL) + (pump as PluginBase).performPluginSwitch(true, PluginType.PUMP) + // Sensitivity + SensitivityOref1Plugin.getPlugin().performPluginSwitch(true, PluginType.SENSITIVITY) + // APS + OpenAPSSMBPlugin.getPlugin().performPluginSwitch(true, PluginType.APS) + LoopPlugin.getPlugin().performPluginSwitch(true, PluginType.LOOP) + + // Enable common + ActionsPlugin.performPluginSwitch(true, PluginType.GENERAL) + + // Disable unneeded + MainApp.getPluginsList().remove(ObjectivesPlugin) + } + + @Test + fun doTest() { + Assert.assertTrue(isRunningTest()) + preparePlugins() + + while (!pump.isInitialized) { + log.debug("Waiting for initialization") + SystemClock.sleep(1000) + } + + while (true) { + log.debug("Tick") + SystemClock.sleep(1000) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index f74a58856f..c152c415cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -63,6 +63,8 @@ import info.nightscout.androidaps.utils.SP; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; +import static info.nightscout.androidaps.utils.EspressoTestHelperKt.isRunningRealPumpTest; + public class MainActivity extends NoSplashAppCompatActivity { private static Logger log = LoggerFactory.getLogger(L.CORE); private CompositeDisposable disposable = new CompositeDisposable(); @@ -137,7 +139,7 @@ public class MainActivity extends NoSplashAppCompatActivity { .subscribe(this::processPreferenceChange, FabricPrivacy::logException) ); - if (!SP.getBoolean(R.string.key_setupwizard_processed, false)) { + if (!SP.getBoolean(R.string.key_setupwizard_processed, false) && !isRunningRealPumpTest()) { Intent intent = new Intent(this, SetupWizardActivity.class); startActivity(intent); } diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java index e236125255..5d4ec01fd9 100644 --- a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java +++ b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java @@ -74,7 +74,7 @@ public abstract class PluginBase { } } - private void performPluginSwitch(boolean enabled, PluginType type) { + public void performPluginSwitch(boolean enabled, PluginType type) { setPluginEnabled(type, enabled); setFragmentVisible(type, enabled); ConfigBuilderPlugin.getPlugin().processOnEnabledCategoryChanged(this, getType()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt index ea6731ca60..1f79b82bc6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt @@ -31,7 +31,7 @@ object RandomBgPlugin : PluginBase(PluginDescription() private val loopHandler = Handler() private lateinit var refreshLoop: Runnable - const val interval = 5L // minutes + const val interval = 1L // minutes init { refreshLoop = Runnable { @@ -55,7 +55,7 @@ object RandomBgPlugin : PluginBase(PluginDescription() } override fun specialEnableCondition(): Boolean { - return VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP) && (MainApp.engineeringMode || isRunningTest()) + return isRunningTest() || VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP) && MainApp.engineeringMode } override fun handleNewData(intent: Intent) { @@ -65,7 +65,7 @@ object RandomBgPlugin : PluginBase(PluginDescription() val cal = GregorianCalendar() val currentMinute = cal.get(Calendar.MINUTE) + (cal.get(Calendar.HOUR_OF_DAY) % 2) * 60 - val bgMgdl = min + (max - min) * sin(currentMinute / 120.0 * 2 * PI) + val bgMgdl = min + (max - min) + (max - min) * sin(currentMinute / 120.0 * 2 * PI) val bgReading = BgReading() bgReading.value = bgMgdl diff --git a/app/src/main/java/info/nightscout/androidaps/utils/EspressoTestHelper.kt b/app/src/main/java/info/nightscout/androidaps/utils/EspressoTestHelper.kt index 7288e6679f..0cddcc0792 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/EspressoTestHelper.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/EspressoTestHelper.kt @@ -9,3 +9,13 @@ fun isRunningTest(): Boolean { false } } + +@Synchronized +fun isRunningRealPumpTest(): Boolean { + return try { + Class.forName("info.nightscout.androidaps.RealPumpTest") + true + } catch (e: ClassNotFoundException) { + false + } +} From 3b9ea53cc4f0f65eec3c698afe3e8a3e6f075432 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 25 Feb 2020 20:46:04 +0100 Subject: [PATCH 08/10] Fix TempTarget confirm dialog --- .../nightscout/androidaps/dialogs/TempTargetDialog.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 77cb0b6823..5b1dd48692 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -114,11 +114,11 @@ class TempTargetDialog : DialogFragmentWithDate() { val reason = overview_temptarget_reason.selectedItem.toString() val unitResId = if (ProfileFunctions.getSystemUnits() == Constants.MGDL) R.string.mgdl else R.string.mmol val target = overview_temptarget_temptarget.value - val duration = overview_temptarget_duration.value - if (target != 0.0 && duration != 0.0) { + val duration = overview_temptarget_duration.value.toInt() + if (target != 0.0 && duration != 0) { actions.add(MainApp.gs(R.string.reason) + ": " + reason) actions.add(MainApp.gs(R.string.nsprofileview_target_label) + ": " + Profile.toCurrentUnitsString(target) + " " + MainApp.gs(unitResId)) - actions.add(MainApp.gs(R.string.duration) + ": " + MainApp.gs(R.string.format_hours, duration)) + actions.add(MainApp.gs(R.string.duration) + ": " + MainApp.gs(R.string.format_mins, duration)) } else { actions.add(MainApp.gs(R.string.stoptemptarget)) } @@ -128,7 +128,7 @@ class TempTargetDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { log.debug("USER ENTRY: TEMP TARGET $target duration: $duration") - if (target == 0.0 || duration == 0.0) { + if (target == 0.0 || duration == 0) { val tempTarget = TempTarget() .date(eventTime) .duration(0) @@ -145,7 +145,7 @@ class TempTargetDialog : DialogFragmentWithDate() { .high(Profile.toMgdl(target, ProfileFunctions.getSystemUnits())) TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget) } - if (duration == 10.0) SP.putBoolean(R.string.key_objectiveusetemptarget, true) + if (duration == 10) SP.putBoolean(R.string.key_objectiveusetemptarget, true) }) } return true From 832663081101188d20c3380cc8818d5f6fc7ec35 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 25 Feb 2020 21:30:44 +0100 Subject: [PATCH 09/10] Revert gradle changes for UI tests --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7d622ed56f..0dd80641bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -342,7 +342,7 @@ task copyLibs(dependsOn: downloadAndUnzipFile, type: Copy) { task full_clean(type: Delete) { delete file("src/main/jniLibs") } - +/* // Run 'adb' shell command to clear application data of main app for 'debug' variant task clearMainAppData(type: Exec) { // we have to iterate to find the 'debug' variant to obtain a variant reference @@ -372,7 +372,7 @@ tasks.whenTaskAdded { task -> task.dependsOn(clearMainAppData) } } - +*/ clean.dependsOn full_clean preBuild.dependsOn copyLibs From 26170ddea55401a2a15c60140365d40551b61b51 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 25 Feb 2020 21:54:14 +0100 Subject: [PATCH 10/10] New Crowdin translations (#2429) * New translations strings.xml (Swedish) * New translations strings.xml (Italian) * New translations strings.xml (Korean) * New translations strings.xml (German) * New translations strings.xml (Slovak) * New translations strings.xml (Korean) * New translations strings.xml (Korean) * New translations strings.xml (Portuguese) * New translations strings.xml (Korean) * New translations strings.xml (Korean) * New translations strings.xml (German) * New translations strings.xml (French) * New translations exam.xml (Dutch) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (Bulgarian) * New translations strings.xml (Korean) * New translations strings.xml (French) * New translations strings.xml (Spanish) * New translations strings.xml (Spanish) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) --- app/src/main/res/values-bg-rBG/strings.xml | 6 ++- app/src/main/res/values-de-rDE/strings.xml | 4 +- app/src/main/res/values-es-rES/strings.xml | 5 ++- app/src/main/res/values-fr-rFR/strings.xml | 42 ++++++++++++--------- app/src/main/res/values-it-rIT/strings.xml | 1 + app/src/main/res/values-ko-rKR/strings.xml | 37 +++++++++--------- app/src/main/res/values-nl-rNL/exam.xml | 4 +- app/src/main/res/values-pt-rPT/strings.xml | 5 +++ app/src/main/res/values-sk-rSK/strings.xml | 5 +++ app/src/main/res/values-sv-rSE/strings.xml | 7 ++++ wear/src/main/res/values-es-rES/strings.xml | 2 +- 11 files changed, 74 insertions(+), 44 deletions(-) diff --git a/app/src/main/res/values-bg-rBG/strings.xml b/app/src/main/res/values-bg-rBG/strings.xml index d3a01e2d86..78b71447fb 100644 --- a/app/src/main/res/values-bg-rBG/strings.xml +++ b/app/src/main/res/values-bg-rBG/strings.xml @@ -1,5 +1,4 @@ - @@ -946,6 +945,7 @@ Започнете първа цел Разрешение Питане за разрешение + ААПС изисква разрешение за да може да Ви уведомява Приложението се нуждае от достъп до вашето местоположение за да активира BT сканиране Приложението се нуждае от разрешение да съхранява данни за да може съхранява лог файлове Искане @@ -1449,4 +1449,8 @@ \"PhoneChecker\" Меню на графиката АS + Диапазон между изпълнение на SMB + Макс. време за изпълнение за SMB + Диапазон между временни базали + Продължителност на временни базали diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 8673afb35a..3ccf637260 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -846,7 +846,7 @@ Das Einlesen der geänderten Basalrate in der Pumpe schlug fehl Änderungen der Historie werden gesucht Der Import mehrerer Boli der gleichen Menge, abgegeben in der gleichen Minute, ist gescheitert: Nur ein Datensatz konnte den Behandlungen hinzugefügt werden. Bitte überprüfe die Pumpe und verwende das Careportal, um fehlende Einträge hinzuzufügen. Stelle sicher, dass keine Einträge für genau dieselbe Minute mit derselben Menge hinzugefügt werden. - \n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nSupport:\nhttps://de.loopercommunity.org/ (de)\nhttp://facebook.androidaps.org + \n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nSupport:\nhttps://de.loopercommunity.org/\nhttp://facebook.androidaps.org Der letzte Bolus liegt mehr als 24 Stunden zurück oder liegt in der Zukunft. Prüfe bitte das Datum auf der Pumpe. Zeit/Datum des abgegebenen Boluses auf der Pumpe erscheint falsch, IOB ist wahrscheinlich nicht korrekt. Bitte prüfe Zeit/Datum der Pumpe. Profil-Wechsel fehlt, bitte nimm einen Profil-Wechsel vor oder drücke \"AKTIVIERE PROFIL\" im lokalen Profil. @@ -1447,7 +1447,7 @@ Unerwartetes Verhalten. Warteschlange löschen? Alle Daten in der Warteschlange gehen verloren! Die Verwendung eines Verzögerungsbolus unterbricht dem Closed Loop Modus für die Dauer des Verzögerungsbolus. Willst Du das wirklich? Closed Loop wegen Verzögerungsbolus unterbrochen - VB + VerzB \"PhoneChecker\" Diagrammmenü AS diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 48e69e0564..9c4bd4d36a 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -1,5 +1,4 @@ - @@ -1446,4 +1445,8 @@ El uso de la función de bolo extendido detendrá el modo de bucle cerrado durante el tiempo de ejecución del bolo extendido. ¿Realmente quieres esto? Bucle cerrado inhabilitado debido a la ejecución del bolo extendido EB + Menú gráfico + AS + Tiempo requerido de SMB + Tiempo de ejecución de SMB diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 2437913625..c398fc1990 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -1,5 +1,4 @@ - @@ -157,7 +156,7 @@ Changez vos entrées ! Source des glycémies Quelle source de données doit être utilisée par AndroidAPS ? - xDrip + xDrip+ Mode APS Boucle Fermée Boucle Ouverte @@ -196,7 +195,7 @@ Capteur Glucides Insuline - Heure glucides + Décalage horaire Diviser Durée Pourcentage @@ -220,7 +219,7 @@ Importer les paramètres Max. U/hr pour le débit temp Basal Cette valeur est appelée Basal Maximum dans le contexte OpenAPS - Le Basal IA maximum que l\'OpenAPS pourra délivrer [U] + IA basale max que OpenAPS pourra délivrer [U] Cette valeur est appelée Max IA (Insuline Active) dans le contexte OpenAPS\nC\'estlle maximum d\'insuline en [U] que APS peut délivrer en une seule fois. FERMER DanaR @@ -385,7 +384,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Renvoyer toutes les données Afficher les Paramètres sur la Montre Erreur Pompe - Niveau Batterie Bas + Piles Faibles Arrêt de la Pompe Batterie Pompe Déchargée DanaR Coréenne @@ -644,7 +643,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Temps du Pic [min] Profil d\'insuline ajustable Oref Insuline à Action Rapide Oref - Insuline à Action Ultra Rapide Oref + Insuline Ultra Rapide Oref Durée d’Action pour %1$f trop courte - utiliser %2$f à la place ! Activer le profil Date @@ -701,7 +700,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Pilote pompe corrigé Pompe hors de portée Valeurs de glycémie manquantes - Utiliser le système des notifications + Utiliser les notifications système pour les alertes et notifications Alertes locales Alerte pas nouvelle donnée glycémique Alerte si la pompe est hors de portée @@ -766,7 +765,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Historique pompe Définir le profil basal Niveau réservoir pompe bas - Niveau batterie pompe bas + Pile pompe faible La pompe affiche l’erreur E%1$d: %2$s Bas Vide @@ -885,7 +884,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S réinitialiser En attente de synchronisation de l\'heure (%1$d sec) Déconnecté (%1$d m) - Maximum Insuline Active IA pour OpenAPS [U] + IA totale maximale pour OpenAPS [U] Cette valeur est appelée Max IA (Insuline Active) dans le contaxte OpenAPS\nOpenAPS n’ajoutera pas plus d’insuline si l\'IA (Insuline Active) actuelle est supérieure à cette valeur Pompe arrêtée Pompe démarrée @@ -909,15 +908,15 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S MGC Utilisez uniquement connexion Wi-fi Wi-fi SSID - Wi-fi uniquement pendant la charge + Uniquement si en charge Paramètres de connexion SSIDs autorisés (séparés par point-virgule) Autoriser connexion données itinérance Maximum Ratio Autosens Minimum Ratio Autosens - Diviseur de Bolus snooze DIA - Maximum multiplicateur quotidien de sécurité - Multiplicateur actuel de sécurité du Basal + Snooze bolus Diviseur de DAI + Multiplicateur max quotidien de sécurité + Multiplicateur de sécurité basale courante ND Type de pompe virtuelle Définition de pompe @@ -947,6 +946,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Démarrez votre premier objectif Autorisation Demande d\'autorisation + L\'application a besoin de l\'autorisation d\'accès à la fenêtre système pour les notifications L\'application requiert l\'autorisation de localisation pour le balayage Bluetooth L\'application requiert une autorisation de stockage de données afin de pouvoir sauvegarder les fichiers journaux Demande @@ -1015,7 +1015,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Erreur de commande Erreur de vitesse Violation d\'une limite d\'insuline - Changement minimum possible [%] + Changement minimum [%] Le fonctionnement de la Boucle demandera une confirmation uniquement si le changement est supérieur à cette valeur en %. Par défaut, la valeur est 20% Appairez SVP votre pompe avec votre téléphone ! Recherche d\'appareils en cours… @@ -1244,7 +1244,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Mondial (868 Mhz) Encodage logiciel 4b6b Encodage matériel 4b6b - Réveil et mise au point + Réveil et Réglage Effacer le bloc Bolus Réinitialiser la config. RileyLink Type de batterie (vue d\'alimentation) @@ -1270,8 +1270,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Paramètres Historique - Statut du RileyLink - Statut de la pompe + État du RileyLink + État de la pompe Paramètres RileyLink RileyLink Adresse configurée @@ -1300,7 +1300,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Bluetooth est désactivé Aucun adaptateur Bluetooth Échec du réglage - Pompe inaccessible + Pompe hors de portée Pod inaccessible Non configuré @@ -1448,4 +1448,10 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Boucle fermée désactivée à cause du bolus étendu EB \"Vérif. du téléphone\" + Menu Graph + AS + Heure de demande SMB + Heure d\'exécution SMB + Heure de demande basal temp + Heure d\'exécution basal temp diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index cbf0f50945..952633064b 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -946,6 +946,7 @@ Avvia il tuo primo obiettivo Permesso Chiedi il permesso + L\'applicazione richiede il permesso finestra di sistema per le notifiche L\'applicazione richiede l\'accesso alla posizione per eseguire lo scan bluetooth L\'applicazione richiede l\'accesso alla memoria per salvare i file di log Richiesta diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 066b4aee6b..66e4215fe6 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -1,5 +1,4 @@ - @@ -105,7 +104,7 @@ 근거 혈당 증분 - 증분: + Delta: 구성 관리자 목표 OpenAPS MA @@ -155,7 +154,7 @@ Basal: 탄수화물 입력값을 변경하세요! - 혈당 소스 + 혈당 출처 AndroidAPS가 어디에서 데이터를 가져옵니까? xDrip APS 모드 @@ -183,7 +182,7 @@ 인슐린 카트리지 교체 프로파일 변경 간식Bolus - 식사Bolus + Meal Bolus 교정Bolus 콤보Bolus 임시Basal 시작 @@ -254,7 +253,7 @@ 허가된 전화번호 +XXXXXXXXXX;+YYYYYYYYYY Bolus %1$.2fU 을 주입하려면 %2$s 를 입력하고 답장하세요 - 식사Bolus %1$.2f을 주입하려면 %2$s를 입력하고 답장하세요 + MEAL Bolus %1$.2f을 주입하려면 %2$s를 입력하고 답장하세요 임시목표 %1$s를 설정하려면 %2$s를 입력하고 답장하세요 임시목표를 취소하려면 %1$s를 입력하고 답장하세요 SMS 원격 기능을 비활성화려면 %1$s를 입력하고 답장하세요.\n\nAAPS 마스터폰을 통해서만 다시 활성화할 수 있습니다. @@ -267,7 +266,7 @@ Bolus %1$.2fU이 주입 완료되었습니다. %1$.2fU을 주입합니다 Bolus %1$.2fU이 주입 완료되었습니다 - 식사Bolus %1$.2f이 주입 완료되었습니다 + Meal Bolus %1$.2f이 주입 완료되었습니다 %2$d 분 동안 목표 %1$s %2$d 분 동안 목표 %1$s 설정이 완료되었습니다 임시 목표 취소가 완료되었습니다 @@ -328,24 +327,24 @@ 원격 명령이 허가되지 않았습니다 원격 주입이 불가능합니다. 나중에 다시 시도해주세요. %2$d분 동안 Basal %1$.2fU/h 주입하려면 %3$s 를 입력하고 답장하세요 - 프로파일을 %1$s %2$d%%로 변경하려면 %3$s 를 입력하고 답장하세요 + 프로파일 %1$s %2$d%%로 변경하려면 %3$s 를 입력하고 답장하세요 %2$d분 동안 확장 Bolus %1$.2fU 주입하려면 %3$s 를 입력하고 답장하세요 %2$s에 %1$dg을 입력하려면 %3$s를 입력하고 답장하세요 %2$d 분 동안 Basal %1$d%% 주입하려면 %3$s을 입력하고 답장하세요 %1$d분동안 Loop 일시중지하려면 %2$s 를 입력하고 답장하세요 Temp Basal %1$.2fU/h for %2$d min started successfully - %2$d분 동안 확장Bolus %1$.2fU주입이 성공적으로 시작되었습니다 + Extended bolus %1$.2fU for %2$d min started successfully 탄수화물 %1$dg 입력이 완료되었습니다 탄수화물 %1$dg 입력이 실패하였습니다 - %2$d분 동안 임시Basal %1$d%%주입이 성공적으로 시작되었습니다 + Temp basal %1$d%% for %2$d min started successfully Temp Basal start failed - 확장 Bolus 실행 실패 + Extended bolus start failed 임시Basal을 중지하려면 %1$s 를 입력하고 답장하세요 확장 Bolus를 중지하려면 %1$s 를 입력하고 답장하세요 Temp Basal canceled - 확장 Bolus 취소 + Extended bolus canceled Canceling Temp Basal failed - 확장 Bolus 취소가 실패하였습니다. + Canceling extended bolus failed 알려지지 않은 명령이거나 잘못된 답장입니다 빠른마법사 빠른마법사 설정 @@ -355,12 +354,12 @@ 추가 수정 삭제 - 식사 + Meal 교정주입 실행 AndroidAPS 시작 NS에 업로드만 하기(동기화 안됨) - NS에 업로드만 하기. 로컬소스(xDrip)가 선택되지 않으면 SGV에는 효력이 없습니다. NS프로파일이 사용중이라면 프로파일에는 효력이 없습니다. + NS에 업로드만 하기. xDrip같은 로컬 혈당 출처가 선택되지 않다면 SGV에는 효력이 없습니다. NS프로파일이 사용중이라면 프로파일에는 효력이 없습니다. 펌프가 초기화 되지 않았습니다! 펌프가 초기화와 프로파일 설정이 되지 않았습니다! 교체/채움 @@ -668,7 +667,7 @@ 임시목표 기본값 식사직전 기간 식사직전 목표 - activity 기간 + 활동 기간 활동 목표 저혈당 기간 저혈당 목표 @@ -784,9 +783,9 @@ %1$.2f 시간 %1$d 분 항상 SMB 사용하기 - Bolus와 독립적으로 항상 SMB를 사용합니다. G5처럼 잘 필터된 혈당소스와만 사용이 가능합니다. + Bolus와 독립적으로 항상 SMB를 사용합니다. G5처럼 잘 필터된 혈당출처와만 사용이 가능합니다. 탄수화물 이후 SMB를 사용합니다. - 탄수화물 이후 6시간동안 SMB를 사용합니다, 0 COB이라도 적용됩니다. G5처럼 잘 필터된 혈당소스와만 사용이 가능합니다. + 탄수화물 이후 6시간동안 SMB를 사용합니다, 0 COB이라도 적용됩니다. G5처럼 잘 필터된 혈당출처와만 사용이 가능합니다. COB와 SMB를 사용합니다. 활성화된 COB가 있으면 SMB를 사용합니다. 임시 목표에서 SMB 사용하기 @@ -878,7 +877,7 @@ 상태를 읽지 못했습니다. 펌프 위치 변경 기록 인슐린 카트리지 변경 기록 - 선택한 BG 소스가 고급 필터링을 지원하지 않기 때문에 SMB가 항상 비활성화됩니다. + 선택한 혈당 출처가 고급 필터링을 지원하지 않기 때문에 SMB가 항상 비활성화됩니다. Open Loop모드에선 SMB가 허용되지 않습니다. Food 재설정 @@ -940,7 +939,7 @@ https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB NSClient는 Nightscout와의 연결을 처리합니다. 이 부분을 건너뛸 수 있지만 설정하기 전엔 목적을 수행할 수 없습니다. 새로운 인슐린 프로파일은 최소 5시간의 DIA가 요구됩니다. 새로운 프로파일의 DIA 5-6시간은 구식 인슐린 프로파일의 DIA 3시간과 동일합니다. - 혈당소스 설정하기 + 혈당 출처 설정하기 프로파일 소스를 선택해주세요. 당뇨인이 어린이라면 NS 프로파일을 선택하여야 합니다. Nightscout으로 관리해줄 사람이 없다면 당신은 로컬 프로파일을 선호할 수도 있습니다. 여기선 프로파일의 소스를 선택할 뿐이라는 것을 명심하세요. 그 프로파일을 실제 사용하려면 \"프로파일 변경\"을 실행하여 프로파일을 활성화 시켜야합니다. 사용 가능한 알고리즘 중 하나를 선택하세요. 과거부터 최신의 순으로 정렬이 되어 있습니다. 일반적으로 새로운 알고리즘은 보다 강력하고 공격적입니다. 따라서 당신이 신규 사용자라면 최신의 알고리즘보단 AMA로 시작하는것이 나을 수 있습니다. 사용 전에 OpenAPS 문서를 읽어보고 설정하는 것을 잊지마세요. 첫번째 목표를 시작하세요. diff --git a/app/src/main/res/values-nl-rNL/exam.xml b/app/src/main/res/values-nl-rNL/exam.xml index 9768183305..eefa78bba3 100644 --- a/app/src/main/res/values-nl-rNL/exam.xml +++ b/app/src/main/res/values-nl-rNL/exam.xml @@ -122,7 +122,7 @@ xDrip app in volg-modus. Loop app op de iPhone. Spike app op de iPhone. - https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Children/kinderen.html + https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Children/Children.html Onderwerp: Insulinegevoeligheidsfactor Hogere ISF-waarden leiden tot minder insulineafgifte wanneer AAPS voor hoge BG corrigeert. Lagere ISF-waarden leiden tot minder insulineafgifte wanneer AAPS voor hoge BG corrigeert. @@ -130,7 +130,7 @@ U moet ISF invoeren in Instellingen. Het wijzigen van de ISF-waarde in uw profiel is voldoende om de wijziging toe te passen. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#insuline-gevoeligheids-factor-insulin-sensitivity-factor-ISF-mmol-l-E-of-mg-dl-E - https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Profielen.html + https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Profiles.html Onderwerp: De KH ratio Hogere KH ratios leiden tot minder insuline afgifte voor een bepaalde hoeveelheid koolhydraten. Lagere KH ratios leiden tot minder insuline afgifte voor een bepaalde hoeveelheid koolhydraten. diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index d2c3a9d519..313f6c6658 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -946,6 +946,7 @@ Iniciar primeiro objectivo Permissão Pedir permissão + Aplicação precisa de permissão de janela do sistema para notificações Aplicação requer permissão de localização para pesquisa BT Aplicação necessita da permissão de armazenamento para ser capaz de armazenar ficheiros de registo Pedido @@ -1449,4 +1450,8 @@ \"VerificadorTelefone\" Menu do Gráfico AS + Hora de solicitação SMB + Hora de execução do SMB + Hora de solicitação Basal Temp + Hora de execução Basal Temp diff --git a/app/src/main/res/values-sk-rSK/strings.xml b/app/src/main/res/values-sk-rSK/strings.xml index 38500ca8a2..0b8fdca2e3 100644 --- a/app/src/main/res/values-sk-rSK/strings.xml +++ b/app/src/main/res/values-sk-rSK/strings.xml @@ -946,6 +946,7 @@ Spusťte prvý cieľ Povolenie Vyžiadať si povolenie + Aplikácia vyžaduje pre oznámenia systémové oprávnenie Aplikácia vyžaduje povolenie \"polohy\", aby mohla vyhľadávať BT zariadenia Aplikácia vyžaduje prístup k úložisku, aby mohla ukladať logy Požiadavka @@ -1449,4 +1450,8 @@ PhoneChecker Grafové menu AS + Čas požiadavky SMB + Čas aplikácie SMB + Čas požiadavky dočasného bazálu + Čas spustenia dočasného bazálu diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index ec0e76b738..96b45303a9 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -947,6 +947,7 @@ Eversense-appen. Påbörja ditt första mål Behörighet Be om behörighet + Applikationen behöver förhöjd behörighet för aviseringar Appen behöver behörighet att använda Platsinfo för att kunna söka efter Bluetooth-enheter Appen behöver behörighet att använda Lagring för att kunna spara loggfiler Begäran @@ -1448,4 +1449,10 @@ Eversense-appen. Closed Loop-läget inaktiverat pga att en förlängd bolus är aktiv FB Telefonkontroll + Diagrammeny + AS + SMB begärd + SMB utförd + Basalförändring begärd + Basalförändring utförd diff --git a/wear/src/main/res/values-es-rES/strings.xml b/wear/src/main/res/values-es-rES/strings.xml index af200da3fb..6e65157335 100644 --- a/wear/src/main/res/values-es-rES/strings.xml +++ b/wear/src/main/res/values-es-rES/strings.xml @@ -1,5 +1,4 @@ - AAPS AAPS @@ -51,6 +50,7 @@ Bajo Medio Alto + Auto Números grandes Historial de Ring Historial de Ring Light