Java Code Examples for com.eveningoutpost.dexdrip.Models.TransmitterData#unchangedRaw()
The following examples show how to use
com.eveningoutpost.dexdrip.Models.TransmitterData#unchangedRaw() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Ob1G5StateMachine.java From xDrip with GNU General Public License v3.0 | 4 votes |
private static synchronized void processNewTransmitterData(int raw_data, int filtered_data, int sensor_battery_level, long captureTime) { final TransmitterData transmitterData = TransmitterData.create(raw_data, filtered_data, sensor_battery_level, captureTime); if (transmitterData == null) { UserError.Log.e(TAG, "TransmitterData.create failed: Duplicate packet"); return; } else { UserError.Log.d(TAG, "Created transmitter data " + transmitterData.uuid + " " + JoH.dateTimeText(transmitterData.timestamp)); // TODO timeInMillisecondsOfLastSuccessfulSensorRead = captureTime; } if (transmitterData.unchangedRaw() && !SensorSanity.allowTestingWithDeadSensor()) { UserError.Log.wtf(TAG, "Raw values are not changing - blocking further processing: " + raw_data + " " + filtered_data); return; } final Sensor sensor = Sensor.currentSensor(); if (sensor == null) { UserError.Log.e(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); return; } //TODO : LOG if unfiltered or filtered values are zero Sensor.updateBatteryLevel(sensor, transmitterData.sensor_battery_level); if (d) UserError.Log.i(TAG, "timestamp create: " + Long.toString(transmitterData.timestamp)); if ((lastGlucoseBgReading != null) && (msSince(lastUsableGlucosePacket) < Constants.SECOND_IN_MS * 30)) { UserError.Log.d(TAG, "Updating BgReading provided by transmitter"); // use sensor data to update previous record instead of trying to calculate with it lastGlucoseBgReading.raw_data = transmitterData.raw_data / 1000; lastGlucoseBgReading.filtered_data = transmitterData.filtered_data / 1000; // TODO calculate filtered calculated value from internal alg?? lastGlucoseBgReading.calculateAgeAdjustedRawValue(); lastGlucoseBgReading.save(); } else { if (!Ob1G5CollectionService.usingNativeMode() || Ob1G5CollectionService.fallbackToXdripAlgorithm() || BgReading.latest(3).size() < 3) { final BgReading bgreading = BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, xdrip.getAppContext(), transmitterData.timestamp); UserError.Log.d(TAG, "BgReading created: " + bgreading.uuid + " " + JoH.dateTimeText(bgreading.timestamp)); } } // UserError.Log.d(TAG, "Dex raw_data " + Double.toString(transmitterData.raw_data));//KS // UserError.Log.d(TAG, "Dex filtered_data " + Double.toString(transmitterData.filtered_data));//KS // UserError.Log.d(TAG, "Dex sensor_battery_level " + Double.toString(transmitterData.sensor_battery_level));//KS // UserError.Log.d(TAG, "Dex timestamp " + JoH.dateTimeText(transmitterData.timestamp));//KS // TODO static_last_timestamp = transmitterData.timestamp; }
Example 2
Source File: Ob1G5StateMachine.java From xDrip with GNU General Public License v3.0 | 4 votes |
private static synchronized void processNewTransmitterData(int raw_data, int filtered_data, int sensor_battery_level, long captureTime) { final TransmitterData transmitterData = TransmitterData.create(raw_data, filtered_data, sensor_battery_level, captureTime); if (transmitterData == null) { UserError.Log.e(TAG, "TransmitterData.create failed: Duplicate packet"); return; } else { UserError.Log.d(TAG, "Created transmitter data " + transmitterData.uuid + " " + JoH.dateTimeText(transmitterData.timestamp)); // TODO timeInMillisecondsOfLastSuccessfulSensorRead = captureTime; } if (transmitterData.unchangedRaw() && !SensorSanity.allowTestingWithDeadSensor()) { UserError.Log.wtf(TAG, "Raw values are not changing - blocking further processing: " + raw_data + " " + filtered_data); return; } final Sensor sensor = Sensor.currentSensor(); if (sensor == null) { UserError.Log.e(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); return; } //TODO : LOG if unfiltered or filtered values are zero Sensor.updateBatteryLevel(sensor, transmitterData.sensor_battery_level); if (d) UserError.Log.i(TAG, "timestamp create: " + Long.toString(transmitterData.timestamp)); if ((lastGlucoseBgReading != null) && (msSince(lastUsableGlucosePacket) < Constants.SECOND_IN_MS * 30)) { UserError.Log.d(TAG, "Updating BgReading provided by transmitter"); // use sensor data to update previous record instead of trying to calculate with it lastGlucoseBgReading.raw_data = transmitterData.raw_data / 1000; lastGlucoseBgReading.filtered_data = transmitterData.filtered_data / 1000; // TODO calculate filtered calculated value from internal alg?? lastGlucoseBgReading.calculateAgeAdjustedRawValue(); lastGlucoseBgReading.save(); } else { if (!Ob1G5CollectionService.usingNativeMode() || Ob1G5CollectionService.fallbackToXdripAlgorithm() || BgReading.latest(3).size() < 3) { final BgReading bgreading = BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, xdrip.getAppContext(), transmitterData.timestamp); UserError.Log.d(TAG, "BgReading created: " + bgreading.uuid + " " + JoH.dateTimeText(bgreading.timestamp)); } } // UserError.Log.d(TAG, "Dex raw_data " + Double.toString(transmitterData.raw_data));//KS // UserError.Log.d(TAG, "Dex filtered_data " + Double.toString(transmitterData.filtered_data));//KS // UserError.Log.d(TAG, "Dex sensor_battery_level " + Double.toString(transmitterData.sensor_battery_level));//KS // UserError.Log.d(TAG, "Dex timestamp " + JoH.dateTimeText(transmitterData.timestamp));//KS // TODO static_last_timestamp = transmitterData.timestamp; }
Example 3
Source File: Ob1G5StateMachine.java From xDrip-plus with GNU General Public License v3.0 | 4 votes |
private static synchronized void processNewTransmitterData(int raw_data, int filtered_data, int sensor_battery_level, long captureTime) { final TransmitterData transmitterData = TransmitterData.create(raw_data, filtered_data, sensor_battery_level, captureTime); if (transmitterData == null) { UserError.Log.e(TAG, "TransmitterData.create failed: Duplicate packet"); return; } else { UserError.Log.d(TAG, "Created transmitter data " + transmitterData.uuid + " " + JoH.dateTimeText(transmitterData.timestamp)); // TODO timeInMillisecondsOfLastSuccessfulSensorRead = captureTime; } if (transmitterData.unchangedRaw() && !SensorSanity.allowTestingWithDeadSensor()) { UserError.Log.wtf(TAG, "Raw values are not changing - blocking further processing: " + raw_data + " " + filtered_data); return; } final Sensor sensor = Sensor.currentSensor(); if (sensor == null) { UserError.Log.e(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); return; } //TODO : LOG if unfiltered or filtered values are zero Sensor.updateBatteryLevel(sensor, transmitterData.sensor_battery_level); if (d) UserError.Log.i(TAG, "timestamp create: " + Long.toString(transmitterData.timestamp)); if ((lastGlucoseBgReading != null) && (msSince(lastUsableGlucosePacket) < Constants.SECOND_IN_MS * 30)) { UserError.Log.d(TAG, "Updating BgReading provided by transmitter"); // use sensor data to update previous record instead of trying to calculate with it lastGlucoseBgReading.raw_data = transmitterData.raw_data / 1000; lastGlucoseBgReading.filtered_data = transmitterData.filtered_data / 1000; // TODO calculate filtered calculated value from internal alg?? lastGlucoseBgReading.calculateAgeAdjustedRawValue(); lastGlucoseBgReading.save(); } else { if (!Ob1G5CollectionService.usingNativeMode() || Ob1G5CollectionService.fallbackToXdripAlgorithm() || BgReading.latest(3).size() < 3) { final BgReading bgreading = BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, xdrip.getAppContext(), transmitterData.timestamp); UserError.Log.d(TAG, "BgReading created: " + bgreading.uuid + " " + JoH.dateTimeText(bgreading.timestamp)); } } // UserError.Log.d(TAG, "Dex raw_data " + Double.toString(transmitterData.raw_data));//KS // UserError.Log.d(TAG, "Dex filtered_data " + Double.toString(transmitterData.filtered_data));//KS // UserError.Log.d(TAG, "Dex sensor_battery_level " + Double.toString(transmitterData.sensor_battery_level));//KS // UserError.Log.d(TAG, "Dex timestamp " + JoH.dateTimeText(transmitterData.timestamp));//KS // TODO static_last_timestamp = transmitterData.timestamp; }
Example 4
Source File: Ob1G5StateMachine.java From xDrip-plus with GNU General Public License v3.0 | 4 votes |
private static synchronized void processNewTransmitterData(int raw_data, int filtered_data, int sensor_battery_level, long captureTime) { final TransmitterData transmitterData = TransmitterData.create(raw_data, filtered_data, sensor_battery_level, captureTime); if (transmitterData == null) { UserError.Log.e(TAG, "TransmitterData.create failed: Duplicate packet"); return; } else { UserError.Log.d(TAG, "Created transmitter data " + transmitterData.uuid + " " + JoH.dateTimeText(transmitterData.timestamp)); // TODO timeInMillisecondsOfLastSuccessfulSensorRead = captureTime; } if (transmitterData.unchangedRaw() && !SensorSanity.allowTestingWithDeadSensor()) { UserError.Log.wtf(TAG, "Raw values are not changing - blocking further processing: " + raw_data + " " + filtered_data); return; } final Sensor sensor = Sensor.currentSensor(); if (sensor == null) { UserError.Log.e(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); return; } //TODO : LOG if unfiltered or filtered values are zero Sensor.updateBatteryLevel(sensor, transmitterData.sensor_battery_level); if (d) UserError.Log.i(TAG, "timestamp create: " + Long.toString(transmitterData.timestamp)); if ((lastGlucoseBgReading != null) && (msSince(lastUsableGlucosePacket) < Constants.SECOND_IN_MS * 30)) { UserError.Log.d(TAG, "Updating BgReading provided by transmitter"); // use sensor data to update previous record instead of trying to calculate with it lastGlucoseBgReading.raw_data = transmitterData.raw_data / 1000; lastGlucoseBgReading.filtered_data = transmitterData.filtered_data / 1000; // TODO calculate filtered calculated value from internal alg?? lastGlucoseBgReading.calculateAgeAdjustedRawValue(); lastGlucoseBgReading.save(); } else { if (!Ob1G5CollectionService.usingNativeMode() || Ob1G5CollectionService.fallbackToXdripAlgorithm() || BgReading.latest(3).size() < 3) { final BgReading bgreading = BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, xdrip.getAppContext(), transmitterData.timestamp); UserError.Log.d(TAG, "BgReading created: " + bgreading.uuid + " " + JoH.dateTimeText(bgreading.timestamp)); } } // UserError.Log.d(TAG, "Dex raw_data " + Double.toString(transmitterData.raw_data));//KS // UserError.Log.d(TAG, "Dex filtered_data " + Double.toString(transmitterData.filtered_data));//KS // UserError.Log.d(TAG, "Dex sensor_battery_level " + Double.toString(transmitterData.sensor_battery_level));//KS // UserError.Log.d(TAG, "Dex timestamp " + JoH.dateTimeText(transmitterData.timestamp));//KS // TODO static_last_timestamp = transmitterData.timestamp; }