Merge branch 'dev' into medtronic_andy

This commit is contained in:
Andy Rozman 2019-04-07 23:48:20 +01:00
commit 03b3bf7388
65 changed files with 2402 additions and 776 deletions

View file

@ -10,6 +10,7 @@ buildscript {
}
}
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: "io.fabric"
apply plugin: "jacoco-android"
apply plugin: 'com.jakewharton.butterknife'
@ -63,14 +64,14 @@ android {
targetSdkVersion 25
multiDexEnabled true
versionCode 1500
// dev_version: 2.2.1-dev
version "medtronic-0.8.3-SNAPSHOT"
// dev_version: 2.2.3-dev
version "medtronic-0.8"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
buildConfigField "String", "DEV_VERSION", '"2.2.1-dev"'
buildConfigField "String", "DEV_DATE", '"30.3.2019"'
buildConfigField "String", "DEV_CHECKIN", '"361ffa91c8c66d3901b1e8ae92b8b54bf0e2a4ce"'
buildConfigField "String", "DEV_VERSION", '"2.2.3-dev"'
buildConfigField "String", "DEV_DATE", '"7.4.2019"'
buildConfigField "String", "DEV_CHECKIN", '"a076b00363067fd43c83cbbd91cc964fa6978ddd"'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// if you change minSdkVersion to less than 11, you need to change executeTask for wear
@ -171,12 +172,11 @@ dependencies {
wearApp project(':wear')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation("com.crashlytics.sdk.android:crashlytics:2.9.9@aar") {
transitive = true;
}
implementation("com.crashlytics.sdk.android:answers:1.4.7@aar") {
transitive = true;
}
libs "MilosKozak:danars-support-lib:master@zip"
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
@ -185,7 +185,6 @@ dependencies {
implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
implementation "com.android.support:gridlayout-v7:${supportLibraryVersion}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:design:${supportLibraryVersion}"
implementation "com.android.support:percent:${supportLibraryVersion}"
implementation "com.wdullaer:materialdatetimepicker:2.3.0"
@ -197,11 +196,12 @@ dependencies {
}
implementation "org.apache.commons:commons-lang3:3.7"
implementation "org.slf4j:slf4j-api:1.7.21"
// Graphview cannot be upgraded
implementation "com.jjoe64:graphview:4.0.1"
implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.1.1"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-wearable:10.2.1'
implementation(name: "android-edittext-validator-v1.3.4-mod", ext: "aar")
implementation(name: "sightparser-release", ext: "aar")
implementation 'com.madgag.spongycastle:core:1.58.0.0'
implementation("com.google.android:flexbox:0.3.0") {
@ -233,8 +233,6 @@ dependencies {
testImplementation "com.google.truth:truth:0.39"
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation "org.skyscreamer:jsonassert:1.5.0"
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "uk.org.lidalia:slf4j-test:1.2.0"
androidTestImplementation "org.mockito:mockito-core:2.8.47"
androidTestImplementation "com.google.dexmaker:dexmaker:${dexmakerVersion}"

107
app/google-services.json Normal file
View file

@ -0,0 +1,107 @@
{
"project_info": {
"project_number": "477603612366",
"firebase_url": "https://androidaps-c34f8.firebaseio.com",
"project_id": "androidaps-c34f8",
"storage_bucket": "androidaps-c34f8.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:477603612366:android:aef229914e3e5448",
"android_client_info": {
"package_name": "info.nightscout.aapspumpcontrol"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDcZpDRMaGjdhihXp531cVYM6LkEL8KbgM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "477603612366-a925drvlvs7qn7gt73r585erbqto8c79.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:477603612366:android:efc956f55b281623",
"android_client_info": {
"package_name": "info.nightscout.androidaps"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDcZpDRMaGjdhihXp531cVYM6LkEL8KbgM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "477603612366-a925drvlvs7qn7gt73r585erbqto8c79.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:477603612366:android:b38d6e7351f73cc0",
"android_client_info": {
"package_name": "info.nightscout.nsclient"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDcZpDRMaGjdhihXp531cVYM6LkEL8KbgM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "477603612366-a925drvlvs7qn7gt73r585erbqto8c79.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:477603612366:android:2dc8cf3acd3332e7",
"android_client_info": {
"package_name": "info.nightscout.nsclient2"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDcZpDRMaGjdhihXp531cVYM6LkEL8KbgM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "477603612366-a925drvlvs7qn7gt73r585erbqto8c79.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

Binary file not shown.

View file

@ -54,6 +54,7 @@ import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus
import info.nightscout.androidaps.setupwizard.SetupWizardActivity;
import info.nightscout.androidaps.tabs.TabPageAdapter;
import info.nightscout.androidaps.utils.AndroidPermission;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.LocaleHelper;
import info.nightscout.androidaps.utils.OKDialog;
import info.nightscout.androidaps.utils.PasswordProtection;
@ -115,6 +116,7 @@ public class MainActivity extends AppCompatActivity {
}
});
VersionChecker.check();
FabricPrivacy.setUserStats();
}
private void checkPluginPreferences(ViewPager viewPager) {

View file

@ -23,6 +23,7 @@ import android.util.Log;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.j256.ormlite.android.apptools.OpenHelperManager;
import com.squareup.otto.Bus;
import com.squareup.otto.LoggingBus;
@ -107,6 +108,8 @@ public class MainApp extends Application {
private static MainApp sInstance;
public static Resources sResources;
private static FirebaseAnalytics mFirebaseAnalytics;
private static DatabaseHelper sDatabaseHelper = null;
private static ConstraintChecker sConstraintsChecker = null;
@ -142,6 +145,8 @@ public class MainApp extends Application {
log.error("Error with Fabric init! " + e);
}
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
JodaTimeAndroid.init(this);
log.info("Version: " + BuildConfig.VERSION_NAME);
@ -235,7 +240,6 @@ public class MainApp extends Application {
pluginsList.add(DstHelperPlugin.getPlugin());
ConfigBuilderPlugin.getPlugin().initialize();
}
@ -394,6 +398,11 @@ public class MainApp extends Application {
}
public static FirebaseAnalytics getFirebaseAnalytics() {
return mFirebaseAnalytics;
}
public static ConstraintChecker getConstraintChecker() {
return sConstraintsChecker;
}

View file

@ -72,8 +72,6 @@ public class GlucoseStatus {
return null;
}
sizeRecords = Math.min(sizeRecords, 9);
if (data.get(0).date < DateUtil.now() - 7 * 60 * 1000L && !allowOldData) {
return null;
}
@ -93,10 +91,14 @@ public class GlucoseStatus {
return status.round();
}
ArrayList<Double> now_value_list = new ArrayList<Double>();
ArrayList<Double> last_deltas = new ArrayList<Double>();
ArrayList<Double> short_deltas = new ArrayList<Double>();
ArrayList<Double> long_deltas = new ArrayList<Double>();
// Use the latest sgv value in the now calculations
now_value_list.add(now.value);
for (int i = 1; i < sizeRecords; i++) {
if (data.get(i).value > 38) {
BgReading then = data.get(i);
@ -111,8 +113,9 @@ public class GlucoseStatus {
// use the average of all data points in the last 2.5m for all further "now" calculations
if (0 < minutesago && minutesago < 2.5) {
now.value = (now.value + then.value) / 2;
now_date = (now_date + then_date) / 2;
// Keep and average all values within the last 2.5 minutes
now_value_list.add(then.value);
now.value = average(now_value_list);
// short_deltas are calculated from everything ~5-15 minutes ago
} else if (2.5 < minutesago && minutesago < 17.5) {
//console.error(minutesago, avgdelta);
@ -124,6 +127,9 @@ public class GlucoseStatus {
// long_deltas are calculated from everything ~20-40 minutes ago
} else if (17.5 < minutesago && minutesago < 42.5) {
long_deltas.add(avgdelta);
} else {
// Do not process any more records after >= 42.5 minutes
break;
}
}
}

View file

@ -20,7 +20,6 @@ import android.content.Context;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.support.annotation.Nullable;
import android.util.Log;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.dao.CloseableIterator;
@ -438,7 +437,6 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
public void run() {
if (L.isEnabled(L.DATABASE))
log.debug("Firing EventNewBg");
Log.d("DatabaseHelper", "WR: Firing EventNewBg");
MainApp.bus().post(new EventNewBG(bgReading));
scheduledBgPost = null;
}
@ -807,7 +805,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
public void createTemptargetFromJsonIfNotExists(JSONObject trJson) {
try {
String units = JsonHelper.safeGetString(trJson, "units", Constants.MGDL);
TempTarget tempTarget = new TempTarget().date(trJson.getLong("mills")).duration(trJson.getInt("duration"))
TempTarget tempTarget = new TempTarget().date(trJson.getLong("mills"))
.duration(JsonHelper.safeGetInt(trJson, "duration"))
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
.reason(JsonHelper.safeGetString(trJson, "reason", ""))._id(trJson.getString("_id"))

View file

@ -10,7 +10,6 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import butterknife.BindView;
@ -19,9 +18,9 @@ import butterknife.OnClick;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui;
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.utils.FabricPrivacy;
public class LoopFragment extends SubscriberFragment {
@ -62,7 +61,6 @@ public class LoopFragment extends SubscriberFragment {
void onRunClick() {
lastRunView.setText(MainApp.gs(R.string.executing));
new Thread(() -> LoopPlugin.getPlugin().invoke("Loop button", true)).start();
FabricPrivacy.getInstance().logCustom(new CustomEvent("Loop_Run"));
}
@Subscribe
@ -75,7 +73,11 @@ public class LoopFragment extends SubscriberFragment {
clearGUI();
final Activity activity = getActivity();
if (activity != null)
activity.runOnUiThread(() -> { synchronized (LoopFragment.this) { if (lastRunView != null) lastRunView.setText(ev.text); } });
activity.runOnUiThread(() -> {
synchronized (LoopFragment.this) {
if (lastRunView != null) lastRunView.setText(ev.text);
}
});
}

View file

@ -13,7 +13,6 @@ import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import org.slf4j.Logger;
@ -33,6 +32,7 @@ import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventAcceptOpenLoopChange;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.interfaces.APSInterface;
@ -44,18 +44,17 @@ import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui;
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui;
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
import info.nightscout.androidaps.events.EventAcceptOpenLoopChange;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.queue.commands.Command;
import info.nightscout.androidaps.utils.FabricPrivacy;
@ -179,11 +178,9 @@ public class LoopPlugin extends PluginBase {
@Subscribe
public void onStatusEvent(final EventTempTargetChange ev) {
new Thread(() -> invoke("EventTempTargetChange", true)).start();
FabricPrivacy.getInstance().logCustom(new CustomEvent("TT_Loop_Run"));
}
public void suspendTo(long endTime) {
loopSuspendedTill = endTime;
isSuperBolus = false;
@ -376,7 +373,7 @@ public class LoopPlugin extends PluginBase {
if (resultAfterConstraints.bolusRequested)
lastRun.smbSetByPump = waiting;
MainApp.bus().post(new EventLoopUpdateGui());
FabricPrivacy.getInstance().logCustom(new CustomEvent("APSRequest"));
FabricPrivacy.getInstance().logCustom("APSRequest");
applyTBRRequest(resultAfterConstraints, profile, new Callback() {
@Override
public void run() {
@ -395,7 +392,6 @@ public class LoopPlugin extends PluginBase {
SystemClock.sleep(1000);
LoopPlugin.getPlugin().invoke("tempBasalFallback", allowNotification, true);
}).start();
FabricPrivacy.getInstance().logCustom(new CustomEvent("Loop_Run_TempBasalFallback"));
}
MainApp.bus().post(new EventLoopUpdateGui());
}
@ -482,7 +478,7 @@ public class LoopPlugin extends PluginBase {
MainApp.bus().post(new EventAcceptOpenLoopChange());
}
});
FabricPrivacy.getInstance().logCustom(new CustomEvent("AcceptTemp"));
FabricPrivacy.getInstance().logCustom("AcceptTemp");
}
/**

View file

@ -8,7 +8,6 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import org.json.JSONArray;
@ -19,11 +18,10 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.JSONFormatter;
public class OpenAPSAMAFragment extends SubscriberFragment implements View.OnClickListener {
@ -68,7 +66,6 @@ public class OpenAPSAMAFragment extends SubscriberFragment implements View.OnCli
switch (view.getId()) {
case R.id.openapsma_run:
OpenAPSAMAPlugin.getPlugin().invoke("OpenAPSAMA button", false);
FabricPrivacy.getInstance().logCustom(new CustomEvent("OpenAPS_AMA_Run"));
break;
}

View file

@ -8,13 +8,12 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.JSONFormatter;
@ -61,7 +60,6 @@ public class OpenAPSMAFragment extends SubscriberFragment implements View.OnClic
switch (view.getId()) {
case R.id.openapsma_run:
OpenAPSMAPlugin.getPlugin().invoke("OpenAPSMA button", false);
FabricPrivacy.getInstance().logCustom(new CustomEvent("OpenAPS_MA_Run"));
break;
}

View file

@ -232,8 +232,13 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("max_daily_safety_multiplier", SP.getInt(R.string.key_openapsama_max_daily_safety_multiplier, 3));
mProfile.put("current_basal_safety_multiplier", SP.getDouble(R.string.key_openapsama_current_basal_safety_multiplier, 4d));
mProfile.put("high_temptarget_raises_sensitivity", SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity));
mProfile.put("low_temptarget_lowers_sensitivity", SP.getBoolean(R.string.key_low_temptarget_lowers_sensitivity, SMBDefaults.low_temptarget_lowers_sensitivity));
// TODO AS-FIX
// mProfile.put("high_temptarget_raises_sensitivity", SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity));
mProfile.put("high_temptarget_raises_sensitivity", false);
//mProfile.put("low_temptarget_lowers_sensitivity", SP.getBoolean(R.string.key_low_temptarget_lowers_sensitivity, SMBDefaults.low_temptarget_lowers_sensitivity));
mProfile.put("low_temptarget_lowers_sensitivity", false);
mProfile.put("sensitivity_raises_target", SMBDefaults.sensitivity_raises_target);
mProfile.put("resistance_lowers_target", SMBDefaults.resistance_lowers_target);
mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments);

View file

@ -8,7 +8,6 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import org.json.JSONArray;
@ -22,11 +21,10 @@ import butterknife.OnClick;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.JSONFormatter;
public class OpenAPSSMBFragment extends SubscriberFragment {
@ -69,7 +67,6 @@ public class OpenAPSSMBFragment extends SubscriberFragment {
@OnClick(R.id.openapsma_run)
public void onRunClick() {
OpenAPSSMBPlugin.getPlugin().invoke("OpenAPSSMB button", false);
FabricPrivacy.getInstance().logCustom(new CustomEvent("OpenAPS_SMB_Run"));
}
@Subscribe

View file

@ -16,8 +16,6 @@ import android.widget.RadioButton;
import android.widget.ScrollView;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import java.util.ArrayList;
import java.util.List;
@ -26,8 +24,8 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.activities.PreferencesActivity;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.activities.PreferencesActivity;
import info.nightscout.androidaps.events.EventConfigBuilderChange;
import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.APSInterface;
@ -42,7 +40,6 @@ import info.nightscout.androidaps.interfaces.SensitivityInterface;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.insulin.InsulinOrefRapidActingPlugin;
import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin;
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref0Plugin;
import info.nightscout.androidaps.utils.FabricPrivacy;
@ -276,7 +273,6 @@ public class ConfigBuilderFragment extends SubscriberFragment {
MainApp.bus().post(new EventRefreshGui());
MainApp.bus().post(new EventConfigBuilderChange());
ConfigBuilderPlugin.getPlugin().logPluginStatus();
FabricPrivacy.getInstance().logCustom(new CustomEvent("ConfigurationChange"));
}
public void cancel(){

View file

@ -1,9 +1,10 @@
package info.nightscout.androidaps.plugins.configBuilder;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.crashlytics.android.answers.CustomEvent;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.squareup.otto.Subscribe;
import org.slf4j.Logger;
@ -129,12 +130,12 @@ public class ProfileFunctions {
}
}
if (activeTreatments.getProfileSwitchesFromHistory().size() > 0) {
FabricPrivacy.getInstance().logCustom(new CustomEvent("CatchedError")
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION)
.putCustomAttribute("version", BuildConfig.VERSION)
.putCustomAttribute("time", time)
.putCustomAttribute("getProfileSwitchesFromHistory", activeTreatments.getProfileSwitchesFromHistory().toString())
);
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "CatchedError");
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, BuildConfig.BUILDVERSION);
bundle.putString(FirebaseAnalytics.Param.START_DATE, String.valueOf(time));
bundle.putString(FirebaseAnalytics.Param.VALUE, activeTreatments.getProfileSwitchesFromHistory().toString());
FabricPrivacy.getInstance().logCustom(bundle);
}
log.error("getProfile at the end: returning null");
return null;
@ -157,7 +158,6 @@ public class ProfileFunctions {
public static void doProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift) {
ProfileSwitch profileSwitch = prepareProfileSwitch(profileStore, profileName, duration, percentage, timeshift, System.currentTimeMillis());
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
}
public static void doProfileSwitch(final int duration, final int percentage, final int timeshift) {
@ -174,7 +174,6 @@ public class ProfileFunctions {
profileSwitch.timeshift = timeshift;
profileSwitch.percentage = percentage;
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
} else {
log.error("No profile switch existing");
}

View file

@ -16,7 +16,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import java.util.ArrayList;
@ -338,13 +337,11 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
case R.id.actions_extendedbolus_cancel:
if (TreatmentsPlugin.getPlugin().isInHistoryExtendedBoluslInProgress()) {
ConfigBuilderPlugin.getPlugin().getCommandQueue().cancelExtended(null);
FabricPrivacy.getInstance().logCustom(new CustomEvent("CancelExtended"));
}
break;
case R.id.actions_canceltempbasal:
if (TreatmentsPlugin.getPlugin().isTempBasalInProgress()) {
ConfigBuilderPlugin.getPlugin().getCommandQueue().cancelTempBasal(true, null);
FabricPrivacy.getInstance().logCustom(new CustomEvent("CancelTemp"));
}
break;
case R.id.actions_settempbasal:

View file

@ -19,7 +19,6 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.crashlytics.android.answers.CustomEvent;
import com.google.common.base.Joiner;
import org.slf4j.Logger;
@ -35,11 +34,10 @@ import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SafeParse;
@ -236,7 +234,6 @@ public class FillDialog extends DialogFragment implements OnClickListener {
}
}
});
FabricPrivacy.getInstance().logCustom(new CustomEvent("Fill"));
}
if (pumpSiteChangeCheckbox.isChecked())
NSUpload.uploadEvent(CareportalEvent.SITECHANGE, now(), notes);

View file

@ -10,8 +10,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,7 +21,6 @@ import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SafeParse;
@ -99,7 +96,6 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
}
}
});
FabricPrivacy.getInstance().logCustom(new CustomEvent("ExtendedBolus"));
}
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);

View file

@ -12,8 +12,6 @@ import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -28,7 +26,6 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SafeParse;
@ -167,7 +164,6 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
} else {
ConfigBuilderPlugin.getPlugin().getCommandQueue().tempBasalAbsolute(finalBasal, finalDurationInMinutes, true, profile, callback);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("TempBasal"));
}
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);

View file

@ -20,7 +20,6 @@ import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.google.common.collect.Lists;
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;
import com.wdullaer.materialdatetimepicker.time.RadialPickerLayout;
@ -48,14 +47,13 @@ import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.ProfileSwitch;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DefaultValueHelper;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.HardLimits;
import info.nightscout.androidaps.utils.JsonHelper;
import info.nightscout.androidaps.utils.NumberPicker;
@ -742,7 +740,6 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
tempTarget.low(0).high(0);
}
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
FabricPrivacy.getInstance().logCustom(new CustomEvent("TempTarget"));
}
} else {
if (JsonHelper.safeGetString(data, "eventType").equals(CareportalEvent.PROFILESWITCH)) {
@ -758,7 +755,6 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
} else {
NSUpload.uploadCareportalEntryToNS(data);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSTreatment"));
}
}

View file

@ -17,7 +17,6 @@ import android.widget.CompoundButton;
import android.widget.ScrollView;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.MainApp;
@ -91,11 +90,11 @@ public class NSClientFragment extends SubscriberFragment implements View.OnClick
switch (view.getId()) {
case R.id.nsclientinternal_restart:
MainApp.bus().post(new EventNSClientRestart());
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSClientRestart"));
FabricPrivacy.getInstance().logCustom("NSClientRestart");
break;
case R.id.nsclientinternal_delivernow:
NSClientPlugin.getPlugin().resend("GUI");
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSClientDeliverNow"));
FabricPrivacy.getInstance().logCustom("NSClientDeliverNow");
break;
case R.id.nsclientinternal_clearlog:
NSClientPlugin.getPlugin().clearLog();
@ -110,7 +109,7 @@ public class NSClientFragment extends SubscriberFragment implements View.OnClick
public void onClick(DialogInterface dialog, int id) {
UploadQueue.clearQueue();
updateGUI();
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSClientClearQueue"));
FabricPrivacy.getInstance().logCustom("NSClientClearQueue");
}
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);
@ -118,7 +117,6 @@ public class NSClientFragment extends SubscriberFragment implements View.OnClick
break;
case R.id.nsclientinternal_showqueue:
MainApp.bus().post(new EventNSClientNewLog("QUEUE", NSClientPlugin.getPlugin().queue().textList()));
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSClientShowQueue"));
break;
}
}
@ -129,7 +127,7 @@ public class NSClientFragment extends SubscriberFragment implements View.OnClick
case R.id.nsclientinternal_paused:
NSClientPlugin.getPlugin().pause(isChecked);
updateGUI();
FabricPrivacy.getInstance().logCustom(new CustomEvent("NSClientPause"));
FabricPrivacy.getInstance().logCustom("NSClientPause");
break;
case R.id.nsclientinternal_autoscroll:
SP.putBoolean(R.string.key_nsclientinternal_autoscroll, isChecked);

View file

@ -11,8 +11,6 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,7 +21,6 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.GlucoseStatus;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SafeParse;
import info.nightscout.androidaps.utils.XdripCalibrations;
@ -88,7 +85,6 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis
final Double bg = SafeParse.stringToDouble(bgNumber.getText());
XdripCalibrations.confirmAndSendCalibration(bg, context);
dismiss();
FabricPrivacy.getInstance().logCustom(new CustomEvent("Calibration"));
break;
case R.id.cancel:
dismiss();

View file

@ -20,7 +20,6 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.crashlytics.android.answers.CustomEvent;
import com.google.common.base.Joiner;
import org.slf4j.Logger;
@ -46,7 +45,6 @@ import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SafeParse;
@ -306,7 +304,6 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener
}
}
});
FabricPrivacy.getInstance().logCustom(new CustomEvent("Bolus"));
}
}
}

View file

@ -17,8 +17,6 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.CheckBox;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -36,7 +34,6 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SafeParse;
import info.nightscout.androidaps.utils.ToastUtils;
@ -194,7 +191,6 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("Bolus"));
}
}
}

View file

@ -26,7 +26,6 @@ import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import org.json.JSONException;
@ -66,7 +65,6 @@ import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.BolusWizard;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.NumberPicker;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SafeParse;
@ -398,7 +396,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("Wizard"));
}
}
}

View file

@ -1,20 +1,5 @@
package info.nightscout.androidaps.plugins.general.overview;
import static info.nightscout.androidaps.utils.DateUtil.now;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.NotificationManager;
@ -49,10 +34,22 @@ import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.jjoe64.graphview.GraphView;
import com.squareup.otto.Subscribe;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
@ -91,8 +88,8 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotifi
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
@ -130,8 +127,9 @@ import info.nightscout.androidaps.utils.SingleClickButton;
import info.nightscout.androidaps.utils.T;
import info.nightscout.androidaps.utils.ToastUtils;
public class OverviewFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener {
import static info.nightscout.androidaps.utils.DateUtil.now;
public class OverviewFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener {
private static Logger log = LoggerFactory.getLogger(L.OVERVIEW);
TextView timeView;
@ -199,27 +197,18 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
Handler sLoopHandler = new Handler();
Runnable sRefreshLoop = null;
public enum CHARTTYPE {
PRE,
BAS,
IOB,
COB,
DEV,
SEN,
DEVSLOPE
}
public enum CHARTTYPE {PRE, BAS, IOB, COB, DEV, SEN, DEVSLOPE}
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
private static ScheduledFuture<?> scheduledUpdate = null;
public OverviewFragment() {
super();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//check screen width
final DisplayMetrics dm = new DisplayMetrics();
@ -357,7 +346,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return view;
}
private void setupChartMenu(View view) {
chartButton = (ImageButton) view.findViewById(R.id.overview_chartMenuButton);
chartButton.setOnClickListener(v -> {
@ -379,59 +367,48 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.PRE.ordinal(), Menu.NONE, "Predictions");
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.prediction, null)),
0, s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.prediction, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showprediction", true));
}
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.BAS.ordinal(), Menu.NONE,
MainApp.gs(R.string.overview_show_basals));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.BAS.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_basals));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.basal, null)), 0,
s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.basal, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showbasals", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.IOB.ordinal(), Menu.NONE,
MainApp.gs(R.string.overview_show_iob));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.IOB.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_iob));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.iob, null)), 0,
s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.iob, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showiob", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.COB.ordinal(), Menu.NONE,
MainApp.gs(R.string.overview_show_cob));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.COB.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_cob));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.cob, null)), 0,
s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.cob, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showcob", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.DEV.ordinal(), Menu.NONE,
MainApp.gs(R.string.overview_show_deviations));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.DEV.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_deviations));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.deviations, null)), 0,
s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.deviations, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showdeviations", false));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.SEN.ordinal(), Menu.NONE,
MainApp.gs(R.string.overview_show_sensitivity));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.SEN.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_sensitivity));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.ratio, null)), 0,
s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.ratio, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showratios", false));
@ -440,15 +417,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.DEVSLOPE.ordinal(), Menu.NONE, "Deviation slope");
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.devslopepos, null)),
0, s.length(), 0);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.devslopepos, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showdevslope", false));
}
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == CHARTTYPE.PRE.ordinal()) {
@ -472,7 +447,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
});
chartButton.setImageResource(R.drawable.ic_arrow_drop_up_white_24dp);
popup.setOnDismissListener(new PopupMenu.OnDismissListener() {
@Override
public void onDismiss(PopupMenu menu) {
chartButton.setImageResource(R.drawable.ic_arrow_drop_down_white_24dp);
@ -488,8 +462,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
super.onCreateContextMenu(menu, v, menuInfo);
if (v == apsModeView) {
final LoopPlugin loopPlugin = LoopPlugin.getPlugin();
final PumpDescription pumpDescription = ConfigBuilderPlugin.getPlugin().getActivePump()
.getPumpDescription();
final PumpDescription pumpDescription =
ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription();
if (!ProfileFunctions.getInstance().isProfileValid("ContexMenuCreation"))
return;
menu.setHeaderTitle(MainApp.gs(R.string.loop));
@ -520,8 +494,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else if (v == activeProfileView) {
menu.setHeaderTitle(MainApp.gs(R.string.profile));
menu.add(MainApp.gs(R.string.danar_viewprofile));
if (ConfigBuilderPlugin.getPlugin().getActiveProfileInterface() != null
&& ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getProfile() != null) {
if (ConfigBuilderPlugin.getPlugin().getActiveProfileInterface() != null && ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getProfile() != null) {
menu.add(MainApp.gs(R.string.careportal_profileswitch));
}
} else if (v == tempTargetView) {
@ -536,8 +509,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
private void showSuspendtPump(ContextMenu menu, PumpDescription pumpDescription) {
private void showSuspendtPump(ContextMenu menu,
PumpDescription pumpDescription) {
if (pumpDescription.tempDurationStep15mAllowed)
menu.add(MainApp.gs(R.string.disconnectpumpfor15m));
if (pumpDescription.tempDurationStep30mAllowed)
@ -547,7 +520,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
menu.add(MainApp.gs(R.string.disconnectpumpfor3h));
}
@Override
public boolean onContextItemSelected(MenuItem item) {
final Profile profile = ProfileFunctions.getInstance().getProfile();
@ -560,12 +532,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
ConfigBuilderPlugin.getPlugin().storeSettings("DisablingLoop");
updateGUI("suspendmenu");
ConfigBuilderPlugin.getPlugin().getCommandQueue().cancelTempBasal(true, new Callback() {
@Override
public void run() {
if (!result.success) {
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(),
MainApp.gs(R.string.tempbasaldeliveryerror));
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.tempbasaldeliveryerror));
}
}
});
@ -578,17 +548,15 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
updateGUI("suspendmenu");
NSUpload.uploadOpenAPSOffline(0);
return true;
} else if (item.getTitle().equals(MainApp.gs(R.string.resume))
|| item.getTitle().equals(MainApp.gs(R.string.reconnect))) {
} else if (item.getTitle().equals(MainApp.gs(R.string.resume)) ||
item.getTitle().equals(MainApp.gs(R.string.reconnect))) {
loopPlugin.suspendTo(0L);
updateGUI("suspendmenu");
ConfigBuilderPlugin.getPlugin().getCommandQueue().cancelTempBasal(true, new Callback() {
@Override
public void run() {
if (!result.success) {
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(),
MainApp.gs(R.string.tempbasaldeliveryerror));
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.tempbasaldeliveryerror));
}
}
});
@ -643,23 +611,34 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else if (item.getTitle().equals(MainApp.gs(R.string.eatingsoon))) {
DefaultValueHelper defHelper = new DefaultValueHelper();
double target = defHelper.determineEatingSoonTT(profile.getUnits());
TempTarget tempTarget = new TempTarget().date(System.currentTimeMillis())
.duration(defHelper.determineEatingSoonTTDuration()).reason(MainApp.gs(R.string.eatingsoon))
.source(Source.USER).low(Profile.toMgdl(target, profile.getUnits()))
TempTarget tempTarget = new TempTarget()
.date(System.currentTimeMillis())
.duration(defHelper.determineEatingSoonTTDuration())
.reason(MainApp.gs(R.string.eatingsoon))
.source(Source.USER)
.low(Profile.toMgdl(target, profile.getUnits()))
.high(Profile.toMgdl(target, profile.getUnits()));
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
} else if (item.getTitle().equals(MainApp.gs(R.string.activity))) {
DefaultValueHelper defHelper = new DefaultValueHelper();
double target = defHelper.determineActivityTT(profile.getUnits());
TempTarget tempTarget = new TempTarget().date(now()).duration(defHelper.determineActivityTTDuration())
.reason(MainApp.gs(R.string.activity)).source(Source.USER)
.low(Profile.toMgdl(target, profile.getUnits())).high(Profile.toMgdl(target, profile.getUnits()));
TempTarget tempTarget = new TempTarget()
.date(now())
.duration(defHelper.determineActivityTTDuration())
.reason(MainApp.gs(R.string.activity))
.source(Source.USER)
.low(Profile.toMgdl(target, profile.getUnits()))
.high(Profile.toMgdl(target, profile.getUnits()));
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
} else if (item.getTitle().equals(MainApp.gs(R.string.hypo))) {
DefaultValueHelper defHelper = new DefaultValueHelper();
double target = defHelper.determineHypoTT(profile.getUnits());
TempTarget tempTarget = new TempTarget().date(now()).duration(defHelper.determineHypoTTDuration())
.reason(MainApp.gs(R.string.hypo)).source(Source.USER).low(Profile.toMgdl(target, profile.getUnits()))
TempTarget tempTarget = new TempTarget()
.date(now())
.duration(defHelper.determineHypoTTDuration())
.reason(MainApp.gs(R.string.hypo))
.source(Source.USER)
.low(Profile.toMgdl(target, profile.getUnits()))
.high(Profile.toMgdl(target, profile.getUnits()));
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
} else if (item.getTitle().equals(MainApp.gs(R.string.custom))) {
@ -669,14 +648,18 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
newTTDialog.setOptions(temptarget, R.string.careportal_temporarytarget);
newTTDialog.show(getFragmentManager(), "NewNSTreatmentDialog");
} else if (item.getTitle().equals(MainApp.gs(R.string.cancel))) {
TempTarget tempTarget = new TempTarget().source(Source.USER).date(now()).duration(0).low(0).high(0);
TempTarget tempTarget = new TempTarget()
.source(Source.USER)
.date(now())
.duration(0)
.low(0)
.high(0);
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
}
return super.onContextItemSelected(item);
}
@Override
public void onClick(View v) {
boolean xdrip = SourceXdripPlugin.getPlugin().isEnabled(PluginType.BGSOURCE);
@ -685,8 +668,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
String units = ProfileFunctions.getInstance().getProfileUnits();
FragmentManager manager = getFragmentManager();
// try to fix
// https://fabric.io/nightscout3/android/apps/info.nightscout.androidaps/issues/5aca7a1536c7b23527eb4be7?time=last-seven-days
// try to fix https://fabric.io/nightscout3/android/apps/info.nightscout.androidaps/issues/5aca7a1536c7b23527eb4be7?time=last-seven-days
// https://stackoverflow.com/questions/14860239/checking-if-state-is-saved-before-committing-a-fragmenttransaction
if (manager.isStateSaved())
return;
@ -737,15 +719,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
new NewCarbsDialog().show(manager, "CarbsDialog");
break;
case R.id.overview_pumpstatus:
if (ConfigBuilderPlugin.getPlugin().getActivePump().isSuspended()
|| !ConfigBuilderPlugin.getPlugin().getActivePump().isInitialized())
if (ConfigBuilderPlugin.getPlugin().getActivePump().isSuspended() || !ConfigBuilderPlugin.getPlugin().getActivePump().isInitialized())
ConfigBuilderPlugin.getPlugin().getCommandQueue().readStatus("RefreshClicked", null);
break;
}
}
public boolean openCgmApp(String packageName) {
PackageManager packageManager = getContext().getPackageManager();
try {
@ -757,13 +737,14 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
getContext().startActivity(intent);
return true;
} catch (ActivityNotFoundException e) {
new AlertDialog.Builder(getContext()).setMessage(R.string.error_starting_cgm).setPositiveButton("OK", null)
new AlertDialog.Builder(getContext())
.setMessage(R.string.error_starting_cgm)
.setPositiveButton("OK", null)
.show();
return false;
}
}
@Override
public boolean onLongClick(View v) {
switch (v.getId()) {
@ -775,19 +756,16 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return false;
}
private void onClickAcceptTemp() {
Profile profile = ProfileFunctions.getInstance().getProfile();
Context context = getContext();
if (context == null)
return;
if (context == null) return;
if (LoopPlugin.getPlugin().isEnabled(PluginType.LOOP) && profile != null) {
LoopPlugin.getPlugin().invoke("Accept temp button", false);
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
if (finalLastRun != null && finalLastRun.lastAPSRun != null
&& finalLastRun.constraintsProcessed.isChangeRequested()) {
if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.isChangeRequested()) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.gs(R.string.confirmation));
builder.setMessage(MainApp.gs(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed);
@ -802,7 +780,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
void onClickQuickwizard() {
final BgReading actualBg = DatabaseHelper.actualBg();
final Profile profile = ProfileFunctions.getInstance().getProfile();
@ -839,21 +816,16 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
String confirmMessage = MainApp.gs(R.string.entertreatmentquestion);
Double insulinAfterConstraints = MainApp.getConstraintChecker()
.applyBolusConstraints(new Constraint<>(wizard.calculatedTotalInsulin)).value();
Integer carbsAfterConstraints = MainApp.getConstraintChecker()
.applyCarbsConstraints(new Constraint<>(quickWizardEntry.carbs())).value();
Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(wizard.calculatedTotalInsulin)).value();
Integer carbsAfterConstraints = MainApp.getConstraintChecker().applyCarbsConstraints(new Constraint<>(quickWizardEntry.carbs())).value();
confirmMessage += "\n" + MainApp.gs(R.string.bolus) + ": "
+ formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + MainApp.gs(R.string.bolus) + ": " + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + MainApp.gs(R.string.carbs) + ": " + carbsAfterConstraints + "g";
if (Math.abs(insulinAfterConstraints - wizard.calculatedTotalInsulin) >= 0.01
|| !carbsAfterConstraints.equals(quickWizardEntry.carbs())) {
if (Math.abs(insulinAfterConstraints - wizard.calculatedTotalInsulin) >= 0.01 || !carbsAfterConstraints.equals(quickWizardEntry.carbs())) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(MainApp.gs(R.string.treatmentdeliveryerror));
builder.setMessage(MainApp.gs(R.string.constraints_violation) + "\n"
+ MainApp.gs(R.string.changeyourinput));
builder.setMessage(MainApp.gs(R.string.constraints_violation) + "\n" + MainApp.gs(R.string.changeyourinput));
builder.setPositiveButton(MainApp.gs(R.string.ok), null);
builder.show();
return;
@ -866,9 +838,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
accepted = false;
builder.setTitle(MainApp.gs(R.string.confirmation));
builder.setMessage(confirmMessage);
builder.setPositiveButton(
MainApp.gs(R.string.ok),
(dialog, id) -> {
builder.setPositiveButton(MainApp.gs(R.string.ok), (dialog, id) -> {
synchronized (builder) {
if (accepted) {
if (L.isEnabled(L.OVERVIEW))
@ -876,17 +846,14 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return;
}
accepted = true;
if (Math.abs(insulinAfterConstraints - wizard.calculatedTotalInsulin) >= 0.01
|| finalCarbsAfterConstraints > 0) {
if (Math.abs(insulinAfterConstraints - wizard.calculatedTotalInsulin) >= 0.01 || finalCarbsAfterConstraints > 0) {
if (wizard.superBolus) {
final LoopPlugin loopPlugin = LoopPlugin.getPlugin();
if (loopPlugin.isEnabled(PluginType.LOOP)) {
loopPlugin.superBolusTo(System.currentTimeMillis() + T.hours(2).msecs());
MainApp.bus().post(new EventRefreshOverview("WizardDialog"));
}
ConfigBuilderPlugin.getPlugin().getCommandQueue()
.tempBasalPercent(0, 120, true, profile, new Callback() {
ConfigBuilderPlugin.getPlugin().getCommandQueue().tempBasalPercent(0, 120, true, profile, new Callback() {
@Override
public void run() {
if (!result.success) {
@ -907,11 +874,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
detailedBolusInfo.context = context;
detailedBolusInfo.boluscalc = boluscalcJSON;
detailedBolusInfo.source = Source.USER;
if (finalInsulinAfterConstraints > 0
|| ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().storesCarbInfo) {
ConfigBuilderPlugin.getPlugin().getCommandQueue()
.bolus(detailedBolusInfo, new Callback() {
if (finalInsulinAfterConstraints > 0 || ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().storesCarbInfo) {
ConfigBuilderPlugin.getPlugin().getCommandQueue().bolus(detailedBolusInfo, new Callback() {
@Override
public void run() {
if (!result.success) {
@ -927,7 +891,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
}
}
});
@ -938,7 +901,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
@Override
public void onPause() {
super.onPause();
@ -949,7 +911,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
unregisterForContextMenu(tempTargetView);
}
@Override
public void onResume() {
super.onResume();
@ -965,79 +926,66 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
updateGUI("onResume");
}
@Subscribe
public void onStatusEvent(final EventInitializationChanged ev) {
scheduleUpdateGUI("EventInitializationChanged");
}
@Subscribe
public void onStatusEvent(final EventPreferenceChange ev) {
scheduleUpdateGUI("EventPreferenceChange");
}
@Subscribe
public void onStatusEvent(final EventRefreshOverview ev) {
scheduleUpdateGUI(ev.from);
}
@Subscribe
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
scheduleUpdateGUI("EventAutosensCalculationFinished");
}
@Subscribe
public void onStatusEvent(final EventTreatmentChange ev) {
scheduleUpdateGUI("EventTreatmentChange");
}
@Subscribe
public void onStatusEvent(final EventCareportalEventChange ev) {
scheduleUpdateGUI("EventCareportalEventChange");
}
@Subscribe
public void onStatusEvent(final EventTempBasalChange ev) {
scheduleUpdateGUI("EventTempBasalChange");
}
@Subscribe
public void onStatusEvent(final EventExtendedBolusChange ev) {
scheduleUpdateGUI("EventExtendedBolusChange");
}
@Subscribe
public void onStatusEvent(final EventNewOpenLoopNotification ev) {
scheduleUpdateGUI("EventNewOpenLoopNotification");
}
@Subscribe
public void onStatusEvent(final EventAcceptOpenLoopChange ev) {
scheduleUpdateGUI("EventAcceptOpenLoopChange");
}
@Subscribe
public void onStatusEvent(final EventTempTargetChange ev) {
scheduleUpdateGUI("EventTempTargetChange");
}
@Subscribe
public void onStatusEvent(final EventProfileSwitchChange ev) {
scheduleUpdateGUI("EventProfileSwitchChange");
}
@Subscribe
public void onStatusEvent(final EventPumpStatusChanged s) {
Activity activity = getActivity();
@ -1045,7 +993,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
activity.runOnUiThread(() -> updatePumpStatus(s.textStatus()));
}
@Subscribe
public void onStatusEvent(final EventIobCalculationProgress e) {
Activity activity = getActivity();
@ -1056,7 +1003,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
});
}
private void hideTempRecommendation() {
Activity activity = getActivity();
if (activity != null)
@ -1066,16 +1012,14 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
});
}
private void clearNotification() {
NotificationManager notificationManager = (NotificationManager)MainApp.instance().getSystemService(
Context.NOTIFICATION_SERVICE);
NotificationManager notificationManager =
(NotificationManager) MainApp.instance().getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.notificationID);
ActionStringHandler.handleInitiate("cancelChangeRequest");
}
private void updatePumpStatus(String status) {
if (!status.equals("")) {
pumpStatusView.setText(status);
@ -1087,10 +1031,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
public void scheduleUpdateGUI(final String from) {
class UpdateRunnable implements Runnable {
public void run() {
Activity activity = getActivity();
if (activity != null)
@ -1109,7 +1051,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
scheduledUpdate = worker.schedule(task, msec, TimeUnit.MILLISECONDS);
}
@SuppressLint("SetTextI18n")
public void updateGUI(final String from) {
if (L.isEnabled(L.OVERVIEW))
@ -1162,19 +1103,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
if (glucoseStatus != null) {
if (deltaView != null)
deltaView.setText("Δ "
+ Profile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL,
units) + " " + units);
deltaView.setText("Δ " + Profile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units);
if (deltaShortView != null)
deltaShortView.setText(Profile.toSignedUnitsString(glucoseStatus.delta, glucoseStatus.delta
* Constants.MGDL_TO_MMOLL, units));
deltaShortView.setText(Profile.toSignedUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units));
if (avgdeltaView != null)
avgdeltaView.setText("øΔ15m: "
+ Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta
* Constants.MGDL_TO_MMOLL, units)
+ " øΔ40m: "
+ Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta
* Constants.MGDL_TO_MMOLL, units));
avgdeltaView.setText("øΔ15m: " + Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) +
" øΔ40m: " + Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units));
} else {
if (deltaView != null)
deltaView.setText("Δ " + MainApp.gs(R.string.notavailable));
@ -1268,14 +1202,11 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
// **** Calibration & CGM buttons ****
boolean xDripIsBgSource = MainApp.getSpecificPlugin(SourceXdripPlugin.class) != null
&& MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginType.BGSOURCE);
boolean g5IsBgSource = MainApp.getSpecificPlugin(SourceDexcomG5Plugin.class) != null
&& MainApp.getSpecificPlugin(SourceDexcomG5Plugin.class).isEnabled(PluginType.BGSOURCE);
boolean xDripIsBgSource = MainApp.getSpecificPlugin(SourceXdripPlugin.class) != null && MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginType.BGSOURCE);
boolean g5IsBgSource = MainApp.getSpecificPlugin(SourceDexcomG5Plugin.class) != null && MainApp.getSpecificPlugin(SourceDexcomG5Plugin.class).isEnabled(PluginType.BGSOURCE);
boolean bgAvailable = DatabaseHelper.actualBg() != null;
if (calibrationButton != null) {
if ((xDripIsBgSource || g5IsBgSource) && bgAvailable
&& SP.getBoolean(R.string.key_show_calibration_button, true)) {
if ((xDripIsBgSource || g5IsBgSource) && bgAvailable && SP.getBoolean(R.string.key_show_calibration_button, true)) {
calibrationButton.setVisibility(View.VISIBLE);
} else {
calibrationButton.setVisibility(View.GONE);
@ -1291,8 +1222,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
final TemporaryBasal activeTemp = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(
System.currentTimeMillis());
final TemporaryBasal activeTemp = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(System.currentTimeMillis());
String basalText = "";
if (shorttextmode) {
if (activeTemp != null) {
@ -1301,8 +1231,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
basalText = DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h";
}
baseBasalView.setOnClickListener(v -> {
String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": "
+ DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h\n";
String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": " + DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h\n";
if (activeTemp != null) {
fullText += MainApp.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
}
@ -1328,8 +1257,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
baseBasalView.setText(basalText);
final ExtendedBolus extendedBolus = TreatmentsPlugin.getPlugin().getExtendedBolusFromHistory(
System.currentTimeMillis());
final ExtendedBolus extendedBolus = TreatmentsPlugin.getPlugin().getExtendedBolusFromHistory(System.currentTimeMillis());
String extendedBolusText = "";
if (extendedBolusView != null) { // must not exists in all layouts
if (shorttextmode) {
@ -1343,8 +1271,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
extendedBolusView.setText(extendedBolusText);
if (Config.NSCLIENT) {
extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(),
MainApp.gs(R.string.extendedbolus), extendedBolus.toString(), null));
extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.extendedbolus), extendedBolus.toString(), null));
}
if (extendedBolusText.equals(""))
extendedBolusView.setVisibility(Config.NSCLIENT ? View.INVISIBLE : View.GONE);
@ -1365,8 +1292,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
QuickWizardEntry quickWizardEntry = OverviewPlugin.getPlugin().quickWizard.getActive();
if (quickWizardEntry != null && lastBG != null && pump.isInitialized() && !pump.isSuspended()) {
quickWizardButton.setVisibility(View.VISIBLE);
String text = quickWizardEntry.buttonText() + "\n" + DecimalFormatter.to0Decimal(quickWizardEntry.carbs())
+ "g";
String text = quickWizardEntry.buttonText() + "\n" + DecimalFormatter.to0Decimal(quickWizardEntry.carbs()) + "g";
BolusWizard wizard = quickWizardEntry.doCalc(profile, tempTarget, lastBG, false);
text += " " + DecimalFormatter.toPumpSupportedBolus(wizard.calculatedTotalInsulin) + "U";
quickWizardButton.setText(text);
@ -1378,8 +1304,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
// **** Various treatment buttons ****
if (carbsButton != null) {
if (SP.getBoolean(R.string.key_show_carbs_button, true)
&& (!ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().storesCarbInfo || (pump
.isInitialized() && !pump.isSuspended()))) {
&& (!ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().storesCarbInfo ||
(pump.isInitialized() && !pump.isSuspended()))) {
carbsButton.setVisibility(View.VISIBLE);
} else {
carbsButton.setVisibility(View.GONE);
@ -1448,8 +1374,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
iobView.setText(iobtext);
} else {
String iobtext = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
+ DecimalFormatter.to2Decimal(bolusIob.iob) + "/" + DecimalFormatter.to2Decimal(basalIob.basaliob)
+ ")";
+ DecimalFormatter.to2Decimal(bolusIob.iob) + "/"
+ DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
iobView.setText(iobtext);
}
@ -1490,8 +1416,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (iageView != null) {
careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(CareportalEvent.INSULINCHANGE);
double insulinAge = careportalEvent != null ? careportalEvent.getHoursFromStart()
: Double.MAX_VALUE;
double insulinAge = careportalEvent != null ? careportalEvent.getHoursFromStart() : Double.MAX_VALUE;
applyStatuslight(iageView, "INS", insulinAge, iageWarn, iageUrgent, Double.MAX_VALUE, true);
}
@ -1528,22 +1453,19 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
// pump status from ns
if (pumpDeviceStatusView != null) {
pumpDeviceStatusView.setText(NSDeviceStatus.getInstance().getPumpStatus());
pumpDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.pump),
NSDeviceStatus.getInstance().getExtendedPumpStatus(), null));
pumpDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.pump), NSDeviceStatus.getInstance().getExtendedPumpStatus(), null));
}
// OpenAPS status from ns
if (openapsDeviceStatusView != null) {
openapsDeviceStatusView.setText(NSDeviceStatus.getInstance().getOpenApsStatus());
openapsDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.openaps),
NSDeviceStatus.getInstance().getExtendedOpenApsStatus(), null));
openapsDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.openaps), NSDeviceStatus.getInstance().getExtendedOpenApsStatus(), null));
}
// Uploader status from ns
if (uploaderDeviceStatusView != null) {
uploaderDeviceStatusView.setText(NSDeviceStatus.getInstance().getUploaderStatusSpanned());
uploaderDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(),
MainApp.gs(R.string.uploader), NSDeviceStatus.getInstance().getExtendedUploaderStatus(), null));
uploaderDeviceStatusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.uploader), NSDeviceStatus.getInstance().getExtendedUploaderStatus(), null));
}
// Sensitivity
@ -1582,18 +1504,17 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
predHours = Math.min(2, predHours);
predHours = Math.max(0, predHours);
hoursToFetch = rangeToDisplay - predHours;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview
// specific
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - T.hours(hoursToFetch).msecs();
endTime = toTime + T.hours(predHours).msecs();
} else {
hoursToFetch = rangeToDisplay;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview
// specific
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - T.hours(hoursToFetch).msecs();
endTime = toTime;
}
final long now = System.currentTimeMillis();
// ------------------ 1st graph
@ -1607,7 +1528,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
// **** BG ****
if (finalPredictionsAvailable && SP.getBoolean("showprediction", false))
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, apsResult.getPredictions());
graphData.addBgReadings(fromTime, toTime, lowLine, highLine,
apsResult.getPredictions());
else
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, null);
@ -1672,8 +1594,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
FragmentActivity activity = getActivity();
if (activity != null) {
activity.runOnUiThread(() -> {
if (SP.getBoolean("showiob", true) || SP.getBoolean("showcob", true)
|| SP.getBoolean("showdeviations", false) || SP.getBoolean("showratios", false)
if (SP.getBoolean("showiob", true)
|| SP.getBoolean("showcob", true)
|| SP.getBoolean("showdeviations", false)
|| SP.getBoolean("showratios", false)
|| SP.getBoolean("showdevslope", false)) {
iobGraph.setVisibility(View.VISIBLE);
} else {
@ -1692,7 +1616,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
Profiler.log(log, from, updateGUIStart);
}
//Notifications
void updateNotifications() {

View file

@ -729,7 +729,7 @@ public class SmsCommunicatorPlugin extends PluginBase {
String passCode = generatePasscode();
String reply = String.format(MainApp.gs(R.string.smscommunicator_calibrationreplywithcode), cal, passCode);
receivedSms.processed = true;
messageToConfirm = new AuthRequest(this, receivedSms, reply, passCode, new SmsAction() {
messageToConfirm = new AuthRequest(this, receivedSms, reply, passCode, new SmsAction(cal) {
@Override
public void run() {
boolean result = XdripCalibrations.sendIntent(aDouble);

View file

@ -1,5 +1,14 @@
package info.nightscout.androidaps.plugins.iob.iobCobCalculator;
import static info.nightscout.androidaps.utils.DateUtil.now;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@ -7,13 +16,6 @@ import android.support.v4.util.LongSparseArray;
import com.squareup.otto.Subscribe;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -31,27 +33,27 @@ import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin;
import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.T;
import static info.nightscout.androidaps.utils.DateUtil.now;
/**
* Created by mike on 24.04.2017.
*/
public class IobCobCalculatorPlugin extends PluginBase {
private Logger log = LoggerFactory.getLogger(L.AUTOSENS);
private static IobCobCalculatorPlugin plugin = null;
public static IobCobCalculatorPlugin getPlugin() {
if (plugin == null)
plugin = new IobCobCalculatorPlugin();
@ -70,44 +72,47 @@ public class IobCobCalculatorPlugin extends PluginBase {
boolean stopCalculationTrigger = false;
private Thread thread = null;
public IobCobCalculatorPlugin() {
super(new PluginDescription()
.mainType(PluginType.GENERAL)
.pluginName(R.string.iobcobcalculator)
.showInList(false)
.neverVisible(true)
.alwaysEnabled(true)
);
super(new PluginDescription().mainType(PluginType.GENERAL).pluginName(R.string.iobcobcalculator)
.showInList(false).neverVisible(true).alwaysEnabled(true));
}
@Override
protected void onStart() {
MainApp.bus().register(this);
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
MainApp.bus().unregister(this);
}
public LongSparseArray<AutosensData> getAutosensDataTable() {
return autosensDataTable;
}
public List<BgReading> getBgReadings() {
return bgReadings;
}
public void setBgReadings(List<BgReading> bgReadings) {
this.bgReadings = bgReadings;
}
public List<BgReading> getBucketedData() {
return bucketed_data;
}
// roundup to whole minute
public static long roundUpTime(long time) {
if (time % 60000 == 0)
@ -116,24 +121,30 @@ public class IobCobCalculatorPlugin extends PluginBase {
return rounded;
}
void loadBgData(long to) {
Profile profile = ProfileFunctions.getInstance().getProfile(to);
double dia = Constants.defaultDIA;
if (profile != null) dia = profile.getDia();
if (profile != null)
dia = profile.getDia();
long start = to - T.hours((long)(24 + dia)).msecs();
if (DateUtil.isCloseToNow(to)) {
// if close to now expect there can be some readings with time in close future (caused by wrong time setting)
// if close to now expect there can be some readings with time in close future (caused by wrong time
// setting)
// so read all records
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(start, false);
if (L.isEnabled(L.AUTOSENS))
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: " + DateUtil.dateAndTimeString(start));
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: "
+ DateUtil.dateAndTimeString(start));
} else {
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(start, to, false);
if (L.isEnabled(L.AUTOSENS))
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: " + DateUtil.dateAndTimeString(start) + " End date: " + DateUtil.dateAndTimeString(to));
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: "
+ DateUtil.dateAndTimeString(start) + " End date: " + DateUtil.dateAndTimeString(to));
}
}
public boolean isAbout5minData() {
synchronized (dataLock) {
if (bgReadings == null || bgReadings.size() < 3) {
@ -151,18 +162,21 @@ public class IobCobCalculatorPlugin extends PluginBase {
diff = Math.abs(diff);
if (diff > T.secs(30).msecs()) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Interval detection: values: " + bgReadings.size() + " diff: " + (diff / 1000) + "[s] is5minData: " + false);
log.debug("Interval detection: values: " + bgReadings.size() + " diff: " + (diff / 1000)
+ "[s] is5minData: " + false);
return false;
}
}
long averageDiff = totalDiff / bgReadings.size() / 1000;
boolean is5mindata = averageDiff < 1;
if (L.isEnabled(L.AUTOSENS))
log.debug("Interval detection: values: " + bgReadings.size() + " averageDiff: " + averageDiff + "[s] is5minData: " + is5mindata);
log.debug("Interval detection: values: " + bgReadings.size() + " averageDiff: " + averageDiff
+ "[s] is5minData: " + is5mindata);
return is5mindata;
}
}
public void createBucketedData() {
if (isAbout5minData())
createBucketedData5min();
@ -170,32 +184,43 @@ public class IobCobCalculatorPlugin extends PluginBase {
createBucketedDataRecalculated();
}
@Nullable
public BgReading findNewer(long time) {
BgReading lastFound = bgReadings.get(0);
if (lastFound.date < time) return null;
if (lastFound.date < time)
return null;
for (int i = 1; i < bgReadings.size(); ++i) {
if (bgReadings.get(i).date == time) return bgReadings.get(i);
if (bgReadings.get(i).date > time) continue;
if (bgReadings.get(i).date == time)
return bgReadings.get(i);
if (bgReadings.get(i).date > time)
continue;
lastFound = bgReadings.get(i - 1);
if (bgReadings.get(i).date < time) break;
if (bgReadings.get(i).date < time)
break;
}
return lastFound;
}
@Nullable
public BgReading findOlder(long time) {
BgReading lastFound = bgReadings.get(bgReadings.size() - 1);
if (lastFound.date > time) return null;
if (lastFound.date > time)
return null;
for (int i = bgReadings.size() - 2; i >= 0; --i) {
if (bgReadings.get(i).date == time) return bgReadings.get(i);
if (bgReadings.get(i).date < time) continue;
if (bgReadings.get(i).date == time)
return bgReadings.get(i);
if (bgReadings.get(i).date < time)
continue;
lastFound = bgReadings.get(i + 1);
if (bgReadings.get(i).date > time) break;
if (bgReadings.get(i).date > time)
break;
}
return lastFound;
}
private void createBucketedDataRecalculated() {
if (bgReadings == null || bgReadings.size() < 3) {
bucketed_data = null;
@ -224,7 +249,9 @@ public class IobCobCalculatorPlugin extends PluginBase {
newBgreading.date = currentTime;
newBgreading.value = Math.round(currentBg);
bucketed_data.add(newBgreading);
//log.debug("BG: " + newBgreading.value + " (" + new Date(newBgreading.date).toLocaleString() + ") Prev: " + older.value + " (" + new Date(older.date).toLocaleString() + ") Newer: " + newer.value + " (" + new Date(newer.date).toLocaleString() + ")");
// log.debug("BG: " + newBgreading.value + " (" + new Date(newBgreading.date).toLocaleString() +
// ") Prev: " + older.value + " (" + new Date(older.date).toLocaleString() + ") Newer: " + newer.value +
// " (" + new Date(newer.date).toLocaleString() + ")");
}
currentTime -= T.mins(5).msecs();
@ -241,12 +268,14 @@ public class IobCobCalculatorPlugin extends PluginBase {
bucketed_data = new ArrayList<>();
bucketed_data.add(bgReadings.get(0));
if (L.isEnabled(L.AUTOSENS))
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgReadings.get(0).date) + " lastbgTime: " + "none-first-value" + " " + bgReadings.get(0).toString());
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgReadings.get(0).date) + " lastbgTime: "
+ "none-first-value" + " " + bgReadings.get(0).toString());
int j = 0;
for (int i = 1; i < bgReadings.size(); ++i) {
long bgTime = bgReadings.get(i).date;
long lastbgTime = bgReadings.get(i - 1).date;
//log.error("Processing " + i + ": " + new Date(bgTime).toString() + " " + bgReadings.get(i).value + " Previous: " + new Date(lastbgTime).toString() + " " + bgReadings.get(i - 1).value);
// log.error("Processing " + i + ": " + new Date(bgTime).toString() + " " + bgReadings.get(i).value +
// " Previous: " + new Date(lastbgTime).toString() + " " + bgReadings.get(i - 1).value);
if (bgReadings.get(i).value < 39 || bgReadings.get(i - 1).value < 39) {
throw new IllegalStateException("<39");
}
@ -270,7 +299,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
// console.error("Interpolated", bucketed_data[j]);
bucketed_data.add(newBgreading);
if (L.isEnabled(L.AUTOSENS))
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: " + DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: "
+ DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
elapsed_minutes = elapsed_minutes - 5;
lastbg = nextbg;
@ -282,7 +312,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
newBgreading.date = bgTime;
bucketed_data.add(newBgreading);
if (L.isEnabled(L.AUTOSENS))
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: " + DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: "
+ DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
} else if (Math.abs(elapsed_minutes) > 2) {
j++;
BgReading newBgreading = new BgReading();
@ -290,7 +321,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
newBgreading.date = bgTime;
bucketed_data.add(newBgreading);
if (L.isEnabled(L.AUTOSENS))
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: " + DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
log.debug("Adding. bgTime: " + DateUtil.toISOString(bgTime) + " lastbgTime: "
+ DateUtil.toISOString(lastbgTime) + " " + newBgreading.toString());
} else {
bucketed_data.get(j).value = (bucketed_data.get(j).value + bgReadings.get(i).value) / 2;
// log.error("***** Average");
@ -304,7 +336,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
long msecDiff = current.date - previous.date;
long adjusted = (msecDiff - T.mins(5).msecs()) / 1000;
if (L.isEnabled(L.AUTOSENS))
log.debug("Adjusting bucketed data time. Current: " + DateUtil.toISOString(current.date) + " to: " + DateUtil.toISOString(previous.date + T.mins(5).msecs()) + " by " + adjusted + " sec");
log.debug("Adjusting bucketed data time. Current: " + DateUtil.toISOString(current.date) + " to: "
+ DateUtil.toISOString(previous.date + T.mins(5).msecs()) + " by " + adjusted + " sec");
if (Math.abs(adjusted) > 90) {
// too big adjustment, fallback to non 5 min data
if (L.isEnabled(L.AUTOSENS))
@ -319,10 +352,12 @@ public class IobCobCalculatorPlugin extends PluginBase {
log.debug("Bucketed data created. Size: " + bucketed_data.size());
}
public long calculateDetectionStart(long from, boolean limitDataToOldestAvailable) {
Profile profile = ProfileFunctions.getInstance().getProfile(from);
double dia = Constants.defaultDIA;
if (profile != null) dia = profile.getDia();
if (profile != null)
dia = profile.getDia();
long oldestDataAvailable = TreatmentsPlugin.getPlugin().oldestDataAvailable();
long getBGDataFrom;
@ -330,18 +365,21 @@ public class IobCobCalculatorPlugin extends PluginBase {
getBGDataFrom = Math.max(oldestDataAvailable, (long)(from - T.hours(1).msecs() * (24 + dia)));
if (getBGDataFrom == oldestDataAvailable)
if (L.isEnabled(L.AUTOSENS))
log.debug("Limiting data to oldest available temps: " + DateUtil.dateAndTimeFullString(oldestDataAvailable));
log.debug("Limiting data to oldest available temps: "
+ DateUtil.dateAndTimeFullString(oldestDataAvailable));
} else
getBGDataFrom = (long)(from - T.hours(1).msecs() * (24 + dia));
return getBGDataFrom;
}
public IobTotal calculateFromTreatmentsAndTempsSynchronized(long time, Profile profile) {
synchronized (dataLock) {
return calculateFromTreatmentsAndTemps(time, profile);
}
}
public IobTotal calculateFromTreatmentsAndTemps(long time, Profile profile) {
long now = System.currentTimeMillis();
time = roundUpTime(time);
@ -352,14 +390,12 @@ public class IobCobCalculatorPlugin extends PluginBase {
// log.debug(">>> calculateFromTreatmentsAndTemps Cache miss " + new Date(time).toLocaleString());
}
IobTotal bolusIob = TreatmentsPlugin.getPlugin().getCalculationToTimeTreatments(time).round();
IobTotal basalIob = TreatmentsPlugin.getPlugin().getCalculationToTimeTempBasals(time, profile, true, now).round();
IobTotal basalIob = TreatmentsPlugin.getPlugin().getCalculationToTimeTempBasals(time, profile, true, now)
.round();
if (OpenAPSSMBPlugin.getPlugin().isEnabled(PluginType.APS)) {
// Add expected zero temp basal for next 240 mins
IobTotal basalIobWithZeroTemp = basalIob.copy();
TemporaryBasal t = new TemporaryBasal()
.date(now + 60 * 1000L)
.duration(240)
.absolute(0);
TemporaryBasal t = new TemporaryBasal().date(now + 60 * 1000L).duration(240).absolute(0);
if (t.date < time) {
IobTotal calc = t.iobCalc(time, profile);
basalIobWithZeroTemp.plus(calc);
@ -375,6 +411,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return iobTotal;
}
@Nullable
public Long findPreviousTimeFromBucketedData(long time) {
if (bucketed_data == null)
@ -386,6 +423,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return null;
}
public BasalData getBasalData(Profile profile, long time) {
long now = System.currentTimeMillis();
time = roundUpTime(time);
@ -411,6 +449,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return retval;
}
@Nullable
public AutosensData getAutosensData(long time) {
synchronized (dataLock) {
@ -434,6 +473,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
@Nullable
public AutosensData getLastAutosensDataSynchronized(String reason) {
if (thread != null && thread.isAlive()) {
@ -454,7 +494,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
@NonNull
public CobInfo getCobInfo(boolean _synchronized, String reason) {
AutosensData autosensData = _synchronized ? getLastAutosensDataSynchronized(reason) : getLastAutosensData(reason);
AutosensData autosensData = _synchronized ? getLastAutosensDataSynchronized(reason)
: getLastAutosensData(reason);
Double displayCob = null;
double futureCarbs = 0;
long now = now();
@ -463,15 +504,17 @@ public class IobCobCalculatorPlugin extends PluginBase {
if (autosensData != null) {
displayCob = autosensData.cob;
for (Treatment treatment : treatments) {
if (!treatment.isValid) continue;
if (IobCobCalculatorPlugin.roundUpTime(treatment.date) > IobCobCalculatorPlugin.roundUpTime(autosensData.time)
&& treatment.date <= now && treatment.carbs > 0) {
if (!treatment.isValid)
continue;
if (IobCobCalculatorPlugin.roundUpTime(treatment.date) > IobCobCalculatorPlugin
.roundUpTime(autosensData.time) && treatment.date <= now && treatment.carbs > 0) {
displayCob += treatment.carbs;
}
}
}
for (Treatment treatment : treatments) {
if (!treatment.isValid) continue;
if (!treatment.isValid)
continue;
if (treatment.date > now && treatment.carbs > 0) {
futureCarbs += treatment.carbs;
}
@ -479,6 +522,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return new CobInfo(displayCob, futureCarbs);
}
@Nullable
public AutosensData getLastAutosensData(String reason) {
if (autosensDataTable.size() < 1) {
@ -496,9 +540,14 @@ public class IobCobCalculatorPlugin extends PluginBase {
log.debug("AUTOSENSDATA null: Exception catched (" + reason + ")");
return null;
}
if (data == null) {
log.debug("AUTOSENSDATA null: data==null");
return null;
}
if (data.time < System.currentTimeMillis() - 11 * 60 * 1000) {
if (L.isEnabled(L.AUTOSENS))
log.debug("AUTOSENSDATA null: data is old (" + reason + ") size()=" + autosensDataTable.size() + " lastdata=" + DateUtil.dateAndTimeString(data.time));
log.debug("AUTOSENSDATA null: data is old (" + reason + ") size()=" + autosensDataTable.size()
+ " lastdata=" + DateUtil.dateAndTimeString(data.time));
return null;
} else {
if (L.isEnabled(L.AUTOSENS))
@ -507,6 +556,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
public String lastDataTime() {
if (autosensDataTable.size() > 0)
return DateUtil.dateAndTimeString(autosensDataTable.valueAt(autosensDataTable.size() - 1).time);
@ -514,6 +564,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return "autosensDataTable empty";
}
public IobTotal[] calculateIobArrayInDia(Profile profile) {
// predict IOB out to DIA plus 30m
long time = System.currentTimeMillis();
@ -530,6 +581,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return array;
}
public IobTotal[] calculateIobArrayForSMB(Profile profile) {
// predict IOB out to DIA plus 30m
long time = System.currentTimeMillis();
@ -546,12 +598,14 @@ public class IobCobCalculatorPlugin extends PluginBase {
return array;
}
public AutosensResult detectSensitivityWithLock(long fromTime, long toTime) {
synchronized (dataLock) {
return ConfigBuilderPlugin.getPlugin().getActiveSensitivity().detectSensitivity(this, fromTime, toTime);
}
}
public static JSONArray convertToJSONArray(IobTotal[] iobArray) {
JSONArray array = new JSONArray();
for (int i = 0; i < iobArray.length; i++) {
@ -560,6 +614,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
return array;
}
@Subscribe
@SuppressWarnings("unused")
public void onEventAppInitialized(EventAppInitialized ev) {
@ -571,6 +626,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
runCalculation("onEventAppInitialized", System.currentTimeMillis(), true, true, ev);
}
@Subscribe
@SuppressWarnings("unused")
public void onEventNewBG(EventNewBG ev) {
@ -583,6 +639,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
runCalculation("onEventNewBG", System.currentTimeMillis(), true, true, ev);
}
public void stopCalculation(String from) {
if (thread != null && thread.getState() != Thread.State.TERMINATED) {
stopCalculationTrigger = true;
@ -596,7 +653,9 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
public void runCalculation(String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable, Event cause) {
public void runCalculation(String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable,
Event cause) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Starting calculation thread: " + from + " to " + DateUtil.dateAndTimeString(end));
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
@ -608,6 +667,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
@Subscribe
public void onNewProfile(EventNewBasalProfile ev) {
if (this != getPlugin()) {
@ -623,13 +683,15 @@ public class IobCobCalculatorPlugin extends PluginBase {
stopCalculation("onNewProfile");
synchronized (dataLock) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Invalidating cached data because of new profile. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records");
log.debug("Invalidating cached data because of new profile. IOB: " + iobTable.size() + " Autosens: "
+ autosensDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
}
runCalculation("onNewProfile", System.currentTimeMillis(), false, true, ev);
}
@Subscribe
public void onEventPreferenceChange(EventPreferenceChange ev) {
if (this != getPlugin()) {
@ -637,18 +699,15 @@ public class IobCobCalculatorPlugin extends PluginBase {
log.debug("Ignoring event for non default instance");
return;
}
if (ev.isChanged(R.string.key_openapsama_autosens_period) ||
ev.isChanged(R.string.key_age) ||
ev.isChanged(R.string.key_absorption_maxtime) ||
ev.isChanged(R.string.key_openapsama_min_5m_carbimpact) ||
ev.isChanged(R.string.key_absorption_cutoff) ||
ev.isChanged(R.string.key_openapsama_autosens_max) ||
ev.isChanged(R.string.key_openapsama_autosens_min)
) {
if (ev.isChanged(R.string.key_openapsama_autosens_period) || ev.isChanged(R.string.key_age)
|| ev.isChanged(R.string.key_absorption_maxtime) || ev.isChanged(R.string.key_openapsama_min_5m_carbimpact)
|| ev.isChanged(R.string.key_absorption_cutoff) || ev.isChanged(R.string.key_openapsama_autosens_max)
|| ev.isChanged(R.string.key_openapsama_autosens_min)) {
stopCalculation("onEventPreferenceChange");
synchronized (dataLock) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Invalidating cached data because of preference change. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records");
log.debug("Invalidating cached data because of preference change. IOB: " + iobTable.size()
+ " Autosens: " + autosensDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
}
@ -656,6 +715,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
@Subscribe
public void onEventConfigBuilderChange(EventConfigBuilderChange ev) {
if (this != getPlugin()) {
@ -666,13 +726,15 @@ public class IobCobCalculatorPlugin extends PluginBase {
stopCalculation("onEventConfigBuilderChange");
synchronized (dataLock) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Invalidating cached data because of configuration change. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records");
log.debug("Invalidating cached data because of configuration change. IOB: " + iobTable.size()
+ " Autosens: " + autosensDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
}
runCalculation("onEventConfigBuilderChange", System.currentTimeMillis(), false, true, ev);
}
// When historical data is changed (comming from NS etc) finished calculations after this date must be invalidated
@Subscribe
public void onEventNewHistoryData(EventNewHistoryData ev) {
@ -700,7 +762,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
for (int index = autosensDataTable.size() - 1; index >= 0; index--) {
if (autosensDataTable.keyAt(index) > time) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Removing from autosensDataTable: " + DateUtil.dateAndTimeFullString(autosensDataTable.keyAt(index)));
log.debug("Removing from autosensDataTable: "
+ DateUtil.dateAndTimeFullString(autosensDataTable.keyAt(index)));
autosensDataTable.removeAt(index);
} else {
break;
@ -709,7 +772,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
for (int index = basalDataTable.size() - 1; index >= 0; index--) {
if (basalDataTable.keyAt(index) > time) {
if (L.isEnabled(L.AUTOSENS))
log.debug("Removing from basalDataTable: " + DateUtil.dateAndTimeFullString(basalDataTable.keyAt(index)));
log.debug("Removing from basalDataTable: "
+ DateUtil.dateAndTimeFullString(basalDataTable.keyAt(index)));
basalDataTable.removeAt(index);
} else {
break;
@ -720,6 +784,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
// log.debug("Releasing onNewHistoryData");
}
public void clearCache() {
synchronized (dataLock) {
if (L.isEnabled(L.AUTOSENS))
@ -729,20 +794,22 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
}
// From https://gist.github.com/IceCreamYou/6ffa1b18c4c8f6aeaad2
// Returns the value at a given percentile in a sorted numeric array.
// "Linear interpolation between closest ranks" method
public static double percentile(Double[] arr, double p) {
if (arr.length == 0) return 0;
if (p <= 0) return arr[0];
if (p >= 1) return arr[arr.length - 1];
if (arr.length == 0)
return 0;
if (p <= 0)
return arr[0];
if (p >= 1)
return arr[arr.length - 1];
double index = arr.length * p,
lower = Math.floor(index),
upper = lower + 1,
weight = index % 1;
double index = arr.length * p, lower = Math.floor(index), upper = lower + 1, weight = index % 1;
if (upper >= arr.length) return arr[(int) lower];
if (upper >= arr.length)
return arr[(int)lower];
return arr[(int)lower] * (1 - weight) + arr[(int)upper] * weight;
}
}

View file

@ -5,8 +5,6 @@ import android.os.PowerManager;
import android.os.SystemClock;
import android.support.v4.util.LongSparseArray;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -16,7 +14,6 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -26,13 +23,13 @@ import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.events.Event;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
@ -224,13 +221,6 @@ public class IobCobOref1Thread extends Thread {
} catch (Exception e) {
log.error("Unhandled exception", e);
FabricPrivacy.logException(e);
FabricPrivacy.getInstance().logCustom(new CustomEvent("CatchedError")
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION)
.putCustomAttribute("version", BuildConfig.VERSION)
.putCustomAttribute("autosensDataTable", iobCobCalculatorPlugin.getAutosensDataTable().toString())
.putCustomAttribute("for_data", ">>>>> bucketed_data.size()=" + bucketed_data.size() + " i=" + i + "hourAgoData=" + hourAgoData.toString())
.putCustomAttribute("past", past)
);
log.debug(autosensDataTable.toString());
log.debug(bucketed_data.toString());
log.debug(IobCobCalculatorPlugin.getPlugin().getBgReadings().toString());
@ -364,7 +354,8 @@ public class IobCobOref1Thread extends Thread {
//log.debug("TIME: " + new Date(bgTime).toString() + " BG: " + bg + " SENS: " + sens + " DELTA: " + delta + " AVGDELTA: " + avgDelta + " IOB: " + iob.iob + " ACTIVITY: " + iob.activity + " BGI: " + bgi + " DEVIATION: " + deviation);
// add an extra negative deviation if a high temptarget is running and exercise mode is set
if (SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity)) {
// TODO AS-FIX
if (false && SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity)) {
TempTarget tempTarget = TreatmentsPlugin.getPlugin().getTempTargetFromHistory(bgTime);
if (tempTarget != null && tempTarget.target() >= 100) {
autosensData.extraDeviation.add(-(tempTarget.target() - 100) / 20);

View file

@ -5,8 +5,6 @@ import android.os.PowerManager;
import android.os.SystemClock;
import android.support.v4.util.LongSparseArray;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -14,7 +12,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -24,13 +21,13 @@ import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.events.Event;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin;
import info.nightscout.androidaps.plugins.treatments.Treatment;
@ -223,13 +220,6 @@ public class IobCobThread extends Thread {
} catch (Exception e) {
log.error("Unhandled exception", e);
FabricPrivacy.logException(e);
FabricPrivacy.getInstance().logCustom(new CustomEvent("CatchedError")
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION)
.putCustomAttribute("version", BuildConfig.VERSION)
.putCustomAttribute("autosensDataTable", iobCobCalculatorPlugin.getAutosensDataTable().toString())
.putCustomAttribute("for_data", ">>>>> bucketed_data.size()=" + bucketed_data.size() + " i=" + i + "hourAgoData=" + hourAgoData.toString())
.putCustomAttribute("past", past)
);
log.debug(autosensDataTable.toString());
log.debug(bucketed_data.toString());
log.debug(IobCobCalculatorPlugin.getPlugin().getBgReadings().toString());

View file

@ -18,6 +18,10 @@ public enum DoseStepSize
new DoseStepSizeEntry(5f, 10f, 0.2f), //
new DoseStepSizeEntry(10f, Double.MAX_VALUE, 0.5f)),
InsightBasal(
new DoseStepSizeEntry(0f, 5f, 0.01f),
new DoseStepSizeEntry(5f, Double.MAX_VALUE, 0.1f)),
MedtronicVeoBasal( //
new DoseStepSizeEntry(0f, 1f, 0.025f), //
new DoseStepSizeEntry(1f, 10f, 0.05f), //

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.common.defs;
import java.util.HashMap;
import java.util.Map;
@ -7,6 +8,8 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.pump.common.data.DoseSettings;
/**
* Created by andy on 02/05/2018.
*
@ -24,8 +27,8 @@ public enum PumpType {
// Cellnovo
Cellnovo1("Cellnovo", 0.05d, null, //
new DoseSettings(0.05d, 30, 24 * 60, 1d, null), //
PumpTempBasalType.Percent, //
new DoseSettings(0.05d, 30, 24*60, 1d, null),
PumpTempBasalType.Percent,
new DoseSettings(5,30, 24*60, 0d, 200d), PumpCapability.BasalRate_Duration30minAllowed, //
0.05d, 0.05d, null, PumpCapability.VirtualPumpCapabilities), //
@ -33,19 +36,28 @@ public enum PumpType {
AccuChekCombo("Accu-Chek Combo", 0.1d, null, //
new DoseSettings(0.1d, 15, 12*60, 0.1d), //
PumpTempBasalType.Percent, new DoseSettings(10, 15, 12 * 60, 0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 12*60,0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.01d, 0.01d, DoseStepSize.ComboBasal, PumpCapability.ComboCapabilities), //
AccuChekSpirit("Accu-Chek Spirit", 0.1d, null, //
new DoseSettings(0.1d, 15, 12*60, 0.1d), //
PumpTempBasalType.Percent, new DoseSettings(10, 15, 12 * 60, 0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 12*60,0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.01d, 0.1d, null, PumpCapability.VirtualPumpCapabilities), //
AccuChekInsight("Accu-Chek Insight", 0.05d, DoseStepSize.InsightBolus, //
new DoseSettings(0.05d, 15, 24*60, 0.05d), //
PumpTempBasalType.Percent, new DoseSettings(10, 15, 12 * 60, 0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 24*60,0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.02d, 0.01d, null, PumpCapability.InsightCapabilities), //
AccuChekInsightBluetooth("Accu-Chek Insight", 0.01d, null, //
new DoseSettings(0.01d, 15, 24*60, 0.05d), //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 24*60,0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.02d, 0.01d, DoseStepSize.InsightBolus, PumpCapability.InsightCapabilities), //
// Animas
AnimasVibe("Animas Vibe", 0.05d, null, // AnimasBolus?
new DoseSettings(0.05d, 30, 12*60, 0.05d), //
@ -76,12 +88,12 @@ public enum PumpType {
DanaRv2("DanaRv2", DanaRS),
// Insulet
Insulet_Omnipod("Insulet Omnipod", 0.05d, null, //
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // cannot exceed max
// basal rate 30u/hr
new DoseSettings(0.05d, 30, 12*60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // cannot exceed max basal rate 30u/hr
0.05d, 0.05d, null, PumpCapability.VirtualPumpCapabilities),
// Medtronic
@ -89,18 +101,18 @@ public enum PumpType {
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 24*60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
0.05d, 0.05d, null, PumpCapability.MedtronicCapabilities),
0.05d, 0.05d, null, PumpCapability.VirtualPumpCapabilities), // TODO
Medtronic_515_715("Medtronic 515/715", Medtronic_512_712),
Medtronic_522_722("Medtronic 522/722", Medtronic_512_712),
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", //
0.05d, null, new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", 0.05d, null, //
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 24*60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
0.025d, 0.025d, DoseStepSize.MedtronicVeoBasal, PumpCapability.MedtronicCapabilities), //
0.025d, 0.025d, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPumpCapabilities), //
Medtronic_554_754_Veo("Medtronic 554/754 (Veo)", Medtronic_523_723_Revel), //
Medtronic_554_754_Veo("Medtronic 554/754 (Veo)", Medtronic_523_723_Revel), // TODO
Medtronic_640G("Medtronic 640G", 0.025d, null, //
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
@ -110,7 +122,9 @@ public enum PumpType {
// Tandem
TandemTSlim("Tandem t:slim", 0.01d, null, //
new DoseSettings(0.01d, 15, 8 * 60, 0.4d), PumpTempBasalType.Percent, new DoseSettings(1, 15, 8 * 60, 0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
new DoseSettings(0.01d,15, 8*60, 0.4d),
PumpTempBasalType.Percent,
new DoseSettings(1,15, 8*60, 0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.1d, 0.001d, null, PumpCapability.VirtualPumpCapabilities),
TandemTFlex("Tandem t:flex", TandemTSlim), //
@ -134,7 +148,8 @@ public enum PumpType {
private PumpType parent;
private static Map<String,PumpType> mapByDescription;
static {
static
{
mapByDescription = new HashMap<>();
for (PumpType pumpType : values()) {
@ -143,38 +158,32 @@ public enum PumpType {
}
PumpType(String description, PumpType parent) {
PumpType(String description, PumpType parent)
{
this.description = description;
this.parent = parent;
}
PumpType(String description, PumpType parent, PumpCapability pumpCapability) {
PumpType(String description, PumpType parent, PumpCapability pumpCapability)
{
this.description = description;
this.parent = parent;
this.pumpCapability = pumpCapability;
}
PumpType(String description, double bolusSize,
DoseStepSize specialBolusSize, //
PumpType(String description, double bolusSize, DoseStepSize specialBolusSize, //
DoseSettings extendedBolusSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings,
PumpCapability specialBasalDurations, //
double baseBasalMinValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps,
PumpCapability pumpCapability) {
this(description, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings,
specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
double baseBasalMinValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
{
this(description, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
}
PumpType(String description, double bolusSize,
DoseStepSize specialBolusSize, //
PumpType(String description, double bolusSize, DoseStepSize specialBolusSize, //
DoseSettings extendedBolusSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings,
PumpCapability specialBasalDurations, //
double baseBasalMinValue, Double baseBasalMaxValue, double baseBasalStep,
DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability) {
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
double baseBasalMinValue, Double baseBasalMaxValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
{
this.description = description;
this.bolusSize = bolusSize;
this.specialBolusSize = specialBolusSize;
@ -194,7 +203,6 @@ public enum PumpType {
return description;
}
public PumpCapability getPumpCapability() {
if (isParentSet())
@ -203,7 +211,6 @@ public enum PumpType {
return this.pumpCapability;
}
public double getBolusSize() {
return isParentSet() ? parent.bolusSize : bolusSize;
}
@ -254,15 +261,20 @@ public enum PumpType {
}
private boolean isParentSet() {
private boolean isParentSet()
{
return this.parent!=null;
}
public static PumpType getByDescription(String desc) {
if (mapByDescription.containsKey(desc)) {
public static PumpType getByDescription(String desc)
{
if (mapByDescription.containsKey(desc))
{
return mapByDescription.get(desc);
} else {
}
else
{
return PumpType.GenericAAPS;
}
}
@ -277,25 +289,25 @@ public enum PumpType {
String extendedNote = hasExtendedBasals ? MainApp.gs(R.string.virtualpump_pump_def_extended_note) : "";
return String.format(
i18nTemplate, //
return String.format(i18nTemplate, //
getStep("" + getBolusSize(), getSpecialBolusSize()), //
eb.getStep(), eb.getDurationStep(),
eb.getMaxDuration() / 60, //
eb.getStep(), eb.getDurationStep(), eb.getMaxDuration()/60, //
getStep(getBaseBasalRange(), getBaseBasalSpecialSteps()), //
tbr.getMinDose() + unit + "-" + tbr.getMaxDose() + unit, tbr.getStep() + unit, tbr.getDurationStep(),
tbr.getMaxDuration() / 60, extendedNote);
tbr.getMinDose() + unit + "-" + tbr.getMaxDose() + unit, tbr.getStep() + unit,
tbr.getDurationStep(), tbr.getMaxDuration()/60, extendedNote);
}
private String getBaseBasalRange() {
private String getBaseBasalRange()
{
Double maxValue = getBaseBasalMaxValue();
return maxValue==null ? "" + getBaseBasalMinValue() : getBaseBasalMinValue() + "-" + maxValue;
}
private String getStep(String step, DoseStepSize stepSize) {
private String getStep(String step, DoseStepSize stepSize)
{
if (stepSize!=null)
return step + " [" + stepSize.getDescription() + "] *";
else
@ -310,16 +322,17 @@ public enum PumpType {
public PumpCapability getSpecialBasalDurations() {
if (isParentSet()) {
if (isParentSet())
{
return parent.getSpecialBasalDurations();
} else {
}
else
{
return specialBasalDurations == null ? //
PumpCapability.BasalRate_Duration15and30minNotAllowed
: specialBasalDurations;
PumpCapability.BasalRate_Duration15and30minNotAllowed : specialBasalDurations;
}
}
public double determineCorrectBolusSize(double bolusAmount) {
if (bolusAmount == 0.0d) {
return bolusAmount;

View file

@ -7,7 +7,6 @@ import com.crashlytics.android.answers.CustomEvent;
import com.google.common.base.Splitter;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.utils.FabricPrivacy;
/**
* Created by andy on 10/26/18.
@ -45,7 +44,7 @@ public class FabricUtil {
}
}
FabricPrivacy.getInstance().logCustom(customEvent);
// FabricPrivacy.getInstance().logCustom(customEvent);
}
}

View file

@ -171,7 +171,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
.preferencesId(R.xml.pref_insight_local));
pumpDescription = new PumpDescription();
pumpDescription.setPumpDescription(PumpType.AccuChekInsight);
pumpDescription.setPumpDescription(PumpType.AccuChekInsightBluetooth);
}
public TBROverNotificationBlock getTBROverNotificationBlock() {
@ -315,7 +315,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
calendar.set(Calendar.HOUR_OF_DAY, pumpTime.getHour());
calendar.set(Calendar.MINUTE, pumpTime.getMinute());
calendar.set(Calendar.SECOND, pumpTime.getSecond());
if (Math.abs(calendar.getTimeInMillis() - System.currentTimeMillis()) > 10000) {
if (calendar.get(Calendar.HOUR_OF_DAY) != pumpTime.getHour() || Math.abs(calendar.getTimeInMillis() - System.currentTimeMillis()) > 10000) {
calendar.setTime(new Date());
pumpTime.setYear(calendar.get(Calendar.YEAR));
pumpTime.setMonth(calendar.get(Calendar.MONTH) + 1);
@ -421,7 +421,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
if (profile.getBasalValues().length > i + 1)
nextValue = profile.getBasalValues()[i + 1];
BasalProfileBlock profileBlock = new BasalProfileBlock();
profileBlock.setBasalAmount(basalValue.value);
profileBlock.setBasalAmount(basalValue.value > 5 ? Math.round(basalValue.value / 0.1) * 0.1 : Math.round(basalValue.value / 0.01) * 0.01);
profileBlock.setDuration((((nextValue != null ? nextValue.timeAsSeconds : 24 * 60 * 60) - basalValue.timeAsSeconds) / 60));
profileBlocks.add(profileBlock);
}
@ -476,7 +476,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
nextValue = profile.getBasalValues()[i + 1];
if (profileBlock.getDuration() * 60 != (nextValue != null ? nextValue.timeAsSeconds : 24 * 60 * 60) - basalValue.timeAsSeconds)
return false;
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) > 0.01D)
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) > (basalValue.value > 5 ? 0.05 : 0.005))
return false;
}
return true;
@ -510,14 +510,15 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
@Override
public PumpEnactResult deliverTreatment(DetailedBolusInfo detailedBolusInfo) {
PumpEnactResult result = new PumpEnactResult();
if (detailedBolusInfo.insulin > 0) {
double insulin = Math.round(detailedBolusInfo.insulin / 0.01) * 0.01;
if (insulin > 0) {
try {
synchronized ($bolusLock) {
DeliverBolusMessage bolusMessage = new DeliverBolusMessage();
bolusMessage.setBolusType(BolusType.STANDARD);
bolusMessage.setDuration(0);
bolusMessage.setExtendedAmount(0);
bolusMessage.setImmediateAmount(detailedBolusInfo.insulin);
bolusMessage.setImmediateAmount(insulin);
bolusID = connectionService.requestMessage(bolusMessage).await().getBolusId();
bolusCancelled = false;
}
@ -527,7 +528,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
t.isSMB = detailedBolusInfo.isSMB;
final EventOverviewBolusProgress bolusingEvent = EventOverviewBolusProgress.getInstance();
bolusingEvent.t = t;
bolusingEvent.status = MainApp.gs(R.string.insight_delivered, 0d, detailedBolusInfo.insulin);
bolusingEvent.status = MainApp.gs(R.string.insight_delivered, 0d, insulin);
bolusingEvent.percent = 0;
MainApp.bus().post(bolusingEvent);
int trials = 0;
@ -565,7 +566,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
synchronized ($bolusLock) {
if (bolusCancelled || trials == -1 || trials++ >= 5) {
if (!bolusCancelled) {
bolusingEvent.status = MainApp.gs(R.string.insight_delivered, detailedBolusInfo.insulin, detailedBolusInfo.insulin);
bolusingEvent.status = MainApp.gs(R.string.insight_delivered, insulin, insulin);
bolusingEvent.percent = 100;
MainApp.bus().post(bolusingEvent);
}
@ -592,6 +593,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
result.enacted = true;
}
result.carbsDelivered = detailedBolusInfo.carbs;
result.bolusDelivered = insulin;
return result;
}
@ -1187,6 +1189,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
}
private void processCannulaFilledEvent(CannulaFilledEvent event) {
if (!SP.getBoolean("insight_log_site_changes", false)) return;
long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(),
event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset;
uploadCareportalEvent(timestamp, CareportalEvent.SITECHANGE);
@ -1214,7 +1217,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
}
private void processSniffingDoneEvent(SniffingDoneEvent event) {
if (!SP.getBoolean("insight_log_site_changes", false)) return;
if (!SP.getBoolean("insight_log_reservoir_changes", false)) return;
long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(),
event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset;
uploadCareportalEvent(timestamp, CareportalEvent.INSULINCHANGE);
@ -1537,6 +1540,11 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
return insulin;
}
@Override
public Constraint<Double> applyExtendedBolusConstraints(Constraint<Double> insulin) {
return applyBolusConstraints(insulin);
}
@Override
public void onStateChanged(InsightState state) {
if (state == InsightState.CONNECTED) {

View file

@ -21,11 +21,9 @@ import android.os.IBinder;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import com.crashlytics.android.answers.CustomEvent;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo;
@ -71,7 +69,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtro
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst;
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.SP;
/**
@ -555,10 +552,17 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
pumpState = PumpDriverState.Initialized;
}
FabricPrivacy.getInstance().logCustom( //
new CustomEvent("MedtronicInitializePump") //
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION) //
.putCustomAttribute("version", BuildConfig.VERSION));
// MainApp.getFirebaseAnalytics().logCustomEvent(FirebaseAnalytics.Event.SELECT_CONTENT, event);
//
// FabricPrivacy.getInstance().logCustom( //
// new CustomEvent("MedtronicInitializePump") //
// .putCustomAttribute("buildversion", BuildConfig.BUILDVERSION) //
// .putCustomAttribute("version", BuildConfig.VERSION));
//
//
//
// MainApp.getFirebaseAnalytics().logEvent();
//
isInitialized = true;
// this.pumpState = PumpDriverState.Initialized;

View file

@ -8,9 +8,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.crashlytics.android.answers.CustomEvent;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.Constants;
@ -595,9 +596,10 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MainApp.instance().startActivity(i);
CustomEvent customEvent = new CustomEvent("TreatmentClash");
customEvent.putCustomAttribute("status", status);
FabricPrivacy.getInstance().logCustom(customEvent);
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "TreatmentClash");
bundle.putString(FirebaseAnalytics.Param.VALUE, status);
FabricPrivacy.getInstance().logCustom(bundle);
}
return newRecordCreated;

View file

@ -18,7 +18,6 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import java.util.List;
@ -40,7 +39,6 @@ import info.nightscout.androidaps.plugins.treatments.dialogs.WizardInfoDialog;
import info.nightscout.androidaps.services.Intents;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.SP;
import static info.nightscout.androidaps.utils.DateUtil.now;
@ -165,7 +163,6 @@ public class TreatmentsBolusFragment extends SubscriberFragment implements View.
TreatmentsPlugin.getPlugin().getService().delete(treatment);
}
updateGUI();
FabricPrivacy.getInstance().logCustom(new CustomEvent("RemoveTreatment"));
}
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);

View file

@ -15,7 +15,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.MainApp;
@ -32,7 +31,6 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutos
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
public class TreatmentsExtendedBolusesFragment extends SubscriberFragment {
@ -150,7 +148,6 @@ public class TreatmentsExtendedBolusesFragment extends SubscriberFragment {
UploadQueue.removeID("dbAdd", _id);
}
MainApp.getDbHelper().delete(extendedBolus);
FabricPrivacy.getInstance().logCustom(new CustomEvent("RemoveExtendedBolus"));
}
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);

View file

@ -15,7 +15,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.MainApp;
@ -34,7 +33,6 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutos
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
public class TreatmentsTemporaryBasalsFragment extends SubscriberFragment {
@ -175,7 +173,6 @@ public class TreatmentsTemporaryBasalsFragment extends SubscriberFragment {
UploadQueue.removeID("dbAdd", _id);
}
MainApp.getDbHelper().delete(tempBasal);
FabricPrivacy.getInstance().logCustom(new CustomEvent("RemoveTempBasal"));
});
builder.setNegativeButton(MainApp.gs(R.string.cancel), null);
builder.show();

View file

@ -7,8 +7,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import com.crashlytics.android.answers.CustomEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -52,7 +50,6 @@ public class KeepAliveReceiver extends BroadcastReceiver {
LocalAlertUtils.shortenSnoozeInterval();
LocalAlertUtils.checkStaleBGAlert();
checkPump();
FabricPrivacy.uploadDailyStats();
if (L.isEnabled(L.CORE))
log.debug("KeepAlive received");
@ -87,7 +84,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
}
if (lastRun != 0 && System.currentTimeMillis() - lastRun > T.mins(10).msecs()) {
log.error("KeepAlive fail");
FabricPrivacy.getInstance().logCustom(new CustomEvent("KeepAliveFail"));
FabricPrivacy.getInstance().logCustom("KeepAliveFail");
}
lastRun = System.currentTimeMillis();
}

View file

@ -1,28 +1,29 @@
package info.nightscout.androidaps.utils;
import java.util.Date;
import android.os.Bundle;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent;
import com.google.firebase.analytics.FirebaseAnalytics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
/**
* Created by jamorham on 21/02/2018.
* <p>
* Some users do not wish to be tracked, Fabric Answers and Crashlytics do not provide an easy way to disable them and
* make calls from a potentially invalid singleton reference. This wrapper emulates the methods but ignores the request
* if the instance is null or invalid.
* Some users do not wish to be tracked, Fabric Answers and Crashlytics do not provide an easy way
* to disable them and make calls from a potentially invalid singleton reference. This wrapper
* emulates the methods but ignores the request if the instance is null or invalid.
*/
public class FabricPrivacy {
private static Logger log = LoggerFactory.getLogger(L.CORE);
private static final String TAG = "FabricPrivacy";
private static volatile FabricPrivacy instance;
@ -33,121 +34,101 @@ public class FabricPrivacy {
return instance;
}
private static synchronized void initSelf() {
if (instance == null) {
instance = new FabricPrivacy();
}
}
// Crashlytics logException
public static void logException(Throwable throwable) {
try {
final Crashlytics crashlytics = Crashlytics.getInstance();
crashlytics.core.logException(throwable);
} catch (NullPointerException | IllegalStateException e) {
android.util.Log.d(TAG, "Ignoring opted out non-initialized log: " + throwable);
if (L.isEnabled(L.CORE))
log.debug("Ignoring opted out non-initialized log: " + throwable);
}
}
// Crashlytics log
public static void log(String msg) {
try {
final Crashlytics crashlytics = Crashlytics.getInstance();
crashlytics.core.log(msg);
} catch (NullPointerException | IllegalStateException e) {
android.util.Log.d(TAG, "Ignoring opted out non-initialized log: " + msg);
if (L.isEnabled(L.CORE))
log.debug("Ignoring opted out non-initialized log: " + msg);
}
}
// Crashlytics log
public static void log(int priority, String tag, String msg) {
try {
final Crashlytics crashlytics = Crashlytics.getInstance();
crashlytics.core.log(priority, tag, msg);
} catch (NullPointerException | IllegalStateException e) {
android.util.Log.d(TAG, "Ignoring opted out non-initialized log: " + msg);
if (L.isEnabled(L.CORE))
log.debug("Ignoring opted out non-initialized log: " + msg);
}
}
public static boolean fabricEnabled() {
if (MainApp.isEngineeringMode())
return true;
return SP.getBoolean("enable_fabric", true);
}
// Answers logCustom
public void logCustom(CustomEvent event) {
// Analytics logCustom
public void logCustom(Bundle event) {
try {
final Answers answers = Answers.getInstance();
if (fabricEnabled()) {
answers.logCustom(event);
MainApp.getFirebaseAnalytics().logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, event);
} else {
android.util.Log.d(TAG, "Ignoring recently opted-out event: " + event.toString());
if (L.isEnabled(L.CORE))
log.debug("Ignoring recently opted-out event: " + event.toString());
}
} catch (NullPointerException | IllegalStateException e) {
android.util.Log.d(TAG, "Ignoring opted-out non-initialized event: " + event.toString());
if (L.isEnabled(L.CORE))
log.debug("Ignoring opted-out non-initialized event: " + event.toString());
}
}
public static void uploadDailyStats() {
if (!fabricEnabled())
return;
long lastUploadDay = SP.getLong(MainApp.gs(R.string.key_plugin_stats_report_timestamp), 0L);
Date date = new Date();
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
long today = date.getTime() - date.getTime() % 1000;
if (today > lastUploadDay) {
uploadAppUsageType();
uploadPluginStats();
SP.putLong(MainApp.gs(R.string.key_plugin_stats_report_timestamp), today);
// Analytics logCustom
public void logCustom(String event) {
try {
if (fabricEnabled()) {
MainApp.getFirebaseAnalytics().logEvent(event, new Bundle());
} else {
if (L.isEnabled(L.CORE))
log.debug("Ignoring recently opted-out event: " + event);
}
} catch (NullPointerException | IllegalStateException e) {
if (L.isEnabled(L.CORE))
log.debug("Ignoring opted-out non-initialized event: " + event);
}
}
public static void setUserStats() {
if (!fabricEnabled()) return;
private static void uploadPluginStats() {
CustomEvent pluginStats = new CustomEvent("PluginStats");
pluginStats.putCustomAttribute("version", BuildConfig.VERSION);
pluginStats.putCustomAttribute("HEAD", BuildConfig.HEAD);
pluginStats.putCustomAttribute("language", SP.getString(R.string.key_language, "default"));
for (PluginBase plugin : MainApp.getPluginsList()) {
if (plugin.isEnabled(plugin.getType()) && !plugin.pluginDescription.alwaysEnabled) {
// Fabric allows no more than 20 attributes attached to an event. By reporting disabled plugins as
// well, we would exceed that threshold, so only report what is enabled
// TODO >2.0: consider reworking this to upload an event per enabled plugin instead.
pluginStats.putCustomAttribute(plugin.getClass().getSimpleName(), "enabled");
}
}
String closedLoopEnabled = MainApp.getConstraintChecker().isClosedLoopAllowed().value() ? "CLOSED_LOOP_ENABLED" : "CLOSED_LOOP_DISABLED";
getInstance().logCustom(pluginStats);
}
MainApp.getFirebaseAnalytics().setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled);
MainApp.getFirebaseAnalytics().setUserProperty("Language", LocaleHelper.getLanguage(MainApp.instance()));
MainApp.getFirebaseAnalytics().setUserProperty("Version", BuildConfig.VERSION);
MainApp.getFirebaseAnalytics().setUserProperty("HEAD", BuildConfig.HEAD);
if (ConfigBuilderPlugin.getPlugin().getActivePump() != null)
MainApp.getFirebaseAnalytics().setUserProperty("Pump", ConfigBuilderPlugin.getPlugin().getActivePump().getClass().getSimpleName());
if (ConfigBuilderPlugin.getPlugin().getActiveAPS() != null)
MainApp.getFirebaseAnalytics().setUserProperty("Aps", ConfigBuilderPlugin.getPlugin().getActiveAPS().getClass().getSimpleName());
if (ConfigBuilderPlugin.getPlugin().getActiveBgSource() != null)
MainApp.getFirebaseAnalytics().setUserProperty("BgSource", ConfigBuilderPlugin.getPlugin().getActiveBgSource().getClass().getSimpleName());
if (ConfigBuilderPlugin.getPlugin().getActiveProfileInterface() != null)
MainApp.getFirebaseAnalytics().setUserProperty("Profile", ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getClass().getSimpleName());
if (ConfigBuilderPlugin.getPlugin().getActiveSensitivity() != null)
MainApp.getFirebaseAnalytics().setUserProperty("Sensitivity", ConfigBuilderPlugin.getPlugin().getActiveSensitivity().getClass().getSimpleName());
if (ConfigBuilderPlugin.getPlugin().getActiveInsulin() != null)
MainApp.getFirebaseAnalytics().setUserProperty("Insulin", ConfigBuilderPlugin.getPlugin().getActiveInsulin().getClass().getSimpleName());
private static void uploadAppUsageType() {
CustomEvent type = new CustomEvent("AppUsageType");
if (Config.NSCLIENT)
type.putCustomAttribute("type", "NSClient");
else if (Config.PUMPCONTROL)
type.putCustomAttribute("type", "PumpControl");
else if (MainApp.getConstraintChecker().isClosedLoopAllowed().value())
type.putCustomAttribute("type", "ClosedLoop");
else
type.putCustomAttribute("type", "OpenLoop");
getInstance().logCustom(type);
}
}

View file

@ -54,6 +54,7 @@
<string name="description_wear">Monitor en beheer AndroidAPS met jou WearOS horlosie.</string>
<string name="description_xdrip_status_line">Wys informasie van jou loop op jou xDrip+ horlosie-gesig.</string>
<string name="description_sms_communicator">Afstandbeheer AndroidAPS met SMS kodes.</string>
<string name="objectives_button_back">Terug</string>
<string name="objectives_button_start">Begin</string>
<string name="objectives_button_verify">Verifieer</string>
<string name="nsprofileview_units_label">Eenhede</string>
@ -265,6 +266,10 @@
<string name="smscommunicator_bolusreplywithcode">Om %1$.2fU bolus te lewer antwoord met kode %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Om kalibrasie %1$.2f te stuur antwoord met kode %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus het misluk</string>
<string name="bolusdelivered">Bolus %1$.2fU suksesvol afgelewer</string>
<string name="bolusrequested">Gaan %1$.2fU lewer</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU suksesvol afgelewer</string>
<string name="bolusdelivering">Lewering van %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Laat afstandbeheerde bevele toe via SMS</string>
<string name="glucosetype_finger">Vinger</string>
<string name="glucosetype_sensor">Sensor</string>
@ -334,11 +339,24 @@
<string name="valuelimitedto">%1$.2f beperk tot %2$.2f</string>
<string name="valueoutofrange" formatted="false">Waarde %s is uit harde perke</string>
<string name="smscommunicator_remotecommandnotallowed">Afstandbeheerde bevel word nie toegelaat nie</string>
<string name="smscommunicator_remotebolusnotallowed">Afstandbeheerde bolus nie beskikbaar nie. Probeer later weer.</string>
<string name="smscommunicator_basalreplywithcode">Om %1$.2fU basale vir %2$d min te aktiveer antwoord met kode %3$s</string>
<string name="smscommunicator_profilereplywithcode">Om profiel te verander na %1$s %2$d%% antwoord met %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Om bolus %1$.2fU vir %2$d min te verleng kies %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Om basal e %1$d%% vir %2$d min te begin kies %3$s</string>
<string name="smscommunicator_suspendreplywithcode">Om lus op te skort vir %1$d minute antwoord met kode %2$s</string>
<string name="smscommunicator_tempbasalset">Temp basale %1$.2fU/h vir %2$d min suksesvol geaktiveerd</string>
<string name="smscommunicator_extendedset">Verlengde bolus %1$.2fU vir %2$d min is begin</string>
<string name="smscommunicator_tempbasalset_percent">Tydelike basale %1$d%% vir %2$d min hardloop</string>
<string name="smscommunicator_tempbasalfailed">Tydelike basale aktivering het gefaal</string>
<string name="smscommunicator_extendedfailed">Verlengde bolus het misluk</string>
<string name="smscommunicator_basalstopreplywithcode">Stop tydelike basale antwoord met kode %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">Stop tydelike basale antwoord met kode %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Tydelike basale gekanselleer</string>
<string name="smscommunicator_extendedcanceled">Verlengde bolus gekanselleer</string>
<string name="smscommunicator_tempbasalcancelfailed">Kansellassie van tydelike basale het gefaal</string>
<string name="smscommunicator_extendedcancelfailed">Kansellasie van verlengde bolus het misluk</string>
<string name="smscommunicator_unknowncommand">Onbekende opdrag of verkeerde opsie</string>
<string name="quickwizard">SlimNutsman</string>
<string name="quickwizardsettings">SlimNutsman instellings</string>
<string name="overview_editquickwizard_buttontext">Knoppie teks:</string>
@ -1069,6 +1087,7 @@
<string name="mute_alert">Demp</string>
<string name="pump_alert">Pomp alarm</string>
<string name="log_site_changes">Log ligging veranderings</string>
<string name="log_reservoir_changes">Log stoor veranderinge</string>
<string name="log_tube_changes">Log voerpyp verandering</string>
<string name="log_battery_changes">Log battery verandering</string>
<string name="log_operating_mode_changes">Log bedryf modus veranderinge</string>
@ -1130,8 +1149,13 @@
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Daglig spaar tyd verandering in 24 h of minder</string>
<string name="dst_loop_disabled_warning">Daglig spaar tyd het verander minder as 3 ure terug - Geslote lus afgeskakel</string>
<string name="storage">interne berging beperking</string>
<string name="diskfull">Bevry ten minste %1$d MB van intene stoorspasie! Lus gedeaktiveer!</string>
<string name="wrongformat">Verkeerde formaat</string>
<string name="sms_wrongcode">Verkeerde kode. Opdrag gekanselleer.</string>
<string name="notconfigured">Nie gekonfigureer nie</string>
<string name="profileswitchcreated">Profiel skakelaar geskep</string>
<plurals name="objective_days">
<item quantity="one">%1$d dae</item>
<item quantity="other">%1$d dae</item>

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<?xml version="1.0" encoding="utf-8"?><!--Generated by crowdin.com-->
<resources>
<string name="treatmentssafety_title">Настройки на сигурността</string>
<string name="treatmentssafety_maxbolus_title">Максимален инсулин при болус [единици]</string>
@ -266,6 +265,10 @@
<string name="smscommunicator_bolusreplywithcode">За да доставите болус от %1$.2fЕ отговорете с код %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">За да изпратите калибрация %1$.2f отговорете с код %2$s</string>
<string name="smscommunicator_bolusfailed">Болус отказан</string>
<string name="bolusdelivered">Болус от %1$.2fЕ доставен успешно</string>
<string name="bolusrequested">Ще стартира %1$.2fЕ болус</string>
<string name="smscommunicator_bolusdelivered">Болус от %1$.2fЕ доставен успешно</string>
<string name="bolusdelivering">Стартирам %1$.2fЕ</string>
<string name="smscommunicator_remotecommandsallowed">Позволи отдалечени команди чрез SMS</string>
<string name="glucosetype_finger">Пръст</string>
<string name="glucosetype_sensor">Сензор</string>
@ -335,11 +338,24 @@
<string name="valuelimitedto">%1$.2f ограничен до %2$.2f</string>
<string name="valueoutofrange" formatted="false">Стойността %s е извън границите</string>
<string name="smscommunicator_remotecommandnotallowed">Отдалеченото управление е забранено</string>
<string name="smscommunicator_remotebolusnotallowed">Отдалечено стартиране на болус не е възможно. Опитайте отново по-късно.</string>
<string name="smscommunicator_basalreplywithcode">За да стартирате базал от %1$.2fЕ/ч за %2$d мин отговорете с код %3$s</string>
<string name="smscommunicator_profilereplywithcode">За да превключите профила към %1$s %2$d%% отговорете с код %3$s</string>
<string name="smscommunicator_extendedreplywithcode">За да започнете удължен болус %1$.2fЕ за %2$d мин отговорете с код %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">За да стартирате базал от %1$d%%Е/ч за %2$d мин отговорете с код %3$s</string>
<string name="smscommunicator_suspendreplywithcode">За да спрете APS за %1$d минути отговорете с код %2$s</string>
<string name="smscommunicator_tempbasalset">Временен базал от %1$.2fЕ/ч за %2$d мин стартиран успешно</string>
<string name="smscommunicator_extendedset">Удължен болус %1$.2fU за %2$d мин стартиран успешно</string>
<string name="smscommunicator_tempbasalset_percent">Временен базал от %1$d%%Е/ч за %2$d мин стартиран успешно</string>
<string name="smscommunicator_tempbasalfailed">Неуспешно стартиране на временен базал</string>
<string name="smscommunicator_extendedfailed">Неуспешно стартиране на удължен болус</string>
<string name="smscommunicator_basalstopreplywithcode">За да спрете времен базал отговорете с код %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">За да спрете удължения болус отговорете с код %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Временният базал е отменен</string>
<string name="smscommunicator_extendedcanceled">Удължен болус спрян</string>
<string name="smscommunicator_tempbasalcancelfailed">Спирането на временния базал е неуспешно</string>
<string name="smscommunicator_extendedcancelfailed">Неуспешно спиране на удължен болус</string>
<string name="smscommunicator_unknowncommand">Непозната команда или грешен отговор</string>
<string name="quickwizard">Бърз болус</string>
<string name="quickwizardsettings">Настройки за бърз болус</string>
<string name="overview_editquickwizard_buttontext">Текст на бутона:</string>
@ -1070,6 +1086,7 @@
<string name="mute_alert">Без звук</string>
<string name="pump_alert">Аларма на помпата</string>
<string name="log_site_changes">Записвай смяната на местата</string>
<string name="log_reservoir_changes">Записвай смените на резервоар</string>
<string name="log_tube_changes">Записвай смените на резервоар</string>
<string name="log_battery_changes">Записвай смяната на батерия</string>
<string name="log_operating_mode_changes">Записвай промените в режима</string>
@ -1131,8 +1148,13 @@
<string name="tomato">Tomato(MяоМяо)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Смяна на времето след по-малко от 24ч</string>
<string name="dst_loop_disabled_warning">Смяна на времето след по-малко от 3 часа - минавам в отворен режим</string>
<string name="storage">Ограничение поради липса на памет</string>
<string name="diskfull">Освободете поне %1$d Мб в паметта на телефона! Loop изключен!</string>
<string name="wrongformat">Грешен формат</string>
<string name="sms_wrongcode">Грешен код. Командата не е изпълнена.</string>
<string name="notconfigured">Не е конфигуриран</string>
<string name="profileswitchcreated">Създаден запис - Промяна на профил</string>
<plurals name="objective_days">
<item quantity="one">%1$d дeн</item>
<item quantity="other">%1$d дни</item>

View file

@ -1087,6 +1087,7 @@
<string name="mute_alert">Ztlumit</string>
<string name="pump_alert">Výstraha pumpy</string>
<string name="log_site_changes">Zaznamenat výměnu kanyly</string>
<string name="log_reservoir_changes">Zaznamenat výměnu zásobníku</string>
<string name="log_tube_changes">Zaznamenat výměnu hadičky</string>
<string name="log_battery_changes">Zaznamenat výměnu baterie</string>
<string name="log_operating_mode_changes">Zaznamenat změnu režimu provozu</string>
@ -1148,6 +1149,7 @@
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Změna letního času za méně než 24 hodin</string>
<string name="dst_loop_disabled_warning">Změna letního času za méně než 3 hodiny - Uzavřená smyčka zastavena</string>
<string name="storage">omezení vnitřního úložiště</string>
<string name="diskfull">Uvolněte alespoň %1$d MB z vnitřního úložiště! Smyčka zakázána!</string>
<string name="wrongformat">Chybný formát</string>

View file

@ -266,6 +266,10 @@
<string name="smscommunicator_bolusreplywithcode">Um einen Bolus von %1$.2f IE abzugeben, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_calibrationreplywithcode">Um die Kalibrierung %1$.2f zu senden, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_bolusfailed">Bolus fehlgeschlagen</string>
<string name="bolusdelivered">Bolus %1$.2fU erfolgreich abgegeben</string>
<string name="bolusrequested">Werde %1$.2fU abgeben</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU erfolgreich abgegeben</string>
<string name="bolusdelivering">Gebe %1$.2fU ab</string>
<string name="smscommunicator_remotecommandsallowed">Erlaube externe Befehle per SMS</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
@ -336,11 +340,24 @@ maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate</string>
<string name="valuelimitedto">%1$.2f limitiert auf %2$.2f</string>
<string name="valueoutofrange" formatted="false">Wert %1$s ist außerhalb des festen Limits.</string>
<string name="smscommunicator_remotecommandnotallowed">Ferngesteuerte Befehle sind nicht erlaubt.</string>
<string name="smscommunicator_remotebolusnotallowed">Bolusabgabe aus der Ferne nicht verfügbar. Versuche es später erneut.</string>
<string name="smscommunicator_basalreplywithcode">Um eine Basalrate von %1$.2fU/h für %2$d Minuten zu setzen, antworte mit dem Code %3$s</string>
<string name="smscommunicator_profilereplywithcode">Um das Profil auf %1$s %2$d%% zu setzen, antworte mit dem Code %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Um den erweiterten Bolus %1$.2fU für %2$d Minuten abzugeben, antworte mit dem Code %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Um die Basalrate von %1$d%% für %2$d Minuten zu setzen, antworte mit dem Code %3$s</string>
<string name="smscommunicator_suspendreplywithcode">Um das Loopen für %1$d Minuten zu pausieren, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_tempbasalset">TBR mit %1$.2f IE/h für %2$d min wurde erfolgreich gestartet.</string>
<string name="smscommunicator_extendedset">Der erweiterte Bolus %1$.2fU für %2$d Minuten wurde erfolgreich gestartet</string>
<string name="smscommunicator_tempbasalset_percent">Die temporäre Basalrate wurde erfolgreich für %2$d Minuten auf %1$d%% gesetzt</string>
<string name="smscommunicator_tempbasalfailed">Das Starten der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_extendedfailed">Die Abgabe des erweiterten Bolus ist fehlgeschlagen</string>
<string name="smscommunicator_basalstopreplywithcode">Antworte mit dem Code %1$s, um die temporäre Basalrate zu beenden</string>
<string name="smscommunicator_extendedstopreplywithcode">Antworte mit dem Code %1$s, um den erweiterten Bolus zu beenden</string>
<string name="smscommunicator_tempbasalcanceled">TBR abgebrochen</string>
<string name="smscommunicator_extendedcanceled">Die Abgabe des erweiterten Bolus wurde abgebrochen</string>
<string name="smscommunicator_tempbasalcancelfailed">Das Abbrechen der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_extendedcancelfailed">Der Abbruch des erweiterten Bolus ist fehlgeschlagen</string>
<string name="smscommunicator_unknowncommand">Unbekannter Befehl oder falsche Antwort</string>
<string name="quickwizard">QuickWizard</string>
<string name="quickwizardsettings">QuickWizard-Einstellungen</string>
<string name="overview_editquickwizard_buttontext">Schaltflächen-Text:</string>
@ -1072,6 +1089,7 @@ Unerwartetes Verhalten.</string>
<string name="mute_alert">Stumm</string>
<string name="pump_alert">Pumpenalarm</string>
<string name="log_site_changes">Katheterwechsel protokollieren</string>
<string name="log_reservoir_changes">Reservoirwechsel aufzeichnen</string>
<string name="log_tube_changes">Schlauchwechsel protokollieren</string>
<string name="log_battery_changes">Batteriewechsel protokollieren</string>
<string name="log_operating_mode_changes">Wechsel des Betriebsmodus protokollieren</string>
@ -1133,8 +1151,13 @@ Unerwartetes Verhalten.</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Zeitumstellung in weniger als 24 Stunden</string>
<string name="dst_loop_disabled_warning">Zeitumstellung vor weniger als 3 Stunden - Closed Loop deaktiviert</string>
<string name="storage">interne Speicherbegrenzung</string>
<string name="diskfull">Mindestens %1$d MB freier interer Speicher benötigt! Loop abgeschaltet!</string>
<string name="wrongformat">Falsches Format</string>
<string name="sms_wrongcode">Falscher Code. Befehl wurde abgebrochen.</string>
<string name="notconfigured">Nicht konfiguriert</string>
<string name="profileswitchcreated">Profilwechsel wurde erstellt</string>
<plurals name="objective_days">
<item quantity="one">%1$d Tag</item>
<item quantity="other">%1$d Tage</item>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_code">Υπενθύμιση R1</string>
<string name="alert_r2_code">Υπενθύμιση R2</string>
<string name="alert_r3_code">Υπενθύμιση R3</string>
<string name="alert_r4_code">Υπενθύμιση R4</string>
<string name="alert_r7_code">Υπενθύμιση R7</string>
<string name="alert_w31_code">Προειδοποίηση W31</string>
<string name="alert_w32_code">Προειδοποίηση W32</string>
<string name="alert_w33_code">Προειδοποίηση W33</string>
<string name="alert_w34_code">Προειδοποίηση W34</string>
<string name="alert_w36_code">Προειδοποίηση W36</string>
<string name="alert_w38_code">Προειδοποίηση W38</string>
<string name="alert_w39_code">Προειδοποίηση W39</string>
<string name="alert_m20_code">Συντήρηση M20</string>
<string name="alert_m21_code">Συντήρηση M21</string>
<string name="alert_m22_code">Συντήρηση M22</string>
<string name="alert_m23_code">Συντήρηση M23</string>
<string name="alert_m24_code">Συντήρηση M24</string>
<string name="alert_m25_code">Συντήρηση M25</string>
<string name="alert_m26_code">Συντήρηση M26</string>
<string name="alert_m27_code">Συντήρηση M27</string>
<string name="alert_m28_code">Συντήρηση M28</string>
<string name="alert_m29_code">Συντήρηση M29</string>
<string name="alert_m30_code">Συντήρηση M30</string>
<string name="alert_e6_code">Σφάλμα E6</string>
<string name="alert_e10_code">Σφάλμα E10</string>
<string name="alert_e13_code">Σφάλμα E13</string>
</resources>

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<?xml version="1.0" encoding="utf-8"?><!--Generated by crowdin.com-->
<resources>
<string name="treatmentssafety_title">Ασφάλεια Θεραπειών</string>
<string name="treatmentssafety_maxbolus_title">Μέγιστο Επιτρεπτό bolus[U]</string>
@ -44,6 +43,8 @@
<string name="description_sensitivity_oref1">Η ευαισθησία υπολογίζεται από 8h δεδομένα στο παρελθόν και οι υδατάνθρακες (αν δεν έχουν απορροφηθεί) κόβονται μετά από χρονικό διάστημα που καθορίζεται στις επιλογές. Η προσθήκη υπολογίζει ακόμα το UAM.</string>
<string name="description_sensitivity_weighted_average">Η ευαισθησία υπολογίζεται ως ο σταθμισμένος μέσος όρος των αποκλίσεων. Νεότερες αποκλίσεις έχουν μεγαλύτερο βάρος. Η ελάχιστη απορρόφηση υδατανθράκων υπολογίζεται από τον χρόνο της μέγιστης απορρόφησης υδατανθράκων από τις επιλογές. Αυτός ο αλγόριθμος είναι ο πιο γρήγορος για να ακολουθεί τις αλλαγές της ευαισθησίας.</string>
<string name="description_source_dexcom_g5">Λάβετε τις τιμές BG από την εφαρμογή του Dexcom G5.</string>
<string name="description_source_dexcom_g6">Λάβετε τις τιμές BG από την εφαρμογή του Dexcom G6.</string>
<string name="description_source_eversense">Λάβετε τις τιμές BG από την εφαρμογή του Eversense.</string>
<string name="description_source_glimp">Λάβετε τις τιμές BG από το Glimp.</string>
<string name="description_source_mm640g">Λάβετε τις τιμές BG από το 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Λήψη δεδομένων BG από Nightscout</string>
@ -52,6 +53,7 @@
<string name="description_wear">Παρακολουθεί και ελέγχει το AndroidAPS χρησιμοποιώντας το ρολόι σας WearOS.</string>
<string name="description_xdrip_status_line">Δείτε πληροφορίες σχετικά με το κύκλωμά σας στην πρόσοψη xDrip +.</string>
<string name="description_sms_communicator">Ελεγξτε απομακρυσμένα το AndroidAPS χρησιμοποιώντας τις εντολές SMS.</string>
<string name="objectives_button_back">Πίσω</string>
<string name="objectives_button_start">Έναρξη</string>
<string name="objectives_button_verify">Επικύρωση</string>
<string name="nsprofileview_units_label">Μονάδες</string>
@ -263,6 +265,10 @@
<string name="smscommunicator_bolusreplywithcode">Για έγχυση bolus %1$.2fU στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Για αποστολή καλιμπραρίσματος %1$.2f στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_bolusfailed">Αποτυχία Bolus</string>
<string name="bolusdelivered">Bolus %1$.2fU δόθηκε επιτυχώς</string>
<string name="bolusrequested">Προς έγχυση %1$.2fU</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU δόθηκε επιτυχώς</string>
<string name="bolusdelivering">Εγχύεται %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Άδεια για απομακρυσμένες εντολές μέσω SMS</string>
<string name="glucosetype_finger">Δάκτυλο</string>
<string name="glucosetype_sensor">Αισθητήρας</string>
@ -332,11 +338,24 @@
<string name="valuelimitedto">Το %1$.2f περιορίζεται σε %2$.2f</string>
<string name="valueoutofrange" formatted="false">Η τιμή %s είναι έξω από τα όρια</string>
<string name="smscommunicator_remotecommandnotallowed">Δεν επιτρέπεται απομακρυσμένη εντολή</string>
<string name="smscommunicator_remotebolusnotallowed">Απομακρυσμένο bolus μη διαθέσιμο. Δοκιμάστε ξανά αργότερα.</string>
<string name="smscommunicator_basalreplywithcode">Για έναρξη βασικού %1$.2fU/h για %2$d λεπτά στείλτε κωδικό %3$s</string>
<string name="smscommunicator_profilereplywithcode">Για αλλαγή προφίλ σε %1$s %2$d%% στείλτε κωδικό %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Για έναρξη εκτεταμένου bolus %1$.2fU για %2$d λεπτά στείλτε κωδικό %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Για έναρξη βασικού %1$d%% για %2$d λεπτά στείλτε κωδικό %3$s</string>
<string name="smscommunicator_suspendreplywithcode">Για αναστολή κυκλκώματος για %1$d λεπτών στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_tempbasalset">Προσωρινός Ρυθμός %1$.2fU/h για %2$d λεπτά ξεκίνησε επιτυχώς</string>
<string name="smscommunicator_extendedset">Εκτεταμένο bolus %1$.2fU για %2$d λεπτά ξεκίνησε επιτυχώς</string>
<string name="smscommunicator_tempbasalset_percent">Προσωρινός Ρυθμός %1$d%% για %2$d λεπτά ξεκίνησε επιτυχώς</string>
<string name="smscommunicator_tempbasalfailed">Εκκίνηση Προσωρινού Ρυθμού απέτυχε</string>
<string name="smscommunicator_extendedfailed">Έναρξη εκτεταμένου bolus απέτυχε</string>
<string name="smscommunicator_basalstopreplywithcode">Για κλείσιμο Προσωρινού Ρυθμού στείλτε κωδικό %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">Για κλείσιμο Εκτεταμένου bolus στείλτε κωδικό %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Ο Προσωρινός Ρυθμός ακυρώθηκε</string>
<string name="smscommunicator_extendedcanceled">Εκτεταμένο bolus ακυρώθηκε</string>
<string name="smscommunicator_tempbasalcancelfailed">Ακύρωση Προσωρινού Ρυθμού απέτυχε</string>
<string name="smscommunicator_extendedcancelfailed">Η ακύρωση του Εκτεταμένου bolus απέτυχε</string>
<string name="smscommunicator_unknowncommand">Άγνωστη εντολή ή λάθος απάντηση</string>
<string name="quickwizard">Γρήγορος Οδηγός</string>
<string name="quickwizardsettings">Ρυθμίσεις Γρήγορου Οδηγού</string>
<string name="overview_editquickwizard_buttontext">Κείμενο στο πλήκτρο:</string>
@ -399,6 +418,7 @@
<string name="array_of_elements">Πεδίο %1$d Στοιχεία.\nΤρέχουσα τιμή:</string>
<string name="openapsma_autosensdata_label">Δεδομένα Autosens</string>
<string name="openapsma_scriptdebugdata_label">Εντοπισμός σφαλμάτων δέσμης ενεργειών</string>
<string name="openapsama_useautosens">Χρήση του Autosens</string>
<string name="refresheventsfromnightscout">Ανανέωσε συμβάντα από NS</string>
<string name="deletefuturetreatments">Διαγραφή συμβάντων στο μέλλον</string>
<string name="eatingsoon">Γεύμα Σύντομα</string>
@ -539,6 +559,12 @@
<string name="insulin_shortname">INS</string>
<string name="enablesuperbolus">Ενεργοποίηση superbolus στον σύντομο οδηγό</string>
<string name="enablesuperbolus_summary">Ενεργοποιήστε την λειτουργία superbolus στον σύντομο οδηγό. Μην το κάνετε μέχρι να μάθετε τι ακριβώς κάνει. ΜΠΟΡΕΙ ΝΑ ΕΓΧΥΣΕΙ ΠΑΡΑΠΑΝΩ ΔΟΣΕΙΣ ΙΝΣΟΥΛΙΝΗΣ ΑΝ ΧΡΗΣΙΜΟΠΟΙΗΘΕΙ ΛΑΝΘΑΣΜΕΝΑ!</string>
<string name="show_statuslights">Εμφάνιση του φωτισμού κατάστασης στην αρχική οθόνη</string>
<string name="show_statuslights_summary">Ενεργοποίηση του φωτισμού κατάστασης για cage, iage, sage, reservoir και επίπεδο μπεταρίας στην αρχική οθόνη.</string>
<string name="statuslights_res_warning">Όριο προειδοποίησης χαμηλής αμπούλας [U]</string>
<string name="statuslights_res_critical">Όριο προειδοποίησης πολύ χαμηλής αμπούλας [U]</string>
<string name="statuslights_bat_warning">Όριο προειδοποίησης χαμηλής μπαταρίας [%]</string>
<string name="statuslights_bat_critical">Όριο προειδοποίησης πολύ χαμηλής μπαταρίας [%]</string>
<string name="iob">IOB</string>
<string name="cob">COB</string>
<string name="virtualpump_firmware_label">Έκδοση</string>
@ -546,6 +572,7 @@
<string name="danar_bluetooth_status">Κατάσταση Bluetooth</string>
<string name="nav_about">Σχετικά με</string>
<string name="smscommunicator_missingsmspermission">Απουσία δικαιωμάτων SMS</string>
<string name="smscommunicator_missingphonestatepermission">Λείπει η άδεια κατάστασης τηλεφώνου</string>
<string name="xdripstatus_settings">Κατάσταση xDrip (ρολόι)</string>
<string name="xdripstatus">Γραμμή Κατάστασης xDrip (ρολόι)</string>
<string name="xdripstatus_shortname">xds</string>
@ -692,7 +719,10 @@
<string name="btwatchdog_title">BT Watchdog</string>
<string name="btwatchdog_summary">Απενεργοποιεί το bluetooth του τηλεφώνου για ένα δευτερόλεπτο αν δεν είναι δυνατή η σύνδεση με την αντλία. Αυτό μπορεί να βοηθήσει σε ορισμένα τηλέφωνα όπου το bluetooth παγώνει.</string>
<string name="DexcomG5">Εφαρμογή DexcomG5 (τροποποιημένη)</string>
<string name="DexcomG6">DexcomG6 App (τροποποιημένη)</string>
<string name="eversense">Eversense App (τροποποιημένη)</string>
<string name="dexcomg5_nsupload_title">Ανέβασμα δεδομένων BG στο NS</string>
<string name="bgsource_upload">Ανέβασμα ρυθμίσεων BG</string>
<string name="wear_detailed_delta_title">Εμφάνιση λεπτομερών στατιστικών</string>
<string name="wear_detailed_delta_summary">Δείξτε τη διαφορά με ένα επιπλέον δεκαδικό ψηφίο</string>
<string name="smbmaxminutes_summary">Τα μέγιστα λεπτά του βασικού ρυθμού που περιορίζουν το SMB να</string>
@ -758,6 +788,7 @@
<string name="combo_error_bolus_verification_failed">Η έγχυση του bolus και η επαλήθευση του ιστορικού αντλίας απέτυχε, ελέγξτε την αντλία. Εάν έχει γίνει έγχυση bolus, θα προστεθεί στις θεραπείες κατά την επόμενη σύνδεση με την αντλία.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Δεν υπάρχει αρκετή ινσουλίνη στην αμπούλα για το bolus</string>
<string name="extendedbolusdeliveryerror">Σφάλμα έγχυσης εκτεταμένου bolus</string>
<string name="insightpump_shortname">Sight</string>
<string name="insightpump">Αντλία Insight</string>
<string name="status_no_colon">Κατάσταση</string>
<string name="changed">Τροποποίηση</string>
@ -832,6 +863,7 @@
<string name="data_choices">Επιλογές δεδομένων</string>
<string name="fabric_upload">Αποστολή δεδομένων στο εργοστάσιο</string>
<string name="allow_automated_crash_reporting">Να επιτρέπεται η αυτόματη αποστολή αναφορών σφάλματος και χαρακτηριστικά χρήσης δεδομένων στους προγραμματιστές μέσω του fabric.io. service.</string>
<string name="g5appnotdetected">Ενημερώστε την εφαρμογή G5 στην υποστηριζόμενη έκδοση</string>
<string name="start_activity_tt">Εκκίνηση δραστηριότητας TT</string>
<string name="start_eating_soon_tt">Εκκίνηση Τρώω σύντομα ΤΤ</string>
<string name="temptargetshort">TT</string>
@ -874,6 +906,8 @@
<string name="closedmodedisabledinpreferences">Το κλειστό κύκλωμα είναι απενεργοποιημένο στις Επιλογές</string>
<string name="autosensdisabledinpreferences">Το Autosens είναι απενεργοποιημένο στις Επιλογές</string>
<string name="smbdisabledinpreferences">Το SMB απενεργοποιήθηκε στις Επιλογές</string>
<string name="uamdisabledinpreferences">Το UAM απενεργοποιήθηκε στις Επιλογές</string>
<string name="uamdisabledoref1notselected">Το UAM απενεργοποιήθηκε επειδή είναι ενεργοποιημένο στην προσθήκη ευαισθησία στο Oref1</string>
<string name="limitingbasalratio">Ο μέγιστος βασικός ρυθμός περιορίζεται σε %1$.2f U/h λόγω ότι %2$s</string>
<string name="pumplimit">όριο αντλίας</string>
<string name="itmustbepositivevalue">πρέπει να είναι θετική τιμή</string>
@ -995,6 +1029,7 @@
<string name="nth_objective">%1$d. Στόχος</string>
<string name="poctech">Poctech</string>
<string name="description_source_poctech">Λάβετε τις τιμές BG από την εφαρμογή Poctech</string>
<string name="description_source_tomato">Λάβετε τιμές BG από Tomato app (MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">Ο υψηλός προσωρινός στόχος ανεβάζει την ευαισθησία</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Αύξηση ευαισθησίας για προσωρινό στόχο > = 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Ο χαμηλός προσωρινός στόχος μειώνει την ευαισθησία</string>
@ -1036,6 +1071,90 @@
<string name="insulinlimitviolation">Υπέρβαση του ορίου ινσουλίνης</string>
<string name="loop_openmode_min_change">Ελάχιστο αίτημα για αλλαγή [%]</string>
<string name="loop_openmode_min_change_summary">Το κύκλωμα δημιουργεί μια νέα αίτηση αλλαγής μόνο αν η αλλαγή είναι μεγαλύτερη από αυτήν την τιμή. Η προεπιλεγμένη τιμή είναι 20%</string>
<string name="pairfirst">Παρακαλώ συνδέστε την αντλία στο τηλέφωνο!</string>
<string name="searching_for_devices">Αναζήτηση συσκευών…</string>
<string name="please_wait">Περιμένετε…</string>
<string name="pairing_completed">Σύζευξη ολοκληρώθηκε</string>
<string name="code_compare">Ταιριάζουν οι εμφανιζόμενοι κωδικοί με αυτούς της αντλίας;</string>
<string name="insight_pairing">Σύζευξη Insight</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2fU / %2$.2fU παραδόθηκε</string>
<string name="insight_alert_formatter">%1$s: %2$s</string>
<string name="tube_changed">Σωληνάκι αλλάχθηκε</string>
<string name="pump_time_updated">Η ώρα στην αντλία άλλαξε</string>
<string name="confirm">Επιβεβαίωση</string>
<string name="mute_alert">Σίγαση</string>
<string name="pump_alert">Συναγερμός αντλίας</string>
<string name="log_site_changes">Αλλαγές αρχείου καταγραφής</string>
<string name="log_reservoir_changes">Αλλαγές αρχείου αμπούλας</string>
<string name="log_tube_changes">Αλλαγές αρχείου σωλήνα</string>
<string name="log_battery_changes">Αλλαγές αρχείου μπαταρίας</string>
<string name="log_operating_mode_changes">Αλλαγές αρχείου κατάστασης λειτουργίας</string>
<string name="log_alerts">Τοπικές Ειδοποιήσεις</string>
<string name="enable_tbr_emulation">Ενεργοποίηση εξομοίωσης TBR</string>
<string name="enable_tbr_emulation_summary">Χρησιμοποιείστε εκτεταμένα bolus αντί για TBR για παράκαμψη του ορίου 250%</string>
<string name="disconnect_delay">Αποσυνδέστε καθυστέρηση [s]</string>
<string name="serial_number">Serial number</string>
<string name="release_software_version">Απελευθέρωση έκδοση λογισμικού</string>
<string name="ui_processor_software_version">Έκδοση λογισμικού επεξεργαστή UI</string>
<string name="pc_processor_software_version">Έκδοση λογισμικού επεξεργαστή PC</string>
<string name="md_tel_processor_software_version">Έκδοση λογισμικού επεξεργαστή MD tel</string>
<string name="safety_processor_software_version">Έκδοση λογισμικού ασφαλείας επεξεργαστή</string>
<string name="bt_info_page_version">Έκδοση σελίδας πληροφοριών BT</string>
<string name="bluetooth_address">Διεύθυνση Bluetooth</string>
<string name="system_id_appendix">Σύστημα ID προσάρτημα</string>
<string name="manufacturing_date">Ημερομηνία κατασκευής</string>
<string name="delete_pairing">Διαγραφή σύζευξης</string>
<string name="pairing_information">Πληροφορίεςσύζευξης</string>
<string name="refreh_status">Ανανέωση κατάστασης</string>
<string name="start_pump">Έναρξη αντλίας</string>
<string name="stop_pump">Διακοπή αντλίας</string>
<string name="operating_mode">Κατάσταση λειτουργίας</string>
<string name="insight_status">Κατάσταση</string>
<string name="tdd_bolus">TDD Bolus</string>
<string name="tdd_basal">TDD βασικός</string>
<string name="tdd_total">TDD σύνολο</string>
<string name="recovering">Ανάκτηση</string>
<string name="not_paired">Μη σύζευξη</string>
<string name="last_connected">Τελευταία σύνδεση</string>
<string name="started">Ξεκίνησε</string>
<string name="stopped">Σταμάτησε</string>
<string name="tbr_formatter">%1$d%% για %2$d / %3$d λεπτά</string>
<string name="extended_bolus">Εκτεταμένο bolus</string>
<string name="multiwave_bolus">Συνδυαστικό bolus</string>
<string name="eb_formatter">%1$.2f / %2$.2f U για %3$d λεπτά</string>
<string name="enable_tbr_over_notification">Ενεργοποίηση ειδοποίησης TBR τέλος\n (ρύθμιση αντλίας)</string>
<string name="disable_tbr_over_notification">Απενεργοποίηση ειδοποίησης TBR τέλος\n (ρύθμιση αντλίας)</string>
<string name="refresh">Ανανέωση</string>
<string name="description_pump_insight_local">Ενσωμάτωση αντλίας για αντλίες Accu-Chek Insight</string>
<string name="not_inserted">Δεν έχει εισαχθεί</string>
<string name="short_status_last_connected">Τελευταία σύνδεση: %1$d λεπτά πριν</string>
<string name="short_status_tbr">TBR: %1$d%% για %2$d / %3$d λεπτά</string>
<string name="short_status_extended">Εκτεταμένο: %1$.2f / %2$.2f U για %3$d λεπτά</string>
<string name="short_status_multiwave">Συνδυαστικό: %1$.2f / %2$.2f U για %3$d λεπτά</string>
<string name="short_status_tdd">TDD: %1$.2f</string>
<string name="short_status_reservoir">Αμπούλα:%1$.2fU</string>
<string name="short_status_battery">Μπατ.:%1$d%%</string>
<string name="max_recovery_duration">Μέγ. διάρκεια αποκατάστασης [s]</string>
<string name="min_recovery_duration">Ελάχ. διάρκεια αποκατάστασης [s]</string>
<string name="recovery_duration">Διάρκεια αποκατάστασης</string>
<string name="timeout_during_handshake">Τέλος χρόνου κατά τη διάρκεια handshake - επαναφορά bluetooth</string>
<string name="profile_total">== ∑ %1$s U</string>
<string name="profile_ins_units_per_hout">U/h</string>
<string name="profile_carbs_per_unit">g/U</string>
<string name="profile_per_unit">/U</string>
<string name="dexcom_lognssensorchange_title">Αλλαγή αρχείου αισθητήρα σε NS</string>
<string name="dexcom_lognssensorchange_summary">Δημιουργία συμβάντος «Αλλαγή αισθητήρα» στο NS αυτόματα με έναρξη αισθητήρα</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Αλλαγή σε Θερινή ώρα σε 24h ή λιγότερο</string>
<string name="dst_loop_disabled_warning">Η Θερινή ώρα αλλάζει σε λιγότερο από 3 ώρες - Απενεργοποιήθηκε το κλειστό κύκλωμα</string>
<string name="storage">περιορισμός εσωτερικής μνήμης</string>
<string name="diskfull">Ελευθερώστε τουλάχιστον %1$d MB από εσωτερική μνήμη! Κύκλωμα απενεργοποιήθηκε!</string>
<string name="wrongformat">Λάθος μορφή αρχείου</string>
<string name="sms_wrongcode">Λάθος κωδικός. Η εντολή ακυρώθηκε.</string>
<string name="notconfigured">Δεν έχει ρυθμιστεί</string>
<string name="profileswitchcreated">Δημιουργήθηκε αλλαγή προφίλ</string>
<plurals name="objective_days">
<item quantity="one">%1$d ημέρα</item>
<item quantity="other">%1$d ημέρες</item>

View file

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources>
<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="nav_preferences">Preferencias</string>
<string name="nav_refreshtreatments">Actualizar los tratamientos desde NS</string>
@ -1129,6 +1127,7 @@
<string name="dexcom_lognssensorchange_summary">Crear evento \"Cambio sensor\" en la automatización NS al iniciar el sensor</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="storage">restricción de almacenamiento interno</string>
<plurals name="objective_days">
<item quantity="one">%1$d día</item>
<item quantity="other">%1$d días</item>

View file

@ -1087,6 +1087,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="mute_alert">Coupure son</string>
<string name="pump_alert">Alerte de la pompe</string>
<string name="log_site_changes">Enreg. changement de site</string>
<string name="log_reservoir_changes">Enregistrer changements de réservoir</string>
<string name="log_tube_changes">Enreg. changement de tubulure</string>
<string name="log_battery_changes">Enreg. changement batterie</string>
<string name="log_operating_mode_changes">Enreg. changement mode de fonctionnement</string>
@ -1148,6 +1149,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Changement d\'heure d\'été dans moins de 24 heures</string>
<string name="dst_loop_disabled_warning">Changement d\'heure d\'été dans moins de 3 heures - Boucle fermée désactivée</string>
<string name="storage">stockage interne limité</string>
<string name="diskfull">Boucle désactivée ! Libérez au moins %1$d Mo du stockage interne !</string>
<string name="wrongformat">Format incorrect</string>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_code">Priminimas R1</string>
<string name="alert_r2_code">Priminimas R2</string>
<string name="alert_r3_code">Priminimas R3</string>
<string name="alert_r4_code">Priminimas R4</string>
<string name="alert_r7_code">Priminimas R7</string>
<string name="alert_w31_code">Įspėjimas W31</string>
<string name="alert_w32_code">Įspėjimas W32</string>
<string name="alert_w33_code">Įspėjimas W33</string>
<string name="alert_w34_code">Įspėjimas W34</string>
<string name="alert_w36_code">Įspėjimas W36</string>
<string name="alert_w38_code">Įspėjimas W38</string>
<string name="alert_w39_code">Įspėjimas W39</string>
<string name="alert_m20_code">Servisas M20</string>
<string name="alert_m21_code">Servisas M21</string>
<string name="alert_m22_code">Servisas M22</string>
<string name="alert_m23_code">Servisas M23</string>
<string name="alert_m24_code">Servisas M24</string>
<string name="alert_m25_code">Servisas M25</string>
<string name="alert_m26_code">Servisas M26</string>
<string name="alert_m27_code">Servisas M27</string>
<string name="alert_m28_code">Servisas M28</string>
<string name="alert_m29_code">Servisas M29</string>
<string name="alert_m30_code">Servisas M30</string>
<string name="alert_e6_code">Klaida E6</string>
<string name="alert_e10_code">Klaida E10</string>
<string name="alert_e13_code">Klaida E13</string>
</resources>

View file

@ -1,3 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r7_description"><![CDATA[Kiekis: <b>%1$d%%</b>\nTrukmė: <b>%2$s h</b>]]></string>
<string name="alert_w31_description"><![CDATA[Rezervuaro tūris: <b>%1$s U</b>]]></string>
<string name="alert_w32_description">Pakeiskite bateriją.</string>
<string name="alert_w33_description">Nustatykite laiką/datą.</string>
<string name="alert_w34_description">Kreipkitės į Accu-Chek palaikymo tarnybą.</string>
<string name="alert_w36_description"><![CDATA[Kiekis: <b>%1$d%%</b><br/>Trukmė: <b>%2$s h</b>]]></string>
<string name="alert_w38_description"><![CDATA[Suprogramuota: <b>%1$s U</b><br/>Suleista: <b>%2$s U</b>]]></string>
<string name="alert_m20_description">Įdėkite rezervuarą.</string>
<string name="alert_m21_description">Pakeiskite rezervuarą.</string>
<string name="alert_m22_description">Pakeiskite bateriją.</string>
<string name="alert_m23_description">Patikrinkite pompos būseną.</string>
<string name="alert_m24_description">Pakeiskite infuzijos rinkinį.</string>
<string name="alert_m25_description">Kreipkitės į Accu-Chek palaikymo tarnybą.</string>
<string name="alert_m26_description">Pakeiskite rezervuarą.</string>
<string name="alert_m27_description">Iš naujo paleiskite duomenų atsisiuntimą.</string>
<string name="alert_m28_description">Patikrinkite pompos būseną.</string>
<string name="alert_m29_description">Nustatykite baterijos tipą.</string>
<string name="alert_m30_description">Nustatykite rezervuaro tipą.</string>
<string name="alert_e6_description">Pakeiskite bateriją ir rezervuarą.</string>
<string name="alert_e10_description">Pakeiskite rezervuarą.</string>
<string name="alert_e13_description">Pakeiskite kalbą.</string>
</resources>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_title">Suleisti bolusą</string>
<string name="alert_r2_title">Praleistas bolusas</string>
<string name="alert_r3_title">Žadintuvas</string>
<string name="alert_r4_title">Keisti infuzijos rinkinį</string>
<string name="alert_r7_title">LBD baigtas</string>
<string name="alert_w31_title">Mažai insulino rezervuare</string>
<string name="alert_w32_title">Baterija senka</string>
<string name="alert_w33_title">Netinkamas laikas/data</string>
<string name="alert_w34_title">Garantija pasibaigė</string>
<string name="alert_w36_title">LBD atšauktas</string>
<string name="alert_w38_title">Bolusas atšauktas</string>
<string name="alert_w39_title">Eksploatacijos laikas artėja prie pabaigos</string>
<string name="alert_m20_title">Rezervuaras neįdėtas</string>
<string name="alert_m21_title">Rezervuaras tuščias</string>
<string name="alert_m22_title">Baterija tuščia</string>
<string name="alert_m23_title">Automatinis išjungimas - pompa sustabdyta</string>
<string name="alert_m24_title">Užsikimšimas</string>
<string name="alert_m25_title">Eksploatacijos laikas pasibaigė</string>
<string name="alert_m26_title">Rezervuaro keitimas neužbaigtas</string>
<string name="alert_m27_title">Atsisiųsti nepavyko</string>
<string name="alert_m28_title">Pristabdymo laikas baigėsi</string>
<string name="alert_m29_title">Baterijos tipas nenustatytas</string>
<string name="alert_m30_title">Rezervuaro tipas nenustatytas</string>
<string name="alert_e6_title">Mechaninė klaida</string>
<string name="alert_e10_title">Stūmoklio grąžinimo klaida</string>
<string name="alert_e13_title">Kalbos klaida</string>
</resources>

View file

@ -1,3 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="connection_failed">Prisijungti nepavyko</string>
<string name="connection_lost">Nutrūko ryšys</string>
<string name="pairing_rejected">Susiejimas atmestas</string>
<string name="socket_creation_failed">Jungtis nesukurta</string>
<string name="timeout">Laukimo laikas viršytas</string>
<string name="maximum_number_of_bolus_type_already_running">Maksimalus bolusų tipų skaičius aktyvus</string>
<string name="no_active_tbr_to_cancel">Nėra aktyvaus LBD, kurį būtų galima atšaukti</string>
<string name="no_active_tbr_to_change">Nėra aktyvaus LBD, kurį būtų galima pakeisti</string>
<string name="no_such_bolus_to_cancel">Nėra atšaukiamo boliuso</string>
<string name="pump_already_in_that_state_exception">Pompa jau šiame režime</string>
<string name="run_mode_not_allowed">Veikimo režimas neleidžiamas</string>
</resources>

File diff suppressed because it is too large Load diff

View file

@ -54,6 +54,7 @@
<string name="description_wear">Monitoruj i kontroluj AndroidAPS, korzystając z SmartWatch WearOS.</string>
<string name="description_xdrip_status_line">Pokaż informacje o swojej pętli na watchface xDrip+.</string>
<string name="description_sms_communicator">Zdalne sterowanie AndroidAPS za pomocą poleceń SMS.</string>
<string name="objectives_button_back">Cofnij</string>
<string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Sprawdź</string>
<string name="nsprofileview_units_label">Jednostki</string>
@ -265,6 +266,10 @@
<string name="smscommunicator_bolusreplywithcode">Aby dostarczyć bolus %1$.2fU wprowadź kod %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Aby wysłać kalibrację %1$.2f wprowadź kod %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus nieudany</string>
<string name="bolusdelivered">Bolus %1$.2fU dostarczony prawidłowo</string>
<string name="bolusrequested">Zamierzam podać %1$.2fU</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU dostarczony prawidłowo</string>
<string name="bolusdelivering">Dostarczam %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Zezwalaj na komendy zdalne via SMS</string>
<string name="glucosetype_finger">Palec</string>
<string name="glucosetype_sensor">Sensor</string>

View file

@ -12,14 +12,19 @@
<string name="alert_w34_title">Fora da Garantia</string>
<string name="alert_w36_title">Basal temporária cancelada</string>
<string name="alert_w38_title">Bolus cancelado</string>
<string name="alert_w39_title">Aviso de periodo de empréstimo</string>
<string name="alert_m20_title">Cartucho não inserido</string>
<string name="alert_m21_title">Cartucho vazio</string>
<string name="alert_m22_title">Bateria vazia</string>
<string name="alert_m23_title">Desligar automático - bomba parada</string>
<string name="alert_m24_title">Oclusão</string>
<string name="alert_m25_title">Fim de período de empréstimo - Fim de operação</string>
<string name="alert_m26_title">Mudança de Cartucho não concluída</string>
<string name="alert_m27_title">Falha no download de dados</string>
<string name="alert_m28_title">Tempo limite de modo de pausa</string>
<string name="alert_m29_title">Tipo de bateria não definido</string>
<string name="alert_m30_title">Tipo de Cartucho não definido</string>
<string name="alert_e6_title">Erro mecânico</string>
<string name="alert_e10_title">Erro Rebobinar</string>
<string name="alert_e13_title">Erro de idioma</string>
</resources>

View file

@ -266,6 +266,10 @@
<string name="smscommunicator_bolusreplywithcode">Para dar bolus %1$.2fU responder com código %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Para enviar calibração %1$.2f responder com código %2$s</string>
<string name="smscommunicator_bolusfailed">Bólus falhado</string>
<string name="bolusdelivered">Bólus %1$.2fU enviado com êxito</string>
<string name="bolusrequested">Vai ser enviado %1$.2fU</string>
<string name="smscommunicator_bolusdelivered">Bólus %1$.2fU enviado com êxito</string>
<string name="bolusdelivering">A enviar %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Permitir comandos remotos via SMS</string>
<string name="glucosetype_finger">Dedo</string>
<string name="glucosetype_sensor">Sensor</string>
@ -340,6 +344,8 @@
<string name="smscommunicator_tempbasalfailed">Início basal temp falhou </string>
<string name="smscommunicator_tempbasalcanceled">Basal temp cancelada</string>
<string name="smscommunicator_tempbasalcancelfailed">Não foi possivel cancelar a basal temp</string>
<string name="smscommunicator_extendedcancelfailed">Falhou o cancelamento do bolus extendido</string>
<string name="smscommunicator_unknowncommand">Comando desconhecido ou resposta errada</string>
<string name="quickwizard">Assistente Rápido</string>
<string name="quickwizardsettings">Definições do Assistente Rápido</string>
<string name="overview_editquickwizard_buttontext">Texto do botão:</string>
@ -1070,19 +1076,23 @@
<string name="mute_alert">Silêncio</string>
<string name="pump_alert">Alerta da Bomba</string>
<string name="log_site_changes">Registar alterações de local</string>
<string name="log_reservoir_changes">Número de unidades do reservatório alteradas</string>
<string name="log_tube_changes">Registar alterações de tubo</string>
<string name="log_battery_changes">Registar mudanças de bateria</string>
<string name="log_operating_mode_changes">Alterações do modo de funcionamento de registo</string>
<string name="log_alerts">Alertas de registo</string>
<string name="enable_tbr_emulation">Ativar a emulação TBR</string>
<string name="enable_tbr_emulation_summary">Usar bolus estendidos em vez de TBRs para contornar o limite de 250%</string>
<string name="disconnect_delay">Atraso de desconexão [s]</string>
<string name="serial_number">Número de série</string>
<string name="release_software_version">Lançar versão de software</string>
<string name="ui_processor_software_version">Versão de software do processador de interface do utilizador</string>
<string name="pc_processor_software_version">Versão do software do processador de PC</string>
<string name="md_tel_processor_software_version">Versão do software do processador MD tel</string>
<string name="safety_processor_software_version">Versão de software do processador de segurança</string>
<string name="bt_info_page_version">Página de informação da versão do BT</string>
<string name="bluetooth_address">Endereço Bluetooth</string>
<string name="system_id_appendix">Apêndice do ID de sistema</string>
<string name="manufacturing_date">Data de fabrico</string>
<string name="delete_pairing">Eliminar emparelhamento</string>
<string name="pairing_information">Informações de emparelhamento</string>
@ -1103,6 +1113,7 @@
<string name="extended_bolus">Bólus estendido</string>
<string name="multiwave_bolus">Bólus Multi-Onda</string>
<string name="eb_formatter">%1$.2f / %2$.2f U por %3$d min</string>
<string name="enable_tbr_over_notification">Desativar notificação do fim da basal temporária\n(configuração da bomba)</string>
<string name="disable_tbr_over_notification">Desativar notificação do fim da basal temporária\n(configuração da bomba)</string>
<string name="refresh">Actualizar</string>
<string name="description_pump_insight_local">Integração de bomba para bombas Accu-Chek Insight</string>
@ -1126,6 +1137,8 @@
<string name="tomato_short">Tomato</string>
<string name="storage">restrição de armazenamento interno</string>
<string name="diskfull">Liberte pelo menos %1$d MB do armazenamento interno! Loop desativado!</string>
<string name="wrongformat">Formato incorrecto</string>
<string name="sms_wrongcode">Código errado. Comando cancelado.</string>
<string name="notconfigured">Não configurado</string>
<string name="profileswitchcreated">Troca de perfil criada</string>
<plurals name="objective_days">

View file

@ -1089,6 +1089,7 @@ Context | Edit Context</string>
<string name="mute_alert">Отключить звук</string>
<string name="pump_alert">Оповещение помпы</string>
<string name="log_site_changes">Журнал изменений места установки</string>
<string name="log_reservoir_changes">Отслеживать замену резервуара</string>
<string name="log_tube_changes">Журнал замены трубки катетера</string>
<string name="log_battery_changes">Журнал замен батареи</string>
<string name="log_operating_mode_changes">Журнал изменений режима работы</string>
@ -1150,6 +1151,7 @@ Context | Edit Context</string>
<string name="tomato">Томато (MiaoMiao)</string>
<string name="tomato_short">Томато</string>
<string name="dst_in_24h_warning">Переход на летнее/зимнее время через 24 часа или менее</string>
<string name="dst_loop_disabled_warning">Переход на летнее время меньше 3 часов назад - Замкнутый цикл отключен</string>
<string name="storage">ограничение по объему карты памяти</string>
<string name="diskfull">Освободите по крайней мере %1$d MB из внутренней памяти! Цикл остановлен!</string>
<string name="wrongformat">Неверный формат</string>

View file

@ -43,17 +43,18 @@
<string name="description_sensitivity_oref0">Citlivosť je počítaná za posledných 24h a sacharidy (ak sú ešte nevstrebané), sú orezané po čase definovanom v nastaveniach.</string>
<string name="description_sensitivity_oref1">Citlivosť je počítaná za posledných 8h a sacharidy (pokiaľ nie sú vstrebané), sú orezané po čase definovanom v nastaveniach. Modul tiež počíta s UAM (neoznámené jedlo).</string>
<string name="description_sensitivity_weighted_average">Citlivosť je počítaná ako vážený priemer z odchýlok. Novšie majú vyššiu prioritu. Minimálna vstrebateľnosť sacharidov je počítaná dynamicky z maximálnej doby vstrebateľnosti definovanej v nastaveniach. Tento algoritmus je najrýchlejší v sledovaní zmien citlivosti.</string>
<string name="description_source_dexcom_g5">Príjmi hodnoty glykémií z upravenej Dexcom G5 aplikácie.</string>
<string name="description_source_dexcom_g6">Prijímam glykémie z upravenej Dexcom G6 aplikácie.</string>
<string name="description_source_eversense">Prijímam glykémie z upravenej Eversense aplikácie.</string>
<string name="description_source_glimp">Príjmi hodnoty glykémií z aplikácie Glimp.</string>
<string name="description_source_mm640g">Príjmi hodnoty glykémií z 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Stiahne hodnoty glykémií z Nightscoutu</string>
<string name="description_source_xdrip">Príjmi hodnoty glykémií z xDripu.</string>
<string name="description_source_dexcom_g5">Získavať hodnoty glykémií z upravenej Dexcom G5 aplikácie.</string>
<string name="description_source_dexcom_g6">Získavať glykémie z upravenej Dexcom G6 aplikácie.</string>
<string name="description_source_eversense">Získavať glykémie z upravenej Eversense aplikácie.</string>
<string name="description_source_glimp">Získavať hodnoty glykémií z aplikácie Glimp.</string>
<string name="description_source_mm640g">Získavať hodnoty glykémií z 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Získavať hodnoty glykémií z Nightscoutu</string>
<string name="description_source_xdrip">Získavať hodnoty glykémií z xDripu.</string>
<string name="description_treatments">Ukladá všetky ošetrenia do databázy</string>
<string name="description_wear">Zobrazovanie stavu a riadenie AndroidAPS z hodiniek s WearOS.</string>
<string name="description_xdrip_status_line">Zobraz informácie o uzavretom okruhu na xDrip+ watchface.</string>
<string name="description_sms_communicator">Ovládaj na diaľku AndroidAPS použitím SMS príkazov.</string>
<string name="objectives_button_back">Naspäť</string>
<string name="objectives_button_start">Začiatok</string>
<string name="objectives_button_verify">Overenie</string>
<string name="nsprofileview_units_label">Jednotky</string>
@ -265,6 +266,10 @@
<string name="smscommunicator_bolusreplywithcode">Pre podanie bolusu %1$.2fU odpovedz SMS kódom %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Pre odoslanie kalibrácie %1$.2f odpovedz SMS kódom %2$s</string>
<string name="smscommunicator_bolusfailed">Chyba pri aplikovaní bolusu</string>
<string name="bolusdelivered">Bolus %1$.2fU podaný úspešne</string>
<string name="bolusrequested">Podávanie %1$.2fU inzulínu</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU podaný úspešne</string>
<string name="bolusdelivering">Podávanie %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Povoliť príkazy na diaľku cez SMS</string>
<string name="glucosetype_finger">Prst</string>
<string name="glucosetype_sensor">Senzor</string>
@ -334,11 +339,24 @@
<string name="valuelimitedto">%1$.2f obmedzené na %2$.2f</string>
<string name="valueoutofrange" formatted="false">Hodnota %s je mimo prednastavený rozsah</string>
<string name="smscommunicator_remotecommandnotallowed">Príkazy na diaľku nie sú povolené</string>
<string name="smscommunicator_remotebolusnotallowed">Diaľkovo ovládaný bolus nie je momentálne povolený. Skúste to neskôr.</string>
<string name="smscommunicator_basalreplywithcode">Pre spustenie bazálu %1$.2fU/h na %2$d min odpovedzte SMS s kódom %3$s</string>
<string name="smscommunicator_profilereplywithcode">Pre prepnutie profilu na %1$s %2$d%% odpovedzte SMS s kódom %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Pre spustenie predĺženého bolusu %1$.2fU na %2$d min odpovedzte SMS s kódom %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Pre spustenie bazálu %1$d%% na %2$d min odpovedzte SMS s kódom %3$s</string>
<string name="smscommunicator_suspendreplywithcode">Pre pozastavenie uzavretého okruhu na %1$d minút odpovedaj SMS s kódom %2$s</string>
<string name="smscommunicator_tempbasalset">Dočasný bazál %1$.2fU/h spustený na %2$d minút</string>
<string name="smscommunicator_extendedset">Predĺžený bolus %1$.2fU na %2$d min úspešne spustený</string>
<string name="smscommunicator_tempbasalset_percent">Dočasný bazál %1$d%% na %2$d minút úspešne spustený</string>
<string name="smscommunicator_tempbasalfailed">Spustenie dočasného bazálu zlyhalo</string>
<string name="smscommunicator_extendedfailed">Spustenie predĺženého bolusu zlyhalo</string>
<string name="smscommunicator_basalstopreplywithcode">Na zastavenie dočasného bazálu odpovedzte SMS s kódom %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">Na zastavenie predĺženého bolusu odpovedzte SMS s kódom %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Dočasný bazál zrušený</string>
<string name="smscommunicator_extendedcanceled">Predĺžený bolus zastavený</string>
<string name="smscommunicator_tempbasalcancelfailed">Zrušenie dočasného bazálu zlyhalo</string>
<string name="smscommunicator_extendedcancelfailed">Zastavenie predĺženého bolusu zlyhalo</string>
<string name="smscommunicator_unknowncommand">Neznámy príkaz alebo chybná odpoveď</string>
<string name="quickwizard">Rýchly bolus</string>
<string name="quickwizardsettings">Nastavenie rýchleho bolusu</string>
<string name="overview_editquickwizard_buttontext">Text na tlačidle:</string>
@ -543,7 +561,7 @@
<string name="enablesuperbolus">Povoliť superbolus</string>
<string name="enablesuperbolus_summary">Povolenie superbolusu v kalkulátore. Nepovoľujte, pokiaľ se nenaučíte, čo to v skutočnosti robí. MÔŽE SPÔSOBIŤ PREDÁVKOVANIE INZULÍNOM PRI NESPRÁVNOM POUŽITÍ!</string>
<string name="show_statuslights">Zobraziť indikátory stavu na domovskej obrazovke</string>
<string name="show_statuslights_summary">Povoliť indikátory stavu pre CAGE, IAGE, SAGE, RESERVOIR a BATTERY LEVEL na domovskej obrazovke.</string>
<string name="show_statuslights_summary">Povoliť indikátory stavu pre CAGE, IAGE, SAGE, Reservoir a Battery Level na domovskej obrazovke.</string>
<string name="statuslights_res_warning">Prah upozornenia na úroveň hladiny zásobníka [U]</string>
<string name="statuslights_res_critical">Prah kritickej úrovne hladiny zásobníka [U]</string>
<string name="statuslights_bat_warning">Prah upozornenia na úroveň batérie [%]</string>
@ -1069,6 +1087,7 @@
<string name="mute_alert">Stlmiť</string>
<string name="pump_alert">Výstraha pumpy</string>
<string name="log_site_changes">Zaznamenať výmenu kanyly</string>
<string name="log_reservoir_changes">Zaznamenať výmenu zásobníka</string>
<string name="log_tube_changes">Zaznamenať výmenu hadičky</string>
<string name="log_battery_changes">Zaznamenať výmenu batérie</string>
<string name="log_operating_mode_changes">Zaznamenať zmenu režimu prevádzky</string>
@ -1129,6 +1148,14 @@
<string name="dexcom_lognssensorchange_summary">Vytvoriť udalosť \"Výmena senzora\" v NS automaticky pri spustení senzora</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Zmena letného času za menej ako 24 hodín</string>
<string name="dst_loop_disabled_warning">Zmena letného času za menej ako 3 hodiny - Uzavretý okruh pozastavený</string>
<string name="storage">obmedzenie interného úložiska</string>
<string name="diskfull">Uvoľnite aspoň %1$d MB z interného úložiska! Uzavretý okruh zakázaný!</string>
<string name="wrongformat">Chybný formát</string>
<string name="sms_wrongcode">Nesprávný kód. Príkaz zrušený.</string>
<string name="notconfigured">Nie je nakonfigurované</string>
<string name="profileswitchcreated">Prepnutie profilu vytvorené</string>
<plurals name="objective_days">
<item quantity="one">%1$d deň</item>
<item quantity="few">%1$d dní</item>

View file

@ -1216,7 +1216,6 @@
<string name="error_adding_treatment_message">A treatment (insulin: %1$.2f, carbs: %2$d, at: %3$s) could not be added to treatments. Please check and manually add a record as appropriate.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), delay: %3$d m</string>
<string name="key_plugin_stats_report_timestamp" translatable="false">key_plugin_stats_report_timestamp</string>
<string name="openaps_noasdata">No autosens data available</string>
<string name="nav_logsettings">Log settings</string>
<string name="resettodefaults">Reset to defaults</string>
@ -1253,6 +1252,7 @@
<string name="mute_alert">Mute</string>
<string name="pump_alert">Pump alert</string>
<string name="log_site_changes">Log site changes</string>
<string name="log_reservoir_changes">Log reservoir changes</string>
<string name="log_tube_changes">Log tube changes</string>
<string name="log_battery_changes">Log battery changes</string>
<string name="log_operating_mode_changes">Log operating mode changes</string>

View file

@ -10,14 +10,19 @@
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_site_changes"
android:title="@string/log_site_changes" />
android:key="insight_log_reservoir_changes"
android:title="@string/log_reservoir_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_tube_changes"
android:title="@string/log_tube_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_site_changes"
android:title="@string/log_site_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_battery_changes"

View file

@ -85,17 +85,24 @@
android:summary="@string/enableuam_summary"
android:title="@string/enableuam" />
<!-- TODO AS-FIX -->
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_high_temptarget_raises_sensitivity"
android:summary="@string/high_temptarget_raises_sensitivity_summary"
android:title="@string/high_temptarget_raises_sensitivity_title" />
android:title="@string/high_temptarget_raises_sensitivity_title"
android:enabled="false"
/>
<!-- TODO AS-FIX -->
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_low_temptarget_lowers_sensitivity"
android:summary="@string/low_temptarget_lowers_sensitivity_summary"
android:title="@string/low_temptarget_lowers_sensitivity_title" />
android:title="@string/low_temptarget_lowers_sensitivity_title"
android:enabled="false"
/>
<PreferenceScreen android:title="@string/advancedsettings_title">

View file

@ -51,7 +51,6 @@ public class GlucoseStatusTest {
when(iobCobCalculatorPlugin.getBgReadings()).thenReturn(generateValidBgData());
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
Assert.assertEquals(214d, glucoseStatus.glucose, 0.001d);
Assert.assertEquals(-2d, glucoseStatus.delta, 0.001d);
Assert.assertEquals(-2.5d, glucoseStatus.short_avgdelta, 0.001d); // -2 -2.5 -3 deltas are relative to current value
@ -65,13 +64,12 @@ public class GlucoseStatusTest {
when(iobCobCalculatorPlugin.getBgReadings()).thenReturn(generateMostRecentBgData());
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
Assert.assertEquals(215d, glucoseStatus.glucose, 0.001d); // (214+216) / 2
Assert.assertEquals(-1.25d, glucoseStatus.delta, 0.001d);
Assert.assertEquals(-1.25d, glucoseStatus.short_avgdelta, 0.001d);
Assert.assertEquals(-1.25d, glucoseStatus.avgdelta, 0.001d);
Assert.assertEquals(-1.0d, glucoseStatus.delta, 0.001d);
Assert.assertEquals(-1.0d, glucoseStatus.short_avgdelta, 0.001d);
Assert.assertEquals(-1.0d, glucoseStatus.avgdelta, 0.001d);
Assert.assertEquals(0d, glucoseStatus.long_avgdelta, 0.001d);
Assert.assertEquals(1514766850000L, glucoseStatus.date); // date is average too
Assert.assertEquals(1514766900000L, glucoseStatus.date); // latest date, even when averaging
}
@Test
@ -117,6 +115,20 @@ public class GlucoseStatusTest {
Assert.assertEquals(0d, GlucoseStatus.average(new ArrayList<>()), 0.001d);
}
@Test
public void calculateGlucoseStatusForLibreTestBgData() {
when(iobCobCalculatorPlugin.getBgReadings()).thenReturn(generateLibreTestData());
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
Assert.assertEquals(100d, glucoseStatus.glucose, 0.001d); //
Assert.assertEquals(-10d, glucoseStatus.delta, 0.001d);
Assert.assertEquals(-10d, glucoseStatus.short_avgdelta, 0.001d);
Assert.assertEquals(-10d, glucoseStatus.avgdelta, 0.001d);
Assert.assertEquals(-10d, glucoseStatus.long_avgdelta, 0.001d);
Assert.assertEquals(1514766900000L, glucoseStatus.date); // latest date
}
@Before
public void initMocking() {
AAPSMocker.mockMainApp();
@ -184,4 +196,25 @@ public class GlucoseStatusTest {
}
return list;
}
List<BgReading> generateLibreTestData() {
List<BgReading> list = new ArrayList<>();
try {
long end_time = 1514766900000L;
double latest_reading = 100d;
// Now
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":" + (latest_reading) + ",\"mills\":" + (end_time) + ",\"direction\":\"Flat\"}"))));
// One minute ago
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":" + (latest_reading) + ",\"mills\":" + (end_time - (1000 * 60 * 1)) + ",\"direction\":\"Flat\"}"))));
// Two minutes ago
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":" + (latest_reading) + ",\"mills\":" + (end_time - (1000 * 60 * 2)) + ",\"direction\":\"Flat\"}"))));
// Three minutes and beyond at constant rate
for (int i=3; i < 50; i++) {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":" + (latest_reading + (i*2)) + ",\"mills\":" + (end_time - (1000 * 60 * i)) + ",\"direction\":\"Flat\"}"))));
}
} catch (JSONException e) {
e.printStackTrace();
}
return list;
}
}

View file

@ -5,10 +5,13 @@ buildscript {
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View file

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
ext {
wearableVersion = "2.0.1"
playServicesWearable = "10.2.1"
playServicesWearable = "16.0.1"
}
def generateGitBuild = { ->