Merge branch 'dev' into xdripstatusline

This commit is contained in:
AdrianLxM 2017-05-09 23:26:31 +02:00 committed by GitHub
commit 298d7a7d9c
29 changed files with 595 additions and 185 deletions

View file

@ -44,7 +44,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 23 targetSdkVersion 23
versionCode 1400 versionCode 1400
version "1.42" version "1.43"
buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", generateGitBuild() buildConfigField "String", "BUILDVERSION", generateGitBuild()
} }

View file

@ -54,6 +54,7 @@ import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTarget
import info.nightscout.androidaps.receivers.DataReceiver; import info.nightscout.androidaps.receivers.DataReceiver;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSSgv; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSSgv;
import info.nightscout.utils.SP;
public class DataService extends IntentService { public class DataService extends IntentService {
@ -98,8 +99,7 @@ public class DataService extends IntentService {
boolean isNSProfile = ConfigBuilderPlugin.getActiveProfile().getClass().equals(NSProfilePlugin.class); boolean isNSProfile = ConfigBuilderPlugin.getActiveProfile().getClass().equals(NSProfilePlugin.class);
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); boolean nsUploadOnly = SP.getBoolean(R.string.key_ns_upload_only, false);
boolean nsUploadOnly = SP.getBoolean("ns_upload_only", false);
if (intent != null) { if (intent != null) {
final String action = intent.getAction(); final String action = intent.getAction();
@ -356,7 +356,7 @@ public class DataService extends IntentService {
String activeProfile = bundles.getString("activeprofile"); String activeProfile = bundles.getString("activeprofile");
String profile = bundles.getString("profile"); String profile = bundles.getString("profile");
NSProfile nsProfile = new NSProfile(new JSONObject(profile), activeProfile); NSProfile nsProfile = new NSProfile(new JSONObject(profile), activeProfile);
MainApp.bus().post(new EventNewBasalProfile(nsProfile)); MainApp.bus().post(new EventNewBasalProfile(nsProfile, "NSClient"));
PumpInterface pump = MainApp.getConfigBuilder(); PumpInterface pump = MainApp.getConfigBuilder();
if (pump != null) { if (pump != null) {

View file

@ -421,6 +421,16 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
return new ArrayList<Treatment>(); return new ArrayList<Treatment>();
} }
public void delete(TempBasal tempBasal) {
try {
getDaoTempBasals().delete(tempBasal);
latestTreatmentChange = tempBasal.getTimeIndex();
} catch (SQLException e) {
e.printStackTrace();
}
scheduleTreatmentChange();
}
public List<TempTarget> getTemptargetsDataFromTime(long mills, boolean ascending) { public List<TempTarget> getTemptargetsDataFromTime(long mills, boolean ascending) {
try { try {
Dao<TempTarget, Long> daoTempTargets = getDaoTempTargets(); Dao<TempTarget, Long> daoTempTargets = getDaoTempTargets();

View file

@ -7,8 +7,10 @@ import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
*/ */
public class EventNewBasalProfile { public class EventNewBasalProfile {
public NSProfile newNSProfile = null; public NSProfile newNSProfile = null;
public String from = "";
public EventNewBasalProfile(NSProfile newProfile) { public EventNewBasalProfile(NSProfile newProfile, String from) {
newNSProfile = newProfile; newNSProfile = newProfile;
this.from = from;
} }
} }

View file

@ -618,7 +618,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
if (pump != null) { if (pump != null) {
pump.setNewBasalProfile(nsProfile); pump.setNewBasalProfile(nsProfile);
log.debug("Setting new profile: " + profile); log.debug("Setting new profile: " + profile);
MainApp.bus().post(new EventNewBasalProfile(nsProfile)); MainApp.bus().post(new EventNewBasalProfile(nsProfile, "NewNSTreatmentDialog"));
} else { } else {
log.error("No active pump selected"); log.error("No active pump selected");
} }

View file

@ -928,6 +928,28 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
} }
} }
public static void uploadOpenAPSOffline(double durationInMinutes) {
try {
Context context = MainApp.instance().getApplicationContext();
JSONObject data = new JSONObject();
data.put("eventType", "OpenAPS Offline");
data.put("duration", durationInMinutes);
data.put("created_at", DateUtil.toISOString(new Date()));
data.put("enteredBy", MainApp.instance().getString(R.string.app_name));
Bundle bundle = new Bundle();
bundle.putString("action", "dbAdd");
bundle.putString("collection", "treatments");
bundle.putString("data", data.toString());
Intent intent = new Intent(Intents.ACTION_DATABASE);
intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent);
DbLogger.dbAdd(intent, data.toString(), ConfigBuilderPlugin.class);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void uploadTempBasalStartPercent(Integer percent, double durationInMinutes) { public void uploadTempBasalStartPercent(Integer percent, double durationInMinutes) {
try { try {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());

View file

@ -156,7 +156,7 @@ public class IobCobCalculatorPlugin implements PluginBase {
private void loadBgData() { private void loadBgData() {
//log.debug("Locking loadBgData"); //log.debug("Locking loadBgData");
synchronized (dataLock) { synchronized (dataLock) {
onNewProfile(new EventNewBasalProfile(null)); onNewProfile(new EventNewBasalProfile(null, "IobCobCalculator init"));
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime((long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia)), false); bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime((long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia)), false);
log.debug("BG data loaded. Size: " + bgReadings.size()); log.debug("BG data loaded. Size: " + bgReadings.size());
} }
@ -545,6 +545,20 @@ public class IobCobCalculatorPlugin implements PluginBase {
if (profile != null) { if (profile != null) {
dia = profile.getDia(); dia = profile.getDia();
} }
if (ev.newNSProfile == null) { // on init no need of reset
return;
}
synchronized (dataLock) {
log.debug("Invalidating cached data because of new profile from " + ev.from + ". IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records");
iobTable = new LongSparseArray<>();
autosensDataTable = new LongSparseArray<>();
}
sHandler.post(new Runnable() {
@Override
public void run() {
calculateSensitivityData();
}
});
} }
// When historical data is changed (comming from NS etc) finished calculations after this date must be invalidated // When historical data is changed (comming from NS etc) finished calculations after this date must be invalidated

View file

@ -14,10 +14,12 @@ import org.slf4j.LoggerFactory;
import java.util.Date; import java.util.Date;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugin; import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugin;
import info.nightscout.androidaps.plugins.NSClientInternal.UploadQueue; import info.nightscout.androidaps.plugins.NSClientInternal.UploadQueue;
import info.nightscout.androidaps.db.DbRequest; import info.nightscout.androidaps.db.DbRequest;
import info.nightscout.utils.SP;
public class DBAccessReceiver extends BroadcastReceiver { public class DBAccessReceiver extends BroadcastReceiver {
private static Logger log = LoggerFactory.getLogger(DBAccessReceiver.class); private static Logger log = LoggerFactory.getLogger(DBAccessReceiver.class);
@ -32,6 +34,10 @@ public class DBAccessReceiver extends BroadcastReceiver {
if (!nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) { if (!nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) {
return; return;
} }
if (SP.getBoolean(R.string.key_ns_noupload, false)) {
log.debug("Upload disabled. Message dropped");
return;
}
wakeLock.acquire(); wakeLock.acquire();
try { try {
Bundle bundles = intent.getExtras(); Bundle bundles = intent.getExtras();

View file

@ -352,18 +352,20 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
@Override @Override
public boolean onContextItemSelected(MenuItem item) { public boolean onContextItemSelected(MenuItem item) {
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop(); final LoopPlugin activeloop = ConfigBuilderPlugin.getActiveLoop();
if (item.getTitle().equals(MainApp.sResources.getString(R.string.disableloop))) { if (item.getTitle().equals(MainApp.sResources.getString(R.string.disableloop))) {
activeloop.setFragmentEnabled(PluginBase.LOOP, false); activeloop.setFragmentEnabled(PluginBase.LOOP, false);
activeloop.setFragmentVisible(PluginBase.LOOP, false); activeloop.setFragmentVisible(PluginBase.LOOP, false);
MainApp.getConfigBuilder().storeSettings(); MainApp.getConfigBuilder().storeSettings();
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(60); // upload 60 min, we don;t know real duration
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.enableloop))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.enableloop))) {
activeloop.setFragmentEnabled(PluginBase.LOOP, true); activeloop.setFragmentEnabled(PluginBase.LOOP, true);
activeloop.setFragmentVisible(PluginBase.LOOP, true); activeloop.setFragmentVisible(PluginBase.LOOP, true);
MainApp.getConfigBuilder().storeSettings(); MainApp.getConfigBuilder().storeSettings();
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(0);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.resume))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.resume))) {
activeloop.suspendTo(0L); activeloop.suspendTo(0L);
@ -377,22 +379,27 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
ConfigBuilderPlugin.uploadOpenAPSOffline(0);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor1h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor1h))) {
activeloop.suspendTo(new Date().getTime() + 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 60L * 60 * 1000);
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(60);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor2h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor2h))) {
activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000);
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(120);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor3h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor3h))) {
activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000);
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(180);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor10h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor10h))) {
activeloop.suspendTo(new Date().getTime() + 10 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 10 * 60L * 60 * 1000);
scheduleUpdateGUI("suspendmenu"); scheduleUpdateGUI("suspendmenu");
ConfigBuilderPlugin.uploadOpenAPSOffline(600);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor30m))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor30m))) {
activeloop.suspendTo(new Date().getTime() + 30L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 30L * 60 * 1000);
@ -406,6 +413,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
ConfigBuilderPlugin.uploadOpenAPSOffline(30);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor1h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor1h))) {
activeloop.suspendTo(new Date().getTime() + 1 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 1 * 60L * 60 * 1000);
@ -419,6 +427,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
ConfigBuilderPlugin.uploadOpenAPSOffline(60);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor2h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor2h))) {
activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000);
@ -432,6 +441,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
ConfigBuilderPlugin.uploadOpenAPSOffline(120);
return true; return true;
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor3h))) { } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor3h))) {
activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000); activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000);
@ -445,6 +455,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
ConfigBuilderPlugin.uploadOpenAPSOffline(180);
return true; return true;
} }

View file

@ -391,7 +391,7 @@ public class ExecutionService extends Service {
return true; return true;
} }
public boolean bolus(Double amount, int carbs, Treatment t) { public boolean bolus(double amount, int carbs, Treatment t) {
bolusingTreatment = t; bolusingTreatment = t;
MsgBolusStart start = new MsgBolusStart(amount); MsgBolusStart start = new MsgBolusStart(amount);
MsgBolusStop stop = new MsgBolusStop(amount, t); MsgBolusStop stop = new MsgBolusStop(amount, t);
@ -405,6 +405,7 @@ public class ExecutionService extends Service {
} }
MsgBolusProgress progress = new MsgBolusProgress(amount, t); // initialize static variables MsgBolusProgress progress = new MsgBolusProgress(amount, t); // initialize static variables
MainApp.bus().post(new EventDanaRBolusStart()); MainApp.bus().post(new EventDanaRBolusStart());
long startTime = new Date().getTime();
if (!stop.stopped) { if (!stop.stopped) {
mSerialIOThread.sendMessage(start); mSerialIOThread.sendMessage(start);
@ -422,7 +423,23 @@ public class ExecutionService extends Service {
} }
waitMsec(300); waitMsec(300);
bolusingTreatment = null; bolusingTreatment = null;
getPumpStatus(); // try to find real amount if bolusing was interrupted or comm failed
if (t.insulin != amount) {
disconnect("bolusingInterrupted");
long now = new Date().getTime();
long estimatedBolusEnd = (long) (startTime + amount / 5d * 60 * 1000); // std delivery rate 5 U/min
waitMsec(Math.max(5000, estimatedBolusEnd - now + 3000));
connect("bolusingInterrupted");
getPumpStatus();
if (danaRPump.lastBolusTime.getTime() > now - 60 * 1000L) { // last bolus max 1 min old
t.insulin = danaRPump.lastBolusAmount;
log.debug("Used bolus amount from history: " + danaRPump.lastBolusAmount);
} else {
log.debug("Bolus amount in history too old: " + danaRPump.lastBolusTime.toLocaleString());
}
} else {
getPumpStatus();
}
return true; return true;
} }

View file

@ -29,6 +29,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin; import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
@ -42,6 +43,8 @@ import info.nightscout.utils.SP;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
import info.nightscout.utils.XdripCalibrations; import info.nightscout.utils.XdripCalibrations;
import static info.nightscout.androidaps.R.string.profile;
/** /**
* Created by mike on 05.08.2016. * Created by mike on 05.08.2016.
*/ */
@ -51,11 +54,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
private static boolean fragmentEnabled = false; private static boolean fragmentEnabled = false;
private static boolean fragmentVisible = true; private static boolean fragmentVisible = true;
final long CONFIRM_TIMEOUT = 5 * 60 * 1000L; private final long CONFIRM_TIMEOUT = 5 * 60 * 1000L;
List<String> allowedNumbers = new ArrayList<String>(); private List<String> allowedNumbers = new ArrayList<String>();
public class Sms { class Sms {
String phoneNumber; String phoneNumber;
String text; String text;
Date date; Date date;
@ -69,21 +72,21 @@ public class SmsCommunicatorPlugin implements PluginBase {
double calibrationRequested = 0d; double calibrationRequested = 0d;
int duration = 0; int duration = 0;
public Sms(SmsMessage message) { Sms(SmsMessage message) {
phoneNumber = message.getOriginatingAddress(); phoneNumber = message.getOriginatingAddress();
text = message.getMessageBody(); text = message.getMessageBody();
date = new Date(message.getTimestampMillis()); date = new Date(message.getTimestampMillis());
received = true; received = true;
} }
public Sms(String phoneNumber, String text, Date date) { Sms(String phoneNumber, String text, Date date) {
this.phoneNumber = phoneNumber; this.phoneNumber = phoneNumber;
this.text = text; this.text = text;
this.date = date; this.date = date;
sent = true; sent = true;
} }
public Sms(String phoneNumber, String text, Date date, String confirmCode) { Sms(String phoneNumber, String text, Date date, String confirmCode) {
this.phoneNumber = phoneNumber; this.phoneNumber = phoneNumber;
this.text = text; this.text = text;
this.date = date; this.date = date;
@ -96,12 +99,12 @@ public class SmsCommunicatorPlugin implements PluginBase {
} }
} }
Sms cancelTempBasalWaitingForConfirmation = null; private Sms cancelTempBasalWaitingForConfirmation = null;
Sms tempBasalWaitingForConfirmation = null; private Sms tempBasalWaitingForConfirmation = null;
Sms bolusWaitingForConfirmation = null; private Sms bolusWaitingForConfirmation = null;
Sms calibrationWaitingForConfirmation = null; private Sms calibrationWaitingForConfirmation = null;
Sms suspendWaitingForConfirmation = null; private Sms suspendWaitingForConfirmation = null;
Date lastRemoteBolusTime = new Date(0); private Date lastRemoteBolusTime = new Date(0);
ArrayList<Sms> messages = new ArrayList<>(); ArrayList<Sms> messages = new ArrayList<>();
@ -187,7 +190,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
} }
} }
boolean isAllowedNumber(String number) { private boolean isAllowedNumber(String number) {
for (String num : allowedNumbers) { for (String num : allowedNumbers) {
if (num.equals(number)) return true; if (num.equals(number)) return true;
} }
@ -199,8 +202,8 @@ public class SmsCommunicatorPlugin implements PluginBase {
Object[] pdus = (Object[]) ev.bundle.get("pdus"); Object[] pdus = (Object[]) ev.bundle.get("pdus");
// For every SMS message received // For every SMS message received
for (int i = 0; i < pdus.length; i++) { for (Object pdu : pdus) {
SmsMessage message = SmsMessage.createFromPdu((byte[]) pdus[i]); SmsMessage message = SmsMessage.createFromPdu((byte[]) pdu);
processSms(new Sms(message)); processSms(new Sms(message));
} }
} }
@ -233,25 +236,30 @@ public class SmsCommunicatorPlugin implements PluginBase {
BgReading actualBG = GlucoseStatus.actualBg(); BgReading actualBG = GlucoseStatus.actualBg();
BgReading lastBG = GlucoseStatus.lastBg(); BgReading lastBG = GlucoseStatus.lastBg();
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); if (ConfigBuilderPlugin.getActiveProfile() == null || ConfigBuilderPlugin.getActiveProfile().getProfile() == null) {
String units = profile.getUnits(); reply = MainApp.sResources.getString(R.string.noprofile);
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
return;
}
Long agoMsec = new Date().getTime() - lastBG.timeIndex; NSProfile profile = ConfigBuilderPlugin.getActiveProfile().getProfile();
int agoMin = (int) (agoMsec / 60d / 1000d); String units = profile.getUnits();
if (actualBG != null) { if (actualBG != null) {
reply = MainApp.sResources.getString(R.string.sms_actualbg) + " " + actualBG.valueToUnitsToString(units) + ", "; reply = MainApp.sResources.getString(R.string.sms_actualbg) + " " + actualBG.valueToUnitsToString(units) + ", ";
} else if (lastBG != null) { } else if (lastBG != null) {
Long agoMsec = new Date().getTime() - lastBG.timeIndex;
int agoMin = (int) (agoMsec / 60d / 1000d);
reply = MainApp.sResources.getString(R.string.sms_lastbg) + " " + lastBG.valueToUnitsToString(units) + " " + String.format(MainApp.sResources.getString(R.string.sms_minago), agoMin) + ", "; reply = MainApp.sResources.getString(R.string.sms_lastbg) + " " + lastBG.valueToUnitsToString(units) + " " + String.format(MainApp.sResources.getString(R.string.sms_minago), agoMin) + ", ";
} }
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData(); GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
if (glucoseStatus != null) if (glucoseStatus != null)
reply += MainApp.sResources.getString(R.string.sms_delta) + " " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units + ", "; reply += MainApp.sResources.getString(R.string.sms_delta) + " " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units + ", ";
MainApp.getConfigBuilder().getActiveTreatments().updateTotalIOB(); ConfigBuilderPlugin.getActiveTreatments().updateTotalIOB();
IobTotal bolusIob = MainApp.getConfigBuilder().getActiveTreatments().getLastCalculation().round(); IobTotal bolusIob = ConfigBuilderPlugin.getActiveTreatments().getLastCalculation().round();
MainApp.getConfigBuilder().getActiveTempBasals().updateTotalIOB(); ConfigBuilderPlugin.getActiveTempBasals().updateTotalIOB();
IobTotal basalIob = MainApp.getConfigBuilder().getActiveTempBasals().getLastCalculation().round(); IobTotal basalIob = ConfigBuilderPlugin.getActiveTempBasals().getLastCalculation().round();
reply += MainApp.sResources.getString(R.string.sms_iob) + " " + DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U (" reply += MainApp.sResources.getString(R.string.sms_iob) + " " + DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
+ MainApp.sResources.getString(R.string.sms_bolus) + " " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U " + MainApp.sResources.getString(R.string.sms_bolus) + " " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U "
@ -303,10 +311,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
Answers.getInstance().logCustom(new CustomEvent("SMS_Loop_Status")); Answers.getInstance().logCustom(new CustomEvent("SMS_Loop_Status"));
break; break;
case "RESUME": case "RESUME":
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop(); final LoopPlugin activeloop = ConfigBuilderPlugin.getActiveLoop();
activeloop.suspendTo(0); activeloop.suspendTo(0);
MainApp.bus().post(new EventRefreshGui(false)); MainApp.bus().post(new EventRefreshGui(false));
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_loopresumed)); ConfigBuilderPlugin.uploadOpenAPSOffline(0);
reply = MainApp.sResources.getString(R.string.smscommunicator_loopresumed);
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date())); sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
Answers.getInstance().logCustom(new CustomEvent("SMS_Loop_Resume")); Answers.getInstance().logCustom(new CustomEvent("SMS_Loop_Resume"));
break; break;
@ -453,7 +462,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
PumpInterface pumpInterface = MainApp.getConfigBuilder(); PumpInterface pumpInterface = MainApp.getConfigBuilder();
if (pumpInterface != null) { if (pumpInterface != null) {
danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class); danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class);
PumpEnactResult result = pumpInterface.deliverTreatment(MainApp.getConfigBuilder().getActiveInsulin(), bolusWaitingForConfirmation.bolusRequested, 0, null); PumpEnactResult result = pumpInterface.deliverTreatment(ConfigBuilderPlugin.getActiveInsulin(), bolusWaitingForConfirmation.bolusRequested, 0, null);
if (result.success) { if (result.success) {
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_bolusdelivered), result.bolusDelivered); reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
if (danaRPlugin != null) if (danaRPlugin != null)
@ -494,7 +503,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class); danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class);
PumpEnactResult result = pumpInterface.cancelTempBasal(); PumpEnactResult result = pumpInterface.cancelTempBasal();
if (result.success) { if (result.success) {
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_tempbasalcanceled)); reply = MainApp.sResources.getString(R.string.smscommunicator_tempbasalcanceled);
if (danaRPlugin != null) if (danaRPlugin != null)
reply += "\n" + danaRPlugin.shortStatus(true); reply += "\n" + danaRPlugin.shortStatus(true);
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date())); sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
@ -510,7 +519,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
calibrationWaitingForConfirmation.processed = true; calibrationWaitingForConfirmation.processed = true;
boolean result = XdripCalibrations.sendIntent(calibrationWaitingForConfirmation.calibrationRequested); boolean result = XdripCalibrations.sendIntent(calibrationWaitingForConfirmation.calibrationRequested);
if (result) { if (result) {
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_calibrationsent)); reply = MainApp.sResources.getString(R.string.smscommunicator_calibrationsent);
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date())); sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
} else { } else {
reply = MainApp.sResources.getString(R.string.smscommunicator_calibrationfailed); reply = MainApp.sResources.getString(R.string.smscommunicator_calibrationfailed);
@ -519,10 +528,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
} else if (suspendWaitingForConfirmation != null && !suspendWaitingForConfirmation.processed && } else if (suspendWaitingForConfirmation != null && !suspendWaitingForConfirmation.processed &&
suspendWaitingForConfirmation.confirmCode.equals(splited[0]) && new Date().getTime() - suspendWaitingForConfirmation.date.getTime() < CONFIRM_TIMEOUT) { suspendWaitingForConfirmation.confirmCode.equals(splited[0]) && new Date().getTime() - suspendWaitingForConfirmation.date.getTime() < CONFIRM_TIMEOUT) {
suspendWaitingForConfirmation.processed = true; suspendWaitingForConfirmation.processed = true;
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop(); final LoopPlugin activeloop = ConfigBuilderPlugin.getActiveLoop();
activeloop.suspendTo(new Date().getTime() + suspendWaitingForConfirmation.duration * 60L * 1000); activeloop.suspendTo(new Date().getTime() + suspendWaitingForConfirmation.duration * 60L * 1000);
ConfigBuilderPlugin.uploadOpenAPSOffline(suspendWaitingForConfirmation.duration * 60);
MainApp.bus().post(new EventRefreshGui(false)); MainApp.bus().post(new EventRefreshGui(false));
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_loopsuspended)); reply = MainApp.sResources.getString(R.string.smscommunicator_loopsuspended);
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date())); sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
} else { } else {
sendSMS(new Sms(receivedSms.phoneNumber, MainApp.sResources.getString(R.string.smscommunicator_unknowncommand), new Date())); sendSMS(new Sms(receivedSms.phoneNumber, MainApp.sResources.getString(R.string.smscommunicator_unknowncommand), new Date()));
@ -542,14 +552,14 @@ public class SmsCommunicatorPlugin implements PluginBase {
} }
} }
public void sendSMSToAllNumbers(Sms sms) { private void sendSMSToAllNumbers(Sms sms) {
for (String number : allowedNumbers) { for (String number : allowedNumbers) {
sms.phoneNumber = number; sms.phoneNumber = number;
sendSMS(sms); sendSMS(sms);
} }
} }
public void sendSMS(Sms sms) { private void sendSMS(Sms sms) {
SmsManager smsManager = SmsManager.getDefault(); SmsManager smsManager = SmsManager.getDefault();
sms.text = stripAccents(sms.text); sms.text = stripAccents(sms.text);
if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139); if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139);
@ -584,7 +594,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
suspendWaitingForConfirmation = null; suspendWaitingForConfirmation = null;
} }
public static String stripAccents(String s) { private static String stripAccents(String s) {
s = Normalizer.normalize(s, Normalizer.Form.NFD); s = Normalizer.normalize(s, Normalizer.Form.NFD);
s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return s; return s;

View file

@ -1,9 +1,13 @@
package info.nightscout.androidaps.plugins.TempBasals; package info.nightscout.androidaps.plugins.TempBasals;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Paint;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.CardView; import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
@ -13,6 +17,8 @@ import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe; import com.squareup.otto.Subscribe;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -44,7 +50,9 @@ public class TempBasalsFragment extends Fragment {
TextView tempBasalTotalView; TextView tempBasalTotalView;
public static class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.TempBasalsViewHolder> { Context context;
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.TempBasalsViewHolder> {
List<TempBasal> tempBasalList; List<TempBasal> tempBasalList;
@ -55,8 +63,7 @@ public class TempBasalsFragment extends Fragment {
@Override @Override
public TempBasalsViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { public TempBasalsViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.tempbasals_item, viewGroup, false); View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.tempbasals_item, viewGroup, false);
TempBasalsViewHolder tempBasalsViewHolder = new TempBasalsViewHolder(v); return new TempBasalsViewHolder(v);
return tempBasalsViewHolder;
} }
@Override @Override
@ -89,6 +96,7 @@ public class TempBasalsFragment extends Fragment {
holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorAffectingIOB)); holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorAffectingIOB));
else else
holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground)); holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground));
holder.remove.setTag(tempBasal);
} }
@Override @Override
@ -101,7 +109,7 @@ public class TempBasalsFragment extends Fragment {
super.onAttachedToRecyclerView(recyclerView); super.onAttachedToRecyclerView(recyclerView);
} }
public static class TempBasalsViewHolder extends RecyclerView.ViewHolder { public class TempBasalsViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
CardView cv; CardView cv;
TextView date; TextView date;
TextView duration; TextView duration;
@ -113,6 +121,7 @@ public class TempBasalsFragment extends Fragment {
TextView iob; TextView iob;
TextView extendedFlag; TextView extendedFlag;
LinearLayout dateLinearLayout; LinearLayout dateLinearLayout;
TextView remove;
TempBasalsViewHolder(View itemView) { TempBasalsViewHolder(View itemView) {
super(itemView); super(itemView);
@ -127,6 +136,36 @@ public class TempBasalsFragment extends Fragment {
iob = (TextView) itemView.findViewById(R.id.tempbasals_iob); iob = (TextView) itemView.findViewById(R.id.tempbasals_iob);
extendedFlag = (TextView) itemView.findViewById(R.id.tempbasals_extendedflag); extendedFlag = (TextView) itemView.findViewById(R.id.tempbasals_extendedflag);
dateLinearLayout = (LinearLayout) itemView.findViewById(R.id.tempbasals_datelinearlayout); dateLinearLayout = (LinearLayout) itemView.findViewById(R.id.tempbasals_datelinearlayout);
remove = (TextView) itemView.findViewById(R.id.tempbasals_remove);
remove.setOnClickListener(this);
remove.setPaintFlags(remove.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
}
@Override
public void onClick(View v) {
final TempBasal tempBasal = (TempBasal) v.getTag();
switch (v.getId()) {
case R.id.tempbasals_remove:
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(tempBasal.timeStart));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// TODO: handle this in NS too
//final String _id = tempBasal._id;
//if (_id != null && !_id.equals("")) {
// MainApp.getConfigBuilder().removeCareportalEntryFromNS(_id);
//}
MainApp.getDbHelper().delete(tempBasal);
tempBasalsPlugin.initializeData();
updateGUI();
Answers.getInstance().logCustom(new CustomEvent("RemoveTempBasal"));
}
});
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
builder.show();
break;
}
} }
} }
} }
@ -145,6 +184,9 @@ public class TempBasalsFragment extends Fragment {
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
tempBasalTotalView = (TextView) view.findViewById(R.id.tempbasals_totaltempiob); tempBasalTotalView = (TextView) view.findViewById(R.id.tempbasals_totaltempiob);
context = getContext();
updateGUI(); updateGUI();
return view; return view;
} }

View file

@ -112,7 +112,7 @@ public class TempBasalsPlugin implements PluginBase, TempBasalsInterface {
return PluginBase.TEMPBASAL; return PluginBase.TEMPBASAL;
} }
private void initializeData() { public void initializeData() {
double dia = 3; double dia = 3;
if (MainApp.getConfigBuilder().getActiveProfile() != null && MainApp.getConfigBuilder().getActiveProfile().getProfile() != null) if (MainApp.getConfigBuilder().getActiveProfile() != null && MainApp.getConfigBuilder().getActiveProfile().getProfile() != null)
dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia(); dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia();

View file

@ -36,6 +36,7 @@ import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange; import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SP;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
/** /**
@ -194,8 +195,7 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis
public void onClick(View view) { public void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.temptargetrange_refreshfromnightscout: case R.id.temptargetrange_refreshfromnightscout:
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean nsUploadOnly = SP.getBoolean(R.string.key_ns_upload_only, false);
boolean nsUploadOnly = SP.getBoolean("ns_upload_only", false);
if (nsUploadOnly) { if (nsUploadOnly) {
ToastUtils.showToastInUiThread(getContext(), this.getContext().getString(R.string.ns_upload_only_enabled)); ToastUtils.showToastInUiThread(getContext(), this.getContext().getString(R.string.ns_upload_only_enabled));
} else { } else {

View file

@ -38,9 +38,11 @@ import info.nightscout.androidaps.data.Iob;
import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventTreatmentChange; import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.interfaces.InsulinInterface; import info.nightscout.androidaps.interfaces.InsulinInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SP;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
public class TreatmentsFragment extends Fragment implements View.OnClickListener { public class TreatmentsFragment extends Fragment implements View.OnClickListener {
@ -72,16 +74,15 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
@Override @Override
public TreatmentsViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { public TreatmentsViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.treatments_item, viewGroup, false); View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.treatments_item, viewGroup, false);
TreatmentsViewHolder treatmentsViewHolder = new TreatmentsViewHolder(v); return new TreatmentsViewHolder(v);
return treatmentsViewHolder;
} }
@Override @Override
public void onBindViewHolder(TreatmentsViewHolder holder, int position) { public void onBindViewHolder(TreatmentsViewHolder holder, int position) {
if (MainApp.getConfigBuilder() == null || MainApp.getConfigBuilder().getActiveProfile() == null) // app not initialized yet if (MainApp.getConfigBuilder() == null || ConfigBuilderPlugin.getActiveProfile() == null) // app not initialized yet
return; return;
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); NSProfile profile = ConfigBuilderPlugin.getActiveProfile().getProfile();
InsulinInterface insulinInterface = MainApp.getConfigBuilder().getActiveInsulin(); InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin();
if (profile == null || insulinInterface == null) if (profile == null || insulinInterface == null)
return; return;
holder.date.setText(DateUtil.dateAndTimeString(treatments.get(position).created_at)); holder.date.setText(DateUtil.dateAndTimeString(treatments.get(position).created_at));
@ -137,7 +138,6 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final Treatment treatment = (Treatment) v.getTag(); final Treatment treatment = (Treatment) v.getTag();
final Context finalContext = context;
switch (v.getId()) { switch (v.getId()) {
case R.id.treatments_remove: case R.id.treatments_remove:
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
@ -152,7 +152,7 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
MainApp.getDbHelper().delete(treatment); MainApp.getDbHelper().delete(treatment);
treatmentsPlugin.initializeData(); treatmentsPlugin.initializeData();
updateGUI(); updateGUI();
Answers.getInstance().logCustom(new CustomEvent("RefreshTreatments")); Answers.getInstance().logCustom(new CustomEvent("RemoveTreatment"));
} }
}); });
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null); builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
@ -192,8 +192,7 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
public void onClick(View view) { public void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.treatments_reshreshfromnightscout: case R.id.treatments_reshreshfromnightscout:
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean nsUploadOnly = SP.getBoolean(R.string.key_ns_upload_only, false);
boolean nsUploadOnly = SP.getBoolean("ns_upload_only", false);
if (nsUploadOnly) { if (nsUploadOnly) {
ToastUtils.showToastInUiThread(getContext(), this.getContext().getString(R.string.ns_upload_only_enabled)); ToastUtils.showToastInUiThread(getContext(), this.getContext().getString(R.string.ns_upload_only_enabled));
} else { } else {

View file

@ -45,10 +45,6 @@ public class StatuslinePlugin implements PluginBase {
StatuslinePlugin(Context ctx) { StatuslinePlugin(Context ctx) {
this.ctx = ctx; this.ctx = ctx;
this.mPrefs = PreferenceManager.getDefaultSharedPreferences(ctx); this.mPrefs = PreferenceManager.getDefaultSharedPreferences(ctx);
if (fragmentEnabled) {
MainApp.bus().register(this);
}
} }
@Override @Override
@ -108,11 +104,15 @@ public class StatuslinePlugin implements PluginBase {
this.fragmentEnabled = fragmentEnabled; this.fragmentEnabled = fragmentEnabled;
if (fragmentEnabled) { if (fragmentEnabled) {
MainApp.bus().register(this); try {
MainApp.bus().register(this);
} catch (Exception e) {}
sendStatus(); sendStatus();
} }
else{ else{
MainApp.bus().unregister(this); try {
MainApp.bus().unregister(this);
} catch (Exception e) {}
sendStatus(); sendStatus();
} }
} }

View file

@ -19,6 +19,7 @@
<Button <Button
android:id="@+id/careportal_bgcheck" android:id="@+id/careportal_bgcheck"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_bgcheck" android:text="@string/careportal_bgcheck"
@ -29,6 +30,7 @@
<Button <Button
android:id="@+id/careportal_exercise" android:id="@+id/careportal_exercise"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_exercise" android:text="@string/careportal_exercise"
@ -39,6 +41,7 @@
<Button <Button
android:id="@+id/careportal_note" android:id="@+id/careportal_note"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_note" android:text="@string/careportal_note"
@ -49,6 +52,7 @@
<Button <Button
android:id="@+id/careportal_snackbolus" android:id="@+id/careportal_snackbolus"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_snackbolus" android:text="@string/careportal_snackbolus"
@ -59,6 +63,7 @@
<Button <Button
android:id="@+id/careportal_mealbolus" android:id="@+id/careportal_mealbolus"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_mealbolus" android:text="@string/careportal_mealbolus"
@ -69,6 +74,7 @@
<Button <Button
android:id="@+id/careportal_correctionbolus" android:id="@+id/careportal_correctionbolus"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_correctionbolus" android:text="@string/careportal_correctionbolus"
@ -79,6 +85,7 @@
<Button <Button
android:id="@+id/careportal_carbscorrection" android:id="@+id/careportal_carbscorrection"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_carbscorrection" android:text="@string/careportal_carbscorrection"
@ -89,6 +96,7 @@
<Button <Button
android:id="@+id/careportal_combobolus" android:id="@+id/careportal_combobolus"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_combobolus" android:text="@string/careportal_combobolus"
@ -99,6 +107,7 @@
<Button <Button
android:id="@+id/careportal_tempbasalstart" android:id="@+id/careportal_tempbasalstart"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_tempbasalstart" android:text="@string/careportal_tempbasalstart"
@ -109,6 +118,7 @@
<Button <Button
android:id="@+id/careportal_tempbasalend" android:id="@+id/careportal_tempbasalend"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_tempbasalend" android:text="@string/careportal_tempbasalend"
@ -119,6 +129,7 @@
<Button <Button
android:id="@+id/careportal_announcement" android:id="@+id/careportal_announcement"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_announcement" android:text="@string/careportal_announcement"
@ -129,6 +140,7 @@
<Button <Button
android:id="@+id/careportal_question" android:id="@+id/careportal_question"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_question" android:text="@string/careportal_question"
@ -139,6 +151,7 @@
<Button <Button
android:id="@+id/careportal_pumpsitechange" android:id="@+id/careportal_pumpsitechange"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_pumpsitechange" android:text="@string/careportal_pumpsitechange"
@ -149,6 +162,7 @@
<Button <Button
android:id="@+id/careportal_cgmsensorinsert" android:id="@+id/careportal_cgmsensorinsert"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_cgmsensorinsert" android:text="@string/careportal_cgmsensorinsert"
@ -159,6 +173,7 @@
<Button <Button
android:id="@+id/careportal_cgmsensorstart" android:id="@+id/careportal_cgmsensorstart"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_cgmsensorstart" android:text="@string/careportal_cgmsensorstart"
@ -169,6 +184,7 @@
<Button <Button
android:id="@+id/careportal_insulincartridgechange" android:id="@+id/careportal_insulincartridgechange"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_insulincartridgechange" android:text="@string/careportal_insulincartridgechange"
@ -179,6 +195,7 @@
<Button <Button
android:id="@+id/careportal_profileswitch" android:id="@+id/careportal_profileswitch"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_profileswitch" android:text="@string/careportal_profileswitch"
@ -189,6 +206,7 @@
<Button <Button
android:id="@+id/careportal_openapsoffline" android:id="@+id/careportal_openapsoffline"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_openapsoffline" android:text="@string/careportal_openapsoffline"
@ -199,6 +217,7 @@
<Button <Button
android:id="@+id/careportal_temporarytarget" android:id="@+id/careportal_temporarytarget"
style="@style/ButtonSmallFontStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/careportal_temporarytarget" android:text="@string/careportal_temporarytarget"

View file

@ -47,6 +47,7 @@
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:text="{fa-bluetooth-b}" android:text="{fa-bluetooth-b}"
android:textColor="@android:color/white"
android:textSize="20dp" /> android:textSize="20dp" />
@ -92,6 +93,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="20dp" /> android:textSize="20dp" />
@ -137,6 +139,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -181,6 +184,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -225,6 +229,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -269,6 +274,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -313,6 +319,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -357,6 +364,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -401,6 +409,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -445,6 +454,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
@ -489,6 +499,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>

View file

@ -23,96 +23,320 @@
android:textStyle="bold" android:textStyle="bold"
android:gravity="center_horizontal" /> android:gravity="center_horizontal" />
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nsprofileview_activeprofile_label" android:orientation="horizontal">
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView <TextView
android:id="@+id/profileview_activeprofile" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:layout_marginLeft="25dp" /> android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_activeprofile_label"
android:textSize="14sp" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="5dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nsprofileview_units_label" android:layout_weight="0"
android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center_horizontal"
android:layout_marginLeft="10dp" /> android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView <TextView
android:id="@+id/profileview_units" android:id="@+id/profileview_activeprofile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" /> android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView </LinearLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/nsprofileview_dia_label"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView <View
android:id="@+id/profileview_dia" android:layout_width="fill_parent"
android:layout_width="match_parent" android:layout_height="2dip"
android:layout_height="wrap_content" android:layout_marginBottom="5dp"
android:layout_marginLeft="25dp" /> android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nsprofileview_ic_label" android:orientation="horizontal">
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView <TextView
android:id="@+id/profileview_ic" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:layout_marginLeft="25dp" /> android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_units_label"
android:textSize="14sp" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="5dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nsprofileview_isf_label" android:layout_weight="0"
android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center_horizontal"
android:layout_marginLeft="10dp" /> android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView <TextView
android:id="@+id/profileview_isf" android:id="@+id/profileview_units"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" /> android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView </LinearLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/nsprofileview_basal_label"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView <View
android:id="@+id/profileview_basal" android:layout_width="fill_parent"
android:layout_width="match_parent" android:layout_height="2dip"
android:layout_height="wrap_content" android:layout_marginBottom="5dp"
android:layout_marginLeft="25dp" /> android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nsprofileview_target_label" android:orientation="horizontal">
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView <TextView
android:id="@+id/profileview_target" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_dia_label"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/profileview_dia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" /> android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_ic_label"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/profileview_ic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_isf_label"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/profileview_isf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_basal_label"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/profileview_basal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/nsprofileview_target_label"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/profileview_target"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
<Button <Button
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -168,6 +168,15 @@
android:text="0.12 U" android:text="0.12 U"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView
android:id="@+id/tempbasals_remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/overview_quickwizard_item_remove_button"
android:textAlignment="viewEnd"
android:textColor="@android:color/holo_orange_light" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -135,10 +135,11 @@
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:text="@string/overview_quickwizard_item_remove_button" android:id="@+id/treatments_remove"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/treatments_remove" android:layout_weight="1"
android:text="@string/overview_quickwizard_item_remove_button"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@android:color/holo_orange_light" /> android:textColor="@android:color/holo_orange_light" />

View file

@ -84,13 +84,13 @@
<string name="noprofile">Не е зареден профил от NS</string> <string name="noprofile">Не е зареден профил от NS</string>
<string name="ns_sync_use_absolute_title">Използване на абсолютни стойности</string> <string name="ns_sync_use_absolute_title">Използване на абсолютни стойности</string>
<string name="nsclient">NSClient</string> <string name="nsclient">NSClient</string>
<string name="nsprofileview_activeprofile_label">Активен профил:</string> <string name="nsprofileview_activeprofile_label">Активен профил</string>
<string name="nsprofileview_basal_label">Базални стойности:</string> <string name="nsprofileview_basal_label">Базални стойности:</string>
<string name="nsprofileview_dia_label">DIA (Време на действие на инсулина):</string> <string name="nsprofileview_dia_label">DIA (Време на действие на инсулина):</string>
<string name="nsprofileview_ic_label">IC (Инсулин/въглехидр.):</string> <string name="nsprofileview_ic_label">IC (Инсулин/въглехидр.):</string>
<string name="noprofileset">НЕ Е ЗАДАДЕН ПРОФИЛ</string> <string name="noprofileset">НЕ Е ЗАДАДЕН ПРОФИЛ</string>
<string name="nsprofileview_target_label">Целeва КЗ:</string> <string name="nsprofileview_target_label">Целeва КЗ:</string>
<string name="nsprofileview_units_label">Единици:</string> <string name="nsprofileview_units_label">Единици</string>
<string name="objectives">Цели</string> <string name="objectives">Цели</string>
<string name="objectives_button_start">Старт</string> <string name="objectives_button_start">Старт</string>
<string name="objectives_button_verify">Проверка</string> <string name="objectives_button_verify">Проверка</string>

View file

@ -84,13 +84,13 @@
<string name="noprofile">Dosud nebyl načten profil z NS</string> <string name="noprofile">Dosud nebyl načten profil z NS</string>
<string name="ns_sync_use_absolute_title">Vždy použít absolutní hodnoty bazálu</string> <string name="ns_sync_use_absolute_title">Vždy použít absolutní hodnoty bazálu</string>
<string name="nsclient">NSClient</string> <string name="nsclient">NSClient</string>
<string name="nsprofileview_activeprofile_label">Aktivní profil:</string> <string name="nsprofileview_activeprofile_label">Aktivní profil</string>
<string name="nsprofileview_basal_label">Bazál:</string> <string name="nsprofileview_basal_label">Bazál</string>
<string name="nsprofileview_dia_label">Trvání inzulínu:</string> <string name="nsprofileview_dia_label">Doba působnosti inzulínu</string>
<string name="nsprofileview_ic_label">Inzulínosacharidový poměr:</string> <string name="nsprofileview_ic_label">Inzulínosacharidový poměr</string>
<string name="noprofileset">ŽÁDNÝ PROFIL NENASTAVEN</string> <string name="noprofileset">ŽÁDNÝ PROFIL NENASTAVEN</string>
<string name="nsprofileview_target_label">Cíl:</string> <string name="nsprofileview_target_label">Cíl</string>
<string name="nsprofileview_units_label">Jednotky:</string> <string name="nsprofileview_units_label">Jednotky</string>
<string name="objectives">Cíle</string> <string name="objectives">Cíle</string>
<string name="objectives_button_start">Začátek</string> <string name="objectives_button_start">Začátek</string>
<string name="objectives_button_verify">Kontrola</string> <string name="objectives_button_verify">Kontrola</string>
@ -395,24 +395,24 @@
<string name="short_avgdelta">Krátkodobý průměr</string> <string name="short_avgdelta">Krátkodobý průměr</string>
<string name="temptargetrange">Dočasný cíl</string> <string name="temptargetrange">Dočasný cíl</string>
<string name="temptargetrange_refreshfromnightscout">Obnovit dočasné cíle z NS</string> <string name="temptargetrange_refreshfromnightscout">Obnovit dočasné cíle z NS</string>
<string name="actions_shortname">" "</string> <string name="actions_shortname">"AKCE"</string>
<string name="wear_shortname">" "</string> <string name="wear_shortname">"WEAR"</string>
<string name="virtualpump_shortname">ViPu</string> <string name="virtualpump_shortname">VPUM</string>
<string name="treatments_shortname">Oš</string> <string name="treatments_shortname">OŠET</string>
<string name="temptargetrange_shortname">" "</string> <string name="temptargetrange_shortname">"CROZ"</string>
<string name="tempbasals_shortname">" "</string> <string name="tempbasals_shortname">"DBAZ"</string>
<string name="smscommunicator_shortname">SMS</string> <string name="smscommunicator_shortname">SMS</string>
<string name="simpleprofile_shortname">JP</string> <string name="simpleprofile_shortname">JPRO</string>
<string name="profileviewer_shortname">" "</string> <string name="profileviewer_shortname">"PROF"</string>
<string name="overview_shortname">Přehl</string> <string name="overview_shortname">PŘEH</string>
<string name="objectives_shortname">Cíle</string> <string name="objectives_shortname">CÍLE</string>
<string name="oaps_shortname">" "</string> <string name="oaps_shortname">"OAPS"</string>
<string name="loop_shortname">Smyč</string> <string name="loop_shortname">SMYČ</string>
<string name="localprofile_shortname">LP</string> <string name="localprofile_shortname">MPRF</string>
<string name="danarpump_shortname">Dana</string> <string name="danarpump_shortname">DANA</string>
<string name="configbuilder_shortname">Konf</string> <string name="configbuilder_shortname">KONF</string>
<string name="circadian_percentage_profile_shortname">CPP</string> <string name="circadian_percentage_profile_shortname">CPP</string>
<string name="careportal_shortname">Péče</string> <string name="careportal_shortname">PÉČE</string>
<string name="advancedsettings_title">Rozšířené nastavení</string> <string name="advancedsettings_title">Rozšířené nastavení</string>
<string name="always_use_shortavg">Vždy používat krátkodobý průměrný rozdíl glykémií místo rozdílu posledních 2 hodnot</string> <string name="always_use_shortavg">Vždy používat krátkodobý průměrný rozdíl glykémií místo rozdílu posledních 2 hodnot</string>
<string name="always_use_shortavg_summary">Výhodné, pokud data z xDripu obsahují velký šum</string> <string name="always_use_shortavg_summary">Výhodné, pokud data z xDripu obsahují velký šum</string>

View file

@ -63,13 +63,13 @@
<string name="nav_backup">Backup</string> <string name="nav_backup">Backup</string>
<string name="nav_preferences">Einstellungen</string> <string name="nav_preferences">Einstellungen</string>
<string name="nsclient">NSClient</string> <string name="nsclient">NSClient</string>
<string name="nsprofileview_activeprofile_label">Aktives Profil:</string> <string name="nsprofileview_activeprofile_label">Aktives Profil</string>
<string name="nsprofileview_basal_label">Basal</string> <string name="nsprofileview_basal_label">Basal</string>
<string name="nsprofileview_dia_label">DIA:</string> <string name="nsprofileview_dia_label">DIA</string>
<string name="nsprofileview_ic_label">IC:</string> <string name="nsprofileview_ic_label">IC</string>
<string name="nsprofileview_isf_label">ISF:</string> <string name="nsprofileview_isf_label">ISF</string>
<string name="nsprofileview_target_label">Ziel:</string> <string name="nsprofileview_target_label">Ziel</string>
<string name="nsprofileview_units_label">Einheiten:</string> <string name="nsprofileview_units_label">Einheiten</string>
<string name="objectives_button_start">Start</string> <string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Verifizieren</string> <string name="objectives_button_verify">Verifizieren</string>
<string name="openapsma">OpenAPS MA</string> <string name="openapsma">OpenAPS MA</string>

View file

@ -17,13 +17,13 @@
<string name="objectives_gate_label_string">Meta:</string> <string name="objectives_gate_label_string">Meta:</string>
<string name="objectives_button_start">Inicio</string> <string name="objectives_button_start">Inicio</string>
<string name="objectives_button_verify">Verificar</string> <string name="objectives_button_verify">Verificar</string>
<string name="nsprofileview_units_label">Unidades:</string> <string name="nsprofileview_units_label">Unidades</string>
<string name="nsprofileview_dia_label">DIA (Duración Insulina Activa):</string> <string name="nsprofileview_dia_label">DIA (Duración Insulina Activa)</string>
<string name="nsprofileview_activeprofile_label">Perfil activo:</string> <string name="nsprofileview_activeprofile_label">Perfil activo</string>
<string name="nsprofileview_ic_label">IC (Insulina/Carbohidratos Ratio):</string> <string name="nsprofileview_ic_label">IC (Insulina/Carbohidratos Ratio)</string>
<string name="nsprofileview_isf_label">ISF (Factor Sensibilidad Insulina):</string> <string name="nsprofileview_isf_label">ISF (Factor Sensibilidad Insulina)</string>
<string name="nsprofileview_basal_label">Dosis Basal:</string> <string name="nsprofileview_basal_label">Dosis Basal</string>
<string name="nsprofileview_target_label">Objetivo:</string> <string name="nsprofileview_target_label">Objetivo</string>
<string name="noprofileset">PERFIL NO ACTIVO</string> <string name="noprofileset">PERFIL NO ACTIVO</string>
<string name="treatments_insulin_label_string">Insulina:</string> <string name="treatments_insulin_label_string">Insulina:</string>
<string name="treatments_carbs_label_string">Carbohidratos:</string> <string name="treatments_carbs_label_string">Carbohidratos:</string>

View file

@ -18,9 +18,9 @@
<string name="objectives_gate_label_string">방법:</string> <string name="objectives_gate_label_string">방법:</string>
<string name="objectives_button_start">시작</string> <string name="objectives_button_start">시작</string>
<string name="objectives_button_verify">확인</string> <string name="objectives_button_verify">확인</string>
<string name="nsprofileview_units_label">단위:</string> <string name="nsprofileview_units_label">단위</string>
<string name="nsprofileview_dia_label">인슐린활동시간(DIA):</string> <string name="nsprofileview_dia_label">인슐린활동시간(DIA):</string>
<string name="nsprofileview_activeprofile_label">활성 프로파일:</string> <string name="nsprofileview_activeprofile_label">활성 프로파일</string>
<string name="nsprofileview_ic_label">인슐린 대 탄수화물 비율(IC):</string> <string name="nsprofileview_ic_label">인슐린 대 탄수화물 비율(IC):</string>
<string name="nsprofileview_isf_label">인슐린 민감도(ISF):</string> <string name="nsprofileview_isf_label">인슐린 민감도(ISF):</string>
<string name="nsprofileview_basal_label">기초주입:</string> <string name="nsprofileview_basal_label">기초주입:</string>

View file

@ -19,13 +19,13 @@
<string name="objectives_gate_label_string">Gate:</string> <string name="objectives_gate_label_string">Gate:</string>
<string name="objectives_button_start">Start</string> <string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Verify</string> <string name="objectives_button_verify">Verify</string>
<string name="nsprofileview_units_label">Units:</string> <string name="nsprofileview_units_label">Units</string>
<string name="nsprofileview_dia_label">DIA:</string> <string name="nsprofileview_dia_label">DIA</string>
<string name="nsprofileview_activeprofile_label">Active profile:</string> <string name="nsprofileview_activeprofile_label">Active profile</string>
<string name="nsprofileview_ic_label">IC:</string> <string name="nsprofileview_ic_label">IC</string>
<string name="nsprofileview_isf_label">ISF:</string> <string name="nsprofileview_isf_label">ISF</string>
<string name="nsprofileview_basal_label">Basal:</string> <string name="nsprofileview_basal_label">Basal</string>
<string name="nsprofileview_target_label">Target:</string> <string name="nsprofileview_target_label">Target</string>
<string name="noprofileset">NO PROFILE SET</string> <string name="noprofileset">NO PROFILE SET</string>
<string name="treatments_insulin_label_string">Insulin:</string> <string name="treatments_insulin_label_string">Insulin:</string>
<string name="treatments_carbs_label_string">Carbs:</string> <string name="treatments_carbs_label_string">Carbs:</string>
@ -508,12 +508,12 @@
<string name="settings_password">Password for settings</string> <string name="settings_password">Password for settings</string>
<string name="unlock_settings">Unlock settings</string> <string name="unlock_settings">Unlock settings</string>
<string name="approachingdailylimit">Approaching insulin daily limit</string> <string name="approachingdailylimit">Approaching insulin daily limit</string>
<string name="nsclientinternal">NSClient internal</string> <string name="nsclientinternal">NSClient</string>
<string name="nsclientinternal_shortname">NSCI</string> <string name="nsclientinternal_shortname">NSCI</string>
<string name="nsclientinternal_url">URL:</string> <string name="nsclientinternal_url">URL:</string>
<string name="nsclientinternal_autoscroll">Autoscroll</string> <string name="nsclientinternal_autoscroll">Autoscroll</string>
<string name="restart">Restart</string> <string name="restart">Restart</string>
<string name="nsclientinternal_title">Internal NSClient</string> <string name="nsclientinternal_title">NSClient</string>
<string name="nsclientinternal_url_title">Nightscout URL</string> <string name="nsclientinternal_url_title">Nightscout URL</string>
<string name="nsclientinternal_url_dialogmessage">Enter Nightscout URL</string> <string name="nsclientinternal_url_dialogmessage">Enter Nightscout URL</string>
<string name="nsclientinternal_secret_title">NS API secret</string> <string name="nsclientinternal_secret_title">NS API secret</string>
@ -605,4 +605,8 @@
<string name="xdripstatus_shortname">xds</string> <string name="xdripstatus_shortname">xds</string>
<string name="wear_showbgi_title">Show BGI</string> <string name="wear_showbgi_title">Show BGI</string>
<string name="wear_showbgi_summary">Add BGI to status line</string> <string name="wear_showbgi_summary">Add BGI to status line</string>
<string name="ns_noupload">No upload to NS</string>
<string name="ns_noupload_summary">All data sent to NS are dropped. AAPS is connected to NS but no change in NS is done</string>
<string name="key_ns_upload_only" translatable="false">ns_upload_only</string>
<string name="key_ns_noupload" translatable="false">ns_noupload</string>
</resources> </resources>

View file

@ -24,4 +24,8 @@
<item name="android:windowAnimationStyle">@android:style/Animation</item> <item name="android:windowAnimationStyle">@android:style/Animation</item>
</style> </style>
<style name="ButtonSmallFontStyle">
<item name="android:textSize">10sp</item>
</style>
</resources> </resources>

View file

@ -10,9 +10,14 @@
android:title="@string/nightscout"> android:title="@string/nightscout">
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="ns_upload_only" android:key="@string/key_ns_upload_only"
android:title="@string/ns_upload_only" android:title="@string/ns_upload_only"
android:summary="@string/ns_upload_only_summary"/> android:summary="@string/ns_upload_only_summary"/>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_ns_noupload"
android:title="@string/ns_noupload"
android:summary="@string/ns_noupload_summary"/>
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="ns_sync_use_absolute" android:key="ns_sync_use_absolute"