use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class BgSendQueue method dataMap.
private static DataMap dataMap(BgReading bg, SharedPreferences sPrefs, BgGraphBuilder bgGraphBuilder, Context context, int battery) {
// KS
Double highMark = Double.parseDouble(sPrefs.getString("highValue", "140"));
Double lowMark = Double.parseDouble(sPrefs.getString("lowValue", "60"));
DataMap dataMap = new DataMap();
// int battery = BgSendQueue.getBatteryLevel(context.getApplicationContext());
dataMap.putString("sgvString", bgGraphBuilder.unitized_string(bg.calculated_value));
dataMap.putString("slopeArrow", bg.slopeArrow());
// TODO: change that to long (was like that in NW)
dataMap.putDouble("timestamp", bg.timestamp);
dataMap.putString("delta", bgGraphBuilder.unitizedDeltaString(true, true));
dataMap.putString("battery", "" + battery);
dataMap.putLong("sgvLevel", sgvLevel(bg.calculated_value, sPrefs, bgGraphBuilder));
dataMap.putInt("batteryLevel", (battery >= 30) ? 1 : 0);
dataMap.putDouble("sgvDouble", bg.calculated_value);
dataMap.putDouble("high", inMgdl(highMark, sPrefs));
dataMap.putDouble("low", inMgdl(lowMark, sPrefs));
// Used in DexCollectionService
dataMap.putInt("bridge_battery", sPrefs.getInt("bridge_battery", -1));
// }
return dataMap;
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class HeartRateService method dataMap.
// this is pretty inefficient - maybe eventually replace with protobuf
private static DataMap dataMap(HeartRate log) {
final DataMap dataMap = new DataMap();
final String json = log.toS();
dataMap.putString("entry", json);
return dataMap;
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class G5BaseService method getWatchStatus.
public static DataMap getWatchStatus() {
DataMap dataMap = new DataMap();
dataMap.putString("lastState", lastState);
dataMap.putLong("timestamp", static_last_timestamp);
return dataMap;
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class Simulation method Approve.
public void Approve(View myview) {
if (watchkeypad) {
// Treatments.create(carbs, insulin, thisnotes, new Date().getTime());
DataMap dataMap = new DataMap();
dataMap.putDouble("timeoffset", timeoffset);
dataMap.putDouble("carbs", carbs);
dataMap.putDouble("insulin", insulin);
dataMap.putDouble("bloodtest", bloodtest);
dataMap.putString("notes", thisnotes);
// dataMap.putLong("timestamp", System.currentTimeMillis());
ListenerService.createTreatment(dataMap, this);
} else
SendData(this, WEARABLE_APPROVE_TREATMENT, null);
finish();
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class DexCollectionService method getWatchStatus.
public static DataMap getWatchStatus() {
DataMap dataMap = new DataMap();
dataMap.putString("lastState", lastState);
if (last_transmitter_Data != null)
dataMap.putLong("timestamp", last_transmitter_Data.timestamp);
dataMap.putInt("mStaticState", mStaticState);
dataMap.putInt("last_battery_level", last_battery_level);
dataMap.putLong("retry_time", retry_time);
dataMap.putLong("failover_time", failover_time);
dataMap.putString("static_last_hexdump", static_last_hexdump);
dataMap.putString("static_last_sent_hexdump", static_last_sent_hexdump);
return dataMap;
}
Aggregations