-
Notifications
You must be signed in to change notification settings - Fork 343
Calibration
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
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
Following functions in protocol Calibrator are implemented in the extension Calibrator:
- initialCalibration
- createNewBgReading
- createNewCalibration
class DexcomCalibrator
class Libre1Calibrator