RS text bolus error codes

This commit is contained in:
Milos Kozak 2018-08-29 20:14:36 +02:00
parent 178c2b90fe
commit 063ead4c17
2 changed files with 23 additions and 4 deletions

View file

@ -408,9 +408,24 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
result.success = connectionOK && Math.abs(detailedBolusInfo.insulin - t.insulin) < pumpDescription.bolusStep;
result.bolusDelivered = t.insulin;
result.carbsDelivered = detailedBolusInfo.carbs;
if (!result.success)
result.comment = String.format(MainApp.gs(R.string.boluserrorcode), detailedBolusInfo.insulin, t.insulin, DanaRS_Packet_Bolus_Set_Step_Bolus_Start.errorCode);
else
if (!result.success) {
String error = "" + DanaRS_Packet_Bolus_Set_Step_Bolus_Start.errorCode;
switch (DanaRS_Packet_Bolus_Set_Step_Bolus_Start.errorCode) {
case 0x10:
error = MainApp.gs(R.string.maxbolusviolation);
break;
case 0x20:
error = MainApp.gs(R.string.commanderror);
break;
case 0x40:
error = MainApp.gs(R.string.speederror);
break;
case 0x80:
error = MainApp.gs(R.string.insulinlimitviolation);
break;
}
result.comment = String.format(MainApp.gs(R.string.boluserrorcode), detailedBolusInfo.insulin, t.insulin, error);
} else
result.comment = MainApp.gs(R.string.virtualpump_resultok);
if (L.isEnabled(L.PUMP))
log.debug("deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.bolusDelivered);

View file

@ -1058,7 +1058,7 @@
<string name="setupwizard_language_prompt">Select your language</string>
<string name="key_language" translatable="false">language</string>
<string name="key_openapsama_min_5m_carbimpact" translatable="false">openapsama_min_5m_carbimpact</string>
<string name="boluserrorcode">Asked: %1$.2fU Delivered: %2$.2fU Error code: %3$d</string>
<string name="boluserrorcode">Asked: %1$.2fU Delivered: %2$.2fU Error code: %3$s</string>
<string name="firstinsulinincrement">First insulin increment</string>
<string name="secondinsulinincrement">Second insulin increment</string>
<string name="thirdinsulinincrement">Third insulin increment</string>
@ -1195,6 +1195,10 @@
<string name="calculation_short">Calc</string>
<string name="handshaking">Handshaking</string>
<string name="sendlogfiles">Send today\'s log files to developers along with this time. Unexpected situation.</string>
<string name="maxbolusviolation">Max bolus violation</string>
<string name="commanderror">Command error</string>
<string name="speederror">Speed error</string>
<string name="insulinlimitviolation">Insulin limit violation</string>
<plurals name="objective_days">
<item quantity="one">%1$d day</item>