RS,Rv2: load only recent history
This commit is contained in:
parent
e6baf3ff47
commit
dd687fbb40
|
@ -240,7 +240,7 @@ public class DanaRSService extends Service {
|
||||||
SystemClock.sleep(100);
|
SystemClock.sleep(100);
|
||||||
}
|
}
|
||||||
if (DanaRS_Packet_APS_History_Events.lastEventTimeLoaded != 0)
|
if (DanaRS_Packet_APS_History_Events.lastEventTimeLoaded != 0)
|
||||||
lastHistoryFetched = DanaRS_Packet_APS_History_Events.lastEventTimeLoaded - 45 * 60 * 1000L; // always load last 45 min
|
lastHistoryFetched = DanaRS_Packet_APS_History_Events.lastEventTimeLoaded - T.mins(1).msecs();
|
||||||
else
|
else
|
||||||
lastHistoryFetched = 0;
|
lastHistoryFetched = 0;
|
||||||
log.debug("Events loaded");
|
log.debug("Events loaded");
|
||||||
|
@ -272,7 +272,7 @@ public class DanaRSService extends Service {
|
||||||
// bleComm.sendMessage(msg);
|
// bleComm.sendMessage(msg);
|
||||||
DanaRS_Packet_APS_Set_Event_History msgSetHistoryEntry_v2 = new DanaRS_Packet_APS_Set_Event_History(DanaRPump.CARBS, carbtime, carbs, 0);
|
DanaRS_Packet_APS_Set_Event_History msgSetHistoryEntry_v2 = new DanaRS_Packet_APS_Set_Event_History(DanaRPump.CARBS, carbtime, carbs, 0);
|
||||||
bleComm.sendMessage(msgSetHistoryEntry_v2);
|
bleComm.sendMessage(msgSetHistoryEntry_v2);
|
||||||
lastHistoryFetched = carbtime - 60000;
|
lastHistoryFetched = Math.min(lastHistoryFetched, carbtime - T.mins(1).msecs());
|
||||||
}
|
}
|
||||||
|
|
||||||
final long bolusStart = System.currentTimeMillis();
|
final long bolusStart = System.currentTimeMillis();
|
||||||
|
|
|
@ -371,7 +371,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService {
|
||||||
mSerialIOThread.sendMessage(msg);
|
mSerialIOThread.sendMessage(msg);
|
||||||
MsgSetHistoryEntry_v2 msgSetHistoryEntry_v2 = new MsgSetHistoryEntry_v2(DanaRPump.CARBS, carbtime, carbs, 0);
|
MsgSetHistoryEntry_v2 msgSetHistoryEntry_v2 = new MsgSetHistoryEntry_v2(DanaRPump.CARBS, carbtime, carbs, 0);
|
||||||
mSerialIOThread.sendMessage(msgSetHistoryEntry_v2);
|
mSerialIOThread.sendMessage(msgSetHistoryEntry_v2);
|
||||||
lastHistoryFetched = carbtime - 60000;
|
lastHistoryFetched = Math.min(lastHistoryFetched, carbtime - T.mins(1).msecs());
|
||||||
}
|
}
|
||||||
|
|
||||||
final long bolusStart = System.currentTimeMillis();
|
final long bolusStart = System.currentTimeMillis();
|
||||||
|
@ -455,7 +455,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService {
|
||||||
mSerialIOThread.sendMessage(msg);
|
mSerialIOThread.sendMessage(msg);
|
||||||
MsgSetHistoryEntry_v2 msgSetHistoryEntry_v2 = new MsgSetHistoryEntry_v2(DanaRPump.CARBS, time, amount, 0);
|
MsgSetHistoryEntry_v2 msgSetHistoryEntry_v2 = new MsgSetHistoryEntry_v2(DanaRPump.CARBS, time, amount, 0);
|
||||||
mSerialIOThread.sendMessage(msgSetHistoryEntry_v2);
|
mSerialIOThread.sendMessage(msgSetHistoryEntry_v2);
|
||||||
lastHistoryFetched = time - 1;
|
lastHistoryFetched = Math.min(lastHistoryFetched, time - T.mins(1).msecs());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService {
|
||||||
}
|
}
|
||||||
SystemClock.sleep(200);
|
SystemClock.sleep(200);
|
||||||
if (MsgHistoryEvents_v2.lastEventTimeLoaded != 0)
|
if (MsgHistoryEvents_v2.lastEventTimeLoaded != 0)
|
||||||
lastHistoryFetched = MsgHistoryEvents_v2.lastEventTimeLoaded - 45 * 60 * 1000L; //always load last 45 min;
|
lastHistoryFetched = MsgHistoryEvents_v2.lastEventTimeLoaded - T.mins(1).msecs();
|
||||||
else
|
else
|
||||||
lastHistoryFetched = 0;
|
lastHistoryFetched = 0;
|
||||||
mDanaRPump.lastConnection = System.currentTimeMillis();
|
mDanaRPump.lastConnection = System.currentTimeMillis();
|
||||||
|
|
Loading…
Reference in a new issue