Skip to content

overriden calibrations used in slopeOOBHandler ? #378

@JohanDegraeve

Description

@JohanDegraeve

when overriding a calibration, the latest calibration is changed so that sensor_confidence=0 and slope_confidence=0 (see https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Models/Calibration.java#L664)

Then when a new calibration is created, a call is made to calculate_w_l_s
this one makes a call to slopeOOBHandler
slopeOOBHandler uses the latest 3 calibrations. For this it calls Calibrations.latest(3)
https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Models/Calibration.java#L550

But latest(3) is picking up all calibrations with matching sensor id, the latest 3, that means it also takes the latest one which is actually being overriden.

Is that normal ?
I would think that it's better to get Calibration.allForSensorInLastFourDays and then take the latet 3 from that result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions