Remove warning if pump time is off.

This commit is contained in:
Johannes Mockenhaupt 2017-12-05 21:44:28 +01:00
parent 7b88ec9e93
commit f9867c69fb
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 0 additions and 26 deletions

View file

@ -346,15 +346,6 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
return;
}
// ensure time and date(!) are current; connect triggers a notification on mismatch
/* menu not supported by ruffy v1
if (!pump.initialized) {
if (!runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime).success) {
return;
}
}
*/
// read basal profile into cache and update pump profile if needed
if (!pump.initialized) {
CommandResult readBasalResult = runCommand("Reading basal profile", 2, ruffyScripter::readBasalProfile);
@ -764,18 +755,6 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
checkAndResolveTbrMismatch(preCheckResult.state);
// raise notification if clock is off (setting clock is not supported by ruffy)
if (preCheckResult.state.pumpTimeMinutesOfDay != 0) {
Date now = new Date();
int minutesOfDayNow = now.getHours() * 60 + now.getMinutes();
if ((Math.abs(preCheckResult.state.pumpTimeMinutesOfDay - minutesOfDayNow) > 3)) {
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_notification_check_time_date), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(notification));
// setting date time isn't supported by ruffy v1, a warning is issue during connect if clock is off
// runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime);
}
}
return null;
}

View file

@ -813,7 +813,6 @@
<string name="combo_pump_unsupported_operation">Requested operation not supported by pump</string>
<string name="combo_bolus_bolus_delivery_failed">Bolus delivery failed. A (partial) bolus might have been delivered. Attempting to update history from pump. Please the pump and treatments tabs and bolus again as needed.</string>
<string name="combo_force_disabled_notification">Unsafe usage: extended or multiwave boluses have been delivered within the last 6 hours or the selected basal rate is not 1. Loop mode has been set to low-suspend only until 6 hours after the last unsupported bolus or basal rate profile. Only normal boluses are supported in loop mode with basal rate profile 1.</string>
<string name="combo_notification_check_time_date">Check pump time and date</string>
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last minute. For safety reasons this is disallowed.</string>
<string name="combo_pump_connected_now">Now</string>
<string name="combo_activity_reading_pump_history">Reading pump history</string>

View file

@ -4,8 +4,6 @@ package de.jotomo.ruffy.spi;
public class PumpState {
/** Time the state was captured. This is NOT the pump's time! */
public long timestamp;
/** The time displayed on the main menu */
public long pumpTimeMinutesOfDay;
public String menu = null;
public boolean suspended;

View file

@ -523,8 +523,6 @@ public class RuffyScripter implements RuffyCommands {
state.tbrRemainingDuration = durationMenuTime.getHour() * 60 + durationMenuTime.getMinute();
state.tbrRate = ((double) menu.getAttribute(MenuAttribute.BASAL_RATE));
}
MenuTime time = (MenuTime) menu.getAttribute(MenuAttribute.TIME);
state.pumpTimeMinutesOfDay = time.getHour() * 60 + time.getMinute();
state.batteryState = ((int) menu.getAttribute(MenuAttribute.BATTERY_STATE));
state.insulinState = ((int) menu.getAttribute(MenuAttribute.INSULIN_STATE));
} else if (menuType == MenuType.WARNING_OR_ERROR) {