Просмотр исходного кода

update to Trio in Xcode swift files

marionbarker 2 лет назад
Родитель
Сommit
229b67b06d
21 измененных файлов с 37 добавлено и 37 удалено
  1. 2 2
      FreeAPS/Sources/APS/FetchGlucoseManager.swift
  2. 1 1
      FreeAPS/Sources/Application/FreeAPSApp.swift
  3. 1 1
      FreeAPS/Sources/Models/AlertEntry.swift
  4. 1 1
      FreeAPS/Sources/Models/CarbsEntry.swift
  5. 1 1
      FreeAPS/Sources/Models/NightscoutTreatment.swift
  6. 1 1
      FreeAPS/Sources/Models/TempTarget.swift
  7. 1 1
      FreeAPS/Sources/Modules/HealthKit/View/AppleHealthKitRootView.swift
  8. 1 1
      FreeAPS/Sources/Modules/IconConfig/View/IconSelection.swift
  9. 2 2
      FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift
  10. 1 1
      FreeAPS/Sources/Modules/NotificationsConfig/View/NotificationsConfigRootView.swift
  11. 5 5
      FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift
  12. 1 1
      FreeAPS/Sources/Modules/PreferencesEditor/View/PreferencesEditorRootView.swift
  13. 2 2
      FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift
  14. 1 1
      FreeAPS/Sources/Services/Calendar/CalendarManager.swift
  15. 3 3
      FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift
  16. 2 2
      FreeAPS/Sources/Services/Network/NightscoutAPI.swift
  17. 1 1
      FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift
  18. 2 2
      FreeAPS/Sources/Services/WatchManager/GarminManager.swift
  19. 3 3
      FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift
  20. 1 1
      FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift
  21. 4 4
      FreeAPSWatch WatchKit Extension/ComplicationController.swift

+ 2 - 2
FreeAPS/Sources/APS/FetchGlucoseManager.swift

@@ -297,11 +297,11 @@ final class BaseFetchGlucoseManager: FetchGlucoseManager, Injectable {
     private func overcalibrate(entries: [BloodGlucose]) -> [BloodGlucose] {
     private func overcalibrate(entries: [BloodGlucose]) -> [BloodGlucose] {
         // overcalibrate
         // overcalibrate
         var overcalibration: ((Int) -> (Double))?
         var overcalibration: ((Int) -> (Double))?
-       
+
         if let cal = calibrationService {
         if let cal = calibrationService {
             overcalibration = cal.calibrate
             overcalibration = cal.calibrate
         }
         }
-       
+
         if let overcalibration = overcalibration {
         if let overcalibration = overcalibration {
             return entries.map { entry in
             return entries.map { entry in
                 var entry = entry
                 var entry = entry

+ 1 - 1
FreeAPS/Sources/Application/FreeAPSApp.swift

@@ -55,7 +55,7 @@ import Swinject
     init() {
     init() {
         debug(
         debug(
             .default,
             .default,
-            "Open-iAPS Started: v\(Bundle.main.releaseVersionNumber ?? "")(\(Bundle.main.buildVersionNumber ?? "")) [buildDate: \(Bundle.main.buildDate)] [buildExpires: \(Bundle.main.profileExpiration)]"
+            "Trio Started: v\(Bundle.main.releaseVersionNumber ?? "")(\(Bundle.main.buildVersionNumber ?? "")) [buildDate: \(Bundle.main.buildDate)] [buildExpires: \(Bundle.main.profileExpiration)]"
         )
         )
         loadServices()
         loadServices()
     }
     }

+ 1 - 1
FreeAPS/Sources/Models/AlertEntry.swift

@@ -15,7 +15,7 @@ struct AlertEntry: JSON, Codable, Hashable {
     let contentBody: String?
     let contentBody: String?
     var errorMessage: String?
     var errorMessage: String?
 
 
-    static let manual = "Open-iAPS"
+    static let manual = "Trio"
 
 
     static func == (lhs: AlertEntry, rhs: AlertEntry) -> Bool {
     static func == (lhs: AlertEntry, rhs: AlertEntry) -> Bool {
         lhs.issuedDate == rhs.issuedDate
         lhs.issuedDate == rhs.issuedDate

+ 1 - 1
FreeAPS/Sources/Models/CarbsEntry.swift

@@ -12,7 +12,7 @@ struct CarbsEntry: JSON, Equatable, Hashable {
     let isFPU: Bool?
     let isFPU: Bool?
     let fpuID: String?
     let fpuID: String?
 
 
-    static let manual = "Open-iAPS"
+    static let manual = "Trio"
     static let appleHealth = "applehealth"
     static let appleHealth = "applehealth"
 
 
     static func == (lhs: CarbsEntry, rhs: CarbsEntry) -> Bool {
     static func == (lhs: CarbsEntry, rhs: CarbsEntry) -> Bool {

+ 1 - 1
FreeAPS/Sources/Models/NightscoutTreatment.swift

@@ -26,7 +26,7 @@ struct NightscoutTreatment: JSON, Hashable, Equatable {
     let targetTop: Decimal?
     let targetTop: Decimal?
     let targetBottom: Decimal?
     let targetBottom: Decimal?
 
 
-    static let local = "Open-iAPS"
+    static let local = "Trio"
 
 
     static let empty = NightscoutTreatment(from: "{}")!
     static let empty = NightscoutTreatment(from: "{}")!
 
 

+ 1 - 1
FreeAPS/Sources/Models/TempTarget.swift

@@ -10,7 +10,7 @@ struct TempTarget: JSON, Identifiable, Equatable, Hashable {
     let enteredBy: String?
     let enteredBy: String?
     let reason: String?
     let reason: String?
 
 
-    static let manual = "Open-iAPS"
+    static let manual = "Trio"
     static let custom = "Temp target"
     static let custom = "Temp target"
     static let cancel = "Cancel"
     static let cancel = "Cancel"
 
 

+ 1 - 1
FreeAPS/Sources/Modules/HealthKit/View/AppleHealthKitRootView.swift

@@ -13,7 +13,7 @@ extension AppleHealthKit {
                     HStack {
                     HStack {
                         Image(systemName: "pencil.circle.fill")
                         Image(systemName: "pencil.circle.fill")
                         Text(
                         Text(
-                            "This allows Open-iAPS to read from and write to Apple Heath. You must also give permissions in Settings > Health > Data Access. If you enter a glucose value into Apple Health, open Open-iAPS to confirm it shows up."
+                            "This allows Trio to read from and write to Apple Heath. You must also give permissions in Settings > Health > Data Access. If you enter a glucose value into Apple Health, open Trio to confirm it shows up."
                         )
                         )
                         .font(.caption)
                         .font(.caption)
                     }
                     }

+ 1 - 1
FreeAPS/Sources/Modules/IconConfig/View/IconSelection.swift

@@ -9,7 +9,7 @@ struct IconSelection: View {
 
 
         VStack {
         VStack {
             HStack {
             HStack {
-                Text("Open-iAPS Icon")
+                Text("Trio Icon")
                     .font(.title)
                     .font(.title)
                 IconImage(icon: model.appIcon)
                 IconImage(icon: model.appIcon)
                     .frame(maxHeight: 114)
                     .frame(maxHeight: 114)

+ 2 - 2
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift

@@ -104,7 +104,7 @@ extension NightscoutConfig {
                             message: Text(
                             message: Text(
                                 (fetchedErrors.first?.error ?? "").count < 4 ?
                                 (fetchedErrors.first?.error ?? "").count < 4 ?
                                     NSLocalizedString(
                                     NSLocalizedString(
-                                        "\nNow please verify all of your new settings thoroughly:\n\n* Basal Settings\n * Carb Ratios\n * Glucose Targets\n * Insulin Sensitivities\n * DIA\n\n in Open-iAPS Settings > Configuration.\n\nBad or invalid profile settings could have disatrous effects.",
+                                        "\nNow please verify all of your new settings thoroughly:\n\n* Basal Settings\n * Carb Ratios\n * Glucose Targets\n * Insulin Sensitivities\n * DIA\n\n in Trio Settings > Configuration.\n\nBad or invalid profile settings could have disatrous effects.",
                                         comment: "Imported Profiles Alert"
                                         comment: "Imported Profiles Alert"
                                     ) :
                                     ) :
                                     NSLocalizedString(fetchedErrors.first?.error ?? "", comment: "Import Error")
                                     NSLocalizedString(fetchedErrors.first?.error ?? "", comment: "Import Error")
@@ -130,7 +130,7 @@ extension NightscoutConfig {
 
 
                 Section {
                 Section {
                     Toggle("Remote control", isOn: $state.allowAnnouncements)
                     Toggle("Remote control", isOn: $state.allowAnnouncements)
-                } header: { Text("Allow Remote control of Open-iAPS") }
+                } header: { Text("Allow Remote control of Trio") }
             }
             }
             .onAppear(perform: configureView)
             .onAppear(perform: configureView)
             .navigationBarTitle("Nightscout Config")
             .navigationBarTitle("Nightscout Config")

+ 1 - 1
FreeAPS/Sources/Modules/NotificationsConfig/View/NotificationsConfigRootView.swift

@@ -92,7 +92,7 @@ extension NotificationsConfig {
 
 
             if !systemLiveActivitySetting {
             if !systemLiveActivitySetting {
                 footer =
                 footer =
-                    "Live activities are turned OFF in system settings. To enable live activities, go to Settings app -> Open-iAPS -> Turn live Activities ON.\n\n" +
+                    "Live activities are turned OFF in system settings. To enable live activities, go to Settings app -> Trio -> Turn live Activities ON.\n\n" +
                     footer
                     footer
             }
             }
 
 

Разница между файлами не показана из-за своего большого размера
+ 5 - 5
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift


+ 1 - 1
FreeAPS/Sources/Modules/PreferencesEditor/View/PreferencesEditorRootView.swift

@@ -22,7 +22,7 @@ extension PreferencesEditor {
 
 
         var body: some View {
         var body: some View {
             Form {
             Form {
-                Section(header: Text("Open-iAPS").textCase(nil)) {
+                Section(header: Text("Trio").textCase(nil)) {
                     Picker("Glucose units", selection: $state.unitsIndex) {
                     Picker("Glucose units", selection: $state.unitsIndex) {
                         Text("mg/dL").tag(0)
                         Text("mg/dL").tag(0)
                         Text("mmol/L").tag(1)
                         Text("mmol/L").tag(1)

+ 2 - 2
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -18,12 +18,12 @@ extension Settings {
                 header: {
                 header: {
                     if let expirationDate = Bundle.main.profileExpiration {
                     if let expirationDate = Bundle.main.profileExpiration {
                         Text(
                         Text(
-                            "Open-iAPS v\(state.versionNumber) (\(state.buildNumber))\nBranch: \(state.branch) \(state.copyrightNotice)" +
+                            "Trio v\(state.versionNumber) (\(state.buildNumber))\nBranch: \(state.branch) \(state.copyrightNotice)" +
                                 "\nBuild Expires: " + expirationDate
                                 "\nBuild Expires: " + expirationDate
                         ).textCase(nil)
                         ).textCase(nil)
                     } else {
                     } else {
                         Text(
                         Text(
-                            "Open-iAPS v\(state.versionNumber) (\(state.buildNumber))\nBranch: \(state.branch) \(state.copyrightNotice)"
+                            "Trio v\(state.versionNumber) (\(state.buildNumber))\nBranch: \(state.branch) \(state.copyrightNotice)"
                         )
                         )
                     }
                     }
                 }
                 }

+ 1 - 1
FreeAPS/Sources/Services/Calendar/CalendarManager.swift

@@ -93,7 +93,7 @@ final class BaseCalendarManager: CalendarManager, Injectable {
         let title = glucoseText + " " + directionText + " " + deltaText
         let title = glucoseText + " " + directionText + " " + deltaText
 
 
         event.title = title
         event.title = title
-        event.notes = "Open-iAPS"
+        event.notes = "Trio"
         event.startDate = Date()
         event.startDate = Date()
         event.endDate = Date(timeIntervalSinceNow: 60 * 10)
         event.endDate = Date(timeIntervalSinceNow: 60 * 10)
         event.calendar = calendar
         event.calendar = calendar

+ 3 - 3
FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift

@@ -19,9 +19,9 @@ protocol HealthKitManager: GlucoseSource {
     func saveIfNeeded(carbs: [CarbsEntry])
     func saveIfNeeded(carbs: [CarbsEntry])
     /// Save Insulin to Health store
     /// Save Insulin to Health store
     func saveIfNeeded(pumpEvents events: [PumpHistoryEvent])
     func saveIfNeeded(pumpEvents events: [PumpHistoryEvent])
-    /// Create observer for data passing beetwen Health Store and Open-iAPS
+    /// Create observer for data passing beetwen Health Store and Trio
     func createBGObserver()
     func createBGObserver()
-    /// Enable background delivering objects from Apple Health to Open-iAPS
+    /// Enable background delivering objects from Apple Health to Trio
     func enableBackgroundDelivery()
     func enableBackgroundDelivery()
     /// Delete glucose with syncID
     /// Delete glucose with syncID
     func deleteGlucose(syncID: String)
     func deleteGlucose(syncID: String)
@@ -46,7 +46,7 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
         static let healthInsulinObject = HKObjectType.quantityType(forIdentifier: .insulinDelivery)
         static let healthInsulinObject = HKObjectType.quantityType(forIdentifier: .insulinDelivery)
 
 
         // Meta-data key of FreeASPX data in HealthStore
         // Meta-data key of FreeASPX data in HealthStore
-        static let freeAPSMetaKey = "From Open-iAPS"
+        static let freeAPSMetaKey = "From Trio"
     }
     }
 
 
     @Injected() private var glucoseStorage: GlucoseStorage!
     @Injected() private var glucoseStorage: GlucoseStorage!

+ 2 - 2
FreeAPS/Sources/Services/Network/NightscoutAPI.swift

@@ -37,8 +37,8 @@ extension NightscoutAPI {
     func checkConnection() -> AnyPublisher<Void, Swift.Error> {
     func checkConnection() -> AnyPublisher<Void, Swift.Error> {
         struct Check: Codable, Equatable {
         struct Check: Codable, Equatable {
             var eventType = "Note"
             var eventType = "Note"
-            var enteredBy = "Open-iAPS"
-            var notes = "Open-iAPS connected"
+            var enteredBy = "Trio"
+            var notes = "Trio connected"
         }
         }
         let check = Check()
         let check = Check()
         var request = URLRequest(url: url.appendingPathComponent(Config.treatmentsPath))
         var request = URLRequest(url: url.appendingPathComponent(Config.treatmentsPath))

+ 1 - 1
FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift

@@ -126,7 +126,7 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
 
 
     private func scheduleMissingLoopNotifiactions(date _: Date) {
     private func scheduleMissingLoopNotifiactions(date _: Date) {
         ensureCanSendNotification {
         ensureCanSendNotification {
-            let title = NSLocalizedString("Open-iAPS Not Active", comment: "Open-iAPS Not Active")
+            let title = NSLocalizedString("Trio Not Active", comment: "Trio Not Active")
             let body = NSLocalizedString("Last loop was more than %d min ago", comment: "Last loop was more than %d min ago")
             let body = NSLocalizedString("Last loop was more than %d min ago", comment: "Last loop was more than %d min ago")
 
 
             let firstInterval = 20 // min
             let firstInterval = 20 // min

+ 2 - 2
FreeAPS/Sources/Services/WatchManager/GarminManager.swift

@@ -63,7 +63,7 @@ final class BaseGarminManager: NSObject, GarminManager, Injectable {
 
 
     init(resolver: Resolver) {
     init(resolver: Resolver) {
         super.init()
         super.init()
-        connectIQ?.initialize(withUrlScheme: "Open-iAPS", uiOverrideDelegate: self)
+        connectIQ?.initialize(withUrlScheme: "Trio", uiOverrideDelegate: self)
         injectServices(resolver)
         injectServices(resolver)
         restoreDevices()
         restoreDevices()
         subscribeToOpenFromGarminConnect()
         subscribeToOpenFromGarminConnect()
@@ -157,7 +157,7 @@ extension BaseGarminManager: IQUIOverrideDelegate {
         debug(.apsManager, NSLocalizedString("Garmin is not available", comment: ""))
         debug(.apsManager, NSLocalizedString("Garmin is not available", comment: ""))
         let messageCont = MessageContent(
         let messageCont = MessageContent(
             content: NSLocalizedString(
             content: NSLocalizedString(
-                "The app Garmin Connect must be installed to use for Open-iAPS.\n Go to App Store to download it",
+                "The app Garmin Connect must be installed to use for Trio.\n Go to App Store to download it",
                 comment: ""
                 comment: ""
             ),
             ),
             type: .warning
             type: .warning

+ 3 - 3
FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift

@@ -3,17 +3,17 @@ import Foundation
 
 
 @available(iOS 16.0, *) struct ListStateIntent: AppIntent {
 @available(iOS 16.0, *) struct ListStateIntent: AppIntent {
     // Title of the action in the Shortcuts app
     // Title of the action in the Shortcuts app
-    static var title: LocalizedStringResource = "List last state available with Open-iAPS"
+    static var title: LocalizedStringResource = "List last state available with Trio"
 
 
     var stateIntent = StateIntentRequest()
     var stateIntent = StateIntentRequest()
 
 
     // Description of the action in the Shortcuts app
     // Description of the action in the Shortcuts app
     static var description = IntentDescription(
     static var description = IntentDescription(
-        "Allow to list the last Blood Glucose, trends, IOB and COB available in Open-iAPS"
+        "Allow to list the last Blood Glucose, trends, IOB and COB available in Trio"
     )
     )
 
 
     static var parameterSummary: some ParameterSummary {
     static var parameterSummary: some ParameterSummary {
-        Summary("List all states of Open-iAPS")
+        Summary("List all states of Trio")
     }
     }
 
 
     @MainActor func perform() async throws -> some ReturnsValue<StateiAPSResults> & ShowsSnippetView {
     @MainActor func perform() async throws -> some ReturnsValue<StateiAPSResults> & ShowsSnippetView {

+ 1 - 1
FreeAPS/Sources/Shortcuts/State/StateIntentRequest.swift

@@ -10,7 +10,7 @@ enum StateIntentError: Error {
 @available(iOS 16, *) struct StateiAPSResults: AppEntity {
 @available(iOS 16, *) struct StateiAPSResults: AppEntity {
     static var defaultQuery = StateBGQuery()
     static var defaultQuery = StateBGQuery()
 
 
-    static var typeDisplayRepresentation: TypeDisplayRepresentation = "Open-iAPS State Result"
+    static var typeDisplayRepresentation: TypeDisplayRepresentation = "Trio State Result"
 
 
     var displayRepresentation: DisplayRepresentation {
     var displayRepresentation: DisplayRepresentation {
         DisplayRepresentation(title: "\(glucose)")
         DisplayRepresentation(title: "\(glucose)")

+ 4 - 4
FreeAPSWatch WatchKit Extension/ComplicationController.swift

@@ -8,7 +8,7 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
         let descriptors = [
         let descriptors = [
             CLKComplicationDescriptor(
             CLKComplicationDescriptor(
                 identifier: "complication",
                 identifier: "complication",
-                displayName: "Open-iAPS",
+                displayName: "Trio",
                 supportedFamilies: [
                 supportedFamilies: [
                     .graphicCorner,
                     .graphicCorner,
                     .graphicCircular,
                     .graphicCircular,
@@ -52,14 +52,14 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
                 return
                 return
             }
             }
             let template = CLKComplicationTemplateGraphicCornerTextImage(
             let template = CLKComplicationTemplateGraphicCornerTextImage(
-                textProvider: CLKTextProvider(format: "%@", "Open-iAPS"),
+                textProvider: CLKTextProvider(format: "%@", "Trio"),
                 imageProvider: CLKFullColorImageProvider(fullColorImage: image)
                 imageProvider: CLKFullColorImageProvider(fullColorImage: image)
             )
             )
             let timelineEntry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template)
             let timelineEntry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template)
             handler(timelineEntry)
             handler(timelineEntry)
         case .modularSmall:
         case .modularSmall:
             let template = CLKComplicationTemplateModularSmallRingText(
             let template = CLKComplicationTemplateModularSmallRingText(
-                textProvider: CLKTextProvider(format: "%@", "Open-iAPS"),
+                textProvider: CLKTextProvider(format: "%@", "Trio"),
                 fillFraction: 1,
                 fillFraction: 1,
                 ringStyle: .closed
                 ringStyle: .closed
             )
             )
@@ -78,7 +78,7 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
             handler(timelineEntry)
             handler(timelineEntry)
         case .circularSmall:
         case .circularSmall:
             let template =
             let template =
-                CLKComplicationTemplateCircularSmallSimpleText(textProvider: CLKTextProvider(format: "%@", "Open-iAPS"))
+                CLKComplicationTemplateCircularSmallSimpleText(textProvider: CLKTextProvider(format: "%@", "Trio"))
             let timelineEntry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template)
             let timelineEntry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template)
             handler(timelineEntry)
             handler(timelineEntry)
         default:
         default: