Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
merge additions
  • Loading branch information
mountrcg committed Nov 7, 2024
1 parent 4bbf118 commit 19141f6
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_DISPLAY_NAME = iAPS
APP_VERSION = 3.7
APP_VERSION = 3.7.1
APP_BUILD_NUMBER = 1
COPYRIGHT_NOTICE = autoISF 3.0
DEVELOPER_TEAM = ##TEAM_ID##
Expand Down
7 changes: 4 additions & 3 deletions FreeAPS.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"originHash" : "52d77fc35af7fe71614051dee0b291e2a0d38522eac7ae4d37d2442e81c7530c",
"pins" : [
{
"identity" : "cryptoswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/CryptoSwift",
"state" : {
"revision" : "c9c3df6ab812de32bae61fc0cd1bf6d45170ebf0",
"version" : "1.8.2"
"revision" : "678d442c6f7828def400a70ae15968aef67ef52d",
"version" : "1.8.3"
}
},
{
Expand Down Expand Up @@ -91,5 +92,5 @@
}
}
],
"version" : 2
"version" : 3
}
14 changes: 14 additions & 0 deletions FreeAPS/Sources/APS/APSManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ enum APSError: LocalizedError {
case apsError(message: String)
case deviceSyncError(message: String)
case manualBasalTemp(message: String)
case activeBolusViewBolus
case activeBolusViewBasal
case activeBolusViewBasalandBolus

var errorDescription: String? {
switch self {
Expand All @@ -56,6 +59,12 @@ enum APSError: LocalizedError {
return "Sync error: \(message)"
case let .manualBasalTemp(message):
return "Manual Basal Temp : \(message)"
case .activeBolusViewBolus:
return "Suggested SMB not enacted while in Bolus View"
case .activeBolusViewBasal:
return "Suggested Temp Basal (when > 0) not enacted while in Bolus View"
case .activeBolusViewBasalandBolus:
return "Suggested Temp Basal (when > 0) and SMB not enacted while in Bolus View"
}
}
}
Expand Down Expand Up @@ -1300,6 +1309,11 @@ final class BaseAPSManager: APSManager, Injectable {
}
}

private func activeBolusView() -> Bool {
let defaults = UserDefaults.standard
return defaults.bool(forKey: IAPSconfig.inBolusView)
}

private func loopStats(loopStatRecord: LoopStats) {
coredataContext.perform {
let nLS = LoopStatRecord(context: self.coredataContext)
Expand Down
1 change: 1 addition & 0 deletions FreeAPS/Sources/APS/Storage/CoreDataStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ final class CoreDataStorage {
}
return insulinDistribution
}

func insulinConcentration() -> (concentration: Double, increment: Double) {
var conc = [InsulinConcentration]()
coredataContext.performAndWait {
Expand Down
14 changes: 14 additions & 0 deletions FreeAPS/Sources/Application/FreeAPSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,18 @@ import Swinject
default: break
}
}

private func isNewVersion() {
let userDefaults = UserDefaults.standard
var version = userDefaults.string(forKey: IAPSconfig.version) ?? ""
userDefaults.set(false, forKey: IAPSconfig.inBolusView)

guard version.count > 1, version == (Bundle.main.releaseVersionNumber ?? "") else {
version = Bundle.main.releaseVersionNumber ?? ""
userDefaults.set(version, forKey: IAPSconfig.version)
userDefaults.set(true, forKey: IAPSconfig.newVersion)
debug(.default, "Running new version: \(version)")
return
}
}
}
4 changes: 4 additions & 0 deletions FreeAPS/Sources/Models/Configs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public enum IAPSconfig {
static let glassShadowOpacity: CGFloat = 0.6
static let shadowFraction: CGFloat = 2
static let minimumCarbEquivalent: Decimal = 0.6
static let id = "iAPS.identifier"
static let version = "iAPS.version"
static let newVersion = "iAPS.newVersion"
static let inBolusView = "iAPS.inBolusView"
}

extension Font {
Expand Down
12 changes: 12 additions & 0 deletions FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ extension Bolus {
}
return nil
}

func notActive() {
let defaults = UserDefaults.standard
defaults.set(false, forKey: IAPSconfig.inBolusView)
// print("Active: NO") // For testing
}

func viewActive() {
let defaults = UserDefaults.standard
defaults.set(true, forKey: IAPSconfig.inBolusView)
// print("Active: YES") // For testing
}
}
}

Expand Down
34 changes: 16 additions & 18 deletions FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,22 @@ extension Settings {
Toggle("Debug options", isOn: $state.debugOptions)
if state.debugOptions {
Group {
HStack {
Text("NS Upload Profile and Settings")
Button("Upload") { state.uploadProfileAndSettings(true) }
.frame(maxWidth: .infinity, alignment: .trailing)
.buttonStyle(.borderedProminent)
}

HStack {
Text("Delete All NS Overrides")
Button("Delete") { state.deleteOverrides() }
.frame(maxWidth: .infinity, alignment: .trailing)
.buttonStyle(.borderedProminent)
.tint(.red)
} /*

HStack {
Toggle("Ignore flat CGM readings", isOn: $state.disableCGMError)
}
// HStack {
// Text("NS Upload Profile and Settings")
// Button("Upload") { state.uploadProfileAndSettings(true) }
// .frame(maxWidth: .infinity, alignment: .trailing)
// .buttonStyle(.borderedProminent)
// }
// HStack {
// Text("Delete All NS Overrides")
// Button("Delete") { state.deleteOverrides() }
// .frame(maxWidth: .infinity, alignment: .trailing)
// .buttonStyle(.borderedProminent)
// .tint(.red)
// }
// HStack {
// Toggle("Ignore flat CGM readings", isOn: $state.disableCGMError)
// }

HStack {
Toggle("Allow diluted insulin concentration settings", isOn: $state.allowDilution)
Expand Down
16 changes: 8 additions & 8 deletions FreeAPS/Sources/Views/ViewModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ struct AddShadow: ViewModifier {
}
}

struct RaisedRectangle: View {
@Environment(\.colorScheme) var colorScheme
var body: some View {
Rectangle().fill(colorScheme == .dark ? .black : .white)
.frame(height: 1)
.addShadows()
}
}
// struct RaisedRectangle: View {
// @Environment(\.colorScheme) var colorScheme
// var body: some View {
// Rectangle().fill(colorScheme == .dark ? .black : .white)
// .frame(height: 1)
// .addShadows()
// }
// }

struct TestTube: View {
let opacity: CGFloat
Expand Down

0 comments on commit 19141f6

Please sign in to comment.