Merge branch 'dev' of https://github.com/MilosKozak/AndroidAPS into MilosKozak-dev
This commit is contained in:
commit
6c3a07cc62
|
@ -37,7 +37,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -44,7 +44,7 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 23
|
||||
versionCode 1100
|
||||
versionName "1.1"
|
||||
versionName "1.1c"
|
||||
buildConfigField "String", "BUILDVERSION", generateGitBuild()
|
||||
}
|
||||
lintOptions {
|
||||
|
|
|
@ -252,7 +252,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
for (int h = 0; h < basalValues; h++) {
|
||||
Double pumpValue = pump.pumpProfiles[pump.activeProfile][h];
|
||||
Double profileValue = profile.getBasal(h * basalIncrement);
|
||||
if (!pumpValue.equals(profileValue)) {
|
||||
if (Math.abs(pumpValue - profileValue) > getPumpDescription().basalStep) {
|
||||
log.debug("Diff found. Hour: " + h + " Pump: " + pumpValue + " Profile: " + profileValue);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class Autosens {
|
|||
double[] bgis = new double[bucketed_data.size() - 2];
|
||||
double[] deviations = new double[bucketed_data.size() - 2];
|
||||
|
||||
String debugString = "";
|
||||
String pastSensitivity = "";
|
||||
for (int i = 0; i < bucketed_data.size() - 3; ++i) {
|
||||
long bgTime = bucketed_data.get(i).timeIndex;
|
||||
int secondsFromMidnight = NSProfile.secondsFromMidnight(new Date(bgTime));
|
||||
|
@ -108,20 +108,21 @@ public class Autosens {
|
|||
// Exclude large positive deviations (carb absorption) from autosens
|
||||
if (avgDelta - bgi < 6) {
|
||||
if (deviation > 0) {
|
||||
debugString += "+";
|
||||
pastSensitivity += "+";
|
||||
} else if (deviation == 0) {
|
||||
debugString += "=";
|
||||
pastSensitivity += "=";
|
||||
} else {
|
||||
debugString += "-";
|
||||
pastSensitivity += "-";
|
||||
}
|
||||
avgDeltas[i] = avgDelta;
|
||||
bgis[i] = bgi;
|
||||
deviations[i] = deviation;
|
||||
deviationSum += deviation;
|
||||
} else {
|
||||
debugString += ">";
|
||||
pastSensitivity += ">";
|
||||
//console.error(bgTime);
|
||||
}
|
||||
//log.debug("TIME: " + new Date(bgTime).toString() + " BG: " + bg + " SENS: " + sens + " DELTA: " + delta + " AVGDELTA: " + avgDelta + " IOB: " + iob.iob + " ACTIVITY: " + iob.activity + " BGI: " + bgi + " DEVIATION: " + deviation);
|
||||
|
||||
// if bgTime is more recent than mealTime
|
||||
if (bgTime > mealTime) {
|
||||
|
@ -134,7 +135,7 @@ public class Autosens {
|
|||
}
|
||||
}
|
||||
//console.error("");
|
||||
log.debug(debugString);
|
||||
log.debug(pastSensitivity);
|
||||
//console.log(JSON.stringify(avgDeltas));
|
||||
//console.log(JSON.stringify(bgis));
|
||||
Arrays.sort(avgDeltas);
|
||||
|
@ -157,15 +158,17 @@ public class Autosens {
|
|||
//console.error("Mean deviation: "+average.toFixed(2));
|
||||
double basalOff = 0;
|
||||
|
||||
String sensResult = "";
|
||||
if (pSensitive < 0) { // sensitive
|
||||
basalOff = pSensitive * (60 / 5) / NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()), profile.getUnits());
|
||||
log.debug("Excess insulin sensitivity detected: ");
|
||||
sensResult = "Excess insulin sensitivity detected";
|
||||
} else if (pResistant > 0) { // resistant
|
||||
basalOff = pResistant * (60 / 5) / NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()), profile.getUnits());
|
||||
log.debug("Excess insulin resistance detected: ");
|
||||
sensResult = "Excess insulin resistance detected";
|
||||
} else {
|
||||
log.debug("Sensitivity normal.");
|
||||
sensResult = "Sensitivity normal";
|
||||
}
|
||||
log.debug(sensResult);
|
||||
double ratio = 1 + (basalOff / profile.getMaxDailyBasal());
|
||||
|
||||
// don't adjust more than 1.5x
|
||||
|
@ -173,8 +176,10 @@ public class Autosens {
|
|||
ratio = Math.max(ratio, Constants.AUTOSENS_MIN);
|
||||
ratio = Math.min(ratio, Constants.AUTOSENS_MAX);
|
||||
|
||||
String ratioLimit = "";
|
||||
if (ratio != rawRatio) {
|
||||
log.debug("Ratio limited from " + rawRatio + " to " + ratio);
|
||||
ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio;
|
||||
log.debug(ratioLimit);
|
||||
}
|
||||
|
||||
double newisf = Math.round(NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()), profile.getUnits()) / ratio);
|
||||
|
@ -187,6 +192,9 @@ public class Autosens {
|
|||
AutosensResult output = new AutosensResult();
|
||||
output.ratio = Round.roundTo(ratio, 0.01);
|
||||
output.carbsAbsorbed = Round.roundTo(carbsAbsorbed, 0.01);
|
||||
output.pastSensitivity = pastSensitivity;
|
||||
output.ratioLimit = ratioLimit;
|
||||
output.sensResult = sensResult;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,30 @@
|
|||
package info.nightscout.androidaps.plugins.OpenAPSAMA;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* Created by mike on 06.01.2017.
|
||||
*/
|
||||
public class AutosensResult {
|
||||
public double ratio;
|
||||
public double carbsAbsorbed;
|
||||
public String sensResult;
|
||||
public String pastSensitivity;
|
||||
public String ratioLimit;
|
||||
|
||||
public JSONObject json() {
|
||||
JSONObject ret = new JSONObject();
|
||||
try {
|
||||
ret.put("ratio", ratio);
|
||||
ret.put("ratioLimit", ratioLimit);
|
||||
ret.put("pastSensitivity", pastSensitivity);
|
||||
ret.put("sensResult", sensResult);
|
||||
ret.put("ratio", ratio);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -125,12 +125,14 @@ public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener
|
|||
}
|
||||
profileView.setText(JSONFormatter.format(determineBasalAdapterAMAJS.getProfileParam()));
|
||||
mealDataView.setText(JSONFormatter.format(determineBasalAdapterAMAJS.getMealDataParam()));
|
||||
autosensDataView.setText(JSONFormatter.format(determineBasalAdapterAMAJS.getAutosensDataParam()));
|
||||
scriptdebugView.setText(determineBasalAdapterAMAJS.getScriptDebug());
|
||||
}
|
||||
if (getPlugin().lastAPSRun != null) {
|
||||
lastRunView.setText(getPlugin().lastAPSRun.toLocaleString());
|
||||
}
|
||||
if (getPlugin().lastAutosensResult != null) {
|
||||
autosensDataView.setText(JSONFormatter.format(getPlugin().lastAutosensResult.json()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
|||
DetermineBasalAdapterAMAJS lastDetermineBasalAdapterAMAJS = null;
|
||||
Date lastAPSRun = null;
|
||||
DetermineBasalResultAMA lastAPSResult = null;
|
||||
AutosensResult lastAutosensResult = null;
|
||||
|
||||
boolean fragmentEnabled = false;
|
||||
boolean fragmentVisible = true;
|
||||
|
@ -173,7 +174,7 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
|||
maxIob = MainApp.getConfigBuilder().applyMaxIOBConstraints(maxIob);
|
||||
|
||||
minBg = verifyHardLimits(minBg, "minBg", 72, 180);
|
||||
maxBg = verifyHardLimits(maxBg, "maxBg", 100, 270);
|
||||
maxBg = verifyHardLimits(maxBg, "maxBg", 99, 270);
|
||||
targetBg = verifyHardLimits(targetBg, "targetBg", 80, 200);
|
||||
|
||||
boolean isTempTarget = false;
|
||||
|
@ -202,10 +203,10 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
|||
long oldestDataAvailable = MainApp.getConfigBuilder().getActiveTempBasals().oldestDataAvaialable();
|
||||
List<BgReading> bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(Math.max(oldestDataAvailable, (long) (new Date().getTime() - 60 * 60 * 1000L * (24 + profile.getDia()))), false);
|
||||
log.debug("Limiting data to oldest available temps: " + new Date(oldestDataAvailable).toString() + " (" + bgReadings.size() + " records)");
|
||||
AutosensResult autosensResult = Autosens.detectSensitivityandCarbAbsorption(bgReadings, new Date().getTime());
|
||||
lastAutosensResult = Autosens.detectSensitivityandCarbAbsorption(bgReadings, new Date().getTime());
|
||||
|
||||
determineBasalAdapterAMAJS.setData(profile, maxIob, maxBasal, minBg, maxBg, targetBg, pump, iobArray, glucoseStatus, mealData,
|
||||
autosensResult.ratio, //autosensDataRatio
|
||||
lastAutosensResult.ratio, //autosensDataRatio
|
||||
isTempTarget,
|
||||
Constants.MIN_5M_CARBIMPACT //min_5m_carbimpact
|
||||
);
|
||||
|
@ -247,15 +248,18 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
|||
}
|
||||
|
||||
public static Double verifyHardLimits(Double value, String valueName, double lowLimit, double highLimit) {
|
||||
if (value < lowLimit || value > highLimit) {
|
||||
Double newvalue = value;
|
||||
if (newvalue < lowLimit || newvalue > highLimit) {
|
||||
newvalue = Math.max(newvalue, lowLimit);
|
||||
newvalue = Math.min(newvalue, highLimit);
|
||||
String msg = String.format(MainApp.sResources.getString(R.string.openapsma_valueoutofrange), valueName);
|
||||
msg += ".\n";
|
||||
msg += String.format(MainApp.sResources.getString(R.string.openapsma_valuelimitedto), value, newvalue);
|
||||
log.error(msg);
|
||||
MainApp.getConfigBuilder().uploadError(msg);
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), msg, R.raw.error);
|
||||
value = Math.max(value, lowLimit);
|
||||
value = Math.min(value, highLimit);
|
||||
}
|
||||
return value;
|
||||
return newvalue;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,9 @@ import info.nightscout.utils.Round;
|
|||
import info.nightscout.utils.SafeParse;
|
||||
import info.nightscout.utils.ToastUtils;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin.checkOnlyHardLimits;
|
||||
import static info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin.verifyHardLimits;
|
||||
|
||||
/**
|
||||
* Created by mike on 05.08.2016.
|
||||
*/
|
||||
|
@ -179,7 +182,7 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
|||
maxIob = MainApp.getConfigBuilder().applyMaxIOBConstraints(maxIob);
|
||||
|
||||
minBg = verifyHardLimits(minBg, "minBg", 72, 180);
|
||||
maxBg = verifyHardLimits(maxBg, "maxBg", 100, 270);
|
||||
maxBg = verifyHardLimits(maxBg, "maxBg", 99, 270);
|
||||
targetBg = verifyHardLimits(targetBg, "targetBg", 80, 200);
|
||||
|
||||
TempTargetRangePlugin tempTargetRangePlugin = (TempTargetRangePlugin) MainApp.getSpecificPlugin(TempTargetRangePlugin.class);
|
||||
|
@ -235,21 +238,5 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
|||
//deviceStatus.suggested = determineBasalResultMA.json;
|
||||
}
|
||||
|
||||
// safety checks
|
||||
public static boolean checkOnlyHardLimits(Double value, String valueName, double lowLimit, double highLimit) {
|
||||
return value.equals(verifyHardLimits(value, valueName, lowLimit, highLimit));
|
||||
}
|
||||
|
||||
public static Double verifyHardLimits(Double value, String valueName, double lowLimit, double highLimit) {
|
||||
if (value < lowLimit || value > highLimit) {
|
||||
String msg = String.format(MainApp.sResources.getString(R.string.openapsma_valueoutofrange), valueName);
|
||||
log.error(msg);
|
||||
MainApp.getConfigBuilder().uploadError(msg);
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), msg, R.raw.error);
|
||||
value = Math.max(value, lowLimit);
|
||||
value = Math.min(value, highLimit);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ public class OverviewFragment extends Fragment {
|
|||
TextView iobView;
|
||||
TextView apsModeView;
|
||||
TextView tempTargetView;
|
||||
TextView initializingView;
|
||||
GraphView bgGraph;
|
||||
CheckBox showPredictionView;
|
||||
|
||||
|
@ -122,7 +123,6 @@ public class OverviewFragment extends Fragment {
|
|||
|
||||
LinearLayout cancelTempLayout;
|
||||
LinearLayout acceptTempLayout;
|
||||
LinearLayout quickWizardLayout;
|
||||
Button cancelTempButton;
|
||||
Button treatmentButton;
|
||||
Button wizardButton;
|
||||
|
@ -159,6 +159,7 @@ public class OverviewFragment extends Fragment {
|
|||
baseBasalView = (TextView) view.findViewById(R.id.overview_basebasal);
|
||||
basalLayout = (LinearLayout) view.findViewById(R.id.overview_basallayout);
|
||||
activeProfileView = (TextView) view.findViewById(R.id.overview_activeprofile);
|
||||
initializingView = (TextView) view.findViewById(R.id.overview_initializing);
|
||||
|
||||
iobView = (TextView) view.findViewById(R.id.overview_iob);
|
||||
apsModeView = (TextView) view.findViewById(R.id.overview_apsmode);
|
||||
|
@ -172,7 +173,6 @@ public class OverviewFragment extends Fragment {
|
|||
acceptTempButton = (Button) view.findViewById(R.id.overview_accepttempbutton);
|
||||
acceptTempLayout = (LinearLayout) view.findViewById(R.id.overview_accepttemplayout);
|
||||
quickWizardButton = (Button) view.findViewById(R.id.overview_quickwizard);
|
||||
quickWizardLayout = (LinearLayout) view.findViewById(R.id.overview_quickwizardlayout);
|
||||
showPredictionView = (CheckBox) view.findViewById(R.id.overview_showprediction);
|
||||
|
||||
notificationsView = (RecyclerView) view.findViewById(R.id.overview_notifications);
|
||||
|
@ -286,7 +286,7 @@ public class OverviewFragment extends Fragment {
|
|||
|
||||
QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive();
|
||||
if (quickWizardEntry != null && lastBG != null) {
|
||||
quickWizardLayout.setVisibility(View.VISIBLE);
|
||||
quickWizardButton.setVisibility(View.VISIBLE);
|
||||
String text = MainApp.sResources.getString(R.string.bolus) + ": " + quickWizardEntry.buttonText();
|
||||
BolusWizard wizard = new BolusWizard();
|
||||
wizard.doCalc(profile.getDefaultProfile(), quickWizardEntry.carbs(), lastBG.valueToUnits(profile.getUnits()), 0d, true, true);
|
||||
|
@ -468,8 +468,14 @@ public class OverviewFragment extends Fragment {
|
|||
updateNotifications();
|
||||
BgReading actualBG = MainApp.getDbHelper().actualBg();
|
||||
BgReading lastBG = MainApp.getDbHelper().lastBg();
|
||||
if (MainApp.getConfigBuilder() == null || MainApp.getConfigBuilder().getActiveProfile() == null || MainApp.getConfigBuilder().getActiveProfile().getProfile() == null) // app not initialized yet
|
||||
|
||||
if (MainApp.getConfigBuilder() == null || MainApp.getConfigBuilder().getActiveProfile() == null || MainApp.getConfigBuilder().getActiveProfile().getProfile() == null) {// app not initialized yet
|
||||
initializingView.setText(R.string.noprofileset);
|
||||
initializingView.setVisibility(View.VISIBLE);
|
||||
return;
|
||||
} else {
|
||||
initializingView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// Skip if not initialized yet
|
||||
if (bgGraph == null)
|
||||
|
@ -635,19 +641,21 @@ public class OverviewFragment extends Fragment {
|
|||
// QuickWizard button
|
||||
QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive();
|
||||
if (quickWizardEntry != null && lastBG != null && pump.isInitialized()) {
|
||||
quickWizardLayout.setVisibility(View.VISIBLE);
|
||||
quickWizardButton.setVisibility(View.VISIBLE);
|
||||
String text = MainApp.sResources.getString(R.string.bolus) + ": " + quickWizardEntry.buttonText() + " " + DecimalFormatter.to0Decimal(quickWizardEntry.carbs()) + "g";
|
||||
BolusWizard wizard = new BolusWizard();
|
||||
wizard.doCalc(profile.getDefaultProfile(), quickWizardEntry.carbs(), lastBG.valueToUnits(profile.getUnits()), 0d, true, true);
|
||||
text += " " + DecimalFormatter.to2Decimal(wizard.calculatedTotalInsulin) + "U";
|
||||
quickWizardButton.setText(text);
|
||||
if (wizard.calculatedTotalInsulin <= 0)
|
||||
quickWizardLayout.setVisibility(View.GONE);
|
||||
quickWizardButton.setVisibility(View.GONE);
|
||||
} else
|
||||
quickWizardLayout.setVisibility(View.GONE);
|
||||
quickWizardButton.setVisibility(View.GONE);
|
||||
|
||||
String units = profile.getUnits();
|
||||
|
||||
// **** BG value ****
|
||||
if (lastBG != null && bgView != null) {
|
||||
if (lastBG != null) {
|
||||
bgView.setText(lastBG.valueToUnitsToString(profile.getUnits()));
|
||||
arrowView.setText(lastBG.directionToSymbol());
|
||||
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
|
||||
|
@ -922,6 +930,21 @@ public class OverviewFragment extends Fragment {
|
|||
bgGraph.getSecondScale().setMaxY(maxBgValue / lowLine * maxBasalValueFound * 1.2d);
|
||||
bgGraph.getGridLabelRenderer().setVerticalLabelsSecondScaleColor(MainApp.instance().getResources().getColor(R.color.background_material_dark)); // same color as backround = hide
|
||||
}
|
||||
|
||||
// Pump not initialized message
|
||||
if (!pump.isInitialized()) {
|
||||
// disable all treatment buttons because we are not able to check constraints without profile
|
||||
wizardButton.setVisibility(View.INVISIBLE);
|
||||
treatmentButton.setVisibility(View.INVISIBLE);
|
||||
quickWizardButton.setVisibility(View.INVISIBLE);
|
||||
initializingView.setText(R.string.waitingforpump);
|
||||
initializingView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
wizardButton.setVisibility(View.VISIBLE);
|
||||
treatmentButton.setVisibility(View.VISIBLE);
|
||||
initializingView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Notifications
|
||||
|
|
|
@ -180,6 +180,7 @@ public class TempBasalsPlugin implements PluginBase, TempBasalsInterface {
|
|||
if (useExtendedBoluses) {
|
||||
for (Integer pos = 0; pos < extendedBoluses.size(); pos++) {
|
||||
TempBasal t = extendedBoluses.get(pos);
|
||||
if (t.timeStart.getTime() > time) continue;
|
||||
IobTotal calc = t.iobCalc(now);
|
||||
total.plus(calc);
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis
|
|||
else
|
||||
holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.cardColorBackground));
|
||||
holder.remove.setTag(tempTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
@ -104,7 +104,7 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis
|
|||
super.onAttachedToRecyclerView(recyclerView);
|
||||
}
|
||||
|
||||
public class TempTargetsViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
public class TempTargetsViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
CardView cv;
|
||||
TextView date;
|
||||
TextView duration;
|
||||
|
@ -134,26 +134,26 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis
|
|||
final Context finalContext = context;
|
||||
switch (v.getId()) {
|
||||
case R.id.temptargetrange_remove:
|
||||
final String _id = tempTarget._id;
|
||||
if (_id != null && !_id.equals("")) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
|
||||
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + _id);
|
||||
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
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(tempTarget.timeStart));
|
||||
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
final String _id = tempTarget._id;
|
||||
if (_id != null && !_id.equals("")) {
|
||||
MainApp.getConfigBuilder().removeCareportalEntryFromNS(_id);
|
||||
try {
|
||||
Dao<TempTarget, Long> daoTempTargets = MainApp.getDbHelper().getDaoTempTargets();
|
||||
daoTempTargets.delete(tempTarget);
|
||||
MainApp.bus().post(new EventTempTargetRangeChange());
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
|
||||
builder.show();
|
||||
}
|
||||
try {
|
||||
Dao<TempTarget, Long> daoTempTargets = MainApp.getDbHelper().getDaoTempTargets();
|
||||
daoTempTargets.delete(tempTarget);
|
||||
MainApp.bus().post(new EventTempTargetRangeChange());
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
|
||||
builder.show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -188,8 +188,8 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis
|
|||
case R.id.temptargetrange_refreshfromnightscout:
|
||||
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean nsUploadOnly = SP.getBoolean("ns_upload_only", false);
|
||||
if(nsUploadOnly){
|
||||
ToastUtils.showToastInUiThread(getContext(),this.getContext().getString(R.string.ns_upload_only_enabled));
|
||||
if (nsUploadOnly) {
|
||||
ToastUtils.showToastInUiThread(getContext(), this.getContext().getString(R.string.ns_upload_only_enabled));
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext());
|
||||
builder.setTitle(this.getContext().getString(R.string.confirmation));
|
||||
|
|
7
app/src/main/res/drawable/initializingborder.xml
Normal file
7
app/src/main/res/drawable/initializingborder.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/colorInitializingBorder" />
|
||||
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||
<corners
|
||||
android:radius="2dp" >
|
||||
</corners>
|
||||
</shape>
|
|
@ -17,7 +17,7 @@
|
|||
android:id="@+id/profileview_noprofile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nsprofileview_noprofile_text"
|
||||
android:text="@string/noprofileset"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
android:textStyle="bold"
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
<TextView
|
||||
|
@ -32,6 +32,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="0.2"
|
||||
android:background="@drawable/loopmodeborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
|
@ -40,20 +41,21 @@
|
|||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_weight="0.1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_activeprofile"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/pillborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="Profile"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="Profile"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@color/colorProfileSwitchButton"
|
||||
android:layout_weight="0.5" />
|
||||
android:textColor="@color/colorProfileSwitchButton" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_temptarget"
|
||||
|
@ -71,6 +73,23 @@
|
|||
android:layout_weight="0.2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_initializing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/initializingborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/initializing"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_marginTop="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -92,13 +111,13 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="-5dp"
|
||||
android:paddingRight="-10dp"
|
||||
android:text="→"
|
||||
android:textSize="70dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="-15dp" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -136,9 +155,9 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/overview_basallayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/overview_basallayout"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -180,11 +199,11 @@
|
|||
android:layout_height="160dip" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/overview_showprediction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/overview_showprediction"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true" />
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -261,7 +280,6 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/overview_quickwizardlayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<string name="nsprofileview_basal_label">Базални стойности:</string>
|
||||
<string name="nsprofileview_dia_label">DIA (Време на действие на инсулина):</string>
|
||||
<string name="nsprofileview_ic_label">IC (Инсулин/въглехидр.):</string>
|
||||
<string name="nsprofileview_noprofile_text">НЕ Е ЗАДАДЕН ПРОФИЛ</string>
|
||||
<string name="noprofileset">НЕ Е ЗАДАДЕН ПРОФИЛ</string>
|
||||
<string name="nsprofileview_target_label">Целeва КЗ:</string>
|
||||
<string name="nsprofileview_units_label">Единици:</string>
|
||||
<string name="objectives">Цели</string>
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<string name="nsprofileview_basal_label">Bazál:</string>
|
||||
<string name="nsprofileview_dia_label">Trvání inzulínu:</string>
|
||||
<string name="nsprofileview_ic_label">Inzulínosacharidový poměr:</string>
|
||||
<string name="nsprofileview_noprofile_text">ŽÁDNÝ PROFIL NENASTAVEN</string>
|
||||
<string name="noprofileset">ŽÁDNÝ PROFIL NENASTAVEN</string>
|
||||
<string name="nsprofileview_target_label">Cíl:</string>
|
||||
<string name="nsprofileview_units_label">Jednotky:</string>
|
||||
<string name="objectives">Cíle</string>
|
||||
|
@ -385,4 +385,21 @@
|
|||
<string name="ongoingnotificaction">Průběžné oznámení</string>
|
||||
<string name="old_data">ZASTARALÉ</string>
|
||||
<string name="localprofile">Místní profil</string>
|
||||
<string name="activity">Aktivita</string>
|
||||
<string name="array_of_elements">Pole %d prvků. Aktuální hodnota:</string>
|
||||
<string name="careportal_temptarget"></string>
|
||||
<string name="eatingsoon">Před jídlem</string>
|
||||
<string name="el_lang">Řečtina</string>
|
||||
<string name="initializing">Inicializuji ...</string>
|
||||
<string name="long_avgdelta">Dlouhodobý průměr</string>
|
||||
<string name="openapsama">OpenAPS AMA</string>
|
||||
<string name="openapsama_useautosens">Používat autodetekci senzitivity</string>
|
||||
<string name="openapsma_autosensdata_label">Data detekce senzitivity</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Ladící informace</string>
|
||||
<string name="openapsma_valuelimitedto" formatted="false">%.2f omezeno na %.2f</string>
|
||||
<string name="refreshtemptargetsfromnightscout">Opravdu aktualizovat dočasné cíle z NS</string>
|
||||
<string name="removerecord">Odstranit záznam:</string>
|
||||
<string name="short_avgdelta">Krátkodobý průměr</string>
|
||||
<string name="temptargetrange">Dočasný cíl</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Obnovit dočasné cíle z NS</string>
|
||||
</resources>
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
<string name="objectives_gate_label_string">Gate:</string>
|
||||
<string name="objectives_objective_label_string">Objective:</string>
|
||||
<string name="objectives">Zielsetzungen</string>
|
||||
<string name="nsprofileview_noprofile_text">KEIN PROFIL GESETZT</string>
|
||||
<string name="noprofileset">KEIN PROFIL GESETZT</string>
|
||||
<string name="nsclientnotinstalled">NSClient nicht installiert. Record lost!</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>
|
||||
|
@ -312,4 +312,5 @@
|
|||
<string name="absorption_rate">Absorptionsrate:</string>
|
||||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="minago">vor %d min</string>
|
||||
<string name="el_lang"></string>
|
||||
</resources>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<string name="nsprofileview_isf_label">ISF (Factor Sensibilidad Insulina):</string>
|
||||
<string name="nsprofileview_basal_label">Dosis Basal:</string>
|
||||
<string name="nsprofileview_target_label">Objetivo:</string>
|
||||
<string name="nsprofileview_noprofile_text">PERFIL NO ACTIVO</string>
|
||||
<string name="noprofileset">PERFIL NO ACTIVO</string>
|
||||
<string name="treatments_insulin_label_string">Insulina:</string>
|
||||
<string name="treatments_carbs_label_string">Carbohidratos:</string>
|
||||
<string name="treatments_iob_label_string">IOB:</string>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<string name="nsprofileview_isf_label">인슐린 민감도(ISF):</string>
|
||||
<string name="nsprofileview_basal_label">기초주입:</string>
|
||||
<string name="nsprofileview_target_label">목표:</string>
|
||||
<string name="nsprofileview_noprofile_text">NO PROFILE SET</string>
|
||||
<string name="noprofileset">NO PROFILE SET</string>
|
||||
<string name="treatments_insulin_label_string">인슐린:</string>
|
||||
<string name="treatments_carbs_label_string">탄수화물:</string>
|
||||
<string name="treatments_iob_label_string">IOB:</string>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="colorInitializingBorder">#ff2630</color>
|
||||
|
||||
<color name="cardColorBackground">#121212</color>
|
||||
<color name="cardObjectiveText">#779ECB</color>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<string name="nsprofileview_isf_label">ISF:</string>
|
||||
<string name="nsprofileview_basal_label">Basal:</string>
|
||||
<string name="nsprofileview_target_label">Target:</string>
|
||||
<string name="nsprofileview_noprofile_text">NO PROFILE SET</string>
|
||||
<string name="noprofileset">NO PROFILE SET</string>
|
||||
<string name="treatments_insulin_label_string">Insulin:</string>
|
||||
<string name="treatments_carbs_label_string">Carbs:</string>
|
||||
<string name="treatments_iob_label_string">IOB:</string>
|
||||
|
@ -319,6 +319,7 @@
|
|||
<string name="smscommunicator_loophasbeenenabled">Loop has been enabled</string>
|
||||
<string name="smscommunicator_loopisdisabled">Loop is disabled</string>
|
||||
<string name="smscommunicator_loopisenabled">Loop is enabled</string>
|
||||
<string name="openapsma_valuelimitedto" formatted="false">%.2f limited to %.2f</string>
|
||||
<string name="openapsma_valueoutofrange" formatted="false">Value %s is out of hard limits</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">Remote basal setting is not allowed</string>
|
||||
<string name="smscommunicator_basalreplywithcode" formatted="false">To start basal %.2fU/h reply with code %s</string>
|
||||
|
@ -408,8 +409,8 @@
|
|||
<string name="openapsama_useautosens">Use AMA autosens feature</string>
|
||||
<string name="temptargetrange">Temp Target</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Refresh temp targets from NS</string>
|
||||
<string name="careportal_temptarget">Temporary Target</string>
|
||||
<string name="eatingsoon">Eating Soon</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="removerecord">Remove record:</string>
|
||||
<string name="initializing">Initializing ...</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue