|
@@ -462,7 +462,7 @@ final class OpenAPS {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- func createProfiles() async {
|
|
|
|
|
|
|
+ func createProfiles(useSwiftOref: Bool) async {
|
|
|
debug(.openAPS, "Start creating pump profile and user profile")
|
|
debug(.openAPS, "Start creating pump profile and user profile")
|
|
|
|
|
|
|
|
// Load required settings and profiles asynchronously
|
|
// Load required settings and profiles asynchronously
|
|
@@ -516,7 +516,8 @@ final class OpenAPS {
|
|
|
tempTargets: tempTargets,
|
|
tempTargets: tempTargets,
|
|
|
model: model,
|
|
model: model,
|
|
|
autotune: RawJSON.null,
|
|
autotune: RawJSON.null,
|
|
|
- freeaps: freeaps
|
|
|
|
|
|
|
+ freeaps: freeaps,
|
|
|
|
|
+ useSwiftOref: useSwiftOref
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
let profile = try await makeProfile(
|
|
let profile = try await makeProfile(
|
|
@@ -529,7 +530,8 @@ final class OpenAPS {
|
|
|
tempTargets: tempTargets,
|
|
tempTargets: tempTargets,
|
|
|
model: model,
|
|
model: model,
|
|
|
autotune: RawJSON.null,
|
|
autotune: RawJSON.null,
|
|
|
- freeaps: freeaps
|
|
|
|
|
|
|
+ freeaps: freeaps,
|
|
|
|
|
+ useSwiftOref: useSwiftOref
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// Save the profiles
|
|
// Save the profiles
|
|
@@ -726,7 +728,8 @@ final class OpenAPS {
|
|
|
tempTargets: JSON,
|
|
tempTargets: JSON,
|
|
|
model: JSON,
|
|
model: JSON,
|
|
|
autotune: JSON,
|
|
autotune: JSON,
|
|
|
- freeaps: JSON
|
|
|
|
|
|
|
+ freeaps: JSON,
|
|
|
|
|
+ useSwiftOref: Bool
|
|
|
) async throws -> RawJSON {
|
|
) async throws -> RawJSON {
|
|
|
// TODO: Compare exceptions as well
|
|
// TODO: Compare exceptions as well
|
|
|
let startJavascriptAt = Date()
|
|
let startJavascriptAt = Date()
|
|
@@ -746,7 +749,7 @@ final class OpenAPS {
|
|
|
|
|
|
|
|
// Important: we want to make sure that this flag ensures that none
|
|
// Important: we want to make sure that this flag ensures that none
|
|
|
// of the native code runs
|
|
// of the native code runs
|
|
|
- guard let settings = try? JSONBridge.freeapsSettings(from: freeaps), settings.useSwiftOref else {
|
|
|
|
|
|
|
+ guard useSwiftOref else {
|
|
|
return jsJson
|
|
return jsJson
|
|
|
}
|
|
}
|
|
|
|
|
|