commit
a1529b3438
|
@ -53,4 +53,6 @@ public interface PumpInterface {
|
|||
String deviceID();
|
||||
|
||||
PumpDescription getPumpDescription();
|
||||
|
||||
public String shortStatus(boolean veryShort);
|
||||
}
|
||||
|
|
|
@ -688,6 +688,15 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String shortStatus(boolean veryShort) {
|
||||
if (activePump != null) {
|
||||
return activePump.shortStatus(veryShort);
|
||||
} else {
|
||||
return "No Pump active!";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constraints interface
|
||||
**/
|
||||
|
|
|
@ -839,7 +839,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
}
|
||||
|
||||
// Reply for sms communicator
|
||||
public String shortStatus() {
|
||||
public String shortStatus(boolean veryShort) {
|
||||
String ret = "";
|
||||
if (getDanaRPump().lastConnection.getTime() != 0) {
|
||||
Long agoMsec = new Date().getTime() - getDanaRPump().lastConnection.getTime();
|
||||
|
@ -855,6 +855,9 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
if (isExtendedBoluslInProgress()) {
|
||||
ret += "Extended: " + getExtendedBolus().toString() + "\n";
|
||||
}
|
||||
if (!veryShort){
|
||||
ret += "TDD: " + DecimalFormatter.to0Decimal(getDanaRPump().dailyTotalUnits) + " / " + getDanaRPump().maxDailyTotalUnits + " U\n";
|
||||
}
|
||||
ret += "IOB: " + getDanaRPump().iob + "U\n";
|
||||
ret += "Reserv: " + DecimalFormatter.to0Decimal(getDanaRPump().reservoirRemainingUnits) + "U\n";
|
||||
ret += "Batt: " + getDanaRPump().batteryRemaining + "\n";
|
||||
|
|
|
@ -839,7 +839,7 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
|||
}
|
||||
|
||||
// Reply for sms communicator
|
||||
public String shortStatus() {
|
||||
public String shortStatus(boolean veryShort) {
|
||||
String ret = "";
|
||||
if (getDanaRPump().lastConnection.getTime() != 0) {
|
||||
Long agoMsec = new Date().getTime() - getDanaRPump().lastConnection.getTime();
|
||||
|
@ -855,6 +855,9 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
|||
if (isExtendedBoluslInProgress()) {
|
||||
ret += "Extended: " + getExtendedBolus().toString() + "\n";
|
||||
}
|
||||
if (!veryShort){
|
||||
ret += "TDD: " + DecimalFormatter.to0Decimal(getDanaRPump().dailyTotalUnits) + " / " + getDanaRPump().maxDailyTotalUnits + " U\n";
|
||||
}
|
||||
ret += "IOB: " + getDanaRPump().iob + "U\n";
|
||||
ret += "Reserv: " + DecimalFormatter.to0Decimal(getDanaRPump().reservoirRemainingUnits) + "U\n";
|
||||
ret += "Batt: " + getDanaRPump().batteryRemaining + "\n";
|
||||
|
|
|
@ -282,4 +282,9 @@ public class MDIPlugin implements PluginBase, PumpInterface {
|
|||
return pumpDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String shortStatus(boolean veryShort) {
|
||||
return deviceID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -307,12 +307,12 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
case "DANAR":
|
||||
DanaRPlugin danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class);
|
||||
if (danaRPlugin != null && danaRPlugin.isEnabled(PluginBase.PUMP)) {
|
||||
reply = danaRPlugin.shortStatus();
|
||||
reply = danaRPlugin.shortStatus(true);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
DanaRKoreanPlugin danaRKoreanPlugin = (DanaRKoreanPlugin) MainApp.getSpecificPlugin(DanaRKoreanPlugin.class);
|
||||
if (danaRKoreanPlugin != null && danaRKoreanPlugin.isEnabled(PluginBase.PUMP)) {
|
||||
reply = danaRKoreanPlugin.shortStatus();
|
||||
reply = danaRKoreanPlugin.shortStatus(true);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
receivedSms.processed = true;
|
||||
|
@ -396,12 +396,12 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
PumpEnactResult result = pumpInterface.deliverTreatment(bolusWaitingForConfirmation.bolusRequested, 0, null);
|
||||
if (result.success) {
|
||||
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
lastRemoteBolusTime = new Date();
|
||||
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_bolusfailed);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
}
|
||||
|
@ -414,11 +414,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
PumpEnactResult result = pumpInterface.setTempBasalAbsolute(tempBasalWaitingForConfirmation.tempBasal, 30);
|
||||
if (result.success) {
|
||||
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_tempbasalset), result.absolute, result.duration);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_tempbasalfailed);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
}
|
||||
|
@ -431,11 +431,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
PumpEnactResult result = pumpInterface.cancelTempBasal();
|
||||
if (result.success) {
|
||||
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_tempbasalcanceled));
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_tempbasalcancelfailed);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus(true);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -440,4 +440,9 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
|||
return pumpDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String shortStatus(boolean veryShort) {
|
||||
return "Virtual Pump";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue