Remove BgReading.noise for now, clashes with existing NS data.

I believe NS uses 'noise' to store the noise level (1 through 3?).
This commit is contained in:
Johannes Mockenhaupt 2018-06-23 11:41:03 +02:00
parent 73e8a0c876
commit 6cb09d4fcb
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 0 additions and 13 deletions

View file

@ -38,7 +38,6 @@ public interface Intents {
String EXTRA_TIMESTAMP = "com.eveningoutpost.dexdrip.Extras.Time";
String EXTRA_RAW = "com.eveningoutpost.dexdrip.Extras.Raw";
String XDRIP_DATA_SOURCE_DESCRIPTION = "com.eveningoutpost.dexdrip.Extras.SourceDesc";
String EXTRA_NOISE = "com.eveningoutpost.dexdrip.Extras.Noise";
String ACTION_NEW_BG_ESTIMATE_NO_DATA = "com.eveningoutpost.dexdrip.BgEstimateNoData";

View file

@ -37,8 +37,6 @@ public class BgReading implements DataPointWithLabelInterface {
@DatabaseField
public double raw;
@DatabaseField
public double noise = -999; // xDrip sends -999 to indicate lack of a noise reading (due to missed readings or calibration)
@DatabaseField
public boolean isFiltered;
@DatabaseField
public String sourcePlugin;
@ -154,7 +152,6 @@ public class BgReading implements DataPointWithLabelInterface {
raw = other.raw;
direction = other.direction;
_id = other._id;
noise = other.noise;
sourcePlugin = other.sourcePlugin;
isFiltered = other.isFiltered;
}

View file

@ -123,8 +123,6 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
"isFiltered", "integer");
createRowIfNotExists(getDaoBgReadings(), DatabaseHelper.DATABASE_BGREADINGS,
"sourcePlugin", "text");
createRowIfNotExists(getDaoBgReadings(), DatabaseHelper.DATABASE_BGREADINGS,
"noise", "real");
} catch (SQLException e) {
log.error("Can't create database", e);

View file

@ -50,15 +50,8 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
bgReading.direction = bundle.getString(Intents.EXTRA_BG_SLOPE_NAME);
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
bgReading.noise = bundle.getDouble(Intents.EXTRA_NOISE, -999);
String sourceDescription = bundle.getString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, "");
bgReading.isFiltered = sourceDescription.equals("G5 Native");
if (MainApp.engineeringMode && !bgReading.isFiltered && bgReading.noise >= 0 && bgReading.noise <= 4) {
// TODO syncing noice with NS is neither implemented nor tested
// * NSUpload.uploadBg
log.debug("Setting filtered=true, since noise is provided and passed check: " + bgReading.noise);
bgReading.isFiltered = true;
}
bgReading.sourcePlugin = getName();
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());