Skip to content

Calibration

Johan Degraeve edited this page Mar 12, 2019 · 6 revisions

Summary

The algorithms folder has protocols and classes which define the Calibration. Only algorithms, no data storage.
Also no read of access to data defined in other classes, the necessary data is passed when calling the functions.

For a new type of Sensor (only Libre and Dexcom at the moment), a new class needs to be created that conforms to the protocol Calibrator and then defines only the variables sParams and ageAdjustMentNeeded.

To use the Calibrator, the functions are initialCalibration, createNewBgReading, createNewCalibration

protocol Calibrator

Defines variables en functions.
The variables need to be adopted by class that conform to the protocol.
The variables are typical sensor type depenent :

  • var sParams:SlopeParameters{get}
    //this variable defines sParams for type of sensor
  • var ageAdjustMentNeeded:Bool{get}
    //age adjustment needed or not, which is not the case for Libre

extension Calibrator

Following functions in protocol Calibrator are implemented in the extension Calibrator:

  • initialCalibration
  • createNewBgReading
  • createNewCalibration

Available Calibrators

Dexcom

class DexcomCalibrator

Libre1

class Libre1Calibrator