Java Code Examples for com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder#NOISE_TRIGGER

The following examples show how to use com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder#NOISE_TRIGGER . 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: BgReading.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
Example 2
Source File: BgReading.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
Example 3
Source File: BgReading.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
Example 4
Source File: BgReading.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
Example 5
Source File: BestGlucose.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}
 
Example 6
Source File: BestGlucose.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}
 
Example 7
Source File: BestGlucose.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}
 
Example 8
Source File: BestGlucose.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}