Merge branch 'dev' into insihgtfix
This commit is contained in:
commit
2fc9b40f9d
11 changed files with 64 additions and 64 deletions
|
@ -89,7 +89,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
|||
pref.setSummary("******");
|
||||
} else if (pref.getKey().equals(MainApp.gs(R.string.key_danars_name))) {
|
||||
pref.setSummary(SP.getString(R.string.key_danars_name, ""));
|
||||
} else if (editTextPref.getText() != null ) {
|
||||
} else if (editTextPref.getText() != null) {
|
||||
((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage());
|
||||
pref.setSummary(editTextPref.getText());
|
||||
} else if (pref.getKey().contains("smscommunicator_allowednumbers") && TextUtils.isEmpty(editTextPref.getText().trim())) {
|
||||
|
@ -183,9 +183,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
|||
addPreferencesFromResourceIfEnabled(NSClientPlugin.getPlugin(), PluginType.GENERAL);
|
||||
addPreferencesFromResourceIfEnabled(SmsCommunicatorPlugin.getPlugin(), PluginType.GENERAL);
|
||||
|
||||
if (!Config.NSCLIENT) {
|
||||
addPreferencesFromResource(R.xml.pref_others);
|
||||
}
|
||||
addPreferencesFromResource(R.xml.pref_others);
|
||||
addPreferencesFromResource(R.xml.pref_datachoices);
|
||||
|
||||
addPreferencesFromResourceIfEnabled(WearPlugin.getPlugin(), PluginType.GENERAL);
|
||||
|
|
|
@ -69,17 +69,17 @@ public class APSResult {
|
|||
return this;
|
||||
}
|
||||
|
||||
public APSResult tempBasalRequested(boolean tempBasalRequested) {
|
||||
public APSResult tempBasalRequested(boolean tempBasalRequested) {
|
||||
this.tempBasalRequested = tempBasalRequested;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APSResult usePercent(boolean usePercent) {
|
||||
public APSResult usePercent(boolean usePercent) {
|
||||
this.usePercent = usePercent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APSResult json(JSONObject json) {
|
||||
public APSResult json(JSONObject json) {
|
||||
this.json = json;
|
||||
return this;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class APSResult {
|
|||
"<b>" + MainApp.gs(R.string.duration) + "</b>: " + DecimalFormatter.to2Decimal(duration) + " min<br>";
|
||||
else
|
||||
ret = "<b>" + MainApp.gs(R.string.rate) + "</b>: " + DecimalFormatter.to2Decimal(rate) + " U/h " +
|
||||
"(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100) + "%) <br>" +
|
||||
"(" + DecimalFormatter.to2Decimal(rate / pump.getBaseBasalRate() * 100d) + "%) <br>" +
|
||||
"<b>" + MainApp.gs(R.string.duration) + "</b>: " + DecimalFormatter.to2Decimal(duration) + " min<br>";
|
||||
|
||||
// smb
|
||||
|
@ -334,22 +334,23 @@ public class APSResult {
|
|||
}
|
||||
}
|
||||
// report change bigger than 30%
|
||||
if (activeTemp != null) {
|
||||
double percentToBeSmallChange = 30;
|
||||
percentToBeSmallChange /= 100;
|
||||
double change = percent / (double) activeTemp.tempBasalConvertedToPercent(now, profile);
|
||||
double lowThreshold = 1 - percentToBeSmallChange;
|
||||
double highThreshold = 1 + percentToBeSmallChange;
|
||||
double percentMinChangeChange = SP.getDouble(R.string.key_loop_openmode_min_change, 30d);
|
||||
percentMinChangeChange /= 100d;
|
||||
double lowThreshold = 1 - percentMinChangeChange;
|
||||
double highThreshold = 1 + percentMinChangeChange;
|
||||
double change = percent / 100d;
|
||||
if (activeTemp != null)
|
||||
change = percent / (double) activeTemp.tempBasalConvertedToPercent(now, profile);
|
||||
|
||||
if (change < lowThreshold || change > highThreshold) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Outside allowed range " + (change * 100) + "%");
|
||||
return true;
|
||||
}
|
||||
if (change < lowThreshold || change > highThreshold) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Outside allowed range " + (change * 100d) + "%");
|
||||
return true;
|
||||
} else {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Inside allowed range " + (change * 100d) + "%");
|
||||
return false;
|
||||
}
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("FALSE");
|
||||
return false;
|
||||
} else {
|
||||
if (activeTemp == null && rate == pump.getBaseBasalRate()) {
|
||||
if (L.isEnabled(L.APS))
|
||||
|
@ -377,22 +378,23 @@ public class APSResult {
|
|||
}
|
||||
}
|
||||
// report change bigger than 30%
|
||||
if (activeTemp != null) {
|
||||
double percentMinChangeChange = SP.getDouble(R.string.key_loop_openmode_min_change, 30d);
|
||||
percentMinChangeChange /= 100;
|
||||
double change = rate / activeTemp.tempBasalConvertedToAbsolute(now, profile);
|
||||
double lowThreshold = 1 - percentMinChangeChange;
|
||||
double highThreshold = 1 + percentMinChangeChange;
|
||||
double percentMinChangeChange = SP.getDouble(R.string.key_loop_openmode_min_change, 30d);
|
||||
percentMinChangeChange /= 100d;
|
||||
double lowThreshold = 1 - percentMinChangeChange;
|
||||
double highThreshold = 1 + percentMinChangeChange;
|
||||
double change = rate / profile.getBasal();
|
||||
if (activeTemp != null)
|
||||
change = rate / activeTemp.tempBasalConvertedToAbsolute(now, profile);
|
||||
|
||||
if (change < lowThreshold || change > highThreshold) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Outside allowed range " + (change * 100) + "%");
|
||||
return true;
|
||||
}
|
||||
if (change < lowThreshold || change > highThreshold) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Outside allowed range " + (change * 100d) + "%");
|
||||
return true;
|
||||
} else {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("TRUE: Inside allowed range " + (change * 100d) + "%");
|
||||
return false;
|
||||
}
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug("FALSE");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,6 +210,9 @@ public class MaintenancePlugin extends PluginBase {
|
|||
public static Intent sendMail(Uri attachementUri, String recipient, String subject) {
|
||||
StringBuilder builder =new StringBuilder();
|
||||
|
||||
builder.append("ADD TIME OF EVENT HERE: " + System.lineSeparator());
|
||||
builder.append("ADD ISSUE DESCRIPTION OR GITHUB ISSUE REFERENCE NUMBER: " + System.lineSeparator());
|
||||
builder.append("-------------------------------------------------------" + System.lineSeparator());
|
||||
builder.append(MainApp.gs(R.string.app_name) + " " + BuildConfig.VERSION + System.lineSeparator());
|
||||
if (Config.NSCLIENT)
|
||||
builder.append("NSCLIENT" + System.lineSeparator());
|
||||
|
|
|
@ -288,17 +288,12 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
|
|||
|
||||
@Override
|
||||
public PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes, Profile profile, boolean enforceNew) {
|
||||
PumpEnactResult result = new PumpEnactResult();
|
||||
if (TreatmentsPlugin.getPlugin().isTempBasalInProgress()) {
|
||||
result = cancelTempBasal(false);
|
||||
if (!result.success)
|
||||
return result;
|
||||
}
|
||||
TemporaryBasal tempBasal = new TemporaryBasal()
|
||||
.date(System.currentTimeMillis())
|
||||
.percent(percent)
|
||||
.duration(durationInMinutes)
|
||||
.source(Source.USER);
|
||||
PumpEnactResult result = new PumpEnactResult();
|
||||
result.success = true;
|
||||
result.enacted = true;
|
||||
result.percent = percent;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package info.nightscout.androidaps.tabs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
|
@ -14,8 +12,10 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.utils.SP;
|
||||
|
||||
/**
|
||||
* Created by mike on 30.05.2016.
|
||||
|
@ -57,8 +57,7 @@ public class TabPageAdapter extends FragmentPagerAdapter {
|
|||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
if (preferences.getBoolean("short_tabtitles", false)) {
|
||||
if (SP.getBoolean(R.string.key_short_tabtitles, false)) {
|
||||
return visibleFragmentList.get(position).getNameShort();
|
||||
}
|
||||
return visibleFragmentList.get(position).getName();
|
||||
|
|
|
@ -110,9 +110,9 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:paddingLeft="-5dp"
|
||||
android:paddingRight="-5dp"
|
||||
android:layout_marginTop="-5dp"
|
||||
android:paddingLeft="-2dp"
|
||||
android:paddingRight="-2dp"
|
||||
android:text="→"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold" />
|
||||
|
|
|
@ -116,9 +116,9 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:paddingLeft="-5dp"
|
||||
android:paddingRight="-5dp"
|
||||
android:layout_marginTop="-5dp"
|
||||
android:paddingLeft="-2dp"
|
||||
android:paddingRight="-2dp"
|
||||
android:text="→"
|
||||
android:textSize="50sp"
|
||||
android:textStyle="bold" />
|
||||
|
|
|
@ -52,23 +52,25 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/treatments_reshreshfromnightscout"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/nav_refreshtreatments"/>
|
||||
android:layout_weight="1"
|
||||
android:text="@string/nav_refreshtreatments" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/treatments_delete_future_treatments"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/deletefuturetreatments" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/careportal_refreshfromnightscout"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/refresheventsfromnightscout" />
|
||||
|
@ -27,7 +27,7 @@
|
|||
android:id="@+id/careportal_removeandroidapsstartedevents"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/careportal_removestartedevents" />
|
||||
|
|
|
@ -1202,7 +1202,8 @@
|
|||
<string name="insulinlimitviolation">Insulin limit violation</string>
|
||||
<string name="key_loop_openmode_min_change" translatable="false">loop_openmode_min_change</string>
|
||||
<string name="loop_openmode_min_change">Minimal request change [%]</string>
|
||||
<string name="loop_openmode_min_change_summary">Loop will popup new change request only if change is bigger than this value. Default value is 30%</string>
|
||||
<string name="loop_openmode_min_change_summary">Loop will popup new change request only if change is bigger than this value. Default value is 20%</string>
|
||||
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
|
||||
|
||||
<plurals name="objective_days">
|
||||
<item quantity="one">%1$d day</item>
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</PreferenceScreen>
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="short_tabtitles"
|
||||
android:key="@string/key_short_tabtitles"
|
||||
android:title="@string/short_tabtitles" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceScreen android:title="@string/localalertsettings_title">
|
||||
|
|
Loading…
Reference in a new issue