Skip to content

Commit

Permalink
add warning to multi-point calibration option
Browse files Browse the repository at this point in the history
  • Loading branch information
paulplant committed Jan 28, 2023
1 parent 7bd4f6b commit 7eb822c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xdrip/Storyboards/en.lproj/BluetoothPeripheralView.strings
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
"nfcScanSuccessfulMessage" = "\n✅ Scan successful ✅\n\nClick OK and just wait to allow the sensor to finish connecting via bluetooth.\n\nIn a short while the status should change to 'Connected'.";
"nfcErrorMessageScanErrorRetrying" = "Sensor scan error\n\nRetrying... # ";
"nfcErrorMessageScanFailed" = "Sensor scan has failed";

"nonFixedSlopeWarning" = "Multi-point calibration is an advanced feature.\n\nPlease do not use this feature until you have read the calibration section of the online help and understand how it works.";
4 changes: 4 additions & 0 deletions xdrip/Texts/TextsBluetoothPeripheralView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,8 @@ class Texts_BluetoothPeripheralView {
return NSLocalizedString("nfcScanNeeded", tableName: filename, bundle: Bundle.main, value: "NFC scan needed", comment: "text in status row, when waiting for a successful NFC scan before starting bluetooth scanning")
}()

static let nonFixedSlopeWarning: String = {
return NSLocalizedString("nonFixedSlopeWarning", tableName: filename, bundle: Bundle.main, value: "Multi-point calibration is an advanced feature.\n\nPlease do not use this feature until you have read the calibration section of the online help and understand how it works.", comment: "text to inform the user that multi-point calibration is an advanced option and could be dangerous if used incorrectly")
}()

}
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,13 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD

self.bluetoothPeripheral?.blePeripheral.nonFixedSlopeEnabled = isOn

// show the user a warning if they enabled multi-point calibration as this should only be used by advanced users who understand how it works. Too many new users were enabling this and getting bad results.
if isOn {

self.present(UIAlertController(title: Texts_Common.warning, message: Texts_BluetoothPeripheralView.nonFixedSlopeWarning, actionHandler: nil), animated: true, completion: nil)

}

// send info to bluetoothPeripheralManager
if let bluetoothPeripheral = self.bluetoothPeripheral {

Expand Down

0 comments on commit 7eb822c

Please sign in to comment.