Merge branch 'dev' into automation

This commit is contained in:
Milos Kozak 2019-04-16 21:08:08 +02:00
commit 4ae7efc75f
150 changed files with 2460 additions and 774 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'
@ -44,6 +45,22 @@ def generateGitBuild = { ->
return stringBuilder.toString()
}
def generateGitRemote = { ->
StringBuilder stringBuilder = new StringBuilder();
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'remote', 'get-url', 'origin'
standardOutput = stdout
}
String commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored) {
stringBuilder.append('NoGitSystemAvailable')
}
return stringBuilder.toString()
}
def generateDate = { ->
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
@ -63,9 +80,10 @@ android {
targetSdkVersion 25
multiDexEnabled true
versionCode 1500
version "2.2.1-dev"
version "2.2.3-dev"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote()+ '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// if you change minSdkVersion to less than 11, you need to change executeTask for wear
@ -168,12 +186,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}"
@ -193,11 +210,11 @@ 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.google.android.gms:play-services-wearable:10.2.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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.android.support.constraint:constraint-layout:1.1.3'

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

@ -39,6 +39,7 @@
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -47,10 +48,10 @@
</activity>
<activity android:name=".activities.PreferencesActivity" />
<activity
android:name=".plugins.general.overview.Dialogs.BolusProgressHelperActivity"
android:name=".plugins.general.overview.dialogs.BolusProgressHelperActivity"
android:theme="@style/Theme.AppCompat.Translucent" />
<activity
android:name=".plugins.general.overview.Dialogs.ErrorHelperActivity"
android:name=".plugins.general.overview.dialogs.ErrorHelperActivity"
android:theme="@style/Theme.AppCompat.Translucent" />
<activity android:name=".activities.AgreementActivity" />
<activity android:name=".plugins.pump.danaR.activities.DanaRHistoryActivity" />
@ -73,30 +74,40 @@
<activity android:name=".plugins.pump.danaRS.activities.PairingHelperActivity" />
<activity android:name=".activities.HistoryBrowseActivity" />
<!-- Receive new BG readings from other local apps -->
<receiver
android:name=".receivers.DataReceiver"
android:enabled="true"
android:exported="true">
android:name=".receivers.DataReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<!-- Receive new SMS messages -->
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<!-- Receiver from xDrip -->
<action android:name="com.eveningoutpost.dexdrip.BgEstimate" />
<action android:name="com.eveningoutpost.dexdrip.BgEstimate"/>
<!-- Receiver from 640g uploader -->
<action android:name="com.eveningoutpost.dexdrip.NS_EMULATOR" />
<action android:name="com.eveningoutpost.dexdrip.NS_EMULATOR"/>
<!-- Receiver from glimp -->
<action android:name="it.ct.glicemia.ACTION_GLUCOSE_MEASURED" />
<action android:name="it.ct.glicemia.ACTION_GLUCOSE_MEASURED"/>
<!-- Receiver from DexcomG5 -->
<action android:name="com.dexcom.cgm.DATA" />
<action android:name="com.dexcom.cgm.AndroidAPSEVGCallback.BROADCAST" />
<action android:name="com.dexcom.cgm.g5.AndroidAPSEVGCallback.BROADCAST" />
<action android:name="com.dexcom.cgm.DATA"/>
<action android:name="com.dexcom.cgm.AndroidAPSEVGCallback.BROADCAST"/>
<action android:name="com.dexcom.cgm.g5.AndroidAPSEVGCallback.BROADCAST"/>
<!-- Receiver from Poctech -->
<action android:name="com.china.poctech.data" />
<action android:name="com.china.poctech.data"/>
<!-- Receiver from Tomato -->
<action android:name="com.fanqies.tomatofn.BgEstimate" />
<action android:name="com.fanqies.tomatofn.BgEstimate"/>
</intent-filter>
</receiver>
<!-- Receive new SMS messages -->
<receiver
android:name=".receivers.SmsReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
<!-- Receiver keepalive, scheduled every 30 min -->
<receiver android:name=".receivers.KeepAliveReceiver" />
@ -179,57 +190,57 @@
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_data" />
android:pathPrefix="/nightscout_watch_data"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_data_resend" />
android:pathPrefix="/nightscout_watch_data_resend"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_cancel_bolus" />
android:pathPrefix="/nightscout_watch_cancel_bolus"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_confirmactionstring" />
android:pathPrefix="/nightscout_watch_confirmactionstring"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_initiateactionstring" />
android:pathPrefix="/nightscout_watch_initiateactionstring"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/openwearsettings" />
android:pathPrefix="/openwearsettings"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/sendstatustowear" />
android:pathPrefix="/sendstatustowear"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/sendpreferencestowear" />
android:pathPrefix="/sendpreferencestowear"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_basal" />
android:pathPrefix="/nightscout_watch_basal"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_bolusprogress" />
android:pathPrefix="/nightscout_watch_bolusprogress"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_actionconfirmationrequest" />
android:pathPrefix="/nightscout_watch_actionconfirmationrequest"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_changeconfirmationrequest" />
android:pathPrefix="/nightscout_watch_changeconfirmationrequest"
android:scheme="wear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_cancelnotificationrequest" />
android:pathPrefix="/nightscout_watch_cancelnotificationrequest"
android:scheme="wear" />
</intent-filter>
</service>
<service
@ -261,19 +272,19 @@
<activity
android:name=".activities.SingleFragmentActivity"
android:theme="@style/AppTheme" />
<activity android:name=".plugins.general.maintenance.activities.LogSettingActivity"></activity>
<activity android:name=".plugins.general.maintenance.activities.LogSettingActivity" />
<activity
android:name=".plugins.pump.insight.activities.InsightPairingActivity"
android:theme="@style/AppTheme"
android:label="@string/insight_pairing" />
android:label="@string/insight_pairing"
android:theme="@style/AppTheme" />
<activity
android:name=".plugins.pump.insight.activities.InsightAlertActivity"
android:label="@string/pump_alert"
android:theme="@style/InsightAlertDialog" />
<activity
android:name=".plugins.pump.insight.activities.InsightPairingInformationActivity"
android:theme="@style/AppTheme"
android:label="@string/pairing_information" />
android:label="@string/pairing_information"
android:theme="@style/AppTheme" />
</application>
</manifest>

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) {
@ -170,7 +172,7 @@ public class MainActivity extends AppCompatActivity {
boolean keepScreenOn = SP.getBoolean(R.string.key_keep_screen_on, false);
final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (keepScreenOn) {
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "AAPS");
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "AndroidAPS:MainActivity_onEventPreferenceChange");
if (!mWakeLock.isHeld())
mWakeLock.acquire();
} else {

View file

@ -9,7 +9,7 @@ import android.support.annotation.PluralsRes;
import android.support.v4.content.LocalBroadcastManager;
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;
@ -98,6 +98,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;
@ -124,17 +126,18 @@ public class MainApp extends Application {
try {
if (FabricPrivacy.fabricEnabled()) {
Fabric.with(this, new Crashlytics());
Fabric.with(this, new Answers());
Crashlytics.setString("BUILDVERSION", BuildConfig.BUILDVERSION);
}
} catch (Exception e) {
log.error("Error with Fabric init! " + e);
}
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
JodaTimeAndroid.init(this);
log.info("Version: " + BuildConfig.VERSION_NAME);
log.info("BuildVersion: " + BuildConfig.BUILDVERSION);
log.info("Remote: " + BuildConfig.REMOTE);
String extFilesDir = LoggerUtils.getLogDirectory();
File engineeringModeSemaphore = new File(extFilesDir, "engineering_mode");
@ -309,6 +312,10 @@ public class MainApp extends Application {
}
}
public static FirebaseAnalytics getFirebaseAnalytics() {
return mFirebaseAnalytics;
}
public static ConstraintChecker getConstraintChecker() {
return sConstraintsChecker;
}

View file

@ -8,9 +8,8 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
@ -30,12 +29,11 @@ public class GlucoseStatus {
public long date = 0L;
@Override
public String toString() {
return MainApp.gs(R.string.glucose) + " " + DecimalFormatter.to0Decimal(glucose) + " mg/dl\n" +
MainApp.gs(R.string.delta) + " " + DecimalFormatter.to0Decimal(delta) + " mg/dl\n" +
MainApp.gs(R.string.short_avgdelta) + " " + DecimalFormatter.to2Decimal(short_avgdelta) + " mg/dl\n" +
MainApp.gs(R.string.long_avgdelta) + " " + DecimalFormatter.to2Decimal(long_avgdelta) + " mg/dl";
public String log() {
return "Glucose: " + DecimalFormatter.to0Decimal(glucose) + " mg/dl " +
"Delta: " + DecimalFormatter.to0Decimal(delta) + " mg/dl" +
"Short avg. delta: " + " " + DecimalFormatter.to2Decimal(short_avgdelta) + " mg/dl " +
"Long avg. delta: " + DecimalFormatter.to2Decimal(long_avgdelta) + " mg/dl";
}
public GlucoseStatus() {
@ -64,17 +62,22 @@ public class GlucoseStatus {
List<BgReading> data = IobCobCalculatorPlugin.getPlugin().getBgReadings();
if (data == null)
return null;
int sizeRecords = data.size();
if (sizeRecords == 0) {
if (data == null) {
if (L.isEnabled(L.GLUCOSE))
log.debug("data=null");
return null;
}
sizeRecords = Math.min(sizeRecords, 9);
int sizeRecords = data.size();
if (sizeRecords == 0) {
if (L.isEnabled(L.GLUCOSE))
log.debug("sizeRecords==0");
return null;
}
if (data.get(0).date < DateUtil.now() - 7 * 60 * 1000L && !allowOldData) {
if (L.isEnabled(L.GLUCOSE))
log.debug("olddata");
return null;
}
@ -90,18 +93,24 @@ public class GlucoseStatus {
status.long_avgdelta = 0d;
status.avgdelta = 0d; // for OpenAPS MA
status.date = now_date;
if (L.isEnabled(L.GLUCOSE))
log.debug("sizeRecords==1");
return status.round();
}
ArrayList<Double> last_deltas = new ArrayList<Double>();
ArrayList<Double> short_deltas = new ArrayList<Double>();
ArrayList<Double> long_deltas = new ArrayList<Double>();
ArrayList<Double> now_value_list = new ArrayList<>();
ArrayList<Double> last_deltas = new ArrayList<>();
ArrayList<Double> short_deltas = new ArrayList<>();
ArrayList<Double> long_deltas = new ArrayList<>();
// 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);
long then_date = then.date;
double avgdelta = 0;
double avgdelta;
long minutesago;
minutesago = Math.round((now_date - then_date) / (1000d * 60));
@ -109,10 +118,14 @@ public class GlucoseStatus {
change = now.value - then.value;
avgdelta = change / minutesago * 5;
if (L.isEnabled(L.GLUCOSE))
log.debug(then.toString() + " minutesago=" + minutesago + " avgdelta=" + avgdelta);
// 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 +137,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;
}
}
}
@ -143,6 +159,8 @@ public class GlucoseStatus {
status.long_avgdelta = average(long_deltas);
status.avgdelta = status.short_avgdelta; // for OpenAPS MA
if (L.isEnabled(L.GLUCOSE))
log.debug(status.log());
return status.round();
}

View file

@ -35,7 +35,7 @@ import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.events.EventCareportalEventChange;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.events.EventReloadProfileSwitchData;
import info.nightscout.androidaps.events.EventReloadTempBasalData;
@ -726,7 +726,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
String units = JsonHelper.safeGetString(trJson, "units", Constants.MGDL);
TempTarget tempTarget = new TempTarget()
.date(trJson.getLong("mills"))
.duration(trJson.getInt("duration"))
.duration(JsonHelper.safeGetInt(trJson, "duration"))
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
.reason(JsonHelper.safeGetString(trJson, "reason", ""))
@ -1574,9 +1574,9 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
class PostRunnable implements Runnable {
public void run() {
if (L.isEnabled(L.DATABASE))
log.debug("Firing EventProfileSwitchChange");
log.debug("Firing EventProfileNeedsUpdate");
MainApp.bus().post(new EventReloadProfileSwitchData());
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
scheduledProfileSwitchEventPost = null;
}
}

View file

@ -4,5 +4,5 @@ package info.nightscout.androidaps.events;
* Created by mike on 02.06.2017.
*/
public class EventProfileSwitchChange extends Event {
public class EventProfileNeedsUpdate extends Event {
}

View file

@ -78,6 +78,7 @@ public class L {
public static final String CORE = "CORE";
public static final String AUTOSENS = "AUTOSENS";
public static final String EVENTS = "EVENTS";
public static final String GLUCOSE = "GLUCOSE";
public static final String BGSOURCE = "BGSOURCE";
public static final String OVERVIEW = "OVERVIEW";
public static final String NOTIFICATION = "NOTIFICATION";
@ -103,6 +104,7 @@ public class L {
logElements.add(new LogElement(APS, true));
logElements.add(new LogElement(AUTOSENS, false));
logElements.add(new LogElement(BGSOURCE, true));
logElements.add(new LogElement(GLUCOSE, false));
logElements.add(new LogElement(CONFIGBUILDER, false));
logElements.add(new LogElement(CONSTRAINTS, true));
logElements.add(new LogElement(CORE, true));

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;
@ -18,11 +19,11 @@ import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.db.ProfileSwitch;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.FabricPrivacy;
@ -47,7 +48,7 @@ public class ProfileFunctions {
}
@Subscribe
public void onProfileSwitch(EventProfileSwitchChange ignored) {
public void onProfileSwitch(EventProfileNeedsUpdate ignored) {
if (L.isEnabled(L.PROFILE))
log.debug("onProfileSwitch");
ConfigBuilderPlugin.getPlugin().getCommandQueue().setProfile(getProfile(), new Callback() {
@ -61,7 +62,8 @@ public class ProfileFunctions {
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MainApp.instance().startActivity(i);
}
MainApp.bus().post(new EventNewBasalProfile());
if (result.enacted)
MainApp.bus().post(new EventNewBasalProfile());
}
});
}
@ -129,12 +131,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 +159,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 +175,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

@ -12,7 +12,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;
@ -21,9 +20,9 @@ import java.util.List;
import java.util.Map;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.activities.HistoryBrowseActivity;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.activities.HistoryBrowseActivity;
import info.nightscout.androidaps.activities.TDDStatsActivity;
import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.TemporaryBasal;
@ -35,7 +34,6 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.dialogs.FillDialog;
import info.nightscout.androidaps.plugins.general.actions.dialogs.NewExtendedBolusDialog;
@ -70,7 +68,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
SingleClickButton tddStats;
SingleClickButton history;
private Map<String,CustomAction> pumpCustomActions = new HashMap<>();
private Map<String, CustomAction> pumpCustomActions = new HashMap<>();
private List<SingleClickButton> pumpCustomButtons = new ArrayList<>();
public ActionsFragment() {
@ -222,7 +220,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
View.OnClickListener pumpCustomActionsListener = v -> {
SingleClickButton btn = (SingleClickButton)v;
SingleClickButton btn = (SingleClickButton) v;
CustomAction customAction = this.pumpCustomActions.get(btn.getText().toString());
@ -243,7 +241,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
List<CustomAction> customActions = activePump.getCustomActions();
if (customActions != null && customActions.size()>0) {
if (customActions != null && customActions.size() > 0) {
LinearLayout ll = actionsFragmentView.findViewById(R.id.action_buttons_layout);
@ -275,7 +273,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
private void removePumpCustomActions() {
if (pumpCustomActions.size()==0)
if (pumpCustomActions.size() == 0)
return;
LinearLayout ll = actionsFragmentView.findViewById(R.id.action_buttons_layout);
@ -314,13 +312,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.overview.Dialogs.ErrorHelperActivity;
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;
@ -190,7 +188,7 @@ public class FillDialog extends DialogFragment implements OnClickListener {
}
if (pumpSiteChangeCheckbox.isChecked())
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.actionsConfirm) + "'>" + MainApp.gs(R.string.record_pump_site_change) + "</font>");
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.actionsConfirm) + "'>" + MainApp.gs(R.string.record_pump_site_change) + "</font>");
if (insulinCartridgeChangeCheckbox.isChecked())
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.actionsConfirm) + "'>" + MainApp.gs(R.string.record_insulin_cartridge_change) + "</font>");
@ -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;
@ -21,9 +19,8 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
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.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;
@ -26,9 +24,8 @@ import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.PumpDescription;
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.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

@ -222,6 +222,7 @@ public class MaintenancePlugin extends PluginBase {
builder.append("NSCLIENT" + System.lineSeparator());
builder.append("Build: " + BuildConfig.BUILDVERSION + System.lineSeparator());
builder.append("Remote: " + BuildConfig.REMOTE + System.lineSeparator());
builder.append("Flavor: " + BuildConfig.FLAVOR + BuildConfig.BUILD_TYPE + System.lineSeparator());
builder.append(MainApp.gs(R.string.configbuilder_nightscoutversion_label) + " " + NSSettingsStatus.getInstance().nightscoutVersionName + System.lineSeparator());
if (MainApp.engineeringMode)

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

@ -120,7 +120,7 @@ public class NSClientService extends Service {
}
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NSClientService");
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:NSClientService");
initialize();
}
@ -499,7 +499,7 @@ public class NSClientService extends Service {
public void run() {
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"onDataUpdate");
"AndroidAPS:NSClientService_onDataUpdate");
wakeLock.acquire();
try {

View file

@ -34,7 +34,6 @@ 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;
@ -46,6 +45,7 @@ import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
@ -72,7 +72,7 @@ import info.nightscout.androidaps.events.EventCareportalEventChange;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.events.EventTempBasalChange;
@ -83,44 +83,43 @@ import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
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.general.careportal.CareportalFragment;
import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog;
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.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
import info.nightscout.androidaps.plugins.general.overview.dialogs.CalibrationDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.NewCarbsDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.NewInsulinDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.NewTreatmentDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.WizardDialog;
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity;
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData;
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationRecyclerViewAdapter;
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensData;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification;
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;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.CalibrationDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.NewCarbsDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.NewInsulinDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.NewTreatmentDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.WizardDialog;
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity;
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData;
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationRecyclerViewAdapter;
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore;
import info.nightscout.androidaps.plugins.source.SourceDexcomG5Plugin;
import info.nightscout.androidaps.plugins.source.SourceDexcomG6Plugin;
import info.nightscout.androidaps.plugins.source.SourceXdripPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.treatments.fragments.ProfileViewerDialog;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
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.DefaultValueHelper;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.OKDialog;
import info.nightscout.androidaps.utils.Profiler;
import info.nightscout.androidaps.utils.SP;
@ -268,15 +267,15 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
sage = (TextView) view.findViewById(R.id.careportal_sensorage);
pbage = (TextView) view.findViewById(R.id.careportal_pbage);
iageView = (TextView) view.findViewById(R.id.overview_insulinage);
cageView = (TextView) view.findViewById(R.id.overview_canulaage);
reservoirView = (TextView) view.findViewById(R.id.overview_reservoirlevel);
sageView = (TextView) view.findViewById(R.id.overview_sensorage);
batteryView = (TextView) view.findViewById(R.id.overview_batterylevel);
statuslightsLayout = (LinearLayout) view.findViewById(R.id.overview_statuslights);
iageView = (TextView) view.findViewById(R.id.overview_insulinage);
cageView = (TextView) view.findViewById(R.id.overview_canulaage);
reservoirView = (TextView) view.findViewById(R.id.overview_reservoirlevel);
sageView = (TextView) view.findViewById(R.id.overview_sensorage);
batteryView = (TextView) view.findViewById(R.id.overview_batterylevel);
statuslightsLayout = (LinearLayout) view.findViewById(R.id.overview_statuslights);
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
iobGraph = (GraphView) view.findViewById(R.id.overview_iobgraph);
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
iobGraph = (GraphView) view.findViewById(R.id.overview_iobgraph);
treatmentButton = (SingleClickButton) view.findViewById(R.id.overview_treatmentbutton);
treatmentButton.setOnClickListener(this);
@ -475,7 +474,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
menu.add(MainApp.gs(R.string.suspendloopfor2h));
menu.add(MainApp.gs(R.string.suspendloopfor3h));
menu.add(MainApp.gs(R.string.suspendloopfor10h));
} else {
} else {
if (!loopPlugin.isDisconnected()) {
menu.add(MainApp.gs(R.string.resume));
}
@ -488,7 +487,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (!loopPlugin.isDisconnected()) {
showSuspendtPump(menu, pumpDescription);
} else {
} else {
menu.add(MainApp.gs(R.string.reconnect));
}
@ -892,7 +891,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
}
}
});
@ -984,8 +982,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
@Subscribe
public void onStatusEvent(final EventProfileSwitchChange ev) {
scheduleUpdateGUI("EventProfileSwitchChange");
public void onStatusEvent(final EventProfileNeedsUpdate ev) {
scheduleUpdateGUI("EventProfileNeedsUpdate");
}
@Subscribe
@ -1461,7 +1459,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (sensitivityView != null) {
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensData("Overview");
if (autosensData != null)
sensitivityView.setText(String.format("%.0f%%", autosensData.autosensResult.ratio * 100));
sensitivityView.setText(String.format(Locale.ENGLISH, "%.0f%%", autosensData.autosensResult.ratio * 100));
else
sensitivityView.setText("");
}

View file

@ -18,7 +18,7 @@ import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.QuickWizard;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.EditQuickWizardDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog;
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin;
import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange;
import info.nightscout.androidaps.utils.DateUtil;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.app.Activity;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.content.Context;
@ -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

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.os.Bundle;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.content.Intent;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.os.Bundle;
import android.os.HandlerThread;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.content.Context;
import android.content.Intent;
@ -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;
@ -170,8 +168,8 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener
insulinDialogState.putBoolean("recordOnlyCheckbox", recordOnlyCheckbox.isChecked());
insulinDialogState.putDouble("editTime", editTime.getValue());
insulinDialogState.putDouble("editInsulin", editInsulin.getValue());
insulinDialogState.putString("notesEdit",notesEdit.getText().toString());
log.debug("Instance state saved:"+insulinDialogState.toString());
insulinDialogState.putString("notesEdit", notesEdit.getText().toString());
log.debug("Instance state saved:" + insulinDialogState.toString());
super.onSaveInstanceState(insulinDialogState);
}
@ -227,7 +225,7 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener
}
}
if (Math.abs(insulinAfterConstraints - insulin) > pump.getPumpDescription().pumpType.determineCorrectBolusSize(insulinAfterConstraints))
if (Math.abs(insulinAfterConstraints - insulin) > pump.getPumpDescription().pumpType.determineCorrectBolusSize(insulinAfterConstraints))
actions.add("<font color='" + MainApp.gc(R.color.warning) + "'>" + MainApp.gs(R.string.bolusconstraintapplied) + "</font>");
int eatingSoonTTDuration = SP.getInt(R.string.key_eatingsoon_duration, Constants.defaultEatingSoonTTDuration);
@ -306,7 +304,6 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener
}
}
});
FabricPrivacy.getInstance().logCustom(new CustomEvent("Bolus"));
}
}
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.content.Context;
import android.content.DialogInterface;
@ -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

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.general.overview.Dialogs;
package info.nightscout.androidaps.plugins.general.overview.dialogs;
import android.app.Activity;
import android.content.Context;
@ -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

@ -118,7 +118,7 @@ public class SmsCommunicatorPlugin extends PluginBase {
}
boolean isCommand(String command, String number) {
switch(command.toUpperCase()) {
switch (command.toUpperCase()) {
case "BG":
case "LOOP":
case "TREATMENTS":
@ -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);
@ -760,11 +760,18 @@ public class SmsCommunicatorPlugin extends PluginBase {
void sendSMS(Sms sms) {
SmsManager smsManager = SmsManager.getDefault();
sms.text = stripAccents(sms.text);
if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139);
try {
if (L.isEnabled(L.SMS))
log.debug("Sending SMS to " + sms.phoneNumber + ": " + sms.text);
smsManager.sendTextMessage(sms.phoneNumber, null, sms.text, null, null);
if (sms.text.getBytes().length <= 140)
smsManager.sendTextMessage(sms.phoneNumber, null, sms.text, null, null);
else {
ArrayList<String> parts = smsManager.divideMessage(sms.text);
smsManager.sendMultipartTextMessage(sms.phoneNumber, null, parts,
null, null);
}
messages.add(sms);
} catch (IllegalArgumentException e) {
Notification notification = new Notification(Notification.INVALID_PHONE_NUMBER, MainApp.gs(R.string.smscommunicator_invalidphonennumber), Notification.NORMAL);

View file

@ -625,10 +625,12 @@ public class ActionStringHandler {
}
generateTempTarget(duration, low, high);
} else if ("wizard2".equals(act[0])) {
//use last calculation as confirmed string matches
if (lastBolusWizard != null) {
//use last calculation as confirmed string matches
doBolus(lastBolusWizard.calculatedTotalInsulin, lastBolusWizard.carbs);
lastBolusWizard = null;
doBolus(lastBolusWizard.calculatedTotalInsulin, lastBolusWizard.carbs);
lastBolusWizard = null;
}
} else if ("bolus".equals(act[0])) {
double insulin = SafeParse.stringToDouble(act[1]);
int carbs = SafeParse.stringToInt(act[2]);

View file

@ -482,6 +482,8 @@ public class WatchUpdaterService extends WearableListenerService implements Goog
for (; runningTime < now; runningTime += 5 * 60 * 1000) {
Profile profileTB = ProfileFunctions.getInstance().getProfile(runningTime);
if (profileTB == null)
return;
//basal rate
endBasalValue = profile.getBasal(runningTime);
if (endBasalValue != beginBasalValue) {

View file

@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
@ -66,7 +67,7 @@ public class AutosensData implements DataPointWithLabelInterface {
@Override
public String toString() {
return String.format("CarbsInPast: time: %s carbs: %.02f min5minCI: %.02f remaining: %.2f", new Date(time).toLocaleString(), carbs, min5minCarbImpact, remaining);
return String.format(Locale.ENGLISH, "CarbsInPast: time: %s carbs: %.02f min5minCI: %.02f remaining: %.2f", new Date(time).toLocaleString(), carbs, min5minCarbImpact, remaining);
}
}
@ -101,7 +102,7 @@ public class AutosensData implements DataPointWithLabelInterface {
@Override
public String toString() {
return String.format("AutosensData: %s pastSensitivity=%s delta=%.02f avgDelta=%.02f bgi=%.02f deviation=%.02f avgDeviation=%.02f absorbed=%.02f carbsFromBolus=%.02f cob=%.02f autosensRatio=%.02f slopeFromMaxDeviation=%.02f slopeFromMinDeviation=%.02f activeCarbsList=%s",
return String.format(Locale.ENGLISH, "AutosensData: %s pastSensitivity=%s delta=%.02f avgDelta=%.02f bgi=%.02f deviation=%.02f avgDeviation=%.02f absorbed=%.02f carbsFromBolus=%.02f cob=%.02f autosensRatio=%.02f slopeFromMaxDeviation=%.02f slopeFromMinDeviation=%.02f activeCarbsList=%s",
new Date(time).toLocaleString(), pastSensitivity, delta, avgDelta, bgi, deviation, avgDeviation, absorbed, carbsFromBolus, cob, autosensResult.ratio, slopeFromMaxDeviation, slopeFromMinDeviation, activeCarbsList.toString());
}

View file

@ -496,6 +496,10 @@ 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));
@ -626,6 +630,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
log.debug("Invalidating cached data because of new profile. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
basalDataTable = new LongSparseArray<>();
}
runCalculation("onNewProfile", System.currentTimeMillis(), false, true, ev);
}
@ -648,9 +653,10 @@ public class IobCobCalculatorPlugin extends PluginBase {
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" + " BasalData: " + basalDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
basalDataTable = new LongSparseArray<>();
}
runCalculation("onEventPreferenceChange", System.currentTimeMillis(), false, true, ev);
}
@ -726,6 +732,7 @@ public class IobCobCalculatorPlugin extends PluginBase {
log.debug("Clearing cached data.");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
basalDataTable = new LongSparseArray<>();
}
}

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

@ -49,9 +49,15 @@ public enum PumpType {
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, //
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), //

View file

@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
@ -31,7 +33,7 @@ public class MsgSettingBasal extends MessageBase {
if (L.isEnabled(L.PUMPCOMM))
for (int index = 0; index < 24; index++) {
log.debug("Basal " + String.format("%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
log.debug("Basal " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
}
}
}

View file

@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
@ -55,7 +57,7 @@ public class MsgSettingBasalProfileAll extends MessageBase {
for (int profile = 0; profile < 4; profile++) {
for (int index = 0; index < 48; index++) {
try {
log.debug("Basal profile " + profile + ": " + String.format("%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
log.debug("Basal profile " + profile + ": " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
} catch (Exception e){
log.error("Unhandled exception" , e);
}
@ -67,8 +69,8 @@ public class MsgSettingBasalProfileAll extends MessageBase {
//this is absurd pump.pumpProfiles[profile][index] returns nullPointerException
try {
log.debug("Basal profile " + profile + ": " +
String.format("%02d", (index / 2)) +
":" + String.format("%02d", (index % 2) * 30) + " : " +
String.format(Locale.ENGLISH, "%02d", (index / 2)) +
":" + String.format(Locale.ENGLISH, "%02d", (index % 2) * 30) + " : " +
pump.pumpProfiles[profile][index]);
} catch (Exception e){
log.error("Unhandled exception" , e);

View file

@ -18,14 +18,14 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -166,7 +166,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
MainApp.bus().post(new EventPumpStatusChanged(MainApp.gs(R.string.gettingpumpsettings)));
mSerialIOThread.sendMessage(new MsgSettingBasal());
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getPlugin().getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
}
}

View file

@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
@ -55,15 +57,15 @@ public class MsgSettingBasalProfileAll_k extends MessageBase {
if (pump.basal48Enable) {
for (int profile = 0; profile < 4; profile++) {
for (int index = 0; index < 24; index++) {
log.debug("Basal profile " + profile + ": " + String.format("%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
log.debug("Basal profile " + profile + ": " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
}
}
} else {
for (int profile = 0; profile < 4; profile++) {
for (int index = 0; index < 48; index++) {
log.debug("Basal profile " + profile + ": " +
String.format("%02d", (index / 2)) +
":" + String.format("%02d", (index % 2) * 30) + " : " +
String.format(Locale.ENGLISH, "%02d", (index / 2)) +
":" + String.format(Locale.ENGLISH, "%02d", (index % 2) * 30) + " : " +
pump.pumpProfiles[profile][index]);
}
}

View file

@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
@ -32,7 +34,7 @@ public class MsgSettingBasal_k extends MessageBase {
if (L.isEnabled(L.PUMPCOMM))
for (int index = 0; index < 24; index++) {
log.debug("Basal " + String.format("%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
log.debug("Basal " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
}
}
}

View file

@ -18,14 +18,14 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
@ -171,7 +171,7 @@ public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService {
MainApp.bus().post(new EventPumpStatusChanged(MainApp.gs(R.string.gettingpumpsettings)));
mSerialIOThread.sendMessage(new MsgSettingBasal());
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getPlugin().getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
}
}

View file

@ -6,6 +6,8 @@ import com.cozmo.danar.util.BleCommandUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L;
@ -49,7 +51,7 @@ public class DanaRS_Packet_Basal_Get_Basal_Rate extends DanaRS_Packet {
log.debug("Max basal: " + pump.maxBasal + " U");
log.debug("Basal step: " + pump.basalStep + " U");
for (int index = 0; index < 24; index++)
log.debug("Basal " + String.format("%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
log.debug("Basal " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[pump.activeProfile][index]);
}
if (pump.basalStep != 0.01d) {

View file

@ -5,6 +5,8 @@ import com.cozmo.danar.util.BleCommandUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
@ -51,7 +53,7 @@ public class DanaRS_Packet_Basal_Get_Profile_Basal_Rate extends DanaRS_Packet {
}
if (L.isEnabled(L.PUMPCOMM)) {
for (int index = 0; index < 24; index++)
log.debug("Basal " + String.format("%02d", index) + "h: " + pump.pumpProfiles[profileNumber][index]);
log.debug("Basal " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + pump.pumpProfiles[profileNumber][index]);
}
}

View file

@ -20,14 +20,14 @@ import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -149,7 +149,7 @@ public class DanaRSService extends Service {
MainApp.bus().post(new EventPumpStatusChanged(MainApp.gs(R.string.gettingpumpsettings)));
bleComm.sendMessage(new DanaRS_Packet_Basal_Get_Basal_Rate()); // basal profile, basalStep, maxBasal
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getPlugin().getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
}
}

View file

@ -19,15 +19,15 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -188,7 +188,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService {
MainApp.bus().post(new EventPumpStatusChanged(MainApp.gs(R.string.gettingpumpsettings)));
mSerialIOThread.sendMessage(new MsgSettingBasal());
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getPlugin().getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
}
}

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

@ -9,7 +9,7 @@ import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.T;

View file

@ -1,9 +1,10 @@
package info.nightscout.androidaps.plugins.treatments;
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;
@ -37,20 +38,21 @@ import info.nightscout.androidaps.interfaces.InsulinInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
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.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensData;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensData;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
@ -184,7 +186,11 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin();
if (insulinInterface == null)
return total;
return total;
PumpInterface pumpInterface = ConfigBuilderPlugin.getPlugin().getActivePump();
if (pumpInterface == null)
return total;
double dia = profile.getDia();
@ -209,7 +215,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
}
}
if (!ConfigBuilderPlugin.getPlugin().getActivePump().isFakingTempsByExtendedBoluses())
if (!pumpInterface.isFakingTempsByExtendedBoluses())
synchronized (extendedBoluses) {
for (Integer pos = 0; pos < extendedBoluses.size(); pos++) {
ExtendedBolus e = extendedBoluses.get(pos);
@ -259,7 +265,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
if (t > absorptionTime_ago && t <= now) {
if (treatment.carbs >= 1) {
result.carbs += treatment.carbs;
if(t > result.lastCarbTime)
if (t > result.lastCarbTime)
result.lastCarbTime = t;
}
}
@ -312,7 +318,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
}
}
if (L.isEnabled(L.DATATREATMENTS))
log.debug("Last bolus time: " + new Date(last).toLocaleString());
log.debug("Last bolus time: " + new Date(last).toLocaleString());
return last;
}
@ -341,7 +347,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
@Subscribe
public void onStatusEvent(final EventReloadTreatmentData ev) {
if (L.isEnabled(L.DATATREATMENTS))
log.debug("EventReloadTreatmentData");
log.debug("EventReloadTreatmentData");
initializeTreatmentData();
initializeExtendedBolusData();
updateTotalIOBTreatments();
@ -352,7 +358,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
@SuppressWarnings("unused")
public void onStatusEvent(final EventReloadTempBasalData ev) {
if (L.isEnabled(L.DATATREATMENTS))
log.debug("EventReloadTempBasalData");
log.debug("EventReloadTempBasalData");
initializeTempBasalData();
updateTotalIOBTempBasals();
}
@ -372,14 +378,14 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin();
if (insulinInterface == null)
return total;
return total;
synchronized (tempBasals) {
for (Integer pos = 0; pos < tempBasals.size(); pos++) {
TemporaryBasal t = tempBasals.get(pos);
if (t.date > time) continue;
IobTotal calc;
if(truncate && t.end() > truncateTime){
if (truncate && t.end() > truncateTime) {
TemporaryBasal dummyTemp = new TemporaryBasal();
dummyTemp.copyFrom(t);
dummyTemp.cutEndTo(truncateTime);
@ -398,7 +404,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
ExtendedBolus e = extendedBoluses.get(pos);
if (e.date > time) continue;
IobTotal calc;
if(truncate && e.end() > truncateTime){
if (truncate && e.end() > truncateTime) {
ExtendedBolus dummyExt = new ExtendedBolus();
dummyExt.copyFrom(e);
dummyExt.cutEndTo(truncateTime);
@ -535,9 +541,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

@ -27,13 +27,13 @@ import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.services.Intents;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.ProfileSwitch;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.utils.DateUtil;
@ -216,7 +216,7 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
}
@Subscribe
public void onStatusEvent(final EventProfileSwitchChange ev) {
public void onStatusEvent(final EventProfileNeedsUpdate ev) {
updateGUI();
}

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

@ -23,8 +23,8 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressHelperActivity;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusprogressIfRunning;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
@ -381,7 +381,7 @@ public class CommandQueue {
Notification notification = new Notification(Notification.NOT_ENG_MODE_OR_RELEASE, MainApp.gs(R.string.not_eng_mode_or_release), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
if (callback != null)
callback.result(new PumpEnactResult().success(false).comment(MainApp.gs(R.string.not_eng_mode_or_release))).run();
callback.result(new PumpEnactResult().success(false).enacted(false).comment(MainApp.gs(R.string.not_eng_mode_or_release))).run();
return false;
}
@ -394,7 +394,7 @@ public class CommandQueue {
Notification notification = new Notification(Notification.BASAL_VALUE_BELOW_MINIMUM, MainApp.gs(R.string.basalvaluebelowminimum), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
if (callback != null)
callback.result(new PumpEnactResult().success(false).comment(MainApp.gs(R.string.basalvaluebelowminimum))).run();
callback.result(new PumpEnactResult().success(false).enacted(false).comment(MainApp.gs(R.string.basalvaluebelowminimum))).run();
return false;
}
}

View file

@ -18,6 +18,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusprogressIfRunning;
import info.nightscout.androidaps.queue.events.EventQueueChanged;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
/**
* Created by mike on 09.11.2017.
@ -28,9 +29,8 @@ public class QueueThread extends Thread {
private CommandQueue queue;
private long lastCommandTime = 0;
private boolean connectLogged = false;
public boolean waitingForDisconnect = false;
boolean waitingForDisconnect = false;
private PowerManager.WakeLock mWakeLock;
@ -41,14 +41,17 @@ public class QueueThread extends Thread {
Context context = MainApp.instance().getApplicationContext();
if (context != null) {
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "QueueThread");
if (powerManager != null)
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:QueueThread");
}
}
@Override
public final void run() {
mWakeLock.acquire();
if (mWakeLock != null)
mWakeLock.acquire(T.mins(10).msecs());
MainApp.bus().post(new EventQueueChanged());
long lastCommandTime;
long connectionStartTime = lastCommandTime = System.currentTimeMillis();
try {
@ -72,7 +75,7 @@ public class QueueThread extends Thread {
//BLUETOOTH-WATCHDOG
boolean watchdog = SP.getBoolean(R.string.key_btwatchdog, false);
long last_watchdog = SP.getLong(R.string.key_btwatchdog_lastbark, 0l);
long last_watchdog = SP.getLong(R.string.key_btwatchdog_lastbark, 0L);
watchdog = watchdog && System.currentTimeMillis() - last_watchdog > (Constants.MIN_WATCHDOG_INTERVAL_IN_SECONDS * 1000);
if (watchdog) {
if (L.isEnabled(L.PUMPQUEUE))
@ -170,7 +173,8 @@ public class QueueThread extends Thread {
}
}
} finally {
mWakeLock.release();
if (mWakeLock != null)
mWakeLock.release();
if (L.isEnabled(L.PUMPQUEUE))
log.debug("thread end");
}

View file

@ -8,7 +8,7 @@ import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusprogressIfRunning;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.DecimalFormatter;

View file

@ -7,15 +7,13 @@ 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;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
@ -46,13 +44,12 @@ public class KeepAliveReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent rIntent) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "");
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:KeepAliveReciever");
wl.acquire();
LocalAlertUtils.shortenSnoozeInterval();
LocalAlertUtils.checkStaleBGAlert();
checkPump();
FabricPrivacy.uploadDailyStats();
if (L.isEnabled(L.CORE))
log.debug("KeepAlive received");
@ -76,7 +73,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
}
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getPlugin().getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
MainApp.bus().post(new EventProfileNeedsUpdate());
} else if (isStatusOutdated && !pump.isBusy()) {
lastReadStatus = System.currentTimeMillis();
ConfigBuilderPlugin.getPlugin().getCommandQueue().readStatus("KeepAlive. Status outdated.", null);
@ -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

@ -0,0 +1,7 @@
package info.nightscout.androidaps.receivers;
/**
* Forward received SMS intents. This is a separate class, because unlike local broadcasts handled by DataReceiver,
* receiving SMS requires a special permission in the manifest, which necessitates a separate receiver.
*/
public class SmsReceiver extends DataReceiver {}

View file

@ -75,8 +75,11 @@ public class AlarmSoundService extends Service {
@Override
public void onDestroy() {
player.stop();
player.release();
if (player != null) {
player.stop();
player.release();
}
if (L.isEnabled(L.CORE))
log.debug("onDestroy");
}

View file

@ -22,7 +22,7 @@ import info.nightscout.androidaps.MainActivity;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventProfileStoreChanged;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesSaved;
import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus;
@ -115,7 +115,7 @@ public class SetupWizardActivity extends AppCompatActivity {
}
@Subscribe
public void onEventProfileSwitchChange(EventProfileSwitchChange ignored) {
public void onEventProfileSwitchChange(EventProfileNeedsUpdate ignored) {
updateButtons();
}

View file

@ -1,16 +1,17 @@
package info.nightscout.androidaps.utils;
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 java.util.Date;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
/**
* Created by jamorham on 21/02/2018.
@ -21,8 +22,8 @@ import java.util.Date;
*/
public class FabricPrivacy {
private static Logger log = LoggerFactory.getLogger(L.CORE);
private static final String TAG = "FabricPrivacy";
private static volatile FabricPrivacy instance;
@ -45,7 +46,8 @@ public class FabricPrivacy {
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);
}
}
@ -55,7 +57,8 @@ public class FabricPrivacy {
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);
}
}
@ -65,7 +68,8 @@ public class FabricPrivacy {
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);
}
}
@ -73,68 +77,67 @@ public class FabricPrivacy {
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() {
// 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;
long lastUploadDay = SP.getLong(MainApp.gs(R.string.key_plugin_stats_report_timestamp), 0L);
String closedLoopEnabled = MainApp.getConstraintChecker().isClosedLoopAllowed().value() ? "CLOSED_LOOP_ENABLED" : "CLOSED_LOOP_DISABLED";
// Size is limited to 36 chars
String remote = BuildConfig.REMOTE
.replace("https://","")
.replace("http://","")
.replace(".git", "")
.replace(".com/", ":")
.replace(".org/", ":")
.replace(".net/", ":");
Date date = new Date();
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
long today = date.getTime() - date.getTime() % 1000;
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);
MainApp.getFirebaseAnalytics().setUserProperty("Remote", remote);
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());
if (today > lastUploadDay) {
uploadAppUsageType();
uploadPluginStats();
SP.putLong(MainApp.gs(R.string.key_plugin_stats_report_timestamp), today);
}
}
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");
}
}
getInstance().logCustom(pluginStats);
}
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

@ -5,11 +5,13 @@ import android.util.LongSparseArray;
import java.util.Calendar;
public class MidnightTime {
private static final LongSparseArray<Long> times = new LongSparseArray<>();
static final LongSparseArray<Long> times = new LongSparseArray<>();
private static long hits = 0;
private static long misses = 0;
private static final int THRESHOLD = 100000;
public static long calc() {
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, 0);
@ -36,10 +38,17 @@ public class MidnightTime {
m = c.getTimeInMillis();
times.append(time, m);
++misses;
if (times.size() > THRESHOLD) resetCache();
}
return m;
}
static void resetCache() {
hits = 0;
misses = 0;
times.clear();
}
public static String log() {
return "Hits: " + hits + " misses: " + misses + " stored: " + times.size();
}

View file

@ -1,5 +1,7 @@
package org.monkey.d.ruffy.ruffy.driver.display.menu;
import java.util.Locale;
/**
* Created by fishermen21 on 24.05.17.
*/
@ -30,6 +32,6 @@ public class MenuDate {
@Override
public String toString() {
return day+"."+String.format("%02d",month)+".";
return day+"."+String.format(Locale.ENGLISH, "%02d",month)+".";
}
}

View file

@ -1,5 +1,7 @@
package org.monkey.d.ruffy.ruffy.driver.display.menu;
import java.util.Locale;
/**
* Created by fishermen21 on 22.05.17.
*/
@ -31,6 +33,6 @@ public class MenuTime {
@Override
public String toString() {
return hour+":"+String.format("%02d",minute);
return hour+":"+String.format(Locale.ENGLISH, "%02d",minute);
}
}

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

View file

@ -21,7 +21,7 @@
android:id="@+id/logsettings_placeholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout>
android:orientation="vertical" />
</ScrollView>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
@ -529,7 +528,8 @@
android:id="@+id/careportal_newnstreatment_notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="180dp" />
android:width="180dp"
android:inputType="text" />
</LinearLayout>

View file

@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

View file

@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

View file

@ -1,5 +1,4 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"

View file

@ -2,7 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.PumpInsight.InsightFragment">
tools:context="info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment">
<ScrollView
android:layout_width="match_parent"

View file

@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

View file

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".plugins.general.overview.Dialogs.BolusProgressDialog"
tools:context=".plugins.general.overview.dialogs.BolusProgressDialog"
android:paddingTop="15dp"
android:paddingBottom="15dp">

View file

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.general.overview.Dialogs.CalibrationDialog">
tools:context=".plugins.general.overview.dialogs.CalibrationDialog">
<ScrollView
android:layout_width="match_parent"

View file

@ -2,7 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.general.overview.Dialogs.EditQuickWizardDialog">
tools:context=".plugins.general.overview.dialogs.EditQuickWizardDialog">
<ScrollView
android:layout_width="match_parent"

View file

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".plugins.general.overview.Dialogs.ErrorDialog"
tools:context=".plugins.general.overview.dialogs.ErrorDialog"
android:paddingTop="15dp"
android:paddingBottom="15dp">

View file

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.general.overview.Dialogs.NewCarbsDialog">
tools:context=".plugins.general.overview.dialogs.NewCarbsDialog">
<ScrollView
android:layout_width="match_parent"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.general.overview.Dialogs.NewInsulinDialog">
tools:context=".plugins.general.overview.dialogs.NewInsulinDialog">
<ScrollView
android:layout_width="match_parent"

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -52,12 +51,14 @@
<RadioButton
android:id="@+id/overview_newtempbasal_percent_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/overview_newtempbasal_percent_label" />
<RadioButton
android:id="@+id/overview_newtempbasal_absolute_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="U/h" />

View file

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.general.overview.Dialogs.NewTreatmentDialog">
tools:context=".plugins.general.overview.dialogs.NewTreatmentDialog">
<ScrollView
android:layout_width="match_parent"

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/overview_quickwizard_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -5,4 +5,4 @@
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:textColor="#FFFFFF"></TextView>
android:textColor="#FFFFFF" />

View file

@ -1,5 +1,4 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"

View file

@ -9,7 +9,7 @@
<string name="nav_resetdb">Herstel databasis</string>
<string name="reset_db_confirm">Wil jy regtig die databasis herstel?</string>
<string name="nav_exit">Gaan uit</string>
<string name="danar_useextended_title">Gebruik verlengde boluses vir &gt;200%</string>
<string name="danar_useextended_title">Gebruik verlengde boluses vir &gt;200%%</string>
<string name="danar_bt_name_title">DanaR Bluetooth-toestel</string>
<string name="ns_sync_use_absolute_title">Gebruik altyd absolute basale aardes</string>
<string name="alert_dialog_storage_permission_text">Herlaai jou foon of herlaai AndroidAPS met die stelsel instellings \nanders sal AndroidAPS nie geskiedenis hê nie! (Belangrik om te spoor en te verifieer dat die algoritmes korrek werk)!</string>
@ -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>
@ -309,7 +314,7 @@
<string name="overview_bolusprogress_stop">Staak</string>
<string name="overview_bolusprogress_stoppressed">STAAK GEDRUK</string>
<string name="waitingforpump">Wag vir pomp</string>
<string name="overview_bolusprogress_goingtodeliver" formatted="false">Gaan %.2fU lewer</string>
<string name="overview_bolusprogress_goingtodeliver">Gaan %1$.2fU lewer</string>
<string name="objectives_0_objective">Opstel van visualisering en monitering, en ontleed basale en verhoudings</string>
<string name="objectives_0_gate">Verifieer dat BG beskikbaar is in Nightscout, en dat pomp insulien data opgelaai word</string>
<string name="objectives_1_objective">Begin op \'n oop lus</string>
@ -332,13 +337,26 @@
<string name="smscommunicator_loopisdisabled">Loop is gedeaktiveer</string>
<string name="smscommunicator_loopisenabled">Lus geaktiveer</string>
<string name="valuelimitedto">%1$.2f beperk tot %2$.2f</string>
<string name="valueoutofrange" formatted="false">Waarde %s is uit harde perke</string>
<string name="valueoutofrange">Waarde %1$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>
@ -446,7 +464,7 @@
<string name="profile">Profiel</string>
<string name="openapsama_max_daily_safety_multiplier_summary">Verstek waarde: 3 dit is \'n sleutel OpenAPS veiligheidsdrumpels. Wat dit doen is om jou basale te berk tot 3 x (in hierdie mense) jou grootste basale koers. Jy sal waarskynlik nooit dit hoef te verander, maar jy moet bewus wees wat bespreek is oor \"3 x max daaglikse; 4 x huidige\"vir veiligheidsdrumpels.</string>
<string name="openapsama_current_basal_safety_multiplier_summary">Verstek waarde: 4 dit is die helfte van die sleutel OpenAPS veiligheid limiete, en die ander helfte van \"3 x maks daaglikse; 4 x huidige\"van die veiligheid limiet. Dit beteken jou basale, ongeag max basale stel op jou pomp, kan enige hoër wees as hierdie nommer tye die huidige vlak van jou basale. Dit is om te verhoed dat mense in gevaarlike gebied deur instelling buitensporig hoë max basals voor om te verstaan hoe die algoritme werk. Weer, die verstek is 4 x; die meeste mense sal nooit moet dit aanpas en is eerder meer geneig om te moet aanpas ander instellings as hulle voel hulle \"loop in\" hierdie veiligheid limiet.</string>
<string name="openapsama_autosens_max_summary">Verstek waarde: 1.2\nThis is \'n vermenigvuldiger cap vir autosens (en gou autotune) stel \'n 20% max limiet op hoe hoog die autosens verhouding kan wees, wat op sy beurt bepaal hoe hoog autosens basale kan aanpas, hoe laag dit ISF kan aanpas, en hoe laag dit die BG teiken kan stel.</string>
<string name="openapsama_autosens_max_summary">Verstek waarde: 1.2\nThis is \'n vermenigvuldiger plafon vir autosens (en gou autotune) stel \'n 20%% max limiet op hoe hoog die autosens verhouding kan wees, wat op sy beurt bepaal hoe hoog autosens basale kan aanpas, hoe laag dit ISF kan aanpas, en hoe laag dit die BG teiken kan stel.</string>
<string name="openapsama_autosens_min_summary">Verstek waarde: 0.7\nDie ander kant van die autosens veiligheidsperke, sit \'n limiet op hoe laag autosens basals kan aanpas, en hoe hoog dit ISF en BG teikens kan verstel.</string>
<string name="openapsama_autosens_adjusttargets">Autosens Verstel doelwitte ook</string>
<string name="openapsama_autosens_adjusttargets_summary">Verstek waarde: waar\nDit word gebruik om autosens toe te laat om BG teikens aan te pas, benewens ISF en basale.</string>
@ -459,7 +477,7 @@
<string name="error_phone_not_valid">Telefoonnommer ongeldig</string>
<string name="smscommunicator_invalidphonennumber">Ongeldige SMS selfoon nommer</string>
<string name="overview_calibration">Kalibrasie</string>
<string name="send_calibration" formatted="false">Stuur kalibrasie %.1f to xDrip?</string>
<string name="send_calibration">Stuur kalibrasie %1$.1f na xDrip?</string>
<string name="xdripnotinstalled">xDrip + nie geïnstalleerd nie</string>
<string name="calibrationsent">Kalibrasie gestuur na xDrip</string>
<string name="smscommunicator_calibrationsent">Kalibrasie gestuur. Ontvang moet geaktiveer word in xDrip.</string>
@ -600,7 +618,7 @@
<string name="absorptionsettings_title">Absorpsie instellings</string>
<string name="absorption_maxtime_title">Maaltyd max\ks absorpsie tyd [h]</string>
<string name="absorption_maxtime_summary">Tyd in ure waarna verwag word dat alle koolhidrate uit maaltyd geabsorbeer sal wees</string>
<string name="danar_visualizeextendedaspercentage_title">Visualiseer verlengde bolus as %</string>
<string name="danar_visualizeextendedaspercentage_title">Visualiseer verlengde bolus as %%</string>
<string name="careportal_sensorage_label_short">SAGE</string>
<string name="careportal_insulinage_label_short">IAGE</string>
<string name="careportal_canulaage_label_short">CAGE</string>
@ -713,8 +731,8 @@
<string name="dexcomg5_xdripupload_title">Stuur BG data na xDrip+</string>
<string name="dexcomg5_xdripupload_summary">Xdrip+ kies 640g/Eversense data bron</string>
<string name="nsclientbg">NSClient BG</string>
<string name="minimalbasalvaluereplaced">Basale waarde vervang deur minimum ondersteunde waarde: %s</string>
<string name="maximumbasalvaluereplaced">Basale waarde vervang deur maksimum ondersteunde waarde: %s</string>
<string name="minimalbasalvaluereplaced">Basale waarde vervang deur minimum ondersteunde waarde: %1$s</string>
<string name="maximumbasalvaluereplaced">Basale waarde vervang deur maksimum ondersteunde waarde: %1$s</string>
<string name="overview_editquickwizard_usebg">BG berekening</string>
<string name="overview_editquickwizard_usebolusiob">Bolus IAB berekening</string>
<string name="overview_editquickwizard_usebasaliob">Basale IAB berekening</string>
@ -732,8 +750,8 @@
<string name="closedmodeenabled">Geslote modus geaktiveer</string>
<string name="maxiobset">Maksimum IAB behoorlik gestel</string>
<string name="hasbgdata">BG beskikbaar vanaf geselekteerde bron</string>
<string name="basalprofilenotaligned" formatted="false">Basale waardes nie in lyn met ure: %s</string>
<string name="zerovalueinprofile" formatted="false">Ongeldige profiel: %s</string>
<string name="basalprofilenotaligned">Basale waardes nie in lyn met ure: %1$s</string>
<string name="zerovalueinprofile">Ongeldige profiel: %1$s</string>
<string name="combo_programming_bolus">Programmeer pomp vir bolusing</string>
<string name="combo_refresh">Verfris</string>
<string name="combo_pump_state_label">Staat</string>
@ -1069,12 +1087,13 @@
<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>
<string name="log_alerts">Log alarms</string>
<string name="enable_tbr_emulation">Skakel TBR emulasie aan</string>
<string name="enable_tbr_emulation_summary">Gebruik uitgebreide boluses in plaas van TBRs om die 250% perk te omseil</string>
<string name="enable_tbr_emulation_summary">Gebruik verlengde boluses in plaas van TBRs om die 250%% perk te omseil</string>
<string name="disconnect_delay">Ontkoppel vertraging [s]</string>
<string name="serial_number">Reeksnommer</string>
<string name="release_software_version">Vrygestelde sagteware weergawe</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>

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