revert dev changes
This commit is contained in:
parent
43a61f312a
commit
707a9e62d8
5 changed files with 19 additions and 27 deletions
|
@ -19,22 +19,23 @@ tempBasalFunctions.setTempBasal = function setTempBasal(rate, duration, profile,
|
||||||
//var maxSafeBasal = Math.min(profile.max_basal, 3 * profile.max_daily_basal, 4 * profile.current_basal);
|
//var maxSafeBasal = Math.min(profile.max_basal, 3 * profile.max_daily_basal, 4 * profile.current_basal);
|
||||||
|
|
||||||
var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
|
var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
|
||||||
var round_basal = require('./round-basal');
|
var round_basal = require('./round-basal');
|
||||||
|
|
||||||
if (rate < 0) {
|
if (rate < 0) {
|
||||||
rate = 0;
|
rate = 0;
|
||||||
} else if (rate > maxSafeBasal) {
|
} // if >30m @ 0 required, zero temp will be extended to 30m instead
|
||||||
|
else if (rate > maxSafeBasal) {
|
||||||
rate = maxSafeBasal;
|
rate = maxSafeBasal;
|
||||||
}
|
}
|
||||||
|
|
||||||
var suggestedRate = round_basal(rate, profile);
|
var suggestedRate = round_basal(rate, profile);
|
||||||
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && typeof(currenttemp.rate) !== 'undefined' && currenttemp.duration > (duration-10) && currenttemp.duration <= 120 && suggestedRate <= currenttemp.rate * 1.2 && suggestedRate >= currenttemp.rate * 0.8 && duration > 0 ) {
|
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && typeof(currenttemp.rate) !== 'undefined' && currenttemp.duration > (duration-10) && currenttemp.duration <= 120 && suggestedRate <= currenttemp.rate * 1.2 && suggestedRate >= currenttemp.rate * 0.8) {
|
||||||
rT.reason += " "+currenttemp.duration+"m left and " + currenttemp.rate + " ~ req " + suggestedRate + "U/hr: no temp required";
|
rT.reason += " "+currenttemp.duration+"m left and " + currenttemp.rate + " ~ req " + suggestedRate + "U/hr: no temp required";
|
||||||
return rT;
|
return rT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (suggestedRate === profile.current_basal) {
|
if (suggestedRate === profile.current_basal) {
|
||||||
if (profile.skip_neutral_temps === true) {
|
if (profile.skip_neutral_temps) {
|
||||||
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && currenttemp.duration > 0) {
|
if (typeof(currenttemp) !== 'undefined' && typeof(currenttemp.duration) !== 'undefined' && currenttemp.duration > 0) {
|
||||||
reason(rT, 'Suggested rate is same as profile rate, a temp basal is active, canceling current temp');
|
reason(rT, 'Suggested rate is same as profile rate, a temp basal is active, canceling current temp');
|
||||||
rT.duration = 0;
|
rT.duration = 0;
|
||||||
|
|
|
@ -156,12 +156,6 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
|
||||||
log.info("Do nothing for downgrading...");
|
|
||||||
log.debug("oldVersion: {}, newVersion: {}", oldVersion, newVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getOldVersion() {
|
public int getOldVersion() {
|
||||||
return oldVersion;
|
return oldVersion;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,9 +107,9 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
running = false;
|
|
||||||
super.onPause();
|
super.onPause();
|
||||||
MainApp.unsubscribe(this);
|
MainApp.unsubscribe(this);
|
||||||
|
running = false;
|
||||||
if (L.isEnabled(L.UI))
|
if (L.isEnabled(L.UI))
|
||||||
log.debug("onPause");
|
log.debug("onPause");
|
||||||
}
|
}
|
||||||
|
@ -173,12 +173,10 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
activity.runOnUiThread(() -> {
|
activity.runOnUiThread(() -> {
|
||||||
try {
|
|
||||||
if (running) {
|
|
||||||
if (L.isEnabled(L.UI))
|
if (L.isEnabled(L.UI))
|
||||||
log.debug("executing");
|
log.debug("executing");
|
||||||
|
try {
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Unhandled exception", e);
|
log.error("Unhandled exception", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1364,7 +1364,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
||||||
|
|
||||||
// Sensitivity
|
// Sensitivity
|
||||||
if (sensitivityView != null) {
|
if (sensitivityView != null) {
|
||||||
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensData("Overview");
|
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("Overview");
|
||||||
if (autosensData != null)
|
if (autosensData != null)
|
||||||
sensitivityView.setText(String.format("%.0f%%", autosensData.autosensResult.ratio * 100));
|
sensitivityView.setText(String.format("%.0f%%", autosensData.autosensResult.ratio * 100));
|
||||||
else
|
else
|
||||||
|
|
|
@ -807,7 +807,7 @@
|
||||||
<string name="hour">hodin</string>
|
<string name="hour">hodin</string>
|
||||||
<string name="day">dní</string>
|
<string name="day">dní</string>
|
||||||
<string name="week">týdnů</string>
|
<string name="week">týdnů</string>
|
||||||
<string name="time_plural"></string>
|
<string name="time_plural"> </string>
|
||||||
<string name="insight_keepalive_format_string">%1$d vyprší %2$s</string>
|
<string name="insight_keepalive_format_string">%1$d vyprší %2$s</string>
|
||||||
<string name="insight_keep_alive_status">Stav keep-alive</string>
|
<string name="insight_keep_alive_status">Stav keep-alive</string>
|
||||||
<string name="statistics">Statistika</string>
|
<string name="statistics">Statistika</string>
|
||||||
|
@ -1052,7 +1052,6 @@
|
||||||
<string name="insulinlimitviolation">Překročen limit inzulínu</string>
|
<string name="insulinlimitviolation">Překročen limit inzulínu</string>
|
||||||
<string name="loop_openmode_min_change">Minimální změna pro výzvu [%]</string>
|
<string name="loop_openmode_min_change">Minimální změna pro výzvu [%]</string>
|
||||||
<string name="loop_openmode_min_change_summary">Smyčka vytvoří novou žádost o změnu pouze v případě, že změna je větší než tato hodnota. Výchozí hodnota je 20 %</string>
|
<string name="loop_openmode_min_change_summary">Smyčka vytvoří novou žádost o změnu pouze v případě, že změna je větší než tato hodnota. Výchozí hodnota je 20 %</string>
|
||||||
<string name="pairfirst">Spárujte pumpu s telefonem!</string>
|
|
||||||
<plurals name="objective_days">
|
<plurals name="objective_days">
|
||||||
<item quantity="one">%1$d den</item>
|
<item quantity="one">%1$d den</item>
|
||||||
<item quantity="few">%1$d dnů</item>
|
<item quantity="few">%1$d dnů</item>
|
||||||
|
|
Loading…
Reference in a new issue