Merge pull request #697 from jotomo/phantom-fusion

AndroidAPS should support more pumps
This commit is contained in:
AdrianLxM 2018-02-18 13:50:00 +01:00 committed by GitHub
commit 641b39b4e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -57,7 +57,7 @@ android {
targetSdkVersion 23 targetSdkVersion 23
multiDexEnabled true multiDexEnabled true
versionCode 1500 versionCode 1500
version "1.57-combo-csv2-beta-6" version "1.58-combo-phantom-fusion"
buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", generateGitBuild() buildConfigField "String", "BUILDVERSION", generateGitBuild()

View file

@ -293,7 +293,7 @@ public class CommandQueue {
// wait for DatabaseHelper.scheduleProfiSwitch() to do the profile switch // TODO clean this crap up // wait for DatabaseHelper.scheduleProfiSwitch() to do the profile switch // TODO clean this crap up
SystemClock.sleep(5000); SystemClock.sleep(5000);
if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) { if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) {
Notification noProfileSwitchNotif = new Notification(Notification.PROFILE_SWITCH_MISSING, MainApp.sResources.getString(R.string.profileswitch_ismissing), Notification.NORMAL); Notification noProfileSwitchNotif = new Notification(Notification.PROFILE_SWITCH_MISSING, MainApp.gs(R.string.profileswitch_ismissing), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(noProfileSwitchNotif)); MainApp.bus().post(new EventNewNotification(noProfileSwitchNotif));
if (callback != null) { if (callback != null) {
PumpEnactResult result = new PumpEnactResult().success(false).enacted(false).comment("Refuse to send profile to pump! No ProfileSwitch!"); PumpEnactResult result = new PumpEnactResult().success(false).enacted(false).comment("Refuse to send profile to pump! No ProfileSwitch!");

View file

@ -81,17 +81,18 @@ public class CommandQueueTest extends CommandQueue {
extendedBolus(1, 30, null); extendedBolus(1, 30, null);
Assert.assertEquals(2, size()); Assert.assertEquals(2, size());
// add setProfile // add setProfile (command is not queued before unless a ProfileSwitch exists)
// TODO test with profile switch set
setProfile(new Profile(new JSONObject(profileJson), Constants.MGDL), null); setProfile(new Profile(new JSONObject(profileJson), Constants.MGDL), null);
Assert.assertEquals(3, size()); Assert.assertEquals(2, size());
// add loadHistory // add loadHistory
loadHistory((byte) 0, null); loadHistory((byte) 0, null);
Assert.assertEquals(4, size()); Assert.assertEquals(3, size());
// add loadEvents // add loadEvents
loadEvents(null); loadEvents(null);
Assert.assertEquals(5, size()); Assert.assertEquals(4, size());
clear(); clear();
tempBasalAbsolute(0, 30, true, null); tempBasalAbsolute(0, 30, true, null);