Merge branch 'smb060' of https://gitlab.com/MilosKozak/AndroidAPS into smb060

This commit is contained in:
Milos Kozak 2018-01-13 22:50:10 +01:00
commit 24909bf59c
80 changed files with 2089 additions and 585 deletions

View file

@ -0,0 +1,7 @@
Follow this link to get the source PSD file for the Steampunk graphics. The file could not be included in the repository as it exceeds Github's 25 mb limit.
Note, the source image size is 1600x1600. The image size should be reduced to 400x400 prior to export of final PNG.
https://drive.google.com/drive/folders/1MrdgnQz3wOniDvRSMhAsqHBYb2WmE5i0
Graphics created by (Github): andrew-warrington

View file

@ -174,6 +174,10 @@ dependencies {
compile 'junit:junit:4.12'
testCompile 'org.json:json:20140107'
testCompile 'org.mockito:mockito-core:2.7.22'
testCompile 'org.powermock:powermock-api-mockito2:1.7.3'
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.7.3'
testCompile 'org.powermock:powermock-module-junit4-rule:1.7.3'
testCompile 'org.powermock:powermock-module-junit4:1.7.3'
androidTestCompile 'org.mockito:mockito-core:2.7.22'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'

View file

@ -213,6 +213,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
var lastTempAge;
if (typeof iob_data.lastTemp !== 'undefined' ) {
lastTempAge = round(( new Date().getTime() - iob_data.lastTemp.date ) / 60000); // in minutes
// } ---- added to not produce errors
} else {
lastTempAge = 0;
}
//console.error("currenttemp:",currenttemp,"lastTemp:",JSON.stringify(iob_data.lastTemp),"lastTempAge:",lastTempAge,"m");
tempModulus = (lastTempAge + currenttemp.duration) % 30;

View file

@ -112,12 +112,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
runOnUiThread(new Runnable() {
@Override
public void run() {
recreate();
try { // activity may be destroyed
setUpTabs(true);
} catch (IllegalStateException e) {
log.error("Unhandled exception", e);
if(ev.recreate) {
recreate();
}else {
try { // activity may be destroyed
setUpTabs(true);
} catch (IllegalStateException e) {
log.error("Unhandled exception", e);
}
}
boolean lockScreen = BuildConfig.NSCLIENTOLNY && SP.getBoolean("lockscreen", false);
if (lockScreen)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.EditTextPreference;
@ -59,8 +60,9 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
if (key.equals("language")) {
String lang = sharedPreferences.getString("language", "en");
LocaleHelper.setLocale(getApplicationContext(), lang);
recreate();
MainApp.bus().post(new EventRefreshGui());
MainApp.bus().post(new EventRefreshGui(true));
//recreate() does not update language so better close settings
finish();
}
if (key.equals("short_tabtitles")) {
MainApp.bus().post(new EventRefreshGui());

View file

@ -96,7 +96,12 @@ public class DataService extends IntentService {
boolean isNSProfile = ConfigBuilderPlugin.getActiveProfileInterface().getClass().equals(NSProfilePlugin.class);
boolean nsUploadOnly = SP.getBoolean(R.string.key_ns_upload_only, false);
boolean acceptNSData = !SP.getBoolean(R.string.key_ns_upload_only, false);
Bundle bundles = intent.getExtras();
if (bundles != null && bundles.containsKey("islocal")) {
acceptNSData = acceptNSData || bundles.getBoolean("islocal");
}
if (intent != null) {
final String action = intent.getAction();
@ -125,7 +130,7 @@ public class DataService extends IntentService {
} else if (isNSProfile && Intents.ACTION_NEW_PROFILE.equals(action) || Intents.ACTION_NEW_DEVICESTATUS.equals(action)) {
// always handle Profile if NSProfile is enabled without looking at nsUploadOnly
handleNewDataFromNSClient(intent);
} else if (!nsUploadOnly &&
} else if (acceptNSData &&
(Intents.ACTION_NEW_TREATMENT.equals(action) ||
Intents.ACTION_CHANGED_TREATMENT.equals(action) ||
Intents.ACTION_REMOVED_TREATMENT.equals(action) ||

View file

@ -65,14 +65,21 @@ public class GlucoseStatus {
return this;
}
@Nullable
public static GlucoseStatus getGlucoseStatusData() {
public static GlucoseStatus getGlucoseStatusData(){
return getGlucoseStatusData(false);
}
@Nullable
public static GlucoseStatus getGlucoseStatusData(boolean allowOldData) {
// load 45min
long fromtime = (long) (System.currentTimeMillis() - 60 * 1000L * 45);
List<BgReading> data = MainApp.getDbHelper().getBgreadingsDataFromTime(fromtime, false);
int sizeRecords = data.size();
if (sizeRecords < 1 || data.get(0).date < System.currentTimeMillis() - 7 * 60 * 1000L) {
if (sizeRecords < 1 || (data.get(0).date < System.currentTimeMillis() - 7 * 60 * 1000L && !allowOldData)) {
return null;
}

View file

@ -23,6 +23,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.ToastUtils;
@ -163,15 +164,23 @@ public class Profile {
for (Integer index = 0; index < array.length(); index++) {
try {
final JSONObject o = array.getJSONObject(index);
long tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
Double value = o.getDouble("value") * multiplier;
long tas = 0;
try {
tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
} catch (JSONException e) {
String time = o.getString("time");
tas = getShitfTimeSecs(DateUtil.toSeconds(time));
//log.debug(">>>>>>>>>>>> Used recalculated timeAsSecons: " + time + " " + tas);
}
double value = o.getDouble("value") * multiplier;
sparse.put(tas, value);
if (value == 0) {
Notification notification = new Notification(Notification.ZERO_VALUE_IN_PROFILE, MainApp.sResources.getString(R.string.zerovalueinprofile), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} catch (JSONException e) {
log.error("Unhandled exception", e);
try {
log.error(array.getJSONObject(index).toString());
} catch (JSONException e1) {
}
log.error(json.toString());
}
}
@ -332,6 +341,14 @@ public class Profile {
public Double getBasal(Integer timeAsSeconds) {
if (basal_v == null) {
basal_v = convertToSparseArray(basal);
for (int index = 0; index < basal_v.size(); index++) {
long secondsFromMidnight = basal_v.keyAt(index);
if (secondsFromMidnight % 3600 != 0) {
Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, MainApp.sResources.getString(R.string.basalprofilenotaligned), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
}
// Check for minimal basal value
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
if (pump != null) {

View file

@ -80,7 +80,7 @@ public class QuickWizardEntry {
// COB
double cob = 0d;
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
if (autosensData != null && useCOB() == YES) {
cob = autosensData.cob;
}
@ -181,7 +181,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useBG");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return YES;
}
@ -190,7 +190,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useCOB");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return NO;
}
@ -199,7 +199,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useBolusIOB");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return YES;
}
@ -208,7 +208,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useBasalIOB");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return YES;
}
@ -217,7 +217,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useTrend");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return NO;
}
@ -226,7 +226,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useSuperBolus");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return NO;
}
@ -235,7 +235,7 @@ public class QuickWizardEntry {
try {
return storage.getInt("useTempTarget");
} catch (JSONException e) {
log.error("Unhandled exception", e);
//log.error("Unhandled exception", e);
}
return NO;
}

View file

@ -30,7 +30,9 @@ import java.util.concurrent.TimeUnit;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.events.EventCareportalEventChange;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventFoodDatabaseChanged;
@ -43,7 +45,10 @@ import info.nightscout.androidaps.events.EventReloadTreatmentData;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.PumpDanaR.activities.DanaRNSHistorySync;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
import info.nightscout.utils.PercentageSplitter;
@ -1674,6 +1679,19 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
profileSwitch.percentage = trJson.getInt("percentage");
if (trJson.has("profileJson"))
profileSwitch.profileJson = trJson.getString("profileJson");
else {
ProfileStore store = ConfigBuilderPlugin.getActiveProfileInterface().getProfile();
Profile profile = store.getSpecificProfile(profileSwitch.profileName);
if (profile != null) {
profileSwitch.profileJson = profile.getData().toString();
log.debug("Profile switch prefilled with JSON from local store");
} else {
Notification notification = new Notification(Notification.NO_LOCALE_PROFILE_FOUND, MainApp.sResources.getString(R.string.nolocaleprofilefound), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
log.debug("JSON for profile switch doesn't exist. Ignoring ...");
return;
}
}
if (trJson.has("profilePlugin"))
profileSwitch.profilePlugin = trJson.getString("profilePlugin");
createOrUpdate(profileSwitch);

View file

@ -4,4 +4,11 @@ package info.nightscout.androidaps.events;
* Created by mike on 13.06.2016.
*/
public class EventRefreshGui extends Event {
public boolean recreate = false;
public EventRefreshGui(boolean recreate) {
this.recreate = recreate;
}
public EventRefreshGui(){
this(false);
}
}

View file

@ -15,6 +15,8 @@ public interface ConstraintsInterface {
boolean isAMAModeEnabled();
boolean isSMBModeEnabled();
Double applyBasalConstraints(Double absoluteRate);
Integer applyBasalConstraints(Integer percentRate);

View file

@ -101,7 +101,8 @@ public class FillDialog extends DialogFragment implements OnClickListener {
divider.setVisibility(View.GONE);
}
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}

View file

@ -55,7 +55,8 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
view.findViewById(R.id.ok).setOnClickListener(this);
view.findViewById(R.id.cancel).setOnClickListener(this);
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}

View file

@ -103,7 +103,8 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
view.findViewById(R.id.cancel).setOnClickListener(this);
basalTypeRadioGroup.setOnCheckedChangeListener(this);
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}

View file

@ -360,7 +360,8 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
showOrHide((ViewGroup) view.findViewById(R.id.careportal_newnstreatment_reuse_layout), options.profile && ps != null && ps.isCPP);
showOrHide((ViewGroup) view.findViewById(R.id.careportal_newnstreatment_temptarget_layout), options.tempTarget);
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}
@ -533,7 +534,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
if (options.eventType == R.id.careportal_combobolus) {
Double enteredInsulin = SafeParse.stringToDouble(editInsulin.getText());
data.put("enteredinsulin", enteredInsulin);
data.put("insulin", enteredInsulin * SafeParse.stringToDouble(editInsulin.getText()) / 100);
data.put("insulin", enteredInsulin * SafeParse.stringToDouble(editSplit.getText()) / 100);
data.put("relative", enteredInsulin * (100 - SafeParse.stringToDouble(editSplit.getText())) / 100 / SafeParse.stringToDouble(editDuration.getText()) * 60);
}
} catch (JSONException e) {

View file

@ -16,9 +16,9 @@ import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Intervals;
import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.data.Intervals;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileIntervals;
import info.nightscout.androidaps.data.PumpEnactResult;
@ -40,8 +40,8 @@ import info.nightscout.androidaps.interfaces.SensitivityInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.plugins.Loop.APSResult;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.queue.CommandQueue;
@ -498,8 +498,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
@Override
public boolean isAMAModeEnabled() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
boolean result = preferences.getBoolean("openapsama_useautosens", false);
boolean result = SP.getBoolean("openapsama_useautosens", false);
ArrayList<PluginBase> constraintsPlugins = MainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class);
for (PluginBase p : constraintsPlugins) {
@ -510,6 +509,19 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
return result;
}
@Override
public boolean isSMBModeEnabled() {
boolean result = true; // TODO update for SMB // SP.getBoolean("openapsama_useautosens", false);
ArrayList<PluginBase> constraintsPlugins = MainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class);
for (PluginBase p : constraintsPlugins) {
ConstraintsInterface constrain = (ConstraintsInterface) p;
if (!p.isEnabled(PluginBase.CONSTRAINTS)) continue;
result = result && constrain.isSMBModeEnabled();
}
return result;
}
@Override
public Double applyBasalConstraints(Double absoluteRate) {
Double rateAfterConstrain = absoluteRate;

View file

@ -14,9 +14,15 @@ import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.interfaces.APSInterface;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.ConstraintsSafety.SafetyPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugin;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
import info.nightscout.utils.SP;
/**
@ -152,14 +158,37 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
RequirementResult requirementsMet(Integer objNum) {
switch (objNum) {
case 0:
return new RequirementResult(bgIsAvailableInNS && pumpStatusIsAvailableInNS,
boolean isVirtualPump = VirtualPumpPlugin.getPlugin().isEnabled(PluginBase.PUMP);
boolean vpUploadEnabled = SP.getBoolean("virtualpump_uploadstatus", false);
boolean vpUploadNeeded = !isVirtualPump || vpUploadEnabled;
boolean hasBGData = DatabaseHelper.lastBg()!=null;
boolean apsEnabled = false;
APSInterface usedAPS = ConfigBuilderPlugin.getActiveAPS();
if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginBase.APS))
apsEnabled = true;
return new RequirementResult(hasBGData&&bgIsAvailableInNS && pumpStatusIsAvailableInNS && NSClientInternalPlugin.getPlugin().hasWritePermission() && LoopPlugin.getPlugin().isEnabled(PluginBase.LOOP) && apsEnabled && vpUploadNeeded,
MainApp.sResources.getString(R.string.objectives_bgavailableinns) + ": " + yesOrNo(bgIsAvailableInNS)
+ " " + MainApp.sResources.getString(R.string.objectives_pumpstatusavailableinns) + ": " + yesOrNo(pumpStatusIsAvailableInNS));
+ "\n" + MainApp.sResources.getString(R.string.nsclienthaswritepermission) + ": " + yesOrNo(NSClientInternalPlugin.getPlugin().hasWritePermission())
+ (isVirtualPump ? "\n" + MainApp.sResources.getString(R.string.virtualpump_uploadstatus_title) + ": " + yesOrNo(vpUploadEnabled) : "")
+ "\n" + MainApp.sResources.getString(R.string.objectives_pumpstatusavailableinns) + ": " + yesOrNo(pumpStatusIsAvailableInNS)
+ "\n" + MainApp.sResources.getString(R.string.hasbgdata) + ": " + yesOrNo(hasBGData)
+ "\n" + MainApp.sResources.getString(R.string.loopenabled) + ": " + yesOrNo(LoopPlugin.getPlugin().isEnabled(PluginBase.LOOP))
+ "\n" + MainApp.sResources.getString(R.string.apsselected) + ": " + yesOrNo(apsEnabled)
);
case 1:
return new RequirementResult(manualEnacts >= manualEnactsNeeded,
MainApp.sResources.getString(R.string.objectives_manualenacts) + ": " + manualEnacts + "/" + manualEnactsNeeded);
case 2:
return new RequirementResult(true, "");
case 3:
boolean closedModeEnabled = SafetyPlugin.getPlugin().isClosedModeEnabled();
return new RequirementResult(closedModeEnabled, MainApp.sResources.getString(R.string.closedmodeenabled) + ": " + yesOrNo(closedModeEnabled));
case 4:
double maxIOB = MainApp.getConfigBuilder().applyMaxIOBConstraints(1000d);
boolean maxIobSet = maxIOB > 0;
return new RequirementResult(maxIobSet, MainApp.sResources.getString(R.string.maxiobset) + ": " + yesOrNo(maxIobSet));
default:
return new RequirementResult(true, "");
}
@ -212,7 +241,13 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
MainApp.sResources.getString(R.string.objectives_6_objective),
"",
new Date(0),
14,
28,
new Date(0)));
objectives.add(new Objective(7,
MainApp.sResources.getString(R.string.objectives_7_objective),
"",
new Date(0),
28,
new Date(0)));
}
@ -260,7 +295,7 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
**/
@Override
public boolean isLoopEnabled() {
return objectives.get(1).started.getTime() > 0;
return objectives.get(0).started.getTime() > 0;
}
@Override
@ -278,6 +313,11 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
return objectives.get(6).started.getTime() > 0;
}
@Override
public boolean isSMBModeEnabled() {
return objectives.get(7).started.getTime() > 0;
}
@Override
public Double applyMaxIOBConstraints(Double maxIob) {
if (objectives.get(4).started.getTime() > 0 || objectives.get(2).accomplished.getTime() == 0)

View file

@ -116,6 +116,11 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
return true;
}
@Override
public boolean isSMBModeEnabled() {
return true;
}
@Override
public Double applyBasalConstraints(Double absoluteRate) {
Double origAbsoluteRate = absoluteRate;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.IobCobCalculator.events;
package info.nightscout.androidaps.plugins.IobCobCalculator;
/**
* Created by mike on 10.06.2017.

View file

@ -31,7 +31,6 @@ import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.BasalData;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData;
import info.nightscout.androidaps.plugins.OpenAPSSMB.OpenAPSSMBPlugin;
@ -597,6 +596,10 @@ public class IobCobCalculatorPlugin implements PluginBase {
//log.debug(">>> getAutosensData Cache hit " + data.log(time));
return data;
} else {
if (time > now) {
// data may not be calculated yet, use last data
return getLastAutosensData();
}
//log.debug(">>> getAutosensData Cache miss " + new Date(time).toLocaleString());
return null;
}
@ -608,7 +611,7 @@ public class IobCobCalculatorPlugin implements PluginBase {
if (autosensDataTable.size() < 1)
return null;
AutosensData data = autosensDataTable.valueAt(autosensDataTable.size() - 1);
if (data.time < System.currentTimeMillis() - 5 * 60 * 1000) {
if (data.time < System.currentTimeMillis() - 11 * 60 * 1000) {
return null;
} else {
return data;

View file

@ -260,18 +260,6 @@ public class LoopPlugin implements PluginBase {
if (!isEnabled(PluginBase.LOOP))
return;
if (isSuspended()) {
log.debug(MainApp.sResources.getString(R.string.loopsuspended));
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.loopsuspended)));
return;
}
if (pump.isSuspended()) {
log.debug(MainApp.sResources.getString(R.string.pumpsuspended));
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.pumpsuspended)));
return;
}
if (MainApp.getConfigBuilder().getProfile() == null) {
log.debug(MainApp.sResources.getString(R.string.noprofileselected));
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.noprofileselected)));
@ -281,7 +269,7 @@ public class LoopPlugin implements PluginBase {
// Check if pump info is loaded
if (pump.getBaseBasalRate() < 0.01d) return;
APSInterface usedAPS = MainApp.getConfigBuilder().getActiveAPS();
APSInterface usedAPS = ConfigBuilderPlugin.getActiveAPS();
if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginBase.APS)) {
usedAPS.invoke(initiator);
result = usedAPS.getLastAPSResult();
@ -312,6 +300,20 @@ public class LoopPlugin implements PluginBase {
lastRun.source = ((PluginBase) usedAPS).getName();
lastRun.setByPump = null;
NSUpload.uploadDeviceStatus();
if (isSuspended()) {
log.debug(MainApp.sResources.getString(R.string.loopsuspended));
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.loopsuspended)));
return;
}
if (pump.isSuspended()) {
log.debug(MainApp.sResources.getString(R.string.pumpsuspended));
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.pumpsuspended)));
return;
}
if (constraintsInterface.isClosedModeEnabled()) {
if (result.changeRequested) {
final PumpEnactResult waiting = new PumpEnactResult();
@ -372,7 +374,6 @@ public class LoopPlugin implements PluginBase {
}
MainApp.bus().post(new EventLoopUpdateGui());
NSUpload.uploadDeviceStatus();
} finally {
if (Config.logFunctionCalls)
log.debug("invoke end");

View file

@ -222,4 +222,8 @@ public class NSClientInternalPlugin implements PluginBase {
public String url() {
return NSClientService.nsURL;
}
public boolean hasWritePermission() {
return nsClientService.hasWriteAuth;
}
}

View file

@ -24,11 +24,12 @@ import info.nightscout.utils.SP;
public class BroadcastTreatment {
private static Logger log = LoggerFactory.getLogger(BroadcastTreatment.class);
public static void handleNewTreatment(JSONObject treatment, boolean isDelta) {
public static void handleNewTreatment(JSONObject treatment, boolean isDelta, boolean isLocalBypass) {
Bundle bundle = new Bundle();
bundle.putString("treatment", treatment.toString());
bundle.putBoolean("delta", isDelta);
bundle.putBoolean("islocal", isLocalBypass);
Intent intent = new Intent(Intents.ACTION_NEW_TREATMENT);
intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);

View file

@ -30,14 +30,6 @@ public class DBAccessReceiver extends BroadcastReceiver {
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
DBAccessReceiver.class.getSimpleName());
NSClientInternalPlugin nsClientInternalPlugin = MainApp.getSpecificPlugin(NSClientInternalPlugin.class);
if (!nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) {
return;
}
if (SP.getBoolean(R.string.key_ns_noupload, false)) {
log.debug("Upload disabled. Message dropped");
return;
}
wakeLock.acquire();
try {
Bundle bundles = intent.getExtras();
@ -83,16 +75,22 @@ public class DBAccessReceiver extends BroadcastReceiver {
}
if (action.equals("dbRemove")) {
DbRequest dbr = new DbRequest(action, collection, nsclientid.toString(), _id);
UploadQueue.add(dbr);
if (shouldUpload()) {
DbRequest dbr = new DbRequest(action, collection, nsclientid.toString(), _id);
UploadQueue.add(dbr);
}
} else {
DbRequest dbr = new DbRequest(action, collection, nsclientid.toString(), data);
// this is not used as mongo _id but only for searching in UploadQueue database
// if record has to be removed from queue before upload
dbr._id = nsclientid.toString();
UploadQueue.add(dbr);
if (collection.equals("treatments"))
if (shouldUpload()) {
UploadQueue.add(dbr);
}
if (collection.equals("treatments")) {
genereateTreatmentOfflineBroadcast(dbr);
}
}
} finally {
@ -101,13 +99,18 @@ public class DBAccessReceiver extends BroadcastReceiver {
}
public boolean shouldUpload() {
NSClientInternalPlugin nsClientInternalPlugin = MainApp.getSpecificPlugin(NSClientInternalPlugin.class);
return nsClientInternalPlugin.isEnabled(PluginBase.GENERAL) && !SP.getBoolean(R.string.key_ns_noupload, false);
}
public void genereateTreatmentOfflineBroadcast(DbRequest request) {
if (request.action.equals("dbAdd")) {
try {
JSONObject data = new JSONObject(request.data);
data.put("mills", DateUtil.fromISODateString(data.getString("created_at")).getTime());
data.put("_id", data.get("NSCLIENT_ID")); // this is only fake id
BroadcastTreatment.handleNewTreatment(data, false);
BroadcastTreatment.handleNewTreatment(data, false, true);
} catch (Exception e) {
log.error("Unhadled exception", e);
}

View file

@ -114,6 +114,18 @@ public class NSClientService extends Service {
initialize();
}
@Override
public void onCreate() {
super.onCreate();
mWakeLock.acquire();
}
@Override
public void onDestroy() {
super.onDestroy();
mWakeLock.release();
}
public class LocalBinder extends Binder {
public NSClientService getServiceInstance() {
return NSClientService.this;
@ -182,8 +194,6 @@ public class NSClientService extends Service {
public void initialize() {
dataCounter = 0;
NSClientService.mWakeLock.acquire();
readPreferences();
if (!nsAPISecret.equals(""))
@ -221,7 +231,6 @@ public class NSClientService extends Service {
MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "No NS URL specified"));
MainApp.bus().post(new EventNSClientStatus("Not configured"));
}
NSClientService.mWakeLock.release();
}
private Emitter.Listener onConnect = new Emitter.Listener() {
@ -242,6 +251,15 @@ public class NSClientService extends Service {
public void destroy() {
if (mSocket != null) {
mSocket.off(Socket.EVENT_CONNECT);
mSocket.off(Socket.EVENT_DISCONNECT);
mSocket.off(Socket.EVENT_PING);
mSocket.off("dataUpdate");
mSocket.off("announcement");
mSocket.off("alarm");
mSocket.off("urgent_alarm");
mSocket.off("clear_alarm");
MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "destroy"));
isConnected = false;
hasWriteAuth = false;

View file

@ -247,9 +247,11 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
determineBasalResultAMA.changeRequested = false;
// limit requests on openloop mode
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1)
if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultAMA.rate == 0 && determineBasalResultAMA.duration == 0) {
// going to cancel
} else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) {
determineBasalResultAMA.changeRequested = false;
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
} else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
determineBasalResultAMA.changeRequested = false;
}

View file

@ -232,9 +232,11 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
determineBasalResultMA.changeRequested = false;
// limit requests on openloop mode
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1)
if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultMA.rate == 0 && determineBasalResultMA.duration == 0) {
// going to cancel
} else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) {
determineBasalResultMA.changeRequested = false;
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
} else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
determineBasalResultMA.changeRequested = false;
}

View file

@ -243,6 +243,7 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("remainingCarbsCap", SMBDefaults.remainingCarbsCap);
mProfile.put("enableUAM", SP.getBoolean(R.string.key_use_uam, false));
mProfile.put("A52_risk_enable", SMBDefaults.A52_risk_enable);
mProfile.put("enableSMB_always", SMBDefaults.enableSMB_always);
mProfile.put("enableSMB_with_COB", SP.getBoolean(R.string.key_use_smb, false) && SMBDefaults.enableSMB_with_COB);
mProfile.put("enableSMB_with_temptarget", SP.getBoolean(R.string.key_use_smb, false) && SMBDefaults.enableSMB_with_temptarget);
mProfile.put("enableSMB_after_carbs", SP.getBoolean(R.string.key_use_smb, false) && (SourceDexcomG5Plugin.getPlugin().isEnabled(PluginBase.APS) || SMBDefaults.enableSMB_after_carbs));

View file

@ -68,7 +68,7 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface {
@Override
public String getNameShort() {
String name = MainApp.sResources.getString(R.string.smb_shortname);
if (!name.trim().isEmpty()){
if (!name.trim().isEmpty()) {
//only if translation exists
return name;
}
@ -179,8 +179,8 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface {
double maxIob = SP.getDouble("openapsma_max_iob", 1.5d);
double maxBasal = SP.getDouble("openapsma_max_basal", 1d);
double minBg = Profile.toMgdl(profile.getTargetLow(), units);
double maxBg = Profile.toMgdl(profile.getTargetHigh(), units);
double minBg = Profile.toMgdl(profile.getTargetLow(), units);
double maxBg = Profile.toMgdl(profile.getTargetHigh(), units);
double targetBg = (minBg + maxBg) / 2;
minBg = Round.roundTo(minBg, 0.1d);
@ -251,10 +251,13 @@ public class OpenAPSSMBPlugin implements PluginBase, APSInterface {
determineBasalResultSMB.changeRequested = false;
// limit requests on openloop mode
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1)
if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultSMB.rate == 0 && determineBasalResultSMB.duration == 0) {
// going to cancel
} else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) {
determineBasalResultSMB.changeRequested = false;
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - pump.getBaseBasalRate()) < 0.1)
} else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultSMB.rate - pump.getBaseBasalRate()) < 0.1) {
determineBasalResultSMB.changeRequested = false;
}
}
determineBasalResultSMB.iob = iobArray[0];

View file

@ -76,7 +76,8 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis
unitsView = (TextView) view.findViewById(R.id.overview_calibration_units);
unitsView.setText(units);
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}

View file

@ -102,7 +102,8 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher);
editInsulin.setParams(0d, 0d, maxInsulin, ConfigBuilderPlugin.getActivePump().getPumpDescription().bolusStep, new DecimalFormat("0.00"), false, textWatcher);
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}

View file

@ -233,7 +233,8 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
editCarbTime.setParams(0d, -60d, 60d, 5d, new DecimalFormat("0"), false);
initDialog();
setCancelable(false);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);
return view;
}
@ -458,9 +459,9 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
// COB
Double c_cob = 0d;
if (cobCheckbox.isChecked()) {
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
if(autosensData != null && autosensData.time > System.currentTimeMillis() - 11 * 60 * 1000L) {
if(autosensData != null) {
c_cob = autosensData.cob;
}
}

View file

@ -11,6 +11,7 @@ import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
@ -177,6 +178,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
Handler sLoopHandler = new Handler();
Runnable sRefreshLoop = null;
final Object updateSync = new Object();
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
private static ScheduledFuture<?> scheduledUpdate = null;
@ -900,9 +903,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
@SuppressLint("SetTextI18n")
public void updateGUI(String from) {
public void updateGUI(final String from) {
log.debug("updateGUI entered from: " + from);
Date updateGUIStart = new Date();
final Date updateGUIStart = new Date();
if (getActivity() == null)
return;
@ -924,7 +927,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
BgReading actualBG = DatabaseHelper.actualBg();
BgReading lastBG = DatabaseHelper.lastBg();
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
final PumpInterface pump = ConfigBuilderPlugin.getActivePump();
Profile profile = MainApp.getConfigBuilder().getProfile();
String units = profile.getUnits();
@ -936,8 +939,16 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return;
}
double lowLine = SP.getDouble("low_mark", 0d);
double highLine = SP.getDouble("high_mark", 0d);
double lowLineSetting = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units));
double highLineSetting = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units));
if (lowLineSetting < 1)
lowLineSetting = Profile.fromMgdlToUnits(76d, units);
if (highLineSetting < 1)
highLineSetting = Profile.fromMgdlToUnits(180d, units);
final double lowLine = lowLineSetting;
final double highLine = highLineSetting;
//Start with updating the BG as it is unaffected by loop.
// **** BG value ****
@ -1141,16 +1152,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
if (lowLine < 1) {
lowLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units);
}
if (highLine < 1) {
highLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units);
}
// **** BG value ****
if (lastBG == null) { //left this here as it seems you want to exit at this point if it is null...
return;
}
Integer flag = bgView.getPaintFlags();
@ -1197,13 +1200,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
// cob
if (cobView != null) { // view must not exists
String cobText = "";
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
if (autosensData != null)
cobText = (int) autosensData.cob + " g";
cobView.setText(cobText);
}
boolean predictionsAvailable = finalLastRun != null && finalLastRun.request.hasPredictions;
final boolean predictionsAvailable = finalLastRun != null && finalLastRun.request.hasPredictions;
if (predictionsAvailable) {
showPredictionView.setVisibility(View.VISIBLE);
getActivity().findViewById(R.id.overview_showprediction_label).setVisibility(View.VISIBLE);
@ -1247,111 +1250,126 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
// ****** GRAPH *******
// align to hours
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.add(Calendar.HOUR, 1);
new Thread(new Runnable() {
@Override
public void run() {
// allign to hours
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.add(Calendar.HOUR, 1);
int hoursToFetch;
long toTime;
long fromTime;
long endTime;
if (predictionsAvailable && showPredictionView.isChecked()) {
int predHours = (int) (Math.ceil(finalLastRun.constraintsProcessed.getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
predHours = Math.min(2, predHours);
predHours = Math.max(0, predHours);
hoursToFetch = rangeToDisplay - predHours;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
endTime = toTime + predHours * 60 * 60 * 1000L;
} else {
hoursToFetch = rangeToDisplay;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
endTime = toTime;
}
int hoursToFetch;
final long toTime;
final long fromTime;
final long endTime;
if (predictionsAvailable && showPredictionView.isChecked()) {
int predHours = (int) (Math.ceil(finalLastRun.constraintsProcessed.getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
predHours = Math.min(2, predHours);
predHours = Math.max(0, predHours);
hoursToFetch = rangeToDisplay - predHours;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
endTime = toTime + predHours * 60 * 60 * 1000L;
} else {
hoursToFetch = rangeToDisplay;
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
endTime = toTime;
}
long now = System.currentTimeMillis();
final long now = System.currentTimeMillis();
// 2nd graph
// remove old data
iobGraph.getSeries().clear();
// ------------------ 1st graph
Profiler.log(log, from + " - 1st graph - START", updateGUIStart);
GraphData secondGraphData = new GraphData();
final GraphData graphData = new GraphData(bgGraph);
boolean useIobForScale = false;
boolean useCobForScale = false;
boolean useDevForScale = false;
boolean useRatioForScale = false;
boolean useDSForScale = false;
// **** In range Area ****
graphData.addInRangeArea(fromTime, endTime, lowLine, highLine);
if (showIobView.isChecked()) {
useIobForScale = true;
} else if (showCobView.isChecked()) {
useCobForScale = true;
} else if (showDeviationsView.isChecked()) {
useDevForScale = true;
} else if (showRatiosView.isChecked()) {
useRatioForScale = true;
} else if (Config.displayDeviationSlope) {
useDSForScale = true;
}
// **** BG ****
if (predictionsAvailable && showPredictionView.isChecked())
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, finalLastRun.constraintsProcessed);
else
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, null);
if (showIobView.isChecked())
secondGraphData.addIob(iobGraph, fromTime, now, useIobForScale, 1d);
if (showCobView.isChecked())
secondGraphData.addCob(iobGraph, fromTime, now, useCobForScale, useCobForScale ? 1d : 0.5d);
if (showDeviationsView.isChecked())
secondGraphData.addDeviations(iobGraph, fromTime, now, useDevForScale, 1d);
if (showRatiosView.isChecked())
secondGraphData.addRatio(iobGraph, fromTime, now, useRatioForScale, 1d);
if (Config.displayDeviationSlope)
secondGraphData.addDeviationSlope(iobGraph, fromTime, now, useDSForScale, 1d);
// set manual x bounds to have nice steps
graphData.formatAxis(fromTime, endTime);
if (showIobView.isChecked() || showCobView.isChecked() || showDeviationsView.isChecked() || showRatiosView.isChecked() || Config.displayDeviationSlope) {
iobGraph.setVisibility(View.VISIBLE);
} else {
iobGraph.setVisibility(View.GONE);
}
// Treatments
graphData.addTreatments(fromTime, endTime);
// remove old data from graph
bgGraph.getSeries().clear();
// add basal data
if (pump.getPumpDescription().isTempBasalCapable && showBasalsView.isChecked()) {
graphData.addBasals(fromTime, now, lowLine / graphData.maxY / 1.2d);
}
GraphData graphData = new GraphData();
// **** NOW line ****
graphData.addNowLine(now);
// ------------------ 2nd graph
Profiler.log(log, from + " - 2nd graph - START", updateGUIStart);
// **** In range Area ****
graphData.addInRangeArea(bgGraph, fromTime, endTime, lowLine, highLine);
final GraphData secondGraphData = new GraphData(iobGraph);
// **** BG ****
if (predictionsAvailable && showPredictionView.isChecked())
graphData.addBgReadings(bgGraph, fromTime, toTime, lowLine, highLine, finalLastRun.constraintsProcessed);
else
graphData.addBgReadings(bgGraph, fromTime, toTime, lowLine, highLine, null);
boolean useIobForScale = false;
boolean useCobForScale = false;
boolean useDevForScale = false;
boolean useRatioForScale = false;
boolean useDSForScale = false;
// set manual x bounds to have nice steps
graphData.formatAxis(bgGraph, fromTime, endTime);
secondGraphData.formatAxis(iobGraph, fromTime, endTime);
if (showIobView.isChecked()) {
useIobForScale = true;
} else if (showCobView.isChecked()) {
useCobForScale = true;
} else if (showDeviationsView.isChecked()) {
useDevForScale = true;
} else if (showRatiosView.isChecked()) {
useRatioForScale = true;
} else if (Config.displayDeviationSlope) {
useDSForScale = true;
}
// Treatments
graphData.addTreatments(bgGraph, fromTime, endTime);
if (showIobView.isChecked())
secondGraphData.addIob(fromTime, now, useIobForScale, 1d);
if (showCobView.isChecked())
secondGraphData.addCob(fromTime, now, useCobForScale, useCobForScale ? 1d : 0.5d);
if (showDeviationsView.isChecked())
secondGraphData.addDeviations(fromTime, now, useDevForScale, 1d);
if (showRatiosView.isChecked())
secondGraphData.addRatio(fromTime, now, useRatioForScale, 1d);
if (Config.displayDeviationSlope)
secondGraphData.addDeviationSlope(fromTime, now, useDSForScale, 1d);
// add basal data
if (pump.getPumpDescription().isTempBasalCapable && showBasalsView.isChecked()) {
graphData.addBasals(bgGraph, fromTime, now, lowLine / graphData.maxY / 1.2d);
}
// **** NOW line ****
// set manual x bounds to have nice steps
secondGraphData.formatAxis(fromTime, endTime);
secondGraphData.addNowLine(now);
// **** NOW line ****
graphData.addNowLine(bgGraph, now);
secondGraphData.addNowLine(iobGraph, now);
// finaly enforce drawing of graphs
bgGraph.onDataChanged(false, false);
iobGraph.onDataChanged(false, false);
// do GUI update
FragmentActivity activity = getActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (showIobView.isChecked() || showCobView.isChecked() || showDeviationsView.isChecked() || showRatiosView.isChecked() || Config.displayDeviationSlope) {
iobGraph.setVisibility(View.VISIBLE);
} else {
iobGraph.setVisibility(View.GONE);
}
// finally enforce drawing of graphs
graphData.performUpdate();
secondGraphData.performUpdate();
Profiler.log(log, from + " - onDataChanged", updateGUIStart);
}
});
}
}
}).start();
Profiler.log(log, from, updateGUIStart);
}
@ -1437,6 +1455,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
}
}
void updateNotifications() {

View file

@ -26,7 +26,7 @@ import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.BasalData;
import info.nightscout.androidaps.plugins.IobCobCalculator.BasalData;
import info.nightscout.androidaps.plugins.Loop.APSResult;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.AreaGraphSeries;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.DataPointWithLabelInterface;
@ -44,15 +44,18 @@ import info.nightscout.utils.Round;
public class GraphData {
public GraphData() {
units = MainApp.getConfigBuilder().getProfileUnits();
}
private GraphView graph;
public double maxY = 0;
private List<BgReading> bgReadingsArray;
private String units;
private List<Series> series = new ArrayList<>();
public void addBgReadings(GraphView bgGraph, long fromTime, long toTime, double lowLine, double highLine, APSResult apsResult) {
public GraphData(GraphView graph) {
units = MainApp.getConfigBuilder().getProfileUnits();
this.graph = graph;
}
public void addBgReadings(long fromTime, long toTime, double lowLine, double highLine, APSResult apsResult) {
double maxBgValue = 0d;
bgReadingsArray = MainApp.getDbHelper().getBgreadingsDataFromTime(fromTime, true);
List<DataPointWithLabelInterface> bgListArray = new ArrayList<>();
@ -78,20 +81,18 @@ public class GraphData {
DataPointWithLabelInterface[] bg = new DataPointWithLabelInterface[bgListArray.size()];
bg = bgListArray.toArray(bg);
if (bg.length > 0) {
addSeriesWithoutInvalidate(bgGraph, new PointsWithLabelGraphSeries<>(bg));
}
maxY = maxBgValue;
// set manual y bounds to have nice steps
bgGraph.getViewport().setMaxY(maxY);
bgGraph.getViewport().setMinY(0);
bgGraph.getViewport().setYAxisBoundsManual(true);
bgGraph.getGridLabelRenderer().setNumVerticalLabels(numOfVertLines);
graph.getViewport().setMaxY(maxY);
graph.getViewport().setMinY(0);
graph.getViewport().setYAxisBoundsManual(true);
graph.getGridLabelRenderer().setNumVerticalLabels(numOfVertLines);
addSeries(new PointsWithLabelGraphSeries<>(bg));
}
public void addInRangeArea(GraphView bgGraph, long fromTime, long toTime, double lowLine, double highLine) {
public void addInRangeArea(long fromTime, long toTime, double lowLine, double highLine) {
AreaGraphSeries<DoubleDataPoint> inRangeAreaSeries;
DoubleDataPoint[] inRangeAreaDataPoints = new DoubleDataPoint[]{
@ -99,14 +100,15 @@ public class GraphData {
new DoubleDataPoint(toTime, lowLine, highLine)
};
inRangeAreaSeries = new AreaGraphSeries<>(inRangeAreaDataPoints);
addSeriesWithoutInvalidate(bgGraph, inRangeAreaSeries);
inRangeAreaSeries.setColor(0);
inRangeAreaSeries.setDrawBackground(true);
inRangeAreaSeries.setBackgroundColor(MainApp.sResources.getColor(R.color.inrangebackground));
addSeries(inRangeAreaSeries);
}
// scale in % of vertical size (like 0.3)
public void addBasals(GraphView bgGraph, long fromTime, long toTime, double scale) {
public void addBasals(long fromTime, long toTime, double scale) {
LineGraphSeries<ScaledDataPoint> basalsLineSeries;
LineGraphSeries<ScaledDataPoint> absoluteBasalsLineSeries;
LineGraphSeries<ScaledDataPoint> baseBasalsSeries;
@ -191,7 +193,7 @@ public class GraphData {
basalsLineSeries = new LineGraphSeries<>(basalLine);
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2);
paint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity * 2);
paint.setPathEffect(new DashPathEffect(new float[]{2, 4}, 0));
paint.setColor(MainApp.sResources.getColor(R.color.basal));
basalsLineSeries.setCustomPaint(paint);
@ -201,19 +203,19 @@ public class GraphData {
absoluteBasalsLineSeries = new LineGraphSeries<>(absoluteBasalLine);
Paint absolutePaint = new Paint();
absolutePaint.setStyle(Paint.Style.STROKE);
absolutePaint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2);
absolutePaint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity * 2);
absolutePaint.setColor(MainApp.sResources.getColor(R.color.basal));
absoluteBasalsLineSeries.setCustomPaint(absolutePaint);
basalScale.setMultiplier(maxY * scale / maxBasalValueFound);
addSeriesWithoutInvalidate(bgGraph, baseBasalsSeries);
addSeriesWithoutInvalidate(bgGraph, tempBasalsSeries);
addSeriesWithoutInvalidate(bgGraph, basalsLineSeries);
addSeriesWithoutInvalidate(bgGraph, absoluteBasalsLineSeries);
addSeries(baseBasalsSeries);
addSeries(tempBasalsSeries);
addSeries(basalsLineSeries);
addSeries(absoluteBasalsLineSeries);
}
public void addTreatments(GraphView bgGraph, long fromTime, long endTime) {
public void addTreatments(long fromTime, long endTime) {
List<DataPointWithLabelInterface> filteredTreatments = new ArrayList<>();
List<Treatment> treatments = MainApp.getConfigBuilder().getTreatmentsFromHistory();
@ -259,9 +261,7 @@ public class GraphData {
DataPointWithLabelInterface[] treatmentsArray = new DataPointWithLabelInterface[filteredTreatments.size()];
treatmentsArray = filteredTreatments.toArray(treatmentsArray);
if (treatmentsArray.length > 0) {
addSeriesWithoutInvalidate(bgGraph, new PointsWithLabelGraphSeries<>(treatmentsArray));
}
addSeries(new PointsWithLabelGraphSeries<>(treatmentsArray));
}
private double getNearestBg(long date) {
@ -276,7 +276,7 @@ public class GraphData {
}
// scale in % of vertical size (like 0.3)
public void addIob(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
public void addIob(long fromTime, long toTime, boolean useForScale, double scale) {
FixedLineGraphSeries<ScaledDataPoint> iobSeries;
List<ScaledDataPoint> iobArray = new ArrayList<>();
Double maxIobValueFound = 0d;
@ -307,11 +307,11 @@ public class GraphData {
iobScale.setMultiplier(maxY * scale / maxIobValueFound);
addSeriesWithoutInvalidate(graph, iobSeries);
addSeries(iobSeries);
}
// scale in % of vertical size (like 0.3)
public void addCob(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
public void addCob(long fromTime, long toTime, boolean useForScale, double scale) {
FixedLineGraphSeries<ScaledDataPoint> cobSeries;
List<ScaledDataPoint> cobArray = new ArrayList<>();
Double maxCobValueFound = 0d;
@ -346,11 +346,11 @@ public class GraphData {
cobScale.setMultiplier(maxY * scale / maxCobValueFound);
addSeriesWithoutInvalidate(graph, cobSeries);
addSeries(cobSeries);
}
// scale in % of vertical size (like 0.3)
public void addDeviations(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
public void addDeviations(long fromTime, long toTime, boolean useForScale, double scale) {
class DeviationDataPoint extends ScaledDataPoint {
public int color;
@ -393,11 +393,11 @@ public class GraphData {
devScale.setMultiplier(maxY * scale / maxDevValueFound);
addSeriesWithoutInvalidate(graph, devSeries);
addSeries(devSeries);
}
// scale in % of vertical size (like 0.3)
public void addRatio(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
public void addRatio(long fromTime, long toTime, boolean useForScale, double scale) {
LineGraphSeries<ScaledDataPoint> ratioSeries;
List<ScaledDataPoint> ratioArray = new ArrayList<>();
Double maxRatioValueFound = 0d;
@ -423,11 +423,11 @@ public class GraphData {
ratioScale.setMultiplier(maxY * scale / maxRatioValueFound);
addSeriesWithoutInvalidate(graph, ratioSeries);
addSeries(ratioSeries);
}
// scale in % of vertical size (like 0.3)
public void addDeviationSlope(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
public void addDeviationSlope(long fromTime, long toTime, boolean useForScale, double scale) {
LineGraphSeries<ScaledDataPoint> dsMaxSeries;
LineGraphSeries<ScaledDataPoint> dsMinSeries;
List<ScaledDataPoint> dsMaxArray = new ArrayList<>();
@ -466,12 +466,12 @@ public class GraphData {
dsMaxScale.setMultiplier(maxY * scale / maxFromMaxValueFound);
dsMinScale.setMultiplier(maxY * scale / maxFromMinValueFound);
addSeriesWithoutInvalidate(graph, dsMaxSeries);
addSeriesWithoutInvalidate(graph, dsMinSeries);
addSeries(dsMaxSeries);
addSeries(dsMinSeries);
}
// scale in % of vertical size (like 0.3)
public void addNowLine(GraphView graph, long now) {
public void addNowLine(long now) {
LineGraphSeries<DataPoint> seriesNow;
DataPoint[] nowPoints = new DataPoint[]{
new DataPoint(now, 0),
@ -488,10 +488,10 @@ public class GraphData {
paint.setColor(Color.WHITE);
seriesNow.setCustomPaint(paint);
addSeriesWithoutInvalidate(graph, seriesNow);
addSeries(seriesNow);
}
public void formatAxis(GraphView graph, long fromTime, long endTime) {
public void formatAxis(long fromTime, long endTime) {
graph.getViewport().setMaxX(endTime);
graph.getViewport().setMinX(fromTime);
graph.getViewport().setXAxisBoundsManual(true);
@ -499,11 +499,23 @@ public class GraphData {
graph.getGridLabelRenderer().setNumHorizontalLabels(7); // only 7 because of the space
}
private void addSeriesWithoutInvalidate(GraphView bgGraph, Series s) {
if (!s.isEmpty()) {
s.onGraphViewAttached(bgGraph);
bgGraph.getSeries().add(s);
}
private void addSeries(Series s) {
series.add(s);
}
public void performUpdate() {
// clear old data
graph.getSeries().clear();
// add precalculated series
for (Series s: series) {
if (!s.isEmpty()) {
s.onGraphViewAttached(graph);
graph.getSeries().add(s);
}
}
// draw it
graph.onDataChanged(false, false);
}
}

View file

@ -57,6 +57,9 @@ public class Notification {
public static final int BG_READINGS_MISSED = 27;
public static final int UNSUPPORTED_FIRMWARE = 28;
public static final int MINIMAL_BASAL_VALUE_REPLACED = 29;
public static final int BASAL_PROFILE_NOT_ALIGNED_TO_HOURS = 30;
public static final int ZERO_VALUE_IN_PROFILE = 31;
public static final int NO_LOCALE_PROFILE_FOUND = 32;
public int id;
public Date date;

View file

@ -162,9 +162,6 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
baseic[i] = SP.getDouble(SETTINGS_PREFIX + "baseic" + i, baseic[i]);
baseisf[i] = SP.getDouble(SETTINGS_PREFIX + "baseisf" + i, baseisf[i]);
}
createConvertedProfile();
}
public String externallySetParameters(int timeshift, int percentage) {
@ -347,6 +344,9 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
@Override
public ProfileStore getProfile() {
if (convertedProfile == null)
createConvertedProfile();
performLimitCheck();
return convertedProfile;
}
@ -358,6 +358,9 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
@Override
public String getProfileName() {
if (convertedProfile == null)
createConvertedProfile();
performLimitCheck();
return convertedProfileName;
}

View file

@ -178,7 +178,6 @@ public class LocalProfilePlugin implements PluginBase, ProfileInterface {
} catch (JSONException ignored) {
}
}
createConvertedProfile();
}
/*
@ -244,6 +243,8 @@ public class LocalProfilePlugin implements PluginBase, ProfileInterface {
@Override
public ProfileStore getProfile() {
if (convertedProfile == null)
createConvertedProfile();
return convertedProfile;
}
@ -254,6 +255,8 @@ public class LocalProfilePlugin implements PluginBase, ProfileInterface {
@Override
public String getProfileName() {
if (convertedProfile == null)
createConvertedProfile();
return DecimalFormatter.to2Decimal(convertedProfile.getDefaultProfile().percentageBasalSum()) + "U ";
}

View file

@ -13,9 +13,9 @@ import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.utils.SP;
/**
@ -28,7 +28,7 @@ public class SimpleProfilePlugin implements PluginBase, ProfileInterface {
public static SimpleProfilePlugin getPlugin() {
if (simpleProfilePlugin == null)
simpleProfilePlugin = new SimpleProfilePlugin();
simpleProfilePlugin = new SimpleProfilePlugin();
return simpleProfilePlugin;
}
@ -146,7 +146,6 @@ public class SimpleProfilePlugin implements PluginBase, ProfileInterface {
basal = SP.getDouble("SimpleProfile" + "basal", 1d);
targetLow = SP.getDouble("SimpleProfile" + "targetlow", 80d);
targetHigh = SP.getDouble("SimpleProfile" + "targethigh", 120d);
createConvertedProfile();
}
/*
@ -211,6 +210,8 @@ public class SimpleProfilePlugin implements PluginBase, ProfileInterface {
@Override
public ProfileStore getProfile() {
if (convertedProfile == null)
createConvertedProfile();
return convertedProfile;
}

View file

@ -785,6 +785,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
return true;
}
@Override
public boolean isSMBModeEnabled() {
return true;
}
@SuppressWarnings("PointlessBooleanExpression")
@Override
public Double applyBasalConstraints(Double absoluteRate) {

View file

@ -787,6 +787,11 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, DanaRInterf
return true;
}
@Override
public boolean isSMBModeEnabled() {
return true;
}
@SuppressWarnings("PointlessBooleanExpression")
@Override
public Double applyBasalConstraints(Double absoluteRate) {

View file

@ -289,6 +289,11 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
return true;
}
@Override
public boolean isSMBModeEnabled() {
return true;
}
@Override
public Double applyBasalConstraints(Double absoluteRate) {
double origAbsoluteRate = absoluteRate;
@ -400,6 +405,8 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
} else {
MainApp.bus().post(new EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED));
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
Notification notification = new Notification(Notification.PROFILE_SET_OK, MainApp.sResources.getString(R.string.profile_set_ok), Notification.INFO, 60);
MainApp.bus().post(new EventNewNotification(notification));
result.success = true;
result.enacted = true;
result.comment = "OK";

View file

@ -1,8 +1,10 @@
package info.nightscout.androidaps.plugins.PumpDanaRS.events;
import info.nightscout.androidaps.events.Event;
/**
* Created by mike on 05.09.2017.
*/
public class EventDanaRSDeviceChange {
public class EventDanaRSDeviceChange extends Event {
}

View file

@ -1,12 +1,13 @@
package info.nightscout.androidaps.plugins.PumpDanaRS.events;
import info.nightscout.androidaps.events.Event;
import info.nightscout.androidaps.plugins.PumpDanaRS.comm.DanaRS_Packet;
/**
* Created by mike on 01.09.2017.
*/
public class EventDanaRSPacket {
public class EventDanaRSPacket extends Event{
public EventDanaRSPacket(DanaRS_Packet data) {
this.data = data;
}

View file

@ -1,8 +1,10 @@
package info.nightscout.androidaps.plugins.PumpDanaRS.events;
import info.nightscout.androidaps.events.Event;
/**
* Created by mike on 01.09.2017.
*/
public class EventDanaRSPairingSuccess {
public class EventDanaRSPairingSuccess extends Event{
}

View file

@ -257,6 +257,8 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, DanaRInterface,
} else {
MainApp.bus().post(new EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED));
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
Notification notification = new Notification(Notification.PROFILE_SET_OK, MainApp.sResources.getString(R.string.profile_set_ok), Notification.INFO, 60);
MainApp.bus().post(new EventNewNotification(notification));
result.success = true;
result.enacted = true;
result.comment = "OK";
@ -730,6 +732,11 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, DanaRInterface,
return true;
}
@Override
public boolean isSMBModeEnabled() {
return true;
}
@SuppressWarnings("PointlessBooleanExpression")
@Override
public Double applyBasalConstraints(Double absoluteRate) {

View file

@ -1,8 +1,6 @@
package info.nightscout.androidaps.plugins.PumpVirtual;
import android.content.SharedPreferences;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import org.json.JSONException;
import org.json.JSONObject;
@ -16,6 +14,7 @@ import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.Source;
@ -24,8 +23,9 @@ import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.PumpVirtual.events.EventVirtualPumpUpdateGui;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.NSUpload;
@ -65,6 +65,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
}
private static VirtualPumpPlugin plugin = null;
public static VirtualPumpPlugin getPlugin() {
loadFakingStatus();
if (plugin == null)
@ -219,12 +220,14 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
// Do nothing here. we are using MainApp.getConfigBuilder().getActiveProfile().getProfile();
PumpEnactResult result = new PumpEnactResult();
result.success = true;
Notification notification = new Notification(Notification.PROFILE_SET_OK, MainApp.sResources.getString(R.string.profile_set_ok), Notification.INFO, 60);
MainApp.bus().post(new EventNewNotification(notification));
return result;
}
@Override
public boolean isThisProfileSet(Profile profile) {
return false;
return true;
}
@Override
@ -401,8 +404,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
@Override
public JSONObject getJSONStatus() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
if (!preferences.getBoolean("virtualpump_uploadstatus", false)) {
if (!SP.getBoolean("virtualpump_uploadstatus", false)) {
return null;
}
JSONObject pump = new JSONObject();

View file

@ -149,12 +149,13 @@ public class BGSourceFragment extends SubscriberFragment {
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(bgReading.date) + "\n" + bgReading.valueToUnitsToString(profile.getUnits()));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
final String _id = bgReading._id;
/* final String _id = bgReading._id;
if (NSUpload.isIdValid(_id)) {
NSUpload.removeFoodFromNS(_id);
} else {
UploadQueue.removeID("dbAdd", _id);
}
*/
bgReading.isValid = false;
MainApp.getDbHelper().update(bgReading);
updateGUI();

View file

@ -38,6 +38,7 @@ import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump;
import info.nightscout.androidaps.plugins.PumpDanaR.comm.RecordTypes;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.utils.BolusWizard;
@ -268,13 +269,15 @@ public class ActionStringHandler {
} else if ("tddstats".equals(act[0])) {
Object activePump = MainApp.getConfigBuilder().getActivePump();
PumpInterface dana = MainApp.getSpecificPlugin(DanaRPlugin.class);
PumpInterface danaRS = MainApp.getSpecificPlugin(DanaRSPlugin.class);
PumpInterface danaV2 = MainApp.getSpecificPlugin(DanaRv2Plugin.class);
PumpInterface danaKorean = MainApp.getSpecificPlugin(DanaRKoreanPlugin.class);
if ((dana == null || dana != activePump) &&
(danaV2 == null || danaV2 != activePump) &&
(danaKorean == null || danaKorean != activePump)
(danaKorean == null || danaKorean != activePump) &&
(danaRS == null || danaRS != activePump)
) {
sendError("Pump does not support TDDs!");
return;

View file

@ -243,6 +243,7 @@ public class WatchUpdaterService extends WearableListenerService implements
DataMap dataMap = new DataMap();
dataMap.putString("sgvString", lastBG.valueToUnitsToString(units));
dataMap.putString("glucoseUnits", units);
dataMap.putLong("timestamp", lastBG.date);
if (glucoseStatus == null) {
dataMap.putString("slopeArrow", "");
@ -253,7 +254,6 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMap.putString("delta", deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units));
dataMap.putString("avgDelta", deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, units));
}
dataMap.putLong("sgvLevel", sgvLevel);
dataMap.putDouble("sgvDouble", lastBG.value);
dataMap.putDouble("high", highLine);
@ -316,7 +316,7 @@ public class WatchUpdaterService extends WearableListenerService implements
if (last_bg == null) return;
List<BgReading> graph_bgs = MainApp.getDbHelper().getBgreadingsDataFromTime(startTime, true);
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData(true);
if (!graph_bgs.isEmpty()) {
DataMap entries = dataMapSingleBG(last_bg, glucoseStatus);
@ -533,7 +533,7 @@ public class WatchUpdaterService extends WearableListenerService implements
String iobSum = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob);
String iobDetail = "(" + DecimalFormatter.to2Decimal(bolusIob.iob) + "|" + DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
String cobString = generateCOBString();
String tempBasal = generateBasalString(treatmentsInterface);
String currentBasal = generateBasalString(treatmentsInterface);
//bgi
String bgiString = "";
@ -543,7 +543,7 @@ public class WatchUpdaterService extends WearableListenerService implements
bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi);
}
String status = generateStatusString(profile, tempBasal,iobSum, iobDetail, bgiString);
String status = generateStatusString(profile, currentBasal,iobSum, iobDetail, bgiString);
//batteries
int phoneBattery = getBatteryLevel(getApplicationContext());
@ -567,7 +567,7 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMapRequest.getDataMap().putString("iobDetail", iobDetail);
dataMapRequest.getDataMap().putBoolean("detailedIob", mPrefs.getBoolean("wear_detailediob", false));
dataMapRequest.getDataMap().putString("cob", cobString);
dataMapRequest.getDataMap().putString("tempBasal", tempBasal);
dataMapRequest.getDataMap().putString("currentBasal", currentBasal);
dataMapRequest.getDataMap().putString("battery", "" + phoneBattery);
dataMapRequest.getDataMap().putString("rigBattery", rigBattery);
dataMapRequest.getDataMap().putLong("openApsStatus", openApsStatus);
@ -598,7 +598,7 @@ public class WatchUpdaterService extends WearableListenerService implements
}
@NonNull
private String generateStatusString(Profile profile, String tempBasal, String iobSum, String iobDetail, String bgiString) {
private String generateStatusString(Profile profile, String currentBasal, String iobSum, String iobDetail, String bgiString) {
String status = "";
@ -623,7 +623,7 @@ public class WatchUpdaterService extends WearableListenerService implements
iobString = iobSum + "U";
}
status += tempBasal + " " + iobString;
status += currentBasal + " " + iobString;
//add BGI if shown, otherwise return
if (mPrefs.getBoolean("wear_showbgi", false)) {
@ -636,10 +636,16 @@ public class WatchUpdaterService extends WearableListenerService implements
@NonNull
private String generateBasalString(TreatmentsInterface treatmentsInterface) {
String basalStringResult = "-.--U/h";
String basalStringResult;
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
if (activeTemp != null) {
basalStringResult = activeTemp.toStringShort();
} else {
if (SP.getBoolean(R.string.key_danar_visualizeextendedaspercentage, false)) {
basalStringResult = "100%";
} else {
basalStringResult = DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + "U/h";
}
}
return basalStringResult;
}
@ -648,7 +654,7 @@ public class WatchUpdaterService extends WearableListenerService implements
private String generateCOBString() {
String cobStringResult = "--";
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
if (autosensData != null) {
cobStringResult = (int) autosensData.cob + "g";
}

View file

@ -128,7 +128,7 @@ public class CommandQueue {
// After new command added to the queue
// start thread again if not already running
private void notifyAboutNewCommand() {
private synchronized void notifyAboutNewCommand() {
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
thread = new QueueThread(this);
thread.start();

View file

@ -9,8 +9,12 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import info.nightscout.androidaps.MainActivity;
import info.nightscout.androidaps.interfaces.PluginBase;
/**
@ -22,6 +26,8 @@ public class TabPageAdapter extends FragmentStatePagerAdapter {
Context context;
private static Logger log = LoggerFactory.getLogger(TabPageAdapter.class);
public TabPageAdapter(FragmentManager fm, Context context) {
super(fm);
this.context = context;
@ -40,6 +46,8 @@ public class TabPageAdapter extends FragmentStatePagerAdapter {
super.finishUpdate(container);
} catch (NullPointerException nullPointerException){
System.out.println("Catch the NullPointerException in FragmentStatePagerAdapter.finishUpdate");
} catch (IllegalStateException e){
log.error(e.getMessage());
}
}

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="apsmode_title">APS Modus</string>
<string name="objectives_bgavailableinns">BZ verfügbar in NS</string>
<string name="apsmode_title">APS-Modus</string>
<string name="objectives_bgavailableinns">BZ verfügbar in Nightscout</string>
<string name="cancel">Abbrechen</string>
<string name="carbs">Kohlehydrate</string>
<string name="carbs">Kohlenhydrate</string>
<string name="careportal">Careportal</string>
<string name="careportal_correctionbolus">Korrekturbolus</string>
<string name="careportal_correctionbolus">Korrektur-Bolus</string>
<string name="careportal_newnstreatment_meter">Messgerät</string>
<string name="careportal_newnstreatment_notes_label">Notiz</string>
<string name="careportal_newnstreatment_profile_label">Profil</string>
@ -16,43 +16,42 @@
<string name="days">Tage</string>
<string name="ok">OK</string>
<string name="openapsma_profile_label">Profil</string>
<string name="profileviewer">NS Profil</string>
<string name="profileviewer">Nightscout-Profil</string>
<string name="tempbasals_iob_label_string">IOB:</string>
<string name="tempbasals_iobtotal_label_string">Gesamt IOB:</string>
<string name="tempbasals_iobtotal_label_string">Gesamt-IOB:</string>
<string name="tempbasals_netinsulin_label_string">Ins:</string>
<string name="tempbasals_netratio_label_string">Ratio:</string>
<string name="tempbasals_realduration_label_string">Dur:</string>
<string name="treatmentdeliveryerror">Bolus Abgabefehler</string>
<string name="virtualpump_battery_label">Batterie</string>
<string name="tempbasals_realduration_label_string">Dauer:</string>
<string name="treatmentdeliveryerror">Bolus-Abgabefehler</string>
<string name="virtualpump_resultok">OK</string>
<string name="basal">Basal</string>
<string name="bolus">Bolus</string>
<string name="careportal_mealbolus">Mahlzeiten Bolus</string>
<string name="careportal_exercise">Sport</string>
<string name="careportal_combobolus">Combo Bolus</string>
<string name="careportal_cgmsensorstart">CGM Sensor Start</string>
<string name="careportal_mealbolus">Mahlzeiten-Bolus</string>
<string name="careportal_exercise">Bewegung</string>
<string name="careportal_combobolus">Combo-Bolus</string>
<string name="careportal_cgmsensorstart">CGM-Sensor Start</string>
<string name="careportal_newnstreatment_absolute_label">Absolut</string>
<string name="careportal_newnstreatment_carbs_label">Kohlehydrate</string>
<string name="careportal_newnstreatment_carbs_label">Kohlenhydrate</string>
<string name="careportal_newnstreatment_insulin_label">Insulin</string>
<string name="careportal_newnstreatment_glucosetype">Glukose-Art</string>
<string name="careportal_newnstreatment_eventtype">Ereignis-Typ</string>
<string name="careportal_newnstreatment_eventtime_label">Ereignis-Zeit</string>
<string name="careportal_newnstreatment_percent_label">Prozent</string>
<string name="careportal_note">Notiz</string>
<string name="careportal_openapsoffline">OpenAPS Offline</string>
<string name="careportal_openapsoffline">OpenAPS offline</string>
<string name="careportal_profileswitch">Profilwechsel</string>
<string name="careportal_pumpsitechange">Pumpenkatheterwechsel</string>
<string name="careportal_pumpsitechange">Pumpenkatheter-Wechsel</string>
<string name="careportal_question">Frage</string>
<string name="careportal_snackbolus">Snack Bolus</string>
<string name="careportal_tempbasalend">Temp Basal Ende</string>
<string name="careportal_tempbasalstart">Temp Basal Start</string>
<string name="careportal_snackbolus">Snack-Bolus</string>
<string name="careportal_tempbasalend">TBR-Ende</string>
<string name="careportal_tempbasalstart">TBR-Start</string>
<string name="changeyourinput">Ändere deine Eingabe!</string>
<string name="closedloop">Closed Loop</string>
<string name="configbuilder_aps">APS</string>
<string name="configbuilder_bgsource">BZ Quelle</string>
<string name="configbuilder_bgsource">BZ-Quelle</string>
<string name="configbuilder_loop">Loop</string>
<string name="configbuilder_nightscoutversion_label">Nightscout Version:</string>
<string name="configbuilder_tempbasals">Temp Basals</string>
<string name="configbuilder_nightscoutversion_label">Nightscout-Version:</string>
<string name="configbuilder_tempbasals">TBR</string>
<string name="delta">Delta</string>
<string name="duration">Dauer</string>
<string name="en_lang">English</string>
@ -60,7 +59,7 @@
<string name="glucose">Glukose</string>
<string name="nav_backup">Backup</string>
<string name="nav_preferences">Einstellungen</string>
<string name="nsclient">NSClient</string>
<string name="nsclient">Nightscout-Client</string>
<string name="nsprofileview_activeprofile_label">Aktives Profil</string>
<string name="nsprofileview_basal_label">Basal</string>
<string name="nsprofileview_dia_label">DIA</string>
@ -69,57 +68,54 @@
<string name="nsprofileview_target_label">Ziel</string>
<string name="nsprofileview_units_label">Einheiten</string>
<string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Verifizieren</string>
<string name="objectives_button_verify">Bestätigen</string>
<string name="openapsma">OpenAPS MA</string>
<string name="openapsma_glucosestatus_label">Glukose Status</string>
<string name="openapsma_inputparameters_label">Eingabeparamter</string>
<string name="openapsma_iobdata_label">IOB Daten</string>
<string name="openapsma_glucosestatus_label">Glukose-Status</string>
<string name="openapsma_inputparameters_label">Eingabeparameter</string>
<string name="openapsma_iobdata_label">IOB-Daten</string>
<string name="openloop">Open Loop</string>
<string name="overview_bolus_label">Bolus</string>
<string name="overview_calculator_label">Rechner</string>
<string name="overview_tempbasal_button">TempBasal</string>
<string name="overview_tempbasal_button">TBR</string>
<string name="rate">Rate</string>
<string name="reason">Grund</string>
<string name="safety">Sicherheit:</string>
<string name="safety">Sicherheit</string>
<string name="send">SENDE</string>
<string name="treatments_activity_string">Aktivität:</string>
<string name="treatments_carbs_label_string">Kohlehydrate:</string>
<string name="treatments_carbs_label_string">Kohlenhydrate:</string>
<string name="treatments_insulin_label_string">Insulin:</string>
<string name="treatments_iob_label_string">IOB:</string>
<string name="treatments_iobactivitytotal_label_string">Aktives IOB total:</string>
<string name="treatments_iobtotal_label_string">IOB total:</string>
<string name="treatments_wizard_basaliob_label">Basal IOB</string>
<string name="treatments_wizard_unit_label">E</string>
<string name="up">Up</string>
<string name="treatments_iobactivitytotal_label_string">Aktives Gesamt-IOB:</string>
<string name="treatments_iobtotal_label_string">Gesamt-IOB:</string>
<string name="treatments_wizard_basaliob_label">Basal-IOB</string>
<string name="treatments_wizard_unit_label">IE</string>
<string name="up">Auf</string>
<string name="virtualpump">Virtuelle Pumpe</string>
<string name="virtualpump_reservoir_label">Reservoir</string>
<string name="xdrip">xDrip</string>
<string name="vitualpump_label">VIRTUELLE PUMPE</string>
<string name="virtualpump_sqlerror">SQL Error</string>
<string name="virtualpump_extendedbolus_label">Extended bolus</string>
<string name="virtualpump_tempbasal_label">Temp Basal</string>
<string name="virtualpump_extendedbolus_label">Verlängerter Bolus</string>
<string name="visible">Sichtbar</string>
<string name="virtualpump_basebasalrate_label">Basis Basalrate</string>
<string name="treatments_wizard_total_label">TOTAL</string>
<string name="unsupportedclientver">Nicht unterstützte Version von NSClient</string>
<string name="treatments_wizard_total_label">GESAMT</string>
<string name="unsupportedclientver">Nicht unterstützte Version des Nightscout-Clients</string>
<string name="treatments_wizard_bg_label">BZ</string>
<string name="treatments_wizard_bolusiob_label">Bolus IOB</string>
<string name="treatments_wizard_carbs_label">Kohlehydrate</string>
<string name="treatments_wizard_bolusiob_label">Bolus-IOB</string>
<string name="treatments_wizard_carbs_label">Kohlenhydrate</string>
<string name="treatments_wizard_correction_label">Korr</string>
<string name="treatments_newtreatment_carbsamount_label">Kohlehydrat Menge</string>
<string name="treatments_newtreatment_insulinamount_label">Insulin Menge</string>
<string name="treatments_newtreatment_carbsamount_label">Kohlenhydrat-Menge</string>
<string name="treatments_newtreatment_insulinamount_label">Insulin-Menge</string>
<string name="treatments">Behandlungen</string>
<string name="treatmentssafety_maxbolus_title">Max erlaubter Bolus [U]</string>
<string name="treatmentssafety_maxbolus_title">Max erlaubter Bolus [IE]</string>
<string name="treatmentssafety_maxcarbs_title">Max erlaubte Kohlehydrate [g]</string>
<string name="treatmentssafety_title">Tratments Sicherheit</string>
<string name="treatmentssafety_title">Sicherheitseinstellungen Behandlungen</string>
<string name="simpleprofile">Einfaches Profil</string>
<string name="setextendedbolusquestion">Setze neuen extended Bolus:</string>
<string name="setbasalquestion">Akzeptiere neue temp Basalrate:</string>
<string name="danar_useextended_title">Benutze extended Bolus für hohe temps (\>200%)></string>
<string name="objectives_pumpstatusavailableinns">Pumpen Status verfügbar in NS</string>
<string name="overview_newtempbasal_percent_label">% (100% = current)</string>
<string name="overview_newtempbasal_basalpercent">Basal Wert [%]</string>
<string name="overview_extendedbolus_button">Extended Bolus</string>
<string name="setextendedbolusquestion">Setze neuen verlängerten Bolus:</string>
<string name="setbasalquestion">Akzeptiere neue TBR:</string>
<string name="danar_useextended_title">Benutze verlängerten Bolus für hohe TBR (>200%)</string>
<string name="objectives_pumpstatusavailableinns">Pumpen-Status verfügbar in Nightscout</string>
<string name="overview_newtempbasal_percent_label">% (100% = aktuell)</string>
<string name="overview_newtempbasal_basalpercent">Basal-Wert [%]</string>
<string name="overview_extendedbolus_button">Verlängerter Bolus</string>
<string name="overview">Übersicht</string>
<string name="openloop_newsuggestion">Neue Empfehlung verfügbar</string>
<string name="result">Ergebnis</string>
@ -127,52 +123,52 @@
<string name="openapsma_run">Ausführen</string>
<string name="openapsma_nopump">Keine Pumpe verfügbar</string>
<string name="openapsma_noprofile">Kein Profil verfügbar</string>
<string name="openapsma_noglucosedata">Keine BZ Daten verfügbar</string>
<string name="openapsma_mealdata_label">Mahlzeiten Daten</string>
<string name="openapsma_noglucosedata">Keine BZ-Werte verfügbar</string>
<string name="openapsma_mealdata_label">Mahlzeiten-Daten</string>
<string name="openapsma_lastrun_label">Letzte Ausführung</string>
<string name="openapsma_lastenact_label">Zuletzt abgegeben</string>
<string name="openapsma_disabled">Plugin ist deaktiviert</string>
<string name="openapsma_currenttemp_label">Aktuelle temp</string>
<string name="objectives_gate_label_string">Gate:</string>
<string name="objectives_objective_label_string">Objective:</string>
<string name="openapsma_currenttemp_label">Aktuelle TBR</string>
<string name="objectives_gate_label_string">Beschränkung:</string>
<string name="objectives_objective_label_string">Ziel:</string>
<string name="objectives">Zielsetzungen</string>
<string name="noprofileset">KEIN PROFIL GESETZT</string>
<string name="nsclientnotinstalled">NSClient ist nicht installiert. Eintrag verloren!</string>
<string name="ns_sync_use_absolute_title">Verwende absolute statt prozentuelle Basalwerte beim Upload zu NightScout</string>
<string name="noprofile">Bisher noch kein Profil von NS geladen</string>
<string name="nsclientnotinstalled">Nightscout-Client ist nicht installiert. Eintrag verloren!</string>
<string name="ns_sync_use_absolute_title">Verwende absolute statt prozentuale Basalwerte beim Upload zu NightScout</string>
<string name="noprofile">Bisher noch kein Profil von Nightscout geladen</string>
<string name="nochangerequested">Keine Anpassung benötigt</string>
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
<string name="noapsselected">KEIN APS AUSGEWÄHLT ODER KEIN ERGEBNIS VORHANDEN</string>
<string name="nav_test_alert">Test Alarm</string>
<string name="avgdelta">Avg. delta</string>
<string name="bolusconstraintapplied">Bolus Beschränkung angewendet</string>
<string name="avgdelta">Durschn. Delta</string>
<string name="bolusconstraintapplied">Bolus-Beschränkung angewendet</string>
<string name="careportal_announcement">Ankündigung</string>
<string name="careportal_bgcheck">BZ Check</string>
<string name="careportal_carbscorrection">Kohlehydrat Korrektur</string>
<string name="careportal_cgmsensorinsert">CGM Sensor gesetzt</string>
<string name="careportal_insulincartridgechange">Insulin Reservoir wechsel</string>
<string name="careportal_bgcheck">BZ-Test</string>
<string name="careportal_carbscorrection">Kohlenhydrat-Korrektur</string>
<string name="careportal_cgmsensorinsert">CGM-Sensor gesetzt</string>
<string name="careportal_insulincartridgechange">Insulinreservoir-Wechsel</string>
<string name="careportal_newnstreatment_duration_label">Dauer</string>
<string name="careportal_newnstreatment_carbtime_label">Carb time</string>
<string name="careportal_newnstreatment_carbtime_label">KH-Zeit</string>
<string name="careportal_newnstreatment_enteredby_title">Eingegeben durch</string>
<string name="careportal_newnstreatment_other">Anderes</string>
<string name="careportal_newnstreatment_split_label">Split</string>
<string name="configbuilder_constraints">Beschränkungen</string>
<string name="configbuilder_general">Generell</string>
<string name="configbuilder_treatments">Treatments</string>
<string name="constraintapllied">Beschränkungen sind aktiv!</string>
<string name="configbuilder_treatments">Behandlungen</string>
<string name="constraintapllied">Beschränkungen angewendet!</string>
<string name="constraints_violation">Beschränkungen wurden verletzt oder Limit erreicht</string>
<string name="cs_lang">Czech</string>
<string name="loop_setbypump_label">Gesetzt durch Pumpe</string>
<string name="loopdisabled">LOOP DEAKTIVIERT DURCH DIE BESCHRÄNKUNG</string>
<string name="loop_constraintsprocessed_label">Nach Beschränkungen</string>
<string name="loopdisabled">LOOP DEAKTIVIERT DURCH BESCHRÄNKUNGEN</string>
<string name="loop_constraintsprocessed_label">Beschränkungen angewendet</string>
<string name="loop">Loop</string>
<string name="objectives_manualenacts">Manuelle Eingriffe</string>
<string name="carbsconstraintapplied">Kohlenhydrate Beschränkung erreicht</string>
<string name="nav_resetdb">Reset Datenbanken</string>
<string name="objectives_manualenacts">Manuelle Aktionen</string>
<string name="carbsconstraintapplied">Kohlenhydrat-Beschränkung erreicht</string>
<string name="nav_resetdb">Datenbanken zurücksetzen</string>
<string name="objectives_minimalduration">Minimale Dauer</string>
<string name="nav_refreshtreatments">Erneure Behandlungen von NS</string>
<string name="nav_exit">Exit</string>
<string name="missing">Fehlend</string>
<string name="enabled">aktiviert</string>
<string name="enabled">Aktiviert</string>
<string name="entertreatmentquestion">Eingabe neuer Behandlung:</string>
<string name="export_to">Einstellungen exportieren nach</string>
<string name="filenotfound">Datei nicht gefunden</string>
@ -182,22 +178,22 @@
<string name="nav_export">Einstellungen exportieren</string>
<string name="nav_import">Einstellungen importieren</string>
<string name="de_lang">German</string>
<string name="openapsma_maxbasal_summary">Dieser Wert wird max basal in OpenAPS genannt</string>
<string name="openapsma_maxiob_summary">Maximale Menge von nicht bolus IOB die OpenAPs abgeben kann</string>
<string name="openapsma_maxbasal_summary">Dieser Wert wird \"max basal\" in OpenAPS genannt</string>
<string name="openapsma_maxiob_summary">Maximale Menge von nicht Bolus-IOB, die OpenAPs abgeben kann</string>
<string name="bg_lang">Bulgarian</string>
<string name="nightscout">Nightscout</string>
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
<string name="absolute">Absolut</string>
<string name="smscommunicator_bolusfailed">Bolus fehlgeschlagen</string>
<string name="canceltemp">Temp Basal abbrechen</string>
<string name="canceltemp">TBR abbrechen</string>
<string name="careportal_temporarytarget">Temoräres Ziel</string>
<string name="careportal_temporarytargetcancel">Temoräres Ziel abbrechen</string>
<string name="comment">Kommentar</string>
<string name="connected">Verbunden</string>
<string name="connecting">Verbinden</string>
<string name="connectionerror">Pumpen Verbindungsfehler</string>
<string name="connectionerror">Pumpen-Verbindungsfehler</string>
<string name="danar_bt_name_title">DanaR Blueetooth Gerät</string>
<string name="danar_iob_label">Pumpen IOB</string>
<string name="danar_iob_label">Pumpen-IOB</string>
<string name="danar_pump_settings">DanaR Pumpen Einstellungen</string>
<string name="danarpump">DanaR</string>
<string name="disconnected">Getrennt</string>
@ -208,40 +204,37 @@
<string name="reloadprofile">Profil neuladen</string>
<string name="save">Speichern</string>
<string name="success">Erfolgreich</string>
<string name="virtualpump_lastconnection_label">Letzte Verbindung</string>
<string name="danar_lastbolus">Letzter Bolus:</string>
<string name="danar_viewprofile">Profil anzeigen</string>
<string name="danarprofile">DanaR Profil Einstellungen</string>
<string name="danarprofile">DanaR Profil-Einstellungen</string>
<string name="danarprofile_dia">DIA [h]</string>
<string name="manual">Manuell</string>
<string name="danar_dailyunits">Einheiten (Tag)</string>
<string name="danar_invalidinput">ungültige Eingabe</string>
<string name="danar_invalidinput">Ungültige Eingabe</string>
<string name="danar_valuenotsetproperly">Wert nicht korrekt gesetzt</string>
<string name="devicenotfound">ausgewähltes Gerät nicht gefunden</string>
<string name="devicenotfound">Ausgewähltes Gerät nicht gefunden</string>
<string name="dismiss">VERWERFEN</string>
<string name="end_user_license_agreement">Endbenutzervereinbarung</string>
<string name="end_user_license_agreement_i_understand">Ich verstehe und stimme zu</string>
<string name="end_user_license_agreement_text">darf nicht eingestzt werden um med. Eintscheidungen zu treffen</string>
<string name="failedupdatebasalprofile">Fehler beim aktualisieren der Basalrate</string>
<string name="hoursago">vor h </string>
<string name="smscommunicator">SMS Kommunikator</string>
<string name="smscommunicator_allowednumbers">erlaubte Telefonnummern</string>
<string name="waitingforpumpresult">auf Pumpenergebnis warten</string>
<string name="nobtadapter">Kein Bluetoothadapter gefunden</string>
<string name="smscommunicator_remotebolusnotallowed">Remote Bolus ist nicht erlaubt</string>
<string formatted="false" name="smscommunicator_bolusreplywithcode">Um Bolus %.2fU bitte mit %s antworten</string>
<string name="end_user_license_agreement_text">DAS PROGRAMM DARF NICHT FÜR MEDIZINISCHE ENTSCHEIDUNGEN BENUTZT WERDEN. ES GIBT IN DIESEM PROJEKT KEINE GEWÄHRLEISTUNG ODER GARANTIERTE UNTERSTÜTZUNG IN IRGENDEINER ART. WENN DU DICH ENTSCHEIDEST ES ZU NUTZEN, HÄNGT DIE QUALITÄT UND LEISTUNGSFÄHIGKEIT DIESES PROJEKTES VON DIR SELBST AB. ES WIRD \"WIE BESEHEN\" ZUR VERFÜGUNG GESTELLT. SOLLTE SICH DAS PROGRAMM ALS FEHLERHAFT ERWEISEN, ÜBERNEHMEN SIE DIE KOSTEN ALLER NOTWENDIGEN KRANKHEITSKOSTEN, SERVICELEISTUNGEN, REPARATUREN ODER KORREKTUREN.</string>
<string name="failedupdatebasalprofile">Fehler beim Aktualisieren der Basalrate</string>
<string name="hoursago">"h her "</string>
<string name="smscommunicator">SMS-Kommunikator</string>
<string name="smscommunicator_allowednumbers">Erlaubte Telefonnummern</string>
<string name="waitingforpumpresult">Auf Pumpenergebnis warten</string>
<string name="nobtadapter">Kein Bluetooth-Adapter gefunden</string>
<string name="smscommunicator_remotebolusnotallowed">Ferngesteuerter Bolus ist nicht erlaubt</string>
<string formatted="false" name="smscommunicator_bolusreplywithcode">Um einen Bolus von %.2f IE abzugeben, antworte mit dem Code %s</string>
<string name="ko_lang">Korean</string>
<string name="youareonallowedlimit">Limit erreicht</string>
<string name="wrongpumppassword">Falsches Pumpen-Passwort!</string>
<string name="waitingforpumpclicktorefresh">Warte auf Pumpe. Klicke zum aktualisieren.</string>
<string name="waitingforpumpclicktorefresh">Warte auf Pumpe. Klicke zum Aktualisieren.</string>
<string name="correctionbous">Korr</string>
<string name="bolusdelivering">Abgabe %.2fU</string>
<string name="bolusdelivered">%.2fU Bolus erfolgreich abgegeben</string>
<string name="bolusdelivering">Abgabe %.2f IE</string>
<string name="bolusdelivered">%.2f IE Bolus erfolgreich abgegeben</string>
<string name="danar_alarm">Alarm</string>
<string name="danar_carbohydrate">Kohlenhydrate</string>
<string name="danar_error">Fehler</string>
<string name="danar_glucose">Glucose</string>
<string name="danar_history">Historie</string>
<string name="danar_glucose">Glukose</string>
<string name="danar_history_alarm">Alarme</string>
<string name="danar_history_bolus">Bolus</string>
<string name="danar_history_carbohydrates">Kohlenhydrate</string>
@ -253,54 +246,54 @@
<string name="danar_password_title">Pumpen-Passwort</string>
<string name="mealbolus">Essensbolus</string>
<string name="noprofileselected">Kein Profil ausgewählt</string>
<string name="overview_bolusprogress_stop">Stop</string>
<string name="overview_bolusprogress_stop">Stopp</string>
<string name="overview_bolusprogress_stoped">Gestoppt</string>
<string name="overview_bolusprogress_stoppressed">STOP GEDRÜCKT</string>
<string name="overview_bolusprogress_stoppressed">STOPP GEDRÜCKT</string>
<string name="overview_quickwizard_item_remove_button">Löschen</string>
<string name="overview_editquickwizardlistactivity_add">Hinzufügen</string>
<string name="overview_quickwizard_item_edit_button">Bearbeiten</string>
<string name="danar_history_basalhours">Basal-Stunden</string>
<string name="danar_history_connectingfor">Verbindungsaufbau %d s</string>
<string name="overview_editquickwizard_valid">Gültigkeit:</string>
<string name="overview_editquickwizard_carbs">Kohlenhydrate</string>
<string name="quickwizardsettings">QuickWizard Einstellungen</string>
<string name="overview_editquickwizard_carbs">Kohlenhydrate:</string>
<string name="quickwizardsettings">QuickWizard-Einstellungen</string>
<string name="actions">Aktionen</string>
<string name="androidaps_start">Android APS gestartet</string>
<string name="androidaps_start">AndroidAPS gestartet</string>
<string name="disabledloop">Loop deaktiviert</string>
<string name="fillbolus_title">Vorfüll-Standardmengen</string>
<string name="fillwarning">Bitte vergewissern Sie sich, dass die Menge der Spezifikation des Katheters entspricht.</string>
<string name="ns_upload_only">Zu NightScout nur hochladen (kein sync)</string>
<string name="ns_upload_only_summary">Zu NightScout nur hochladen. Nicht wirksam bei SGV wenn nicht eine lokale Quelle wie xDrip gewählt wird. Nicht wirksam bei Profilen, wenn NS-Profile verwendet werden.</string>
<string name="fillbolus_title">Füll-/Vorfüll-Standardmengen</string>
<string name="fillwarning">Bitte vergewissere Dich, dass die Menge den Eigenschaften des Katheters entspricht.</string>
<string name="ns_upload_only">Zu Nightscout nur hochladen (keine Synchronisation)</string>
<string name="ns_upload_only_summary">Zu Nightscout nur hochladen. Nicht wirksam bei SGV, wenn nicht eine lokale Quelle wie xDrip gewählt wird. Nicht wirksam bei Profilen, wenn Nightscout-Profile verwendet werden.</string>
<string name="othersettings_title">Andere</string>
<string name="occlusion">Verstopfung</string>
<string name="overview_bolusprogress_delivered">Abgegeben</string>
<string name="overview_bolusprogress_goingtodeliver">Es werden %.2fU abgegeben</string>
<string name="primefill">Vorfüllen / Füllen</string>
<string name="overview_bolusprogress_goingtodeliver">Es werden %.2f IE abgegeben</string>
<string name="primefill">Vorfüllen/Füllen</string>
<string name="uploading">Hochladen</string>
<string name="es_lang">Spanish</string>
<string name="basal_rate">Basalrate:</string>
<string name="base_profile_label">Basisprofil:</string>
<string name="base_profile_label">Basis-Profil:</string>
<string name="batterydischarged">Pumpenbatterie entladen</string>
<string name="danar_historyreload">neu laden</string>
<string name="high_mark">Hoch Markierung</string>
<string name="low_mark">Niedrig Markierung</string>
<string name="lowbattery">Niedrige Batterie</string>
<string name="danar_historyreload">Neu laden</string>
<string name="high_mark">Hoch-Markierung</string>
<string name="low_mark">Niedrig-Markierung</string>
<string name="lowbattery">Niedriger Batteriestand</string>
<string name="pumpbusy">Pumpe ist beschäftigt</string>
<string name="pumperror">Pumpenfehler</string>
<string name="target_range">Zielbereich:</string>
<string name="units">Einheiten:</string>
<string name="danar_refill">Befüllen</string>
<string name="danar_disableeasymode">EasyUI Modus in der Pumpe deaktivieren</string>
<string name="danar_disableeasymode">EasyUI-Modus in der Pumpe deaktivieren</string>
<string name="danar_basalhour">Basal-Stunde</string>
<string name="button1">Knopf 1</string>
<string name="button2">Knopf 2</string>
<string name="button3">Knopf 3</string>
<string name="configbuilder">Config Builder</string>
<string name="minago">vor %d min</string>
<string name="button1">Button 1</string>
<string name="button2">Button 2</string>
<string name="button3">Button 3</string>
<string name="configbuilder">Konfigurations-Generator</string>
<string name="minago">vor %d Min.</string>
<string name="actions_shortname">AKT</string>
<string name="wear_shortname">WEAR</string>
<string name="virtualpump_shortname">VP</string>
<string name="treatments_shortname">TREAT</string>
<string name="treatments_shortname">BEH</string>
<string name="temptargetrange_shortname">TT</string>
<string name="tempbasals_shortname">TB</string>
<string name="smscommunicator_shortname">SMS</string>
@ -315,18 +308,17 @@
<string name="configbuilder_shortname">CONF</string>
<string name="circadian_percentage_profile_shortname">CPP</string>
<string name="careportal_shortname">CP</string>
<string name="error_only_numeric_digits_allowed">Bitte verwenden Sie nur Ziffern.</string>
<string name="error_only_numeric_digits_allowed">Bitte verwende nur Ziffern.</string>
<string name="error_field_must_not_be_empty">Pflichtfeld</string>
<string name="error_phone_not_valid">Telefonnummer ist nicht gültig.</string>
<string name="error_only_numeric_digits_range_allowed">Bitte verwenden Sie nur Ziffern von %1$s - %2$s</string>
<string name="error_only_numeric_digits_range_allowed">Bitte verwende nur Ziffern von %1$s - %2$s.</string>
<string name="waitingforpump">Warte auf Pumpe</string>
<string name="wear">Wear</string>
<string name="alert_dialog_storage_permission_text">Bitte starte dein Telefon neu oder starte AndroidAPS in den System-Einstellungen neu. Anderenfalls hat AndroidAPS kein logging (wichtig zum Nachverfolgen und Verifizieren, dass der Algorithmus korrekt funktioniert)</string>
<string name="always_use_shortavg">Immer das kurze Durchschnitts-Delta statt dem einfachen Delta verwenden</string>
<string name="always_use_shortavg">Verwende das kurze durchschnittliche Delta statt des einfachen Deltas</string>
<string name="always_use_shortavg_summary">Sinnvoll, wenn die Daten von einer ungefilterten Quelle Signalrauschen haben.</string>
<string name="approachingdailylimit">Tagesinsulin-Limit wird erreicht.</string>
<string name="approachingdailylimit">Tagesinsulin-Limit wird erreicht</string>
<string name="basalshortlabel">BR</string>
<string name="calibrationsent">Kalibrierung an xDrip gesendet</string>
<string name="calibrationsent">Kalibrierung an xDrip+ gesendet</string>
<string name="child">Kind</string>
<string name="clear_queue">Warteschlange leeren</string>
<string name="clearlog">Logs leeren</string>
@ -343,123 +335,122 @@
<string name="xdripnotinstalled">xDrip+ nicht installiert</string>
<string name="wear_showbgi_title">Zeige BGI</string>
<string name="wear_showbgi_summary">Füge BGI zur Statuszeile hinzu</string>
<string name="wear_settings">Wear Einstellungen</string>
<string name="wear_settings">Wear-Einstellungen</string>
<string name="wear_detailedIOB_title">Zeige detailliertes IOB</string>
<string name="wear_detailedIOB_summary">Trenne IOB in Bolus- und Basal-IOB auf dem Watchface</string>
<string name="wear_detailedIOB_summary">Differenziere IOB in Bolus- und Basal-IOB auf dem Watchface</string>
<string name="wrongpassword">Falsches Passwort</string>
<string name="it_lang">Italian</string>
<string name="Glimp">Glimp</string>
<string name="MM640g">MM640g</string>
<string name="absorption_maxtime_summary">Zeit in Stunden in der zu erwarten ist, dass alle Kohlenhydrate resorbiert sein werden</string>
<string name="absorption_maxtime_summary">Zeit in Stunden, in der zu erwarten ist, dass alle Kohlenhydrate resorbiert sein werden</string>
<string name="absorption_maxtime_title">Maximale Essens-Resorptionszeit [h]</string>
<string name="absorptionsettings_title">Resorptions-Einstellungen</string>
<string name="activity">Aktivität</string>
<string name="adult">Erwachsener</string>
<string name="advancedsettings_title">Erweiterte Einstelungen</string>
<string name="advancedsettings_title">Erweiterte Einstellungen</string>
<string name="app_name">AndroidAPS</string>
<string name="basal_short">BAS</string>
<string name="basal_step">Basal-Schritt</string>
<string name="basalmissing">Basal fehlt im Profil. Verwende Standardwert.</string>
<string name="basalvaluebelowminimum">Basalwert unter dem Minimum. Profil nicht gesetzt!</string>
<string name="batteryoptimalizationerror">Gerät untertützt anscheinend das deaktivieren der Akku-Leistungsoptimierung nicht.</string>
<string name="basalmissing">Basalraten fehlen im Profil. Verwende Standard-Werte.</string>
<string name="basalvaluebelowminimum">Wert der Basalrate unter Minimum. Profil nicht gesetzt!</string>
<string name="batteryoptimalizationerror">Smartphone untertützt anscheinend das Deaktivieren der Akku-Leistungsoptimierung nicht!</string>
<string name="bolus_step">Bolus-Schritt</string>
<string name="bolusrequested">Werde %.2fE abgeben</string>
<string name="bolusrequested">Werde %.2f IE abgeben</string>
<string name="careportal_activity_label">AKTIVITÄT &amp; FEEDBACK</string>
<string name="careportal_canulaage_label">Katheteralter</string>
<string name="careportal_canulaage_label_short">CAGE</string>
<string name="careportal_carbsandbolus_label">CARBS &amp; BOLUS</string>
<string name="careportal_cgm_label">CGM &amp; OPENAPS</string>
<string name="careportal_insulinage_label">Insulinalter</string>
<string name="careportal_newnstreatment_duration_min_label">Dauer [min]</string>
<string name="paused">pausiert</string>
<string name="careportal_newnstreatment_duration_min_label">Dauer [Min.]</string>
<string name="paused">Pausiert</string>
<string name="patientage">Patientenalter</string>
<string name="patientage_summary">Bitte wähle das Pateintenalter um die Sicherheits-Limits festzulegen</string>
<string name="targetmissing">Ziel fehlt im Profil. Verwende Standardwert.h</string>
<string name="patientage_summary">Bitte wähle das Pateintenalter, um die Sicherheits-Limits festzulegen</string>
<string name="targetmissing">BZ-Zielbereich fehlt im Profil. Verwende Standardwerte.</string>
<string name="teenage">Teenager</string>
<string name="tempbasal">TempBasal</string>
<string name="tempbasaldeliveryerror">Tempbasal Abgabe-Fehler</string>
<string name="temptarget">TempZiel</string>
<string name="timeshift_hint">Zeit in Stunden um die das profil zylindrisch verschoben wird.</string>
<string name="treatments_wizard_bgtrend_label">15Min Trend</string>
<string name="tempbasaldeliveryerror">TBR Abgabe-Fehler</string>
<string name="temptarget">Temporäres Ziel</string>
<string name="timeshift_hint">Zeit in Stunden, um die das Profil verschoben wird.</string>
<string name="treatments_wizard_bgtrend_label">15-Min.-Trend</string>
<string name="treatments_wizard_cob_label">COB</string>
<string name="unsupportednsversion">Nicht-unterstütze Nightscout-Version</string>
<string name="unsupportednsversion">Nicht unterstütze Nightscout-Version</string>
<string name="uploader">Uploader</string>
<string name="uploader_short">UPLD</string>
<string name="virtualpump_extendedbolus_label_short">EXT</string>
<string name="virtualpump_firmware_label">Firmware</string>
<string name="virtualpump_settings">Virtuelle Pumpe Einstellungen</string>
<string name="virtualpump_settings">Einstellungen der virtuellen Pumpe</string>
<string name="virtualpump_uploadstatus_title">Status zu Nightscout hochladen</string>
<string name="superbolus">Superbolus</string>
<string name="suspendloopfor10h">Pausiere Loop für 10h</string>
<string name="suspendloopfor10h">Pausiere Loop für 10 h</string>
<string name="array_of_elements">Insgesamt %d Einträge. Aktueller Wert:</string>
<string name="careportal_insulinage_label_short">IAGE</string>
<string name="careportal_pbage_label">Batteriealter</string>
<string name="careportal_pump_label">PUMP</string>
<string name="careportal_pumpbatterychange">Pumpen Batterie Wechsel</string>
<string name="careportal_pumpbatterychange">Pumpenbatterie-Wechsel</string>
<string name="careportal_sensorage_label_short">SAGE</string>
<string name="configbuilder_insulin">Insulin</string>
<string name="cpp_notloadedplugins">Es sind nicht alle Profile geladen!</string>
<string name="cpp_sync_setting_missing">Aktivierung wird benötigt um Werte an die Pumpe zu senden!</string>
<string name="cpp_sync_setting_missing">muss aktiviert werden, um Werte an die Pumpe zu senden!</string>
<string name="cpp_valuesnotstored">Werte nicht gespeichert!</string>
<string name="danar_enableextendedbolus">Aktiviere Extended Bolus in der Pumpe</string>
<string name="danar_enableextendedbolus">Aktiviere verlängerten Bolus in der Pumpe</string>
<string name="danar_stats">DanaR Stats</string>
<string name="danar_stats_amount_days"># Tage</string>
<string name="danar_stats_basalrate">Basal</string>
<string name="danar_stats_bolus">Bolus</string>
<string name="danar_stats_weight">Gewichtung</string>
<string name="danar_visualizeextendedaspercentage_title">Zeige Extended Bolus als % an</string>
<string name="danar_visualizeextendedaspercentage_title">Zeige verlängerten Bolus als % an</string>
<string name="danarkoreanpump">DanaR Korean</string>
<string name="danarv2pump">DanaRv2</string>
<string name="deliver_now">Abgeben</string>
<string name="deliver_now">Jetzt abgeben</string>
<string name="dev">DEV</string>
<string name="device">Gerät</string>
<string name="dia">DIA:</string>
<string name="disableloop">Deaktiviere Loop</string>
<string name="disconnecting">Trenne</string>
<string name="disconnectpumpfor10h">Trenne Pumpe für 10h</string>
<string name="disconnectpumpfor1h">Trenne Pumpe für 1h</string>
<string name="disconnectpumpfor2h">Trenne Pumpe für 2h</string>
<string name="disconnectpumpfor30m">Trenne Pumpe für 30Min</string>
<string name="disconnectpumpfor3h">Trenne Pumpe für 3h</string>
<string name="disconnecting">Verbindung wird getrennt</string>
<string name="disconnectpumpfor10h">Trenne Pumpe für 10 h</string>
<string name="disconnectpumpfor1h">Trenne Pumpe für 1 h</string>
<string name="disconnectpumpfor2h">Trenne Pumpe für 2 h</string>
<string name="disconnectpumpfor30m">Trenne Pumpe für 30 Min.</string>
<string name="disconnectpumpfor3h">Trenne Pumpe für 3 h</string>
<string name="do_not_track_profile_switch">Ignoriere Profilwechsel</string>
<string name="do_not_track_profile_switch_summary">Alle Profilwechsel werden ignorierd und nur das aktive Profil wird verwendet</string>
<string name="do_not_track_profile_switch_summary">Alle Profilwechsel werden ignoriert und nur das aktive Profil verwendet</string>
<string name="dont_show_again">Nicht erneut anzeigen</string>
<string name="eatingsoon">Bald essen</string>
<string name="edit_base_basal">Bearbeite Basis-Basal:</string>
<string name="el_lang">Greek</string>
<string name="enableloop">aktiviere Loop</string>
<string name="enableloop">Aktiviere Loop</string>
<string name="enablesuperbolus">Aktiviere SuperBolus im Wizard</string>
<string name="executing">Führe aus</string>
<string name="extendedbolus">ExtendedBolus</string>
<string name="executing">Wird ausgeführt</string>
<string name="extendedbolus">Verlängerter Bolus</string>
<string name="fastactinginsulin">Fast Acting Insulin</string>
<string name="fastactinginsulincomment">Novorapid, Novolog, Humalog</string>
<string name="fastactinginsulinprolonged">Fast Acting Insulin Prolonged</string>
<string name="gettingpumpstatus">Hole Pumpenstatus</string>
<string name="gettingpumpstatus">Pumpenstatus wird geladen</string>
<string name="hours">Stunden</string>
<string name="initializing">Initialisierung...</string>
<string name="invalidprofile">Ungültiges oder defektes Profil!!!</string>
<string name="initializing">Initialisierung &#8230;</string>
<string name="invalidprofile">Ungültiges oder defektes Profil!</string>
<string name="iob">IOB</string>
<string name="localprofile">Lokales Profil</string>
<string name="lock_screen">Sperrbildschirm</string>
<string name="loopmenu">Loop Menü</string>
<string name="loopsuperbolusfor">Superbolus (%d m)</string>
<string name="loopsuperbolusfor">Superbolus (%d Min.)</string>
<string name="loopsuspended">Loop pausiert</string>
<string name="loopsuspendedfor">pausiert (%d m)</string>
<string name="loopsuspendedfor">Pausiert (%d Min.)</string>
<string name="mdtp_cancel">Abbrechen</string>
<string name="mdtp_ok">OK</string>
<string name="mgdl">mg/dl</string>
<string name="mmol">mmol/l</string>
<string name="nav_about">Über</string>
<string name="nav_show_logcat">Logs anzeigen</string>
<string name="nosuccess">nicht erfolgreich - Bitte Telefon prüfen</string>
<string name="nosuccess">nicht erfolgreich - bitte Telefon prüfen</string>
<string name="notavailable">Nicht verfügbar</string>
<string name="nowritepermission">NSCLIENT hat keine Schreibrechte. Falscher API-Key?</string>
<string name="ns_alarmoptions">Alarm Optionen</string>
<string name="ns_localbroadcasts">Aktiviere Broadcast für andere Apps (z.B. xDrip).</string>
<string name="ns_localbroadcasts_title">Aktiviere lokalen Broadcast.</string>
<string name="nowritepermission">NSClient hat keine Schreibrechte. Falscher API-Key?</string>
<string name="ns_alarmoptions">Alarm-Optionen</string>
<string name="ns_localbroadcasts">Aktiviere Broadcasts für andere Apps (z. B. xDrip+).</string>
<string name="ns_localbroadcasts_title">Aktiviere lokale Broadcasts.</string>
<string name="ns_logappstartedevent">Logge App-Start in NS</string>
<string name="ns_noupload">Kein Upload zu NS</string>
<string name="ns_noupload_summary">Alle an NS gesendete Daten werden verworfen. AAPS ist verbunden, aber es wird keine Änderungen in NS gemacht</string>
<string name="ns_noupload">Kein Upload zu Nightscout</string>
<string name="ns_noupload_summary">Alle an Nightscout gesendeten Daten werden verworfen. AAPS ist verbunden, aber Nightscout-Daten werden nicht geändert</string>
<string name="nsalarm_high">Hoch</string>
<string name="nsalarm_low">Niedrig</string>
<string name="nsalarm_summary">Gesetzt zu %f</string>
@ -468,16 +459,16 @@
<string name="nsclientinternal_autoscroll">Autoscroll</string>
<string name="nsclientinternal_devicename_dialogtitle">Gerätenamen eingeben</string>
<string name="nsclientinternal_devicename_title">Gerätename</string>
<string name="nsclientinternal_secret_dialogmessage">NS API-Key eingeben (min 12 Zeichen)</string>
<string name="nsclientinternal_secret_dialogtitle">NightScout API-Key</string>
<string name="nsclientinternal_secret_title">NightScout API-Key</string>
<string name="nsclientinternal_secret_dialogmessage">Nightscout API-Key eingeben (min. 12 Zeichen)</string>
<string name="nsclientinternal_secret_dialogtitle">Nightscout API-Key</string>
<string name="nsclientinternal_secret_title">Nightscout API-Key</string>
<string name="nsclientinternal_url">URL:</string>
<string name="nsclientinternal_url_dialogmessage">Nightscout URL eingeben</string>
<string name="nsclientinternal_url_title">Nightscout URL</string>
<string name="objectives_0_gate">Verifiziere, dass der BZ und Pumpen Insulin Daten in Nightscout erfolgreich hoch geladen wurden</string>
<string name="objectives_0_objective">Konfiguriere die Anzeige und das Monitoring (NS) und analysiere die Basal-Rate und die Faktoren</string>
<string name="objectives_1_gate">Lasse den OpenLoop Modus für ein paar Tage laufen und setzte manuell temp Basal-Raten</string>
<string name="objectives_1_objective">Starte den OpenLoop Modus</string>
<string name="nsclientinternal_url_dialogmessage">Nightscout-URL eingeben</string>
<string name="nsclientinternal_url_title">Nightscout-URL</string>
<string name="objectives_0_gate">Verifiziere, dass BZ- und Pumpen-Insulin-Daten in Nightscout erfolgreich hoch geladen werden</string>
<string name="objectives_0_objective">Konfiguriere die Anzeige und das Monitoring (Nightscout) und analysiere Basal-Raten und Faktoren</string>
<string name="objectives_1_gate">Erprobe den Open Loop Modus für ein paar Tage und setze manuell temporäre Basal-Raten</string>
<string name="objectives_1_objective">Starte den Open Loop Modus</string>
<string name="old_data">VERALTETE DATEN</string>
<string name="ongoingnotificaction">Laufende Benachrichtigungen</string>
<string name="open_settings_on_wear">Öffne Einstellungen auf der Uhr</string>
@ -485,196 +476,255 @@
<string name="openaps_short">OAPS</string>
<string name="openapsama">OpenAPS AMA</string>
<string name="openapsma_scriptdebugdata_label">Skript Debug</string>
<string name="openapsma_valueoutofrange">Wert %s ist außerhalb des festen Limits.</string>
<string name="openapsma_valueoutofrange">Wert %s ist außerhalb des festen Limits</string>
<string name="overview_calibration">Kalibrierung</string>
<string name="overview_calibration_bg_label">Kalibrierung</string>
<string name="overview_editquickwizard_buttontext">Button Text:</string>
<string name="overview_extendedbolus_cancel_button">Extended Bolus abbrechen</string>
<string name="overview_newtempbasal_basalabsolute">Basal Wert [U/h]</string>
<string name="overview_editquickwizard_buttontext">Button-Text:</string>
<string name="overview_extendedbolus_cancel_button">Verlängerten Bolus abbrechen</string>
<string name="overview_newtempbasal_basalabsolute">Basal Wert [IE/h]</string>
<string name="profile">Profil</string>
<string name="profile_set_failed">Setzten vom Basal Profil fehlgeschlagen</string>
<string name="profile_set_ok">Basal Profil in der Pumpe aktualisiert</string>
<string name="profile_set_failed">Setzen des Basal-Profils fehlgeschlagen</string>
<string name="profile_set_ok">Basal-Profil in der Pumpe aktualisiert</string>
<string name="profileswitch">Profilwechsel</string>
<string name="pump">Pumpe</string>
<string name="pumpNotInitialized">Pumpe nicht initialisiert!</string>
<string name="pumpNotInitializedProfileNotSet">Pumpe ist nicht initialisiert, Profil nicht gesetzt!</string>
<string name="pumpNotInitializedProfileNotSet">Pumpe nicht initialisiert, Profil nicht gesetzt!</string>
<string name="pumpshutdown">Pumpe stoppen</string>
<string name="pumpsuspended">Pumpe pausiert</string>
<string name="pumpsuspendedclicktorefresh">Pumpe pausiert. Klicken zum aktualisieren des Status</string>
<string name="queue">Queue:</string>
<string name="pumpsuspendedclicktorefresh">Pumpe pausiert. Klicke zum Aktualisieren des Status</string>
<string name="queue">Warteschlange:</string>
<string name="quickwizard">QuickWizard</string>
<string name="refresheventsfromnightscout">Aktualisiere Einträge von Nightscout</string>
<string name="removerecord">Lösche Eintrag:</string>
<string name="resend_all_data">Alle Daten erneut senden</string>
<string name="reset_db_confirm">Möchtest du die Datenbank wirklich zurücksetzten?</string>
<string name="restart">Restart</string>
<string name="restartingapp">Beende Applikation um neue Einstellungen zu laden.</string>
<string name="resume">Fortsetzten</string>
<string name="reset_db_confirm">Möchtest du die Datenbank wirklich zurücksetzen?</string>
<string name="restart">Neustart</string>
<string name="restartingapp">App wird beendet, um neue Einstellungen zu laden.</string>
<string name="resume">Fortsetzen</string>
<string name="ru_lang">Russisch</string>
<string name="send_calibration">Kalibrierung %.1f an xDrip senden?</string>
<string name="send_calibration">Kalibrierung %.1f an xDrip+ senden?</string>
<string name="settings_password">Passwort für die Einstellungen</string>
<string name="settingtempbasal">Setzte temp Basal</string>
<string name="settingtempbasal">TBR wird gesetzt</string>
<string name="short_tabtitles">Kurze Tab-Überschriften</string>
<string name="show_queue">Zeige Warteschlange</string>
<string name="sms_actualbg">BZ</string>
<string name="sms_actualbg">BZ:</string>
<string name="sms_basal">Basal:</string>
<string name="sms_bolus">Bolus:</string>
<string name="sms_delta">Delta:</string>
<string name="sms_iob">IOB:</string>
<string name="sms_lastbg">Letzter BZ:</string>
<string name="status">Status:</string>
<string name="stoppingextendedbolus">Stoppe Extended Bolus</string>
<string name="stoppingtempbasal">Stoppe temp Basal</string>
<string name="suspendloopfor1h">Pausiere Loop für 1h</string>
<string name="suspendloopfor2h">Pausiere Loop für 2h</string>
<string name="suspendloopfor3h">Pausiere Loop für 3h</string>
<string name="stoppingextendedbolus">Verrlängerter Bolus wird abgebrochen</string>
<string name="stoppingtempbasal">TBR wird abgebrochen</string>
<string name="suspendloopfor1h">Pausiere Loop für 1 h</string>
<string name="suspendloopfor2h">Pausiere Loop für 2 h</string>
<string name="suspendloopfor3h">Pausiere Loop für 3 h</string>
<string name="sv_lang">Schwedish</string>
<string name="updatingbasalrates">Aktualisere Basal Raten</string>
<string name="updatingbasalrates">Basalraten werden aktualisiert</string>
<string name="wear_overviewnotifications">Übersicht Benachrichtigungen</string>
<string name="careportal_sensorage_label">Sensoralter</string>
<string name="danar_switchtouhmode">Wechsle Modus von U/d zu U/h in der Pumpe</string>
<string name="danar_switchtouhmode">Wechsle Modus von IE/d zu IE/h in der Pumpe</string>
<string name="danar_totaluploaded">Insgesamt %d Einträge erfolgreich hochgeladen</string>
<string name="danarprofile_dia_summary">Dauer der Insulinwirkung</string>
<string name="edit_base_ic">Bearbeite Basis-IC:</string>
<string name="edit_base_isf">Bearbeite Basis-ISF:</string>
<string name="icmissing">IC Angabe fehlt im Profil. Verwende default Wert.</string>
<string name="icmissing">IC-Angabe fehlt im Profil. Verwende Standard-Wert.</string>
<string name="insulin_shortname">INS</string>
<string name="isfmissing">ISF fehlt im Profil. Verwende default Wert.</string>
<string name="isfmissing">ISF fehlt im Profil. Verwende Standard-Wert.</string>
<string name="lock_screen_short">Sperr</string>
<string name="needwhitelisting">%s benötigt Batterie-Optimierungs-Whitelisting um korrekt arbeiten zu können</string>
<string name="needwhitelisting">%s benötigt Batterie-Optimierungs-Whitelisting, um korrekt arbeiten zu können</string>
<string name="nsalarm_staledata">Veraltete Daten</string>
<string name="nsalarm_staledatavalue_label">Veraltete Daten seit [Min]</string>
<string name="nsclientinternal_devicename_dialogmessage">Es wird verwendet für das enteredBy Feld</string>
<string name="openapsma_autosensdata_label">Autosens Daten</string>
<string name="openapsma_maxbasal_title">Max U/h die an Temp Basal gesetzt werden kann</string>
<string name="openapsma_maxiob_title">Maximum Basal IOB, was OpenAPS abgeben darf [U]</string>
<string name="percentagefactor_hint">Prozentialer Faktor um den das Basis Profil multipiziert wird.</string>
<string name="nsalarm_staledatavalue_label">Veraltete Daten seit [Min.]</string>
<string name="nsclientinternal_devicename_dialogmessage">Wird für das \"Eingegeben durch\"-Feld verwendet</string>
<string name="openapsma_autosensdata_label">Autosens-Daten</string>
<string name="openapsma_maxbasal_title">Max IE/h, die als TBR gesetzt werden können</string>
<string name="openapsma_maxiob_title">Maximales Basal-IOB, das OpenAPS abgeben darf [IE]</string>
<string name="percentagefactor_hint">Prozentualer Faktor, mit dem das Basis-Profil multipiziert wird.</string>
<string name="pleaseallowpermission">Bitte Rechte gewähren</string>
<string name="prefs_range_summary">Hoch und niedrig Werte für die Übersicht- und die Smartwatch-Anzeige</string>
<string name="prefs_range_summary">Hoch- und Niedrig-Werte für die Übersicht- und die Smartwatch-Anzeige</string>
<string name="prefs_range_title">Zielbereich für die Grafikanzeige</string>
<string name="sensitivity_warning">Bei aktivierter Autosense-Funktion, bitte stell sicher, das du alle gegessenen Kohlenhydrate eingibts. Ansonsten können die Kohlenhydrate-Abweichung als falsche Resistens/Empfindlichkeit identifziert werden!!!</string>
<string name="sensitivity_warning">Stelle bei aktivierter Autosense-Funktion sicher, dass du alle gegessenen Kohlenhydrate eingibst. Ansonsten können die Kohlenhydrate-Abweichung zu falsche Resistenz-/Empfindlichkeitswerten führen!</string>
<string name="sensitivityaaps">Sensitivität AAPS</string>
<string name="sensitivityoref0">Sensitivität Oref0</string>
<string name="sensitivityweightedaverage">Durschnittliche Sensitivität</string>
<string name="settingextendedbolus">Einstellung Extended Bolus</string>
<string name="sms_minago">vor %dMin</string>
<string formatted="false" name="smscommunicator_basalstopreplywithcode">Um das temp Basal zu stoppen, antworte mit dem Code %s</string>
<string formatted="false" name="smscommunicator_bolusdelivered">Bolus %.2fU erfolgreich abgegeben</string>
<string name="smscommunicator_calibrationfailed">xDrip hat die Kalbrierung nicht erhalten</string>
<string name="sensitivityweightedaverage">Durchschnittliche Sensitivität</string>
<string name="settingextendedbolus">Verlängerter Bolus wird gesetzt</string>
<string name="sms_minago">vor %d Min.</string>
<string formatted="false" name="smscommunicator_basalstopreplywithcode">Um die TBR abzubrechen, antworte mit dem Code %s</string>
<string formatted="false" name="smscommunicator_bolusdelivered">Bolus %.2f IE erfolgreich abgegeben</string>
<string name="smscommunicator_calibrationfailed">xDrip+ hat die Kalbrierung nicht erhalten</string>
<string formatted="false" name="smscommunicator_calibrationreplywithcode">Um die Kalibrierung %.2f zu senden, antworte mit dem Code %s</string>
<string name="smscommunicator_calibrationsent">Kalibrierung gesendet. Das empfangen von Kalbrierungen muss in xDrip aktiviert sein.</string>
<string name="smscommunicator_invalidphonennumber">Falsche/Ungültige SMS Telefonnummer</string>
<string name="smscommunicator_calibrationsent">Kalibrierung gesendet. Das Empfangen von Kalbrierungen muss in xDrip+ aktiviert sein.</string>
<string name="smscommunicator_invalidphonennumber">Falsche/ungültige Telefonnummer</string>
<string name="smscommunicator_loophasbeendisabled">Loop wurde deaktiviert</string>
<string name="smscommunicator_loophasbeenenabled">Lopp wurde aktiviert</string>
<string name="smscommunicator_loopisdisabled">Loop ist deaktiviert</string>
<string name="smscommunicator_loopisenabled">Loop ist aktiviert</string>
<string name="smscommunicator_loopresumed">Loop wurde fortgesetzt</string>
<string name="smscommunicator_loopsuspended">Loop pausiert</string>
<string name="smscommunicator_missingsmspermission">Es fehlt das SMS-Recht</string>
<string name="smscommunicator_remotebasalnotallowed">Basal Einstellungen per Remote ist nicht erlaubt</string>
<string name="smscommunicator_remotecalibrationnotallowed">Kalibrierung per Remote ist nicht erlaubt</string>
<string name="smscommunicator_remotecommandnotallowed">Externe Befehle sind nicht erlaubt</string>
<string name="smscommunicator_missingsmspermission">SMS-Steuerung nicht erlaubt</string>
<string name="smscommunicator_remotebasalnotallowed">Ferngesteuerte Basal-Einstellungen sind nicht erlaubt</string>
<string name="smscommunicator_remotecalibrationnotallowed">Ferngesteuerte Kalibrierung ist nicht erlaubt</string>
<string name="smscommunicator_remotecommandnotallowed">Ferngesteuerte Befehle sind nicht erlaubt</string>
<string name="smscommunicator_remotecommandsallowed">Erlaube externe Befehle per SMS</string>
<string formatted="false" name="smscommunicator_suspendreplywithcode">Um den Loop zu pausieren für %d Minuten, antworte mit dem Code %s</string>
<string name="smscommunicator_tempbasalcanceled">Temp Basal abgebrochen</string>
<string name="smscommunicator_tempbasalcancelfailed">Abbrechen des temp Basal ist fehlgeschlagen</string>
<string name="smscommunicator_tempbasalfailed">Temp Basal starten ist fehlgeschlagen</string>
<string formatted="false" name="smscommunicator_tempbasalset">Temp Basal %.2fU/h für %d min wurde erfolgreich gestartet</string>
<string formatted="false" name="smscommunicator_suspendreplywithcode">Um das Loopen für %d Minuten zu pausieren, antworte mit dem Code %s</string>
<string name="smscommunicator_tempbasalcanceled">TBR abgebrochen</string>
<string name="smscommunicator_tempbasalcancelfailed">Das Abbrechen der TBR ist fehlgeschlagen</string>
<string name="smscommunicator_tempbasalfailed">Das Starten der TBR ist fehlgeschlagen</string>
<string formatted="false" name="smscommunicator_tempbasalset">TBR mitl %.2f IE/h für %d Min. wurde erfolgreich gestartet</string>
<string name="smscommunicator_unknowncommand">Unbekannter Befehl oder falsche Antwort</string>
<string name="smscommunicator_wrongduration">Falsche Dauer</string>
<string name="unlock_settings">Einstellungen freischalten</string>
<string formatted="false" name="openapsma_valuelimitedto">%.2f limitiert auf %.2f</string>
<string name="danar_sbolus">S Bolus</string>
<string name="danar_sbolus">S-Bolus</string>
<string formatted="false" name="danar_model">Model: %02X Protokoll: %02X Code: %02X</string>
<string name="configbuilder_sensitivity">Empfindlichkeitserkennung</string>
<string name="cob">COB</string>
<string name="enablesuperbolus_summary">Aktiviere die SuperBolus-Funktion im Wizard. Nicht aktivieren, wenn du nicht weißt, was es macht! ES KANN ZU EINER ÜBERDOSIERUNG AN INSULIN KOMMEN, WENN DU ES BLIND BENUTZT!</string>
<string name="objectives_2_objective">Verstehen des OpenLoops und der Temp-Basal-Empfehlungen</string>
<string name="objectives_2_objective">Verstehen des Open Loops und der TBR-Empfehlungen</string>
<string name="openapsama_useautosens">Verwende AMA Autosense</string>
<string formatted="false" name="smscommunicator_basalreplywithcode">Um Basal mit %.2fU/h zu starten, antworte mit dem Code %s</string>
<string formatted="false" name="smscommunicator_basalreplywithcode">Um eine BR mit %.2f IE/h zu starten, antworte mit dem Code %s</string>
<string name="ultrafastactinginsulincomment">Fiasp</string>
<string name="ultrarapid_oref">Ultra-Rapid Oref</string>
<string name="wear_overviewnotifications_summary">Zeige die Übersichtsbenachrichtigungen auch als Wear Bestätigungsmeldung auf der Uhr an.</string>
<string name="short_avgdelta">Kurzes Durschnitts-Delta</string>
<string name="wear_overviewnotifications_summary">Zeige die Übersichtsbenachrichtigungen auch auf der Uhr an.</string>
<string name="short_avgdelta">Kurzes durchschnittl. Delta</string>
<string name="rapid_acting_oref">Rapid-Acting Oref</string>
<string name="openapsama_autosens_adjusttargets_summary">Default Eintrag: true. Erlaubt Autosense den Ziel-BZ-Bereich in Verbindung mit ISF und Basal anzupassen.</string>
<string name="openapsama_autosens_adjusttargets_summary">Vorgabe: true. Erlaubt Autosense den Ziel-BZ-Bereich in Verbindung mit ISF und Basal anzupassen.</string>
<string name="openapsama_autosens_period">Intervall für Autosense [h]</string>
<string name="openapsama_autosens_period_summary">Anzahl der Stunde von der Vergangenheit, die verwendet werden um die Sensitivität zu erkennen (Kohlenhydrate absorptuinszeit ist nicht enthalten)</string>
<string name="objectives_2_gate">Anhand von dieser Erfahrung, entscheide wie hoch max Basal sein sollte und setzte dies in der Pumpe und den Einstellungen</string>
<string name="objectives_3_gate">Lasse es im ClosedLoop Modus mit max IOB = 0 für ein paar Tage laufen ohne zu viele Unterzuckeren zu haben</string>
<string name="objectives_3_objective">Starte den ClosedLoop Modus mit Abschaltung bei niedrigen Werte</string>
<string name="objectives_4_gate">Verwende es ein paar Tage, und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst.</string>
<string name="objectives_4_objective">Fein-Einstellung des Closed-Loops, Erhöhen von max IOB über 0 und langsames Heruntersetzen des Zielbereichs.</string>
<string name="objectives_5_gate">Eine Woche erfolgreiches Looping am Tag mit regelmäßiger Kohlenhydrat-Eingabe</string>
<string name="objectives_5_objective">Passe Basal und Faktoren an, falls notwendig, und aktiviere dann die Autosense-Funktion</string>
<string name="objectives_6_objective">Aktiviere zusätzliche Funktionen tagsüber, wie z.B. den Mahlzeitenassistent</string>
<string name="openapsama_autosens_period_summary">Anzahl der vergangenen Stunden, die verwendet werden, um die Sensitivität zu erkennen (Zeit, in der KH resorbiert werden, ist nicht berücksichtigt)</string>
<string name="objectives_2_gate">Entscheide anhand von dieser Erfahrung, wie hoch max Basal sein sollte, und übernehme den Wert in die Pumpen- und AAPS-Einstellungen</string>
<string name="objectives_3_gate">Erprobe den Closed Loop Modus mit max IOB = 0 für ein paar Tage, ohne zu viele Unterzuckerungen zu haben</string>
<string name="objectives_3_objective">Starte den Closed Loop Modus mit Abschaltung bei niedrigen Werte</string>
<string name="objectives_4_gate">Verwende es ein paar Tage und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst</string>
<string name="objectives_4_objective">Fein-Einstellung des Closed-Loops, Erhöhen von max IOB über 0 und langsames Heruntersetzen des Zielbereichs</string>
<string name="objectives_5_gate">Eine Woche erfolgreiches Loopen am Tag mit regelmäßiger Kohlenhydrat-Eingabe</string>
<string name="objectives_5_objective">Passe, falls notwendig, Basal und Faktoren an und aktiviere dann die Autosense-Funktion</string>
<string name="objectives_6_objective">Aktiviere zusätzliche Funktionen wie z. B. den Mahlzeitenassistent</string>
<string name="nsalarm_urgentstaledata">Stark veraltete Daten</string>
<string name="nsalarm_urgent_staledatavalue_label">Stark veraltete Daten nach [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Stark veraltete Daten seit [Min.]</string>
<string name="nl_lang">Dutch</string>
<string name="insulin_peak_time">Peak Time [min]</string>
<string name="insulin_oref_peak">IOB Kurve Peak Time</string>
<string name="insulin_oref_peak">IOB Curve Peak Time</string>
<string name="free_peak_oref">Free-Peak Oref</string>
<string formatted="false" name="dia_too_short">DIA von %s ist zu kurz - aaps nutzt stattdessen %s!</string>
<string formatted="false" name="dia_too_short">DIA von %s ist zu kurz - AAPS nutzt stattdessen %s!</string>
<string name="danar_stats_warning_Message">Möglicherweise ungenau, wenn zum Befüllen ein Bolus verwendet wurde!</string>
<string name="danar_stats_ratio">Verhältnis</string>
<string name="activate_profile">aktiviere Profil</string>
<string name="activate_profile">AKTIVIERE PROFIL</string>
<string name="activity_duration">Aktivitätsdauer</string>
<string name="activity_target">Aktivitätsziel</string>
<string name="bloodsugarmeasurementalert">BZ-Messung</string>
<string name="bolusspeed">Bolus Geschwindigkeit</string>
<string name="bolusspeed">Bolus-Geschwindigkeit</string>
<string name="careportal_newnstreatment_percentage_label">Prozentsatz</string>
<string name="careportal_newnstreatment_timeshift_label">Zeitverschiebung</string>
<string name="careportal_pbage_label_short">BAT</string>
<string name="circadian_percentage_profile">CircadianPercantage</string>
<string name="connectiontimedout">Verbindungs-Unterbrechungs-Dauer</string>
<string name="circadian_percentage_profile">CircadianPercentage-Profil</string>
<string name="connectiontimedout">Zeitüberschreitung der Verbindung</string>
<string name="danar_history_prime">Füllen</string>
<string name="danar_debolus">DE Bolus</string>
<string name="danar_dsbolus">DS Bolus</string>
<string name="danar_ebolus">E Bolus</string>
<string name="danar_setbasalstep001">Basalschritt setzen zu 0.01 U/h</string>
<string name="danar_debolus">DE-Bolus</string>
<string name="danar_dsbolus">DS-Bolus</string>
<string name="danar_ebolus">E-Bolus</string>
<string name="danar_setbasalstep001">Setzte Basalschritt zu 0.01 IE/h</string>
<string name="danar_stats_tbb">Tägl. Basalmenge</string>
<string name="danar_stats_tbb2">Tägl. Basalmenge * 2</string>
<string name="danar_stats_tdd">Tägl. Gesamtdosis</string>
<string name="danars_nodeviceavailable">Gerät nicht gefunden</string>
<string name="danars_nodeviceavailable">Gerät noch nicht gefunden</string>
<string name="danarspump">DanaRS</string>
<string name="danarspump_shortname">Dana</string>
<string name="date">Datum</string>
<string name="default_temptargets">Standard Temp. Ziele</string>
<string name="eatingsoon_duration">Eating Soon Dauer</string>
<string name="eatingsoon_target">Eating Soon Ziel</string>
<string name="default_temptargets">Standard temp. Ziele</string>
<string name="eatingsoon_duration">Bald essen - Dauer</string>
<string name="eatingsoon_target">Bald essen - Ziel</string>
<string name="emptyreservoir">Reservoir leer</string>
<string name="enacted">Ausgeführt</string>
<string name="gettingbolusstatus">Ermittle Bolus Status</string>
<string name="gettingextendedbolusstatus">Ermittle verz. Bolus Status</string>
<string name="gettingpumpsettings">Ermittle Pumpen Einstell.</string>
<string name="gettingpumptime">Ermittle Pumpenzeit</string>
<string name="gettingtempbasalstatus">Ermittle temp. Basal Status</string>
<string name="gettingextendedbolusstatus">Status des verzögerten Bolus wird ermittelt</string>
<string name="gettingpumpsettings">Pumpen-Einstellungen werden ermittelt</string>
<string name="gettingpumptime">Pumpenzeit wird ermittelt</string>
<string name="gettingtempbasalstatus">Status der TBR wird ermittelt</string>
<string name="invalid">Ungültig</string>
<string name="long_avgdelta">Langes durchschn. Delta</string>
<string name="long_avgdelta">Langes durchschnittl. Delta</string>
<string name="mdi">ICT</string>
<string name="nsclientinternal">integrierter NSClient</string>
<string name="nsclientinternal">Nighscout-Client</string>
<string name="overview_newtempbasal_basaltype_label">Basaltyp</string>
<string name="pairingtimedout">Verbindung Zeit überschritten</string>
<string name="pairingtimedout">Zeitüberschreitung beim Pairing</string>
<string name="pairpump">Verbinde neue Pumpe</string>
<string name="prefs_delta_title">Delta Einstellungen</string>
<string name="prefs_delta_title">Delta-Einstellungen</string>
<string name="remaininsulinalert">Restinsulin</string>
<string name="reuse">erneut verwenden</string>
<string name="selectedpump">ausgewählte Pumpe</string>
<string name="selectedpump">Ausgewählte Pumpe</string>
<string name="serialnumber">Seriennummer</string>
<string name="waitingforpairing">auf Verbindung warten</string>
<string name="wearcontrol_summary">Setze temp. Ziele und Behandlungen auf Uhr</string>
<string name="wearcontrol_title">Steuerung von der Uhr</string>
<string name="waitingforpairing">Auf Verbindung warten</string>
<string name="wearcontrol_summary">Setze temporäre Ziele und Behandlungen mit der Uhr</string>
<string name="wearcontrol_title">Steuerung durch die Uhr</string>
<string name="sensitivity_shortname">SENS</string>
<string name="ratio_short">SEN</string>
<string name="pairingok">Verbindung OK</string>
<string name="pairing">Verbindung</string>
<string name="pairingok">Pairing OK</string>
<string name="predictionshortlabel">PRE</string>
<string name="nsclientinternal_title">Interner NSClient</string>
<string name="nsclientinternal_title">Nightscout-Client</string>
<string name="nsclientinternal_shortname">NSCI</string>
<string name="localalertsettings_title">Lokale Alarme</string>
<string name="raise_notifications_as_android_notifications">Benutze Systemmeldungen für Alarme und Meldungen</string>
<string name="pump_unreachable">Pumpe ist nicht erreichbar</string>
<string name="enable_missed_bg_readings_alert">Alarm wenn keine Glukose Daten empfangen werden</string>
<string name="enable_pump_unreachable_alert">Alarm wenn die Pumpe nicht erreichbar ist</string>
<string name="pump_unreachable_threshold">Pumpe ist nicht erreichbar Grenze [min]</string>
<string name="enable_missed_bg_readings_alert">Alarm, wenn keine Glukose-Daten empfangen werden</string>
<string name="enable_pump_unreachable_alert">Alarm, wenn die Pumpe nicht erreichbar ist</string>
<string name="pump_unreachable_threshold">Pumpe ist nicht erreichbar Grenze [Min.]</string>
<string name="treatments_wizard_tt_label">TZ</string>
<string name="alert_dialog_storage_permission_text">Bitte starte dein Telefon neu oder starte AndroidAPS in den System-Einstellungen neu. Andernfalls wird AndroidAPS nicht protokolliert (wichtig zum Nachverfolgen und Verifizieren, dass der Algorithmus korrekt funktioniert)</string>
<string name="tempbasal">TBR</string>
<string name="danar_history">Pumpen-Speicher</string>
<string name="enablesuperbolus_summary">Aktiviere die SuperBolus-Funktion im Wizard. Nicht aktivieren, wenn du nicht weißt, welche Auswirkungen dieser Bolus hat! ES KANN ZU EINER ÜBERDOSIERUNG AN INSULIN KOMMEN!</string>
<string name="gettingbolusstatus">Status des Bolus wird ermittelt</string>
<string name="pairing">PAIRING</string>
<string name="startingbolus">Bolus-Abgabe gestartet</string>
<string name="waitingforestimatedbolusend">Warte auf Ende der Bolus-Abgabe. %d Sek. verbleiben.</string>
<string name="executingrightnow">Befehl wird zurzeit ausgeführt.</string>
<string name="missed_bg_readings">BZ-Werte fehlen</string>
<string name="btwatchdog_summary">Deaktiviert Bluetooth kurzzeitig, falls keine Verbindung zur Pumpe besteht. Dies kann für Smartphones mit Verbindungsproblemen nützlich sein.</string>
<string name="food">Essen</string>
<string name="shortgramm">g</string>
<string name="shortkilojoul">kJ</string>
<string name="shortenergy">En</string>
<string name="shortprotein">Pr</string>
<string name="shortfat">Fat</string>
<string name="urgent_alarm">Wichtiger Alarm</string>
<string name="info">INFO</string>
<string name="bluetooth">Bluetooth</string>
<string name="dexcomg5_nsupload_title">Speichere BZ-Werte in Nightscout</string>
<string name="dexcomg5_upload">G5 Upload Einstellungen</string>
<string name="wear_detailed_delta_title">Zeige detailliertes Delta</string>
<string name="wear_detailed_delta_summary">Zeige Delta mit Dezimalstelle</string>
<string name="unsupportedfirmware">Nicht unterstützte Pumpen-Firmware</string>
<string name="dexcomg5_xdripupload_title">Sende BZ-Werte zu xDrip+</string>
<string name="dexcomg5_xdripupload_summary">Wähle in xDrip+ 640g/Eversense als Daten-Quelle</string>
<string name="nsclientbg">Nightscout-Client BZ</string>
<string name="minimalbasalvaluereplaced">Basal-Wert wurde durch den kleinst möglichen Wert ersetzt</string>
<string name="yes">Ja</string>
<string name="no">Nein</string>
<string name="overview_editquickwizard_usebg">BZ Berechnung</string>
<string name="overview_editquickwizard_usebolusiob">Bolus IOB Berechnung</string>
<string name="overview_editquickwizard_usebasaliob">Basal IOB Berechnung</string>
<string name="overview_editquickwizard_usetrend">Trend Berechnung</string>
<string name="overview_editquickwizard_usesuperbolus">Superbolus Berechnung</string>
<string name="positiveonly">Nur positive</string>
<string name="negativeonly">Nur negative</string>
<string name="overview_editquickwizard_usecob">COB Berechnung</string>
<string name="overview_editquickwizard_usetemptarget">Temporäres Ziel Berechnung</string>
<string name="openapsama_max_daily_safety_multiplier_summary">Standardwert: 3\nDies ist eine wichtige Sicherheitseinstellung. Sie begrenzt das maximale Basal-IOB auf die dreifache Menge (im Standardfall) deiner größten Basalrate. In der Regel solltest Du diesen Wert nicht ändern. Aber Du solltest wissen, was \"3x max daily, 4x current\" als Sicherheitseinstellung bedeutet.</string>
<string name="openapsama_current_basal_safety_multiplier_summary">Standardwert: 4\nDies ist die andere wichtige Sicherheitseinstellung, die zweite Hälfte von \"3x max daily, 4x current\". Diese Grenze beschränkt das Basal-IOB auf die vierfache (im Standardfall) Menge der aktuellen Basalrate. Dies ist wichtig, um Nutzer davor zu bewahren, zuviel Basal-Insulin zu verabreichen. Nochmals, der Standardwert ist 4x. Die meisten Nutzer werden niemals diese Einstellung verändern, sondern andere Einstellungen anpassen, um sich nicht dieser Sicherheitsgrenze zu nähern.</string>
<string name="openapsama_autosens_max_summary">Standardwert: 1.2\nDies ist eine Sicherheitsgrenze für autosens (und bald auch autotune), die besagt, wie hoch autosens Basalraten anpassen darf und wie niedrig der ISF (Insulin-Sensitivität-Faktor) und wie niedrig der BZ-Zielwert eingestellt werden kann. 1.2 ist dabei der Multiplikationsfaktor und erlaubt eine Anpassung um 20%.</string>
<string name="openapsama_autosens_min_summary">Standardwert: 0.7\nDies ist die andere Sicherheitsgrenze für autosens. Sie beschränkt wie weit autosens Basalraten absenken und wie sehr ISF und BZ-Zielwerte erhöht werden können.</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Standarwert: 2\nBolus snooze (\"Bolus-Schlummer\") bremst den Loop nach einem Mahleiten-Bolus, damit dieser nicht mit niedrigen TBR reagiert, wenn Du gerade gegessen hast. Beispiel: Der Standardwert 2 bewirkt, dass bei einem 3 Stunden DIA der Bolus snooze während 1.5 Stunden nach dem Bolus linear ausläuft (3 h Dia / 2 = 1.5 h Bolus snooze).</string>
<string name="openapsama_min_5m_carbimpact_summary">Standardwert: 3.0\nDies ist eine Einstellung für die Standard-Kohlenhydrat-Absorptionswirkung pro 5 Minuten. Der Standardwert ist 3mg/dl/5min. Dies wirkt sich darauf aus, wie schnell der COB-Wert fällt und wieviel KH-Absorption bei der Berechnung des vorhergesagten BZ angenommen wird, wenn der BZ stärker als erwartet fällt oder nicht so stark wie erwartet steigt.</string>
<string name="openapsama_link_to_preferncejson_doc_txt">Achtung! Normalerweise musst Du diese Werte nicht ändern. Bitte KLICKE HIER und LESE den Text. Verändere Werte erst, wenn Du den Inhalt des Textes verstanden hast.</string>
<string name="apsselected">APS ausgewählt</string>
<string name="loopenabled">Loop aktiviert</string>
<string name="nsclienthaswritepermission">Nightscout-Client hat Schreibrechte</string>
<string name="maxiobset">Maximales IOB richtig gesetzt</string>
<string name="closedmodeenabled">Closed mode aktiviert</string>
<string name="virtualpump_lastconnection_label">Letzte Verbindung</string>
<string name="virtualpump_basebasalrate_label">Basis-Basalrate</string>
<string name="virtualpump_tempbasal_label">TBR</string>
<string name="virtualpump_battery_label">Batterie</string>
<string name="virtualpump_reservoir_label">Reservoir</string>
<string name="danar_lastbolus">Letzter Bolus:</string>
<string name="objectives_7_objective">Aktiviere zusätzliche Funktionen wie z. B. den SMB</string>
<string name="btwatchdog_title">BT Watchdog</string>
<string name="DexcomG5">DexcomG5 App (patched)</string>
</resources>

View file

@ -316,6 +316,7 @@
<string name="objectives_5_objective">Adjust basals and ratios if needed, and then enable auto-sens</string>
<string name="objectives_5_gate">1 week successful daytime looping with regular carb entry</string>
<string name="objectives_6_objective">Enabling additional features for daytime use, such as advanced meal assist</string>
<string name="objectives_7_objective">Enabling additional features for daytime use, such as SMB</string>
<string name="youareonallowedlimit">You reached allowed limit</string>
<string name="noprofileselected">No profile selected</string>
<string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string>
@ -811,5 +812,14 @@
<string name="negativeonly">Negative only</string>
<string name="overview_editquickwizard_usecob">COB calculation</string>
<string name="overview_editquickwizard_usetemptarget">Temporary target calculation</string>
<string name="loopenabled">Loop enabled</string>
<string name="apsselected">APS selected</string>
<string name="nsclienthaswritepermission">NSClient has write permission</string>
<string name="closedmodeenabled">Closed mode enabled</string>
<string name="maxiobset">Maximal IOB set properly</string>
<string name="hasbgdata">BG available from selected source</string>
<string name="basalprofilenotaligned">Basal values not aligned to hours</string>
<string name="zerovalueinprofile">Zero value in profile</string>
<string name="nolocaleprofilefound">Received profile switch from NS but profile doesn\'t exist localy</string>
</resources>

View file

@ -0,0 +1,85 @@
package info.nightscout.utils;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.data.GlucoseStatus;
import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.PumpMDI.MDIPlugin;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/**
* Created by kuchjir on 12/12/2017.
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest( { MainApp.class, GlucoseStatus.class, ConfigBuilderPlugin.class })
public class BolusWizardTest {
private static final double PUMP_BOLUS_STEP = 0.1;
@Test
/** Should calculate the same bolus when different blood glucose but both in target range */
public void shuldCalculateTheSameBolusWhenBGsInRange() throws Exception {
BolusWizard bw = new BolusWizard();
Profile profile = setupProfile(4d, 8d, 20d, 12d);
Double bolusForBg42 = bw.doCalc(profile, null, 20, 0.0,4.2, 0d, 100d, true, true, false, false);
Double bolusForBg54 = bw.doCalc(profile, null, 20, 0.0,5.4, 0d, 100d, true, true, false, false);
Assert.assertEquals(bolusForBg42, bolusForBg54);
}
@Test
public void shuldCalculateHigherBolusWhenHighBG() throws Exception {
BolusWizard bw = new BolusWizard();
Profile profile = setupProfile(4d, 8d, 20d, 12d);
Double bolusForHighBg = bw.doCalc(profile, null, 20, 0d,9.8, 0d, 100d, true, true, false, false);
Double bolusForBgInRange = bw.doCalc(profile, null, 20, 0.0,5.4, 0d, 100d, true, true, false, false);
Assert.assertTrue(bolusForHighBg > bolusForBgInRange);
}
@Test
public void shuldCalculateLowerBolusWhenLowBG() throws Exception {
BolusWizard bw = new BolusWizard();
Profile profile = setupProfile(4d, 8d, 20d, 12d);
Double bolusForLowBg = bw.doCalc(profile, null, 20, 0d,3.6, 0d, 100d, true, true, false, false);
Double bolusForBgInRange = bw.doCalc(profile, null, 20, 0.0,5.4, 0d, 100d, true, true, false, false);
Assert.assertTrue(bolusForLowBg < bolusForBgInRange);
}
private Profile setupProfile(Double targetLow, Double targetHigh, Double insulinSensitivityFactor, Double insulinToCarbRatio) {
Profile profile = mock(Profile.class);
when(profile.getTargetLow()).thenReturn(targetLow);
when(profile.getTargetHigh()).thenReturn(targetHigh);
when(profile.getIsf()).thenReturn(insulinSensitivityFactor);
when(profile.getIc()).thenReturn(insulinToCarbRatio);
PowerMockito.mockStatic(GlucoseStatus.class);
when(GlucoseStatus.getGlucoseStatusData()).thenReturn(null);
ConfigBuilderPlugin treatment = mock(ConfigBuilderPlugin.class);
IobTotal iobTotalZero = new IobTotal(System.currentTimeMillis());
when(treatment.getLastCalculationTreatments()).thenReturn(iobTotalZero);
when(treatment.getLastCalculationTempBasals()).thenReturn(iobTotalZero);
PowerMockito.mockStatic(MainApp.class);
when(MainApp.getConfigBuilder()).thenReturn(treatment);
PowerMockito.mockStatic(ConfigBuilderPlugin.class);
PumpInterface pump = MDIPlugin.getPlugin();
pump.getPumpDescription().bolusStep = PUMP_BOLUS_STEP;
when(ConfigBuilderPlugin.getActivePump()).thenReturn(pump);
return profile;
}
}

View file

@ -111,6 +111,25 @@
</intent-filter>
</service>
<service
android:name=".watchfaces.Steampunk"
android:allowEmbedded="true"
android:label="AAPS(Steampunk)"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_steampunk" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
<service
android:name=".watchfaces.LargeHome"
android:allowEmbedded="true"

View file

@ -21,6 +21,7 @@ import android.view.Display;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -44,15 +45,17 @@ import lecho.lib.hellocharts.view.LineChartView;
/**
* Created by emmablack on 12/29/14.
* Updated by andrew-warrington on 11/15/17.
* Updated by andrew-warrington on 02-Jan-2018.
*/
public abstract class BaseWatchFace extends WatchFace implements SharedPreferences.OnSharedPreferenceChangeListener {
public final static IntentFilter INTENT_FILTER;
public static final long[] vibratePattern = {0,400,300,400,300,400};
public TextView mTime, mSgv, mDirection, mTimestamp, mUploaderBattery, mRigBattery, mDelta, mAvgDelta, mStatus, mBasalRate, mIOB1, mIOB2, mCOB1, mCOB2, mBgi, mLoop, mDay, mMonth, isAAPSv2, mHighLight, mLowLight;
public ImageView mGlucoseDial, mDeltaGauge, mHourHand, mMinuteHand;
public long datetime;
public RelativeLayout mRelativeLayout;
public LinearLayout mLinearLayout, mLinearLayout2, mDate;
public LinearLayout mLinearLayout, mLinearLayout2, mDate, mChartTap, mMainMenuTap;
public long sgvLevel = 0;
public int ageLevel = 1;
public int loopLevel = 1;
@ -85,6 +88,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
public boolean detailedIOB = false;
public boolean showBGI = false;
public boolean forceSquareCanvas = false; //set to true by the Steampunk watch face.
public long openApsStatus;
public String externalStatusString = "no status";
public String sSgv = "---";
@ -99,21 +103,24 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
public String sCOB1 = "Carb";
public String sCOB2 = "--g";
public String sBgi = "--";
public String sMinute = "0";
public String sHour = "0";
public String sUnits = "-";
@Override
public void onCreate() {
super.onCreate();
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
display.getSize(displaySize);
wakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Clock");
specW = View.MeasureSpec.makeMeasureSpec(displaySize.x,
View.MeasureSpec.EXACTLY);
specH = View.MeasureSpec.makeMeasureSpec(displaySize.y,
View.MeasureSpec.EXACTLY);
sharedPrefs = PreferenceManager
.getDefaultSharedPreferences(this);
specW = View.MeasureSpec.makeMeasureSpec(displaySize.x, View.MeasureSpec.EXACTLY);
if (forceSquareCanvas) {
specH = specW;
} else {
specH = View.MeasureSpec.makeMeasureSpec(displaySize.y, View.MeasureSpec.EXACTLY);
}
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
}
@ -160,10 +167,17 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout);
mLinearLayout = (LinearLayout) stub.findViewById(R.id.secondary_layout);
mLinearLayout2 = (LinearLayout) stub.findViewById(R.id.tertiary_layout);
mGlucoseDial = (ImageView) stub.findViewById(R.id.glucose_dial);
mDeltaGauge = (ImageView) stub.findViewById(R.id.delta_pointer);
mHourHand = (ImageView) stub.findViewById(R.id.hour_hand);
mMinuteHand = (ImageView) stub.findViewById(R.id.minute_hand);
mChartTap = (LinearLayout) stub.findViewById(R.id.chart_zoom_tap);
mMainMenuTap = (LinearLayout) stub.findViewById(R.id.main_menu_tap);
chart = (LineChartView) stub.findViewById(R.id.chart);
layoutSet = true;
setDataFields();
setColor();
}
}
);
@ -214,7 +228,14 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
protected void onDraw(Canvas canvas) {
if (layoutSet) {
setupCharts();
this.mRelativeLayout.draw(canvas);
mRelativeLayout.measure(specW, specH);
if (forceSquareCanvas) {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
} else {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
}
mRelativeLayout.draw(canvas);
Log.d("onDraw", "draw");
}
}
@ -225,11 +246,16 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
wakeLock.acquire(50);
setDataFields();
setColor();
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
if (forceSquareCanvas) {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
} else {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
}
invalidate();
}
}
@ -247,6 +273,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
sDirection = dataMap.getString("slopeArrow");
sDelta = dataMap.getString("delta");
sAvgDelta = dataMap.getString("avgDelta");
sUnits = dataMap.getString("glucoseUnits");
if (chart != null) {
addToWatchSet(dataMap);
setupCharts();
@ -257,7 +284,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
if (layoutSet && bundle != null) {
DataMap dataMap = DataMap.fromBundle(bundle);
wakeLock.acquire(50);
sBasalRate = dataMap.getString("tempBasal");
sBasalRate = dataMap.getString("currentBasal");
sUploaderBattery = dataMap.getString("battery");
sRigBattery = dataMap.getString("rigBattery");
detailedIOB = dataMap.getBoolean("detailedIob");
@ -273,6 +300,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
}
setDataFields();
setColor();
bundle = intent.getBundleExtra("basals");
if (layoutSet && bundle != null) {
@ -282,10 +310,12 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
}
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
if (forceSquareCanvas) {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
} else {
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
}
invalidate();
setColor();
}
}
@ -476,15 +506,22 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
public void setDateAndTime() {
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this);
mTime.setText(timeFormat.format(System.currentTimeMillis()));
if (mTime != null) {
mTime.setText(timeFormat.format(System.currentTimeMillis()));
}
Date now = new Date();
SimpleDateFormat sdfHour = new SimpleDateFormat("HH");
SimpleDateFormat sdfMinute = new SimpleDateFormat("mm");
sHour = sdfHour.format(now);
sMinute = sdfMinute.format(now);
if (mDate != null && mDay != null && mMonth != null) {
if (sharedPrefs.getBoolean("show_date", false)) {
Date today = new Date();
SimpleDateFormat sdfDay = new SimpleDateFormat("dd");
SimpleDateFormat sdfMonth = new SimpleDateFormat("MMM");
mDay.setText(sdfDay.format(today));
mMonth.setText(sdfMonth.format(today));
mDay.setText(sdfDay.format(now));
mMonth.setText(sdfMonth.format(now));
mDate.setVisibility(View.VISIBLE);
} else {
mDate.setVisibility(View.GONE);
@ -532,8 +569,13 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){
if("delta_granularity".equals(key)){
ListenerService.requestData(this);
}
if(layoutSet){
setDataFields();
setColor();
}
invalidate();
}

View file

@ -146,7 +146,7 @@ public class BgGraphBuilder {
for (TempWatchData twd: tempWatchDataList) {
if(twd.endTime > start_time) {
lines.add(tempValuesLine(twd, (float) minChart, factor, false, highlight?3:2));
lines.add(tempValuesLine(twd, (float) minChart, factor, false, highlight?(pointSize+1):pointSize));
if(highlight){
lines.add(tempValuesLine(twd, (float) minChart, factor, true, 1));
}

View file

@ -27,21 +27,13 @@ public class Cockpit extends BaseWatchFace {
@Override
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
if (mSgv != null) {
int extra = (mSgv.getRight() - mSgv.getLeft()) / 2;
if (tapType == TAP_TYPE_TAP &&
x + extra >= mSgv.getLeft() &&
x - extra <= mSgv.getRight() &&
y >= mSgv.getTop() &&
y <= mSgv.getBottom()) {
if (eventTime - sgvTapTime < 800) {
Intent intent = new Intent(this, MainMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
sgvTapTime = eventTime;
if (tapType == TAP_TYPE_TAP ) {
if (eventTime - sgvTapTime < 800) {
Intent intent = new Intent(this, MainMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
sgvTapTime = eventTime;
}
}

View file

@ -0,0 +1,243 @@
package info.nightscout.androidaps.watchfaces;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.support.wearable.watchface.WatchFaceStyle;
import android.view.LayoutInflater;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interaction.menus.MainMenuActivity;
/**
* Created by andrew-warrington on 01/12/2017.
*/
public class Steampunk extends BaseWatchFace {
private long chartTapTime = 0;
private long mainMenuTapTime = 0;
private float lastEndDegrees = 0f;
private float deltaRotationAngle = 0f;
@Override
public void onCreate() {
forceSquareCanvas = true;
super.onCreate();
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
layoutView = inflater.inflate(R.layout.activity_steampunk, null);
performViewSetup();
}
@Override
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
if (tapType == TAP_TYPE_TAP&&
x >= mChartTap.getLeft() &&
x <= mChartTap.getRight()&&
y >= mChartTap.getTop() &&
y <= mChartTap.getBottom()){
if (eventTime - chartTapTime < 800){
changeChartTimeframe();
}
chartTapTime = eventTime;
} else if (tapType == TAP_TYPE_TAP&&
x >= mMainMenuTap.getLeft() &&
x <= mMainMenuTap.getRight()&&
y >= mMainMenuTap.getTop() &&
y <= mMainMenuTap.getBottom()){
if (eventTime - mainMenuTapTime < 800){
Intent intent = new Intent(this, MainMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
mainMenuTapTime = eventTime;
}
}
@Override
protected WatchFaceStyle getWatchFaceStyle() {
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
}
protected void setColorDark() {
if (mLinearLayout2 != null) {
if (ageLevel() <= 0) {
mLinearLayout2.setBackgroundResource(R.drawable.redline);
mTimestamp.setTextColor(getResources().getColor(R.color.red_600));
} else {
mLinearLayout2.setBackgroundResource(0);
mTimestamp.setTextColor(getResources().getColor(R.color.black_86p));
}
}
if (mLoop != null) {
if (loopLevel == 0) {
mLoop.setTextColor(getResources().getColor(R.color.red_600));
} else {
mLoop.setTextColor(getResources().getColor(R.color.black_86p));
}
}
if (!sSgv.equals("---")) {
float rotationAngle = 0f; //by default, show ? on the dial (? is at 0 degrees on the dial)
if (!sUnits.equals("-")) {
//ensure the glucose dial is the correct units
if (sUnits.equals("mmol")) {
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mmol);
} else {
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mgdl);
}
//convert the Sgv to degrees of rotation
if (sUnits.equals("mmol")) {
rotationAngle = Float.valueOf(sSgv) * 18f; //convert to mg/dL, which is equivalent to degrees
} else {
rotationAngle = Float.valueOf(sSgv); //if glucose a value is received, use it to determine the amount of rotation of the dial.
}
}
if (rotationAngle > 330) rotationAngle = 330; //if the glucose value is higher than 330 then show "HIGH" on the dial. ("HIGH" is at 330 degrees on the dial)
if (rotationAngle != 0 && rotationAngle < 30) rotationAngle = 30; //if the glucose value is lower than 30 show "LOW" on the dial. ("LOW" is at 30 degrees on the dial)
//rotate glucose dial
RotateAnimation rotate = new RotateAnimation(
lastEndDegrees, rotationAngle - lastEndDegrees,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setFillAfter(true);
rotate.setInterpolator(new LinearInterpolator());
rotate.setDuration(1);
mGlucoseDial.startAnimation(rotate);
lastEndDegrees = rotationAngle; //store the final angle as a starting point for the next rotation.
}
//set the delta gauge and rotate the delta pointer
float deltaIsNegative = 1f; //by default go clockwise
if (!sAvgDelta.equals("--")) { //if a legitimate delta value is received, then...
if (sAvgDelta.substring(0,1).equals("-")) deltaIsNegative = -1f; //if the delta is negative, go counter-clockwise
//ensure the delta gauge is the right units and granularity
if (!sUnits.equals("-")) {
if (sUnits.equals("mmol")) {
if (sharedPrefs.getString("delta_granularity", "2").equals("1")) { //low
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_10);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 30f); //get rid of the sign so it can be converted to float.
}
if (sharedPrefs.getString("delta_granularity", "2").equals("2")) { //medium
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_05);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 60f); //get rid of the sign so it can be converted to float.
}
if (sharedPrefs.getString("delta_granularity", "2").equals("3")) { //high
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_03);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 100f); //get rid of the sign so it can be converted to float.
}
} else {
if (sharedPrefs.getString("delta_granularity", "2").equals("1")) { //low
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_20);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 1.5f); //get rid of the sign so it can be converted to float.
}
if (sharedPrefs.getString("delta_granularity", "2").equals("2")) { //medium
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_10);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 3f); //get rid of the sign so it can be converted to float.
}
if (sharedPrefs.getString("delta_granularity", "2").equals("3")) { //high
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_5);
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 6f); //get rid of the sign so it can be converted to float.
}
}
}
if (deltaRotationAngle > 40) deltaRotationAngle = 40f;
mDeltaGauge.setRotation(deltaRotationAngle * deltaIsNegative);
}
//rotate the minute hand.
mMinuteHand.setRotation(Float.valueOf(sMinute) * 6f);
//rotate the hour hand.
mHourHand.setRotation((Float.valueOf(sHour) * 30f) + (Float.valueOf(sMinute) * 0.5f));
setTextSizes();
if (mLoop != null) {
mLoop.setBackgroundResource(0);
}
if (chart != null) {
highColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
lowColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
midColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.grey_steampunk);
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
pointSize = 1;
setupCharts();
}
invalidate();
}
protected void setColorLowRes() {
setColorDark();
}
protected void setColorBright() {
setColorDark();
}
protected void setTextSizes() {
float fontSmall = 10f;
float fontMedium = 11f;
float fontLarge = 12f;
if (bIsRound) {
fontSmall = 11f;
fontMedium = 12f;
fontLarge = 13f;
}
//top row. large font unless text too big (i.e. detailedIOB)
mCOB2.setTextSize(fontLarge);
mBasalRate.setTextSize(fontLarge);
if (sIOB2.length() < 7) {
mIOB2.setTextSize(fontLarge);
} else {
mIOB2.setTextSize(fontSmall);
}
//bottom row. font medium unless text too long (i.e. longer than 9' timestamp)
if (mTimestamp.getText().length() < 3 || mLoop.getText().length() < 3) { //always resize these fields together, for symmetry.
mTimestamp.setTextSize(fontMedium);
mLoop.setTextSize(fontMedium);
} else {
mTimestamp.setTextSize(fontSmall);
mLoop.setTextSize(fontSmall);
}
//if both batteries are shown, make them smaller.
if (sharedPrefs.getBoolean("show_uploader_battery", true) && sharedPrefs.getBoolean("show_rig_battery", false)) {
mUploaderBattery.setTextSize(fontSmall);
mRigBattery.setTextSize(fontSmall);
} else {
mUploaderBattery.setTextSize(fontMedium);
mRigBattery.setTextSize(fontMedium);
}
}
private void changeChartTimeframe() {
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
timeframe = (timeframe%5) + 1;
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.wearable.view.WatchViewStub
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:id="@+id/watch_view_stub"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectLayout="@layout/rect_steampunk"
app:roundLayout="@layout/round_steampunk"
tools:context=".watchfaces.Cockpit"
tools:deviceIds="wear"/>

View file

@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".watchfaces.Steampunk"
tools:deviceIds="wear_square">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/glucose_dial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:src="@drawable/steampunk_dial_mgdl" />
</LinearLayout>
<LinearLayout
android:id="@+id/secondary_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@drawable/steampunk_gauge_mgdl_20"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/delta_pointer"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.69"
android:gravity="center"
android:src="@drawable/steampunk_pointer" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:id="@+id/main_menu_tap"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.7"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.05"
android:gravity="center"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.26"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.2"
android:gravity="center"
android:textSize="11sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.16"
android:orientation="horizontal">
<TextView
android:id="@+id/cobView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="7dp"
android:rotation="-28"
android:text="--g"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.24"
android:orientation="horizontal">
<TextView
android:id="@+id/tmpBasal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingBottom="12dp"
android:rotation="-1"
android:text="-.--U/h"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:orientation="horizontal">
<TextView
android:id="@+id/iobView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="6dp"
android:rotation="28"
android:text="0.00U"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.2"
android:gravity="center"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/chart_zoom_tap"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.27"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:orientation="horizontal" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.5" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:orientation="horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.03"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
android:id="@+id/tertiary_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.15"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.21"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.32"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.12"
android:orientation="horizontal">
<TextView
android:id="@+id/loop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingEnd="8dp"
android:paddingTop="8dp"
android:rotation="-24"
android:text="-'"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.12"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/rig_battery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="10sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/uploader_battery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.12"
android:orientation="horizontal">
<TextView
android:id="@+id/timestamp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingStart="10dp"
android:paddingTop="8dp"
android:rotation="24"
android:text="-'"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.32"
android:orientation="horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.64"
android:orientation="horizontal"></LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/cover_plate_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/steampunk_cover_plate"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/hour_hand"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.3"
android:orientation="vertical"
android:rotation="0"
android:src="@drawable/steampunk_hour_hand" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/minute_hand"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.3"
android:orientation="vertical"
android:src="@drawable/steampunk_minute_hand" />
</LinearLayout>
<TextView
android:id="@+id/AAPSv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
</RelativeLayout>

View file

@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".watchfaces.Steampunk"
tools:deviceIds="wear_round">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/glucose_dial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:src="@drawable/steampunk_dial_mgdl" />
</LinearLayout>
<LinearLayout
android:id="@+id/secondary_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@drawable/steampunk_gauge_mgdl_20"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/delta_pointer"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.69"
android:gravity="center"
android:src="@drawable/steampunk_pointer" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:id="@+id/main_menu_tap"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.7"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.05"
android:gravity="center"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.26"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.2"
android:gravity="center"
android:textSize="11sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.165"
android:orientation="horizontal">
<TextView
android:id="@+id/cobView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="7dp"
android:rotation="-28"
android:text="--g"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.27"
android:orientation="horizontal">
<TextView
android:id="@+id/tmpBasal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingBottom="14dp"
android:rotation="0"
android:text="-.--U/h"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.165"
android:orientation="horizontal">
<TextView
android:id="@+id/iobView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="6dp"
android:rotation="28"
android:text="0.00U"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.2"
android:gravity="center"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/chart_zoom_tap"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.27"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:orientation="horizontal" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.5" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:orientation="horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.03"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
android:id="@+id/tertiary_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.15"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.21"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.32"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.12"
android:orientation="horizontal">
<TextView
android:id="@+id/loop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingEnd="8dp"
android:paddingTop="8dp"
android:rotation="-24"
android:text="-'"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.12"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/rig_battery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="12sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/uploader_battery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.12"
android:orientation="horizontal">
<TextView
android:id="@+id/timestamp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:paddingStart="10dp"
android:paddingTop="8dp"
android:rotation="24"
android:text="-'"
android:textAlignment="center"
android:textColor="@color/black_86p"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.32"
android:orientation="horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.64"
android:orientation="horizontal"></LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/cover_plate_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/steampunk_cover_plate"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/hour_hand"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.3"
android:orientation="vertical"
android:rotation="0"
android:src="@drawable/steampunk_hour_hand" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/minute_hand"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.3"
android:orientation="vertical"
android:src="@drawable/steampunk_minute_hand" />
</LinearLayout>
<TextView
android:id="@+id/AAPSv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
</RelativeLayout>

View file

@ -61,6 +61,7 @@
<color name="grey_50">#FAFAFA</color>
<color name="grey_300">#E0E0E0</color>
<color name="grey_500">#9E9E9E</color>
<color name="grey_steampunk">#333333</color>
<!-- Grey -->
<!-- Blue Grey -->

View file

@ -20,6 +20,18 @@
<item>5</item>
</string-array>
<string-array name="delta_granularity">
<item>Low</item>
<item>Medium</item>
<item>High</item>
</string-array>
<string-array name="delta_granularity_values">
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="input_design">
<item>Default</item>
<item>Quick righty</item>

View file

@ -141,6 +141,14 @@
android:summary="Input Design"
android:title="Input Design" />
<ListPreference
android:defaultValue="2"
android:entries="@array/delta_granularity"
android:entryValues="@array/delta_granularity_values"
android:key="delta_granularity"
android:summary="Delta Granularity (Steampunk)"
android:title="Delta Granularity (Steampunk)" />
<CheckBoxPreference
android:defaultValue="false"
android:key="showBigNumbers"