Insight Live History

This commit is contained in:
Jamorham 2018-01-28 21:52:58 +00:00
parent e704f130bc
commit 9a8521b809
No known key found for this signature in database
GPG key ID: 0BC5C3E0AAD64DF9

View file

@ -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;
}
}
}