|
|
@@ -70,6 +70,7 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
var firstGraphLoad: Bool = true
|
|
|
var firstBasalGraphLoad: Bool = true
|
|
|
var minAgoBG: Double = 0.0
|
|
|
+ var currentOverride = 0.0
|
|
|
|
|
|
// Vars for NS Pull
|
|
|
var graphHours:Int=24
|
|
|
@@ -323,6 +324,14 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
eventTitle = eventTitle.replacingOccurrences(of: "%BG%", with: String(self.bgData[self.bgData.count - 1].sgv))
|
|
|
eventTitle = eventTitle.replacingOccurrences(of: "%DIRECTION%", with: direction)
|
|
|
eventTitle = eventTitle.replacingOccurrences(of: "%DELTA%", with: deltaString)
|
|
|
+ if self.currentOverride != 1.0 {
|
|
|
+ let val = Int( self.currentOverride*100)
|
|
|
+ // let overrideText = String(format:"%f1", self.currentOverride*100)
|
|
|
+ let text = String(val) + "%"
|
|
|
+ eventTitle = eventTitle.replacingOccurrences(of: "%OVERRIDE%", with: text)
|
|
|
+ } else {
|
|
|
+ eventTitle = eventTitle.replacingOccurrences(of: "%OVERRIDE%", with: "")
|
|
|
+ }
|
|
|
var minAgo = ""
|
|
|
if deltaTime > 5 {
|
|
|
// write old BG reading and continue pushing out end date to show last entry
|
|
|
@@ -346,27 +355,6 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
eventTitle = eventTitle.replacingOccurrences(of: "%COB%", with: cob)
|
|
|
eventTitle = eventTitle.replacingOccurrences(of: "%BASAL%", with: basal)
|
|
|
|
|
|
- // old
|
|
|
- /*
|
|
|
- eventTitle += String(self.bgData[self.bgData.count - 1].sgv) + " "
|
|
|
- eventTitle += direction + " "
|
|
|
- eventTitle += deltaString + " "
|
|
|
- if deltaTime > 5 {
|
|
|
- // write old BG reading and continue pushing out end date to show last entry
|
|
|
- eventTitle += ": " + String(Int(deltaTime)) + " min"
|
|
|
- eventEndDate = eventStartDate.addingTimeInterval((60 * 10) + (deltaTime * 60))
|
|
|
- }
|
|
|
-
|
|
|
- eventTitle += "\n"
|
|
|
- if self.tableData[1].value != "" {
|
|
|
- eventTitle += "C:" + self.tableData[1].value + "g "
|
|
|
- }
|
|
|
- if self.tableData[0].value != "" {
|
|
|
- eventTitle += "I: " + self.tableData[0].value + "u"
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
// Delete Last Event
|