Combo: fix ReadQuickInfoCommand to handle empty bolus history.
This commit is contained in:
parent
ef650b80a1
commit
3ed4aa468d
1 changed files with 12 additions and 10 deletions
|
@ -39,17 +39,19 @@ public class ReadQuickInfoCommand extends BaseCommand {
|
||||||
// read bolus records
|
// read bolus records
|
||||||
int totalRecords = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.TOTAL_RECORD);
|
int totalRecords = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.TOTAL_RECORD);
|
||||||
int record = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD);
|
int record = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD);
|
||||||
while (true) {
|
if (record > 0) {
|
||||||
bolusHistory.add(readBolusRecord());
|
while (true) {
|
||||||
if (bolusHistory.size() == numberOfBolusRecordsToRetrieve || record == totalRecords) {
|
bolusHistory.add(readBolusRecord());
|
||||||
break;
|
if (bolusHistory.size() == numberOfBolusRecordsToRetrieve || record == totalRecords) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// advance to next record
|
||||||
|
scripter.pressDownKey();
|
||||||
|
while (record == (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD)) {
|
||||||
|
scripter.waitForScreenUpdate();
|
||||||
|
}
|
||||||
|
record = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD);
|
||||||
}
|
}
|
||||||
// advance to next record
|
|
||||||
scripter.pressDownKey();
|
|
||||||
while (record == (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD)) {
|
|
||||||
scripter.waitForScreenUpdate();
|
|
||||||
}
|
|
||||||
record = (int) scripter.getCurrentMenu().getAttribute(MenuAttribute.CURRENT_RECORD);
|
|
||||||
}
|
}
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
if (!result.history.bolusHistory.isEmpty()) {
|
if (!result.history.bolusHistory.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue