Insight Live History
This commit is contained in:
parent
e704f130bc
commit
9a8521b809
|
@ -0,0 +1,32 @@
|
|||
package info.nightscout.androidaps.plugins.PumpInsight.history;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpInsight.utils.Helpers;
|
||||
|
||||
/**
|
||||
* Created by jamorham on 27/01/2018.
|
||||
*
|
||||
* In memory status storage class
|
||||
*/
|
||||
|
||||
public class LiveHistory {
|
||||
|
||||
private static String status = "";
|
||||
private static long status_time = -1;
|
||||
|
||||
public static String getStatus() {
|
||||
if (status.equals("")) return status;
|
||||
return status + " " + Helpers.niceTimeScalar(Helpers.msSince(status_time)) + " ago";
|
||||
}
|
||||
|
||||
public static long getStatusTime() {
|
||||
return status_time;
|
||||
}
|
||||
|
||||
static void setStatus(String mystatus, long eventtime) {
|
||||
if (eventtime > status_time) {
|
||||
status_time = eventtime;
|
||||
status = mystatus;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue