Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@
[submodule "DanaKit"]
path = DanaKit
url = https://github.com/loopandlearn/DanaKit
[submodule "EversenseKit"]
path = EversenseKit
url = https://github.com/bastiaanv/EversenseKit.git
[submodule "MedtrumKit"]
path = MedtrumKit
url = https://github.com/bastiaanv/MedtrumKit
1 change: 1 addition & 0 deletions EversenseKit
Submodule EversenseKit added at 851095
1 change: 1 addition & 0 deletions MedtrumKit
Submodule MedtrumKit added at 5bfb80
16 changes: 16 additions & 0 deletions Trio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@
3BD6CE262DC24CFD00FA0472 /* pumphistory-24h-zoned.json in Resources */ = {isa = PBXBuildFile; fileRef = 3BD6CE252DC24CFD00FA0472 /* pumphistory-24h-zoned.json */; };
3BD9687C2D8DDD4600899469 /* SlideButton in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD9687B2D8DDD4600899469 /* SlideButton */; };
3BD9687F2D8DDD8800899469 /* CryptoSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD9687E2D8DDD8800899469 /* CryptoSwift */; };
3E470F0D2DFA147500ACAF34 /* MedtrumKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E94E2F52DF72793005C358C /* MedtrumKit.framework */; };
3E470F0E2DFA147500ACAF34 /* MedtrumKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3E94E2F52DF72793005C358C /* MedtrumKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3E9D22DE2DF729A0005E4DAA /* EversenseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9D22DD2DF729A0005E4DAA /* EversenseKit.framework */; };
3E9D22DF2DF729A0005E4DAA /* EversenseKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9D22DD2DF729A0005E4DAA /* EversenseKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3E9D23ED2DF72D07005E4DAA /* ConfigOverride.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D23EC2DF72D07005E4DAA /* ConfigOverride.xcconfig */; };
45252C95D220E796FDB3B022 /* ConfigEditorDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8A87AA037BD079BA3528BA /* ConfigEditorDataFlow.swift */; };
45717281F743594AA9D87191 /* ConfigEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 920DDB21E5D0EB813197500D /* ConfigEditorRootView.swift */; };
491D6FBD2D56741C00C49F67 /* TempTargetStored+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491D6FBC2D56741C00C49F67 /* TempTargetStored+CoreDataProperties.swift */; };
Expand Down Expand Up @@ -772,6 +777,7 @@
3B4BA76D2D8DBD690069D5B8 /* CGMBLEKitUI.framework in Embed Frameworks */,
3B4BA76B2D8DBD690069D5B8 /* CGMBLEKit.framework in Embed Frameworks */,
3B4BA7792D8DBD690069D5B8 /* MinimedKit.framework in Embed Frameworks */,
3E470F0E2DFA147500ACAF34 /* MedtrumKit.framework in Embed Frameworks */,
CE95BF5C2BA770C300DC3DE3 /* LoopKit.framework in Embed Frameworks */,
3B4BA7712D8DBD690069D5B8 /* G7SensorKit.framework in Embed Frameworks */,
CEB434FE28B90B8C00B70274 /* SwiftCharts in Embed Frameworks */,
Expand All @@ -780,6 +786,7 @@
3B4BA77D2D8DBD690069D5B8 /* OmniBLE.framework in Embed Frameworks */,
3B4BA77F2D8DBD690069D5B8 /* OmniKit.framework in Embed Frameworks */,
3B4BA7852D8DBD690069D5B8 /* RileyLinkKit.framework in Embed Frameworks */,
3E9D22DF2DF729A0005E4DAA /* EversenseKit.framework in Embed Frameworks */,
3B4BA7752D8DBD690069D5B8 /* LibreTransmitter.framework in Embed Frameworks */,
3B4BA7772D8DBD690069D5B8 /* LibreTransmitterUI.framework in Embed Frameworks */,
3B4BA77B2D8DBD690069D5B8 /* MinimedKitUI.framework in Embed Frameworks */,
Expand Down Expand Up @@ -1074,6 +1081,9 @@
3BD6CE252DC24CFD00FA0472 /* pumphistory-24h-zoned.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "pumphistory-24h-zoned.json"; sourceTree = "<group>"; };
3BDEA2DC60EDE0A3CA54DC73 /* TargetsEditorProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TargetsEditorProvider.swift; sourceTree = "<group>"; };
3BF768BD6264FF7D71D66767 /* NightscoutConfigProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NightscoutConfigProvider.swift; sourceTree = "<group>"; };
3E94E2F52DF72793005C358C /* MedtrumKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MedtrumKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3E9D22DD2DF729A0005E4DAA /* EversenseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = EversenseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3E9D23EC2DF72D07005E4DAA /* ConfigOverride.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = ConfigOverride.xcconfig; path = ../ConfigOverride.xcconfig; sourceTree = SOURCE_ROOT; };
3F60E97100041040446F44E7 /* PumpConfigStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PumpConfigStateModel.swift; sourceTree = "<group>"; };
3F8A87AA037BD079BA3528BA /* ConfigEditorDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ConfigEditorDataFlow.swift; sourceTree = "<group>"; };
42369F66CF91F30624C0B3A6 /* BasalProfileEditorProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BasalProfileEditorProvider.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1556,6 +1566,7 @@
3B4BA7742D8DBD690069D5B8 /* LibreTransmitter.framework in Frameworks */,
3B4BA78C2D8DC0EC0069D5B8 /* ShareClientUI.framework in Frameworks */,
3B4BA77A2D8DBD690069D5B8 /* MinimedKitUI.framework in Frameworks */,
3E470F0D2DFA147500ACAF34 /* MedtrumKit.framework in Frameworks */,
3BD9687C2D8DDD4600899469 /* SlideButton in Frameworks */,
3B4BA7782D8DBD690069D5B8 /* MinimedKit.framework in Frameworks */,
3B4BA7762D8DBD690069D5B8 /* LibreTransmitterUI.framework in Frameworks */,
Expand All @@ -1567,6 +1578,7 @@
3B4BA78A2D8DC0EC0069D5B8 /* ShareClient.framework in Frameworks */,
3B4BA77E2D8DBD690069D5B8 /* OmniKit.framework in Frameworks */,
CE51DD1C2A01970900F163F7 /* ConnectIQ 2.xcframework in Frameworks */,
3E9D22DE2DF729A0005E4DAA /* EversenseKit.framework in Frameworks */,
3811DE1025C9D37700A708ED /* Swinject in Frameworks */,
3B4BA78E2D8DC0EC0069D5B8 /* TidepoolServiceKit.framework in Frameworks */,
B958F1B72BA0711600484851 /* MKRingProgressView in Frameworks */,
Expand Down Expand Up @@ -2161,6 +2173,8 @@
3818AA48274C267000843DB3 /* Frameworks */ = {
isa = PBXGroup;
children = (
3E94E2F52DF72793005C358C /* MedtrumKit.framework */,
3E9D22DD2DF729A0005E4DAA /* EversenseKit.framework */,
3B4BA7882D8DC0EC0069D5B8 /* TidepoolServiceKit.framework */,
3B4BA7892D8DC0EC0069D5B8 /* TidepoolServiceKitUI.framework */,
3B4BA75B2D8DBD690069D5B8 /* CGMBLEKit.framework */,
Expand Down Expand Up @@ -2287,6 +2301,7 @@
CE1F6DE62BAF1A180064EB8D /* BuildDetails.plist */,
38F3783A2613555C009DB701 /* Config.xcconfig */,
BD1CF8B72C1A4A8400CB930A /* ConfigOverride.xcconfig */,
3E9D23EC2DF72D07005E4DAA /* ConfigOverride.xcconfig */,
388E595A25AD948C0019842D /* Trio */,
587A54C82BCDCE0F009D38E2 /* Model */,
38FCF3EE25E9028E0078B0D1 /* TrioTests */,
Expand Down Expand Up @@ -3946,6 +3961,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3E9D23ED2DF72D07005E4DAA /* ConfigOverride.xcconfig in Resources */,
8A91342C2D63D9A2007F8874 /* InfoPlist.xcstrings in Resources */,
CE1F6DE72BAF1A180064EB8D /* BuildDetails.plist in Resources */,
3B3B57C92DA07B3400849D16 /* GoogleService-Info.plist in Resources */,
Expand Down
6 changes: 6 additions & 0 deletions Trio.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Trio/Sources/APS/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DanaKit
import Foundation
import LoopKit
import LoopKitUI
import MedtrumKit
import MinimedKit
import MockKit
import OmniBLE
Expand Down Expand Up @@ -36,6 +37,7 @@ private let staticPumpManagers: [PumpManagerUI.Type] = [
OmnipodPumpManager.self,
OmniBLEPumpManager.self,
DanaKitPumpManager.self,
MedtrumPumpManager.self,
MockPumpManager.self
]

Expand All @@ -44,6 +46,7 @@ private let staticPumpManagersByIdentifier: [String: PumpManagerUI.Type] = [
OmnipodPumpManager.pluginIdentifier: OmnipodPumpManager.self,
OmniBLEPumpManager.pluginIdentifier: OmniBLEPumpManager.self,
DanaKitPumpManager.pluginIdentifier: DanaKitPumpManager.self,
MedtrumPumpManager.pluginIdentifier: MedtrumPumpManager.self,
MockPumpManager.pluginIdentifier: MockPumpManager.self
]

Expand Down Expand Up @@ -111,6 +114,13 @@ final class BaseDeviceDataManager: DeviceDataManager, Injectable {
}
pumpExpiresAtDate.send(endTime)
}
if let medtrum = pumpManager as? MedtrumPumpManager {
guard let endTime = medtrum.state.patchExpiresAt else {
pumpExpiresAtDate.send(nil)
return
}
pumpExpiresAtDate.send(endTime)
}
if let simulatorPump = pumpManager as? MockPumpManager {
pumpDisplayState.value = PumpDisplayState(name: simulatorPump.localizedTitle, image: simulatorPump.smallImage)
pumpName.send(simulatorPump.localizedTitle)
Expand Down
6 changes: 6 additions & 0 deletions Trio/Sources/APS/PluginManager.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import CGMBLEKit
import EversenseKit
import Foundation
import G7SensorKit
import G7SensorKitUI
Expand Down Expand Up @@ -40,6 +41,11 @@ class BasePluginManager: Injectable, PluginManager {
pluginIdentifier: LibreTransmitterManagerV3.pluginIdentifier,
localizedTitle: String(localized: "FreeStyle Libre"),
manager: LibreTransmitterManagerV3.self
),
CgmPluginDescription(
pluginIdentifier: EversenseCGMManager.pluginIdentifier,
localizedTitle: String(localized: "Eversense XL/365"),
manager: EversenseCGMManager.self
)
]

Expand Down
1 change: 1 addition & 0 deletions Trio/Sources/Helpers/CGMOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let cgmOptions: [CGMOption] = [
CGMOption(name: "Dexcom G7 / ONE+", predicate: { $0.type == .plugin && $0.displayName.contains("G7") }),
CGMOption(name: "Dexcom Share", predicate: { $0.type == .plugin && $0.displayName.contains("Dexcom Share") }),
CGMOption(name: "FreeStyle Libre", predicate: { $0.type == .plugin && $0.displayName == "FreeStyle Libre" }),
CGMOption(name: "Eversense XL/365", predicate: { $0.type == .plugin && $0.displayName == "Eversense XL/365" }),
CGMOption(
name: "FreeStyle Libre Demo",
predicate: { $0.type == .plugin && $0.displayName == "FreeStyle Libre Demo" }
Expand Down
1 change: 1 addition & 0 deletions Trio/Sources/Modules/Home/View/HomeRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ extension Home {
Button("Omnipod Eros") { state.addPump(.omnipod) }
Button("Omnipod DASH") { state.addPump(.omnipodBLE) }
Button("Dana(RS/-i)") { state.addPump(.dana) }
Button("Medtrum Nano") { state.addPump(.medtrum) }
Button("Pump Simulator") { state.addPump(.simulator) }
} message: { Text("Select Pump Model") }
.sheet(isPresented: $state.shouldDisplayPumpSetupSheet) {
Expand Down
5 changes: 5 additions & 0 deletions Trio/Sources/Modules/Onboarding/OnboardingStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import DanaKit
import FirebaseCrashlytics
import Foundation
import LoopKit
import MedtrumKit
import MinimedKit
import Observation
import OmniBLE
Expand Down Expand Up @@ -122,6 +123,8 @@ extension Onboarding {
defaultOption = .dana
} else if pumpManager is MinimedPumpManager {
defaultOption = .minimed
} else if pumpManager is MedtrumPumpManager {
defaultOption = .medtrum
} else {
defaultOption = .omnipodDash
}
Expand Down Expand Up @@ -163,6 +166,8 @@ extension Onboarding {
return PickerSetting(value: 0.1, step: 0.05, min: 0, max: 30, type: .insulinUnitPerHour)
case .omnipodEros:
return PickerSetting(value: 0.1, step: 0.05, min: 0.05, max: 30, type: .insulinUnitPerHour)
case .medtrum:
return PickerSetting(value: 0.1, step: 0.05, min: 0.05, max: 30, type: .insulinUnitPerHour)
case .none:
// same as dash, as that is the fallback
return PickerSetting(value: 0.1, step: 0.05, min: 0, max: 30, type: .insulinUnitPerHour)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ struct OnboardingNavigationButtons: View {
case .dana,
.minimed:
currentAutosensSubstep = .rewindResetsAutosens
case .omnipodDash,
case .medtrum,
.omnipodDash,
.omnipodEros:
currentAutosensSubstep = .autosensMax
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct AlgorithmSettingsSubstepView<Substep: AlgorithmSubstepProtocol & RawRepre
case .dana,
.minimed:
return false
case .omnipodDash,
case .medtrum,
.omnipodDash,
.omnipodEros:
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ enum PumpOptionForOnboardingUnits: String, Equatable, CaseIterable, Identifiable
case omnipodEros
case omnipodDash
case dana
case medtrum

var id: String { rawValue }

Expand All @@ -517,6 +518,8 @@ enum PumpOptionForOnboardingUnits: String, Equatable, CaseIterable, Identifiable
return "Omnipod DASH"
case .dana:
return "Dana (RS/-i)"
case .medtrum:
return "Metrum Nano"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Trio/Sources/Modules/PumpConfig/PumpConfigDataFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum PumpConfig {
case omnipod
case omnipodBLE
case dana
case medtrum
case simulator
}

Expand Down
5 changes: 5 additions & 0 deletions Trio/Sources/Modules/PumpConfig/View/PumpConfigRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ extension PumpConfig {
} label: {
HStack {
Image(uiImage: pumpState.image ?? UIImage())
.resizable()
.scaledToFit()
.frame(maxWidth: 100)
Text(pumpState.name)
}
.frame(maxWidth: .infinity, minHeight: 50, alignment: .center)
Expand Down Expand Up @@ -118,6 +121,7 @@ extension PumpConfig {
Text("• Omnipod Eros")
Text("• Omnipod DASH")
Text("• Dana (RS/-i)")
Text("• Medtrum Nano (200u/300u)")
Text("• Pump Simulator")
}
Text(
Expand All @@ -133,6 +137,7 @@ extension PumpConfig {
Button("Omnipod Eros") { state.addPump(.omnipod) }
Button("Omnipod DASH") { state.addPump(.omnipodBLE) }
Button("Dana(RS/-i)") { state.addPump(.dana) }
Button("Medtrum Nano") { state.addPump(.medtrum) }
Button("Pump Simulator") { state.addPump(.simulator) }
} message: { Text("Select Pump Model") }
}
Expand Down
10 changes: 10 additions & 0 deletions Trio/Sources/Modules/PumpConfig/View/PumpSetupView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import DanaKit
import LoopKit
import LoopKitUI
import MedtrumKit
import MinimedKit
import MinimedKitUI
import MockKit
Expand Down Expand Up @@ -68,6 +69,15 @@ extension PumpConfig {
prefersToSkipUserInteraction: false,
allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
)
case .medtrum:
setupViewController = MedtrumPumpManager.setupViewController(
initialSettings: initialSettings,
bluetoothProvider: bluetoothManager,
colorPalette: .default,
allowDebugFeatures: true,
prefersToSkipUserInteraction: false,
allowedInsulinTypes: [.apidra, .humalog, .novolog, .fiasp, .lyumjev]
)
case .simulator:
setupViewController = MockPumpManager.setupViewController(
initialSettings: initialSettings,
Expand Down