- added option for Beep TBR
- added line to DatabaseHelper that can be uncommented in case we make any change tp PodHistory database - isPumpSuspended evaluates PodSessionState.isSuspended too
This commit is contained in:
parent
1dd296ef0e
commit
b16e685ecc
7 changed files with 16 additions and 5 deletions
|
@ -137,6 +137,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
|
||||||
|
//TableUtils.dropTable(connectionSource, PodHistory.class, true);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, PodHistory.class);
|
TableUtils.createTableIfNotExists(connectionSource, PodHistory.class);
|
||||||
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
|
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
|
||||||
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")");
|
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")");
|
||||||
|
|
|
@ -182,6 +182,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
.subscribe(event -> {
|
.subscribe(event -> {
|
||||||
if ((event.isChanged(R.string.key_omnipod_beep_basal_enabled)) ||
|
if ((event.isChanged(R.string.key_omnipod_beep_basal_enabled)) ||
|
||||||
(event.isChanged(R.string.key_omnipod_beep_bolus_enabled)) ||
|
(event.isChanged(R.string.key_omnipod_beep_bolus_enabled)) ||
|
||||||
|
(event.isChanged(R.string.key_omnipod_beep_tbr_enabled)) ||
|
||||||
(event.isChanged(R.string.key_omnipod_beep_smb_enabled)))
|
(event.isChanged(R.string.key_omnipod_beep_smb_enabled)))
|
||||||
refreshConfiguration();
|
refreshConfiguration();
|
||||||
}, FabricPrivacy::logException)
|
}, FabricPrivacy::logException)
|
||||||
|
@ -355,7 +356,8 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSuspended() {
|
public boolean isSuspended() {
|
||||||
return (pumpStatusLocal != null && !pumpStatusLocal.podAvailable);
|
return (pumpStatusLocal != null && !pumpStatusLocal.podAvailable) ||
|
||||||
|
(OmnipodUtil.getPodSessionState()!=null && OmnipodUtil.getPodSessionState().isSuspended());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class OmnipodPumpStatus extends PumpStatus {
|
||||||
public boolean beepBolusEnabled = true;
|
public boolean beepBolusEnabled = true;
|
||||||
public boolean beepBasalEnabled = true;
|
public boolean beepBasalEnabled = true;
|
||||||
public boolean beepSMBEnabled = true;
|
public boolean beepSMBEnabled = true;
|
||||||
|
public boolean beepTBREnabled = true;
|
||||||
|
|
||||||
public OmnipodPumpStatus(PumpDescription pumpDescription) {
|
public OmnipodPumpStatus(PumpDescription pumpDescription) {
|
||||||
super(pumpDescription);
|
super(pumpDescription);
|
||||||
|
@ -104,8 +104,9 @@ public class OmnipodPumpStatus extends PumpStatus {
|
||||||
this.beepBasalEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepBasalEnabled, true);
|
this.beepBasalEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepBasalEnabled, true);
|
||||||
this.beepBolusEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepBolusEnabled, true);
|
this.beepBolusEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepBolusEnabled, true);
|
||||||
this.beepSMBEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepSMBEnabled, true);
|
this.beepSMBEnabled = SP.getBoolean(OmnipodConst.Prefs.BeepSMBEnabled, true);
|
||||||
|
this.beepTBREnabled = SP.getBoolean(OmnipodConst.Prefs.BeepTBREnabled, true);
|
||||||
|
|
||||||
LOG.debug("Beeps [basal={}, bolus={}, SMB={}]", this.beepBasalEnabled, this.beepBolusEnabled, this.beepSMBEnabled);
|
LOG.debug("Beeps [basal={}, bolus={}, SMB={}, TBR={}]", this.beepBasalEnabled, this.beepBolusEnabled, this.beepSMBEnabled, this.beepTBREnabled);
|
||||||
|
|
||||||
reconfigureService();
|
reconfigureService();
|
||||||
|
|
||||||
|
|
|
@ -623,8 +623,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTempBasalBeepsEnabled() {
|
private boolean isTempBasalBeepsEnabled() {
|
||||||
// TODO add separate setting for temp basal beeps
|
return this.pumpStatus.beepTBREnabled;
|
||||||
return this.pumpStatus.beepBasalEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getStringResource(int id, Object... args) {
|
private String getStringResource(int id, Object... args) {
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class OmnipodConst {
|
||||||
public static final int BeepBasalEnabled = R.string.key_omnipod_beep_basal_enabled;
|
public static final int BeepBasalEnabled = R.string.key_omnipod_beep_basal_enabled;
|
||||||
public static final int BeepBolusEnabled = R.string.key_omnipod_beep_bolus_enabled;
|
public static final int BeepBolusEnabled = R.string.key_omnipod_beep_bolus_enabled;
|
||||||
public static final int BeepSMBEnabled = R.string.key_omnipod_beep_smb_enabled;
|
public static final int BeepSMBEnabled = R.string.key_omnipod_beep_smb_enabled;
|
||||||
|
public static final int BeepTBREnabled = R.string.key_omnipod_beep_tbr_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Statistics {
|
public class Statistics {
|
||||||
|
|
|
@ -1649,9 +1649,11 @@
|
||||||
<string name="key_omnipod_beep_bolus_enabled" translatable="false">pref_omnipod_beep_bolus_enabled</string>
|
<string name="key_omnipod_beep_bolus_enabled" translatable="false">pref_omnipod_beep_bolus_enabled</string>
|
||||||
<string name="key_omnipod_beep_basal_enabled" translatable="false">pref_omnipod_beep_basal_enabled</string>
|
<string name="key_omnipod_beep_basal_enabled" translatable="false">pref_omnipod_beep_basal_enabled</string>
|
||||||
<string name="key_omnipod_beep_smb_enabled" translatable="false">pref_omnipod_beep_smb_enabled</string>
|
<string name="key_omnipod_beep_smb_enabled" translatable="false">pref_omnipod_beep_smb_enabled</string>
|
||||||
|
<string name="key_omnipod_beep_tbr_enabled" translatable="false">pref_omnipod_beep_tbr_enabled</string>
|
||||||
<string name="omnipod_config_beep_bolus_enabled">Bolus Beep Enabled</string>
|
<string name="omnipod_config_beep_bolus_enabled">Bolus Beep Enabled</string>
|
||||||
<string name="omnipod_config_beep_basal_enabled">Basal Beep Enabled</string>
|
<string name="omnipod_config_beep_basal_enabled">Basal Beep Enabled</string>
|
||||||
<string name="omnipod_config_beep_smb_enabled">SMB Beep Enabled</string>
|
<string name="omnipod_config_beep_smb_enabled">SMB Beep Enabled</string>
|
||||||
|
<string name="omnipod_config_beep_tbr_enabled">TBR Beep Enabled</string>
|
||||||
|
|
||||||
<!-- Omnipod - Fragment -->
|
<!-- Omnipod - Fragment -->
|
||||||
<string name="omnipod_pod_mgmt">Pod Mgmt</string>
|
<string name="omnipod_pod_mgmt">Pod Mgmt</string>
|
||||||
|
|
|
@ -26,5 +26,10 @@
|
||||||
android:key="@string/key_omnipod_beep_smb_enabled"
|
android:key="@string/key_omnipod_beep_smb_enabled"
|
||||||
android:title="@string/omnipod_config_beep_smb_enabled" />
|
android:title="@string/omnipod_config_beep_smb_enabled" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="@string/key_omnipod_beep_tbr_enabled"
|
||||||
|
android:title="@string/omnipod_config_beep_tbr_enabled" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
Reference in a new issue