-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from ps2/dev
Version 2.0.3
- Loading branch information
Showing
363 changed files
with
12,143 additions
and
1,306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ project.xcworkspace | |
# Pods/ | ||
|
||
Carthage/ | ||
.gitmodules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github "LoopKit/LoopKit" == 2.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github "LoopKit/LoopKit" "v2.1.2" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// HKUnit.swift | ||
// Naterade | ||
// | ||
// Created by Nathan Racklyeft on 1/17/16. | ||
// Copyright © 2016 Nathan Racklyeft. All rights reserved. | ||
// | ||
|
||
import HealthKit | ||
|
||
|
||
extension HKUnit { | ||
static let milligramsPerDeciliter: HKUnit = { | ||
return HKUnit.gramUnit(with: .milli).unitDivided(by: .literUnit(with: .deci)) | ||
}() | ||
|
||
static let millimolesPerLiter: HKUnit = { | ||
return HKUnit.moleUnit(with: .milli, molarMass: HKUnitMolarMassBloodGlucose).unitDivided(by: .liter()) | ||
}() | ||
|
||
var foundationUnit: Unit? { | ||
if self == HKUnit.milligramsPerDeciliter { | ||
return UnitConcentrationMass.milligramsPerDeciliter | ||
} | ||
|
||
if self == HKUnit.millimolesPerLiter { | ||
return UnitConcentrationMass.millimolesPerLiter(withGramsPerMole: HKUnitMolarMassBloodGlucose) | ||
} | ||
|
||
if self == HKUnit.gram() { | ||
return UnitMass.grams | ||
} | ||
|
||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// LocalizedString.swift | ||
// RileyLink | ||
// | ||
// Created by Kathryn DiSimone on 8/15/18. | ||
// Copyright © 2018 Pete Schwamb. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
private class FrameworkBundle { | ||
static let main = Bundle(for: FrameworkBundle.self) | ||
} | ||
|
||
func LocalizedString(_ key: String, tableName: String? = nil, value: String = "", comment: String) -> String { | ||
return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, value: value, comment: comment) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Locked.swift | ||
// LoopKit | ||
// | ||
// Copyright © 2018 LoopKit Authors. All rights reserved. | ||
// | ||
|
||
import os.lock | ||
|
||
|
||
internal class Locked<T> { | ||
private var lock = os_unfair_lock() | ||
private var _value: T | ||
|
||
init(_ value: T) { | ||
os_unfair_lock_lock(&lock) | ||
defer { os_unfair_lock_unlock(&lock) } | ||
_value = value | ||
} | ||
|
||
var value: T { | ||
get { | ||
os_unfair_lock_lock(&lock) | ||
defer { os_unfair_lock_unlock(&lock) } | ||
return _value | ||
} | ||
set { | ||
os_unfair_lock_lock(&lock) | ||
defer { os_unfair_lock_unlock(&lock) } | ||
_value = newValue | ||
} | ||
} | ||
|
||
func mutate(_ changes: (_ value: inout T) -> Void) -> T { | ||
os_unfair_lock_lock(&lock) | ||
defer { os_unfair_lock_unlock(&lock) } | ||
changes(&_value) | ||
return _value | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
RileyLinkKit/es.lproj/InfoPlist.strings → Crypto/de.lproj/InfoPlist.strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* (No Comment) */ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* (No Comment) */ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/* No Localized Strings */ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* Bundle name */ | ||
"CFBundleName" = "$(PRODUCT_NAME)"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* Communications error for a bolus currently running */ | ||
"A bolus is already in progress" = "A bolus is already in progress"; | ||
|
||
/* The description of AlarmClockReminderPumpEvent */ | ||
"AlarmClockReminder" = "AlarmClockReminder"; | ||
|
||
/* The description of AlarmSensorPumpEvent */ | ||
"AlarmSensor" = "AlarmSensor"; | ||
|
||
/* Describing the battery chemistry as Alkaline */ | ||
"Alkaline" = "Alkaline"; | ||
|
||
/* The format string description of a BasalProfileStartPumpEvent. (1: The index of the profile)(2: The basal rate) */ | ||
"Basal Profile %1$@: %2$@ U/hour" = "Basal Profile %1$@: %2$@ U/hour"; | ||
|
||
/* Pump error code when bolus is in progress */ | ||
"Bolus in progress" = "Bolus en progreso"; | ||
|
||
/* Suggestions for diagnosing a command refused pump error */ | ||
"Check that the pump is not suspended or priming, or has a percent temp basal type" = "Check that the pump is not suspended or priming, or has a percent temp basal type"; | ||
|
||
/* Pump error code returned when command refused */ | ||
"Command refused" = "Command refused"; | ||
|
||
/* No comment provided by engineer. */ | ||
"Comms with another pump detected" = "Comms with another pump detected."; | ||
|
||
/* Error description */ | ||
"Decoding Error" = "Decoding Error"; | ||
|
||
/* Error description */ | ||
"Device Error" = "Device Error"; | ||
|
||
/* Describing the pump history insulin data source */ | ||
"Event History" = "Event History"; | ||
|
||
/* Format string for failure reason. (1: The operation being performed) (2: The response data) */ | ||
"Invalid response during %1$@: %2$@" = "Invalid response during %1$@: %2$@"; | ||
|
||
/* Describing the battery chemistry as Lithium */ | ||
"Lithium" = "Lithium"; | ||
|
||
/* Recovery suggestion */ | ||
"Make sure your RileyLink is nearby and powered on" = "Make sure your RileyLink is nearby and powered on"; | ||
|
||
/* Pump error code describing max setting exceeded */ | ||
"Max setting exceeded" = "Max setting exceeded"; | ||
|
||
/* Pump title (1: model number) */ | ||
"Minimed %@" = "Minimed %@"; | ||
|
||
/* Generic title of the minimed pump manager */ | ||
"Minimed 500/700 Series" = "Minimed 500/700 Series"; | ||
|
||
/* Describing the North America pump region */ | ||
"North America" = "North America"; | ||
|
||
/* No comment provided by engineer. */ | ||
"Pump did not respond" = "Pump did not respond"; | ||
|
||
/* Error description */ | ||
"Pump Error" = "Pump Error"; | ||
|
||
/* No comment provided by engineer. */ | ||
"Pump is suspended" = "Pump is suspended"; | ||
|
||
/* No comment provided by engineer. */ | ||
"Pump responded unexpectedly" = "Pump responded unexpectedly"; | ||
|
||
/* The format string describing a pump message. (1: The packet type)(2: The message type)(3: The message address)(4: The message data */ | ||
"PumpMessage(%1$@, %2$@, %3$@, %4$@)" = "PumpMessage(%1$@, %2$@, %3$@, %4$@)"; | ||
|
||
/* Describing the reservoir insulin data source */ | ||
"Reservoir" = "Reservoir"; | ||
|
||
/* Error description */ | ||
"RileyLink radio tune failed" = "RileyLink radio tune failed"; | ||
|
||
/* The format string description of a TempBasalPumpEvent. (1: The rate of the temp basal in minutes) */ | ||
"Temporary Basal: %1$.3f U/hour" = "Temporary Basal: %1$.3f U/hour"; | ||
|
||
/* The format string description of a TempBasalDurationPumpEvent. (1: The duration of the temp basal in minutes) */ | ||
"Temporary Basal: %1$d min" = "Temporary Basal: %1$d min"; | ||
|
||
/* The format string description of a TempBasalPumpEvent. (1: The rate of the temp basal in percent) */ | ||
"Temporary Basal: %1$d%%" = "Temporary Basal: %1$d%%"; | ||
|
||
/* The format string description of an unknown pump error code. (1: The specific error code raw value) */ | ||
"Unknown pump error code: %1$@" = "Unknown pump error code: %1$@"; | ||
|
||
/* No comment provided by engineer. */ | ||
"Unknown pump model: %@" = "Unknown pump model: %@"; | ||
|
||
/* Format string for an unknown response. (1: The operation being performed) (2: The response data) */ | ||
"Unknown response during %1$@: %2$@" = "Unknown response during %1$@: %2$@"; | ||
|
||
/* Describing the worldwide pump region */ | ||
"World-Wide" = "World-Wide"; | ||
|
63 changes: 63 additions & 0 deletions
63
MinimedKit/CGMManager/MySentryPumpStatusMessageBody+CGMManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// | ||
// MySentryPumpStatusMessageBody.swift | ||
// Loop | ||
// | ||
// Created by Nate Racklyeft on 7/28/16. | ||
// Copyright © 2016 Nathan Racklyeft. All rights reserved. | ||
// | ||
|
||
import LoopKit | ||
|
||
|
||
extension MySentryPumpStatusMessageBody: SensorDisplayable { | ||
public var isStateValid: Bool { | ||
switch glucose { | ||
case .active: | ||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
public var trendType: LoopKit.GlucoseTrend? { | ||
guard case .active = glucose else { | ||
return nil | ||
} | ||
|
||
switch glucoseTrend { | ||
case .down: | ||
return .down | ||
case .downDown: | ||
return .downDown | ||
case .up: | ||
return .up | ||
case .upUp: | ||
return .upUp | ||
case .flat: | ||
return .flat | ||
} | ||
} | ||
|
||
public var isLocal: Bool { | ||
return true | ||
} | ||
|
||
var batteryPercentage: Int { | ||
return batteryRemainingPercent | ||
} | ||
|
||
var glucoseSyncIdentifier: String? { | ||
guard let date = glucoseDateComponents, | ||
let year = date.year, | ||
let month = date.month, | ||
let day = date.day, | ||
let hour = date.hour, | ||
let minute = date.minute, | ||
let second = date.second | ||
else { | ||
return nil | ||
} | ||
|
||
return "\(year)-\(month)-\(day) \(hour)-\(minute)-\(second)" | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
MinimedKit/CGMManager/SensorValueGlucoseEvent+CGMManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// SensorValueGlucoseEvent.swift | ||
// Loop | ||
// | ||
// Copyright © 2018 LoopKit Authors. All rights reserved. | ||
// | ||
|
||
|
||
extension SensorValueGlucoseEvent { | ||
var glucoseSyncIdentifier: String? { | ||
let date = timestamp | ||
|
||
guard | ||
let year = date.year, | ||
let month = date.month, | ||
let day = date.day, | ||
let hour = date.hour, | ||
let minute = date.minute, | ||
let second = date.second | ||
else { | ||
return nil | ||
} | ||
|
||
return "\(year)-\(month)-\(day) \(hour)-\(minute)-\(second)" | ||
} | ||
} |
Oops, something went wrong.