Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override watch #239

Draft
wants to merge 57 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1f1e3bf
Override refactoring and additional functionnalities
avouspierre May 7, 2024
7ac38f7
Override refactoring and additional functionnalities
avouspierre May 7, 2024
f1dedc1
Override refactoring and additional functionnalities
avouspierre May 7, 2024
4d2511f
fix when preset has no id
avouspierre May 11, 2024
89af4f0
fix a concurrency issue about overrideObserver
avouspierre May 20, 2024
b5d5495
Add a color for override
avouspierre May 26, 2024
cf7fdc5
Fix a issue with duplicate ID target
avouspierre May 25, 2024
0cfb7fc
improve Override Observer
avouspierre May 26, 2024
dd483d9
Override on Apple Watch
avouspierre May 26, 2024
229c701
Limit carb equivalents of FPU conversion to 1.0 grams:
dnzxy May 26, 2024
be6a284
Edit profile overrides - Enable edit of all settings and/or name for …
dsnallfot May 24, 2024
5258cb4
fix small but annoying mismatch in fontsize start/save profile
dsnallfot May 24, 2024
9341509
Refactor to avoid duplicated code
dsnallfot May 24, 2024
f710d47
Fix disabled save-buttons
dsnallfot May 24, 2024
74e0821
Some wording alignments ("Profile" still used
dsnallfot May 24, 2024
20aa517
Remove unused alertstring
dsnallfot May 25, 2024
ee245ca
Draft 2.0 - Move settings inside edit pop-up
dsnallfot May 25, 2024
19934f4
Fix mmol conversion to mgdl when editing target
dsnallfot May 25, 2024
5df0eee
Populate settings in edit mode with current settings (before editing)
dsnallfot May 25, 2024
75c23d0
DIsable save button in edit popup until any setting has changed
dsnallfot May 25, 2024
9185612
Add alert confirmation after swiping before deletion
dsnallfot May 26, 2024
3ce0ef1
remove unused vars
dsnallfot May 26, 2024
c4f14a9
Remove accidentally copy pasted swedish text
dsnallfot May 26, 2024
79e658d
Improve UX with what settings are populated in root and edit views Wh…
dsnallfot May 27, 2024
475e9de
One more thing
dsnallfot May 27, 2024
e8c841f
Edit Temp Targets
dsnallfot May 25, 2024
2829468
Fix "New duration" fit on one line in edit popup
dsnallfot May 25, 2024
54eba5d
Fix rounding issue when converting mmol to mgdl after edit existing p…
dsnallfot May 25, 2024
eeeae6e
secondary text color
dsnallfot May 25, 2024
d4477b8
ALert after swiping before deletion (same behavior as for overrides)
dsnallfot May 26, 2024
2ebd2d8
Some fixes (Part 1 of 2):
dsnallfot May 26, 2024
a95c9b4
More fixes (Part 2 of 2):
dsnallfot May 26, 2024
d5b30de
Calculate insulin % based on saved preset target
dsnallfot May 26, 2024
99471b4
feat(issue templates): Update with different styling
Sjoerd-Bo3 May 16, 2024
cc8ec73
feat(issue templates): extended bugreport and autoadd to projects
Sjoerd-Bo3 May 27, 2024
1869b18
Update feature-request.md
Sjoerd-Bo3 May 27, 2024
5628392
fix(issue templates): minor formatting fix in bug report - steps to r…
Sjoerd-Bo3 May 27, 2024
183dc8e
feat(issue templates): added labels and projects to feature requests
Sjoerd-Bo3 May 27, 2024
f212b89
issue templates: edit labels and projects syntax
bjornoleh May 27, 2024
98e51e5
fix(issue templates): removed severity level from bug report
Sjoerd-Bo3 May 30, 2024
3f8460e
fix(issue templates): feature request label was not assigned to enhan…
Sjoerd-Bo3 May 30, 2024
9620415
fix(issue templates): removed severity level from feature requests
Sjoerd-Bo3 May 30, 2024
654c0e4
fix(issue templates): updated discord invite link
Sjoerd-Bo3 May 30, 2024
1009741
Remove unused Import Settings in JSON that cause errors decoding JSON
kskandispersonal May 30, 2024
a3237e3
Override refactoring and additional functionnalities
avouspierre May 7, 2024
5f0359b
Update override with new overrideprofileview
avouspierre May 31, 2024
1f9a677
Fix color profil
avouspierre May 31, 2024
5656423
Merge branch 'dev' into dev+override
avouspierre May 31, 2024
265b0b3
fix error after merging
avouspierre May 31, 2024
19f4611
Bug fix in Update OverrideStorage.swift
aug0211 May 31, 2024
50fd941
Exercice --> Exercise
aug0211 Jun 1, 2024
49e19d7
Override optimisation
avouspierre Jun 1, 2024
30c310f
Merge branch 'dev+override' into override-Watch
avouspierre Jun 1, 2024
58bfb82
fix padding issue in light mode for override edit
avouspierre Jun 1, 2024
aad337d
Update override with improvements asked by Trio team
avouspierre Jun 1, 2024
1651ec6
Merge branch 'dev+override' into override-Watch
avouspierre Jun 1, 2024
e3eb22e
update following the update of override
avouspierre Jun 1, 2024
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
3 changes: 2 additions & 1 deletion Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22757" systemVersion="23E224" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22222" systemVersion="23E224" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="BGaverages" representedClassName="BGaverages" syncable="YES" codeGenerationType="class">
<attribute name="average" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="average_1" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
Expand Down Expand Up @@ -65,6 +65,7 @@
<attribute name="isf" optional="YES" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
<attribute name="isfAndCr" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isPreset" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="percentage" optional="YES" attributeType="Double" defaultValueString="100" usesScalarValueType="YES"/>
<attribute name="smbIsOff" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="smbIsScheduledOff" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
Expand Down
20 changes: 20 additions & 0 deletions FreeAPS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@
CA370FC152BC98B3D1832968 /* BasalProfileEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF8BCB0C37DEB5EC377B9612 /* BasalProfileEditorRootView.swift */; };
CC6C406E2ACDD69E009B8058 /* RawFetchedProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */; };
CD78BB94E43B249D60CC1A1B /* NotificationsConfigRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22963BD06A9C83959D4914E4 /* NotificationsConfigRootView.swift */; };
CE0295982BE65817003D5E97 /* OverrideStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0295972BE65817003D5E97 /* OverrideStorage.swift */; };
CE02959B2BE65A40003D5E97 /* OverrideProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE02959A2BE65A40003D5E97 /* OverrideProfile.swift */; };
CE02959F2BE7A003003D5E97 /* TestCoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE02959E2BE7A003003D5E97 /* TestCoreData.swift */; };
CE0295A12BE7A4F9003D5E97 /* OverrideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0295A02BE7A4F9003D5E97 /* OverrideTests.swift */; };
CE0BF4B52BEA6CAB004C00DD /* NightscoutExercice.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0BF4B42BEA6CAB004C00DD /* NightscoutExercice.swift */; };
CE1F6DD92BADF4620064EB8D /* PluginManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1F6DD82BADF4620064EB8D /* PluginManagerTests.swift */; };
CE1F6DDB2BAE08B60064EB8D /* TidepoolManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1F6DDA2BAE08B60064EB8D /* TidepoolManager.swift */; };
CE1F6DE72BAF1A180064EB8D /* BuildDetails.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE1F6DE62BAF1A180064EB8D /* BuildDetails.plist */; };
Expand Down Expand Up @@ -820,6 +825,11 @@
C377490C77661D75E8C50649 /* ManualTempBasalRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ManualTempBasalRootView.swift; sourceTree = "<group>"; };
C8D1A7CA8C10C4403D4BBFA7 /* BolusDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BolusDataFlow.swift; sourceTree = "<group>"; };
CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RawFetchedProfile.swift; sourceTree = "<group>"; };
CE0295972BE65817003D5E97 /* OverrideStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverrideStorage.swift; sourceTree = "<group>"; };
CE02959A2BE65A40003D5E97 /* OverrideProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverrideProfile.swift; sourceTree = "<group>"; };
CE02959E2BE7A003003D5E97 /* TestCoreData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestCoreData.swift; sourceTree = "<group>"; };
CE0295A02BE7A4F9003D5E97 /* OverrideTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverrideTests.swift; sourceTree = "<group>"; };
CE0BF4B42BEA6CAB004C00DD /* NightscoutExercice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutExercice.swift; sourceTree = "<group>"; };
CE1F6DD82BADF4620064EB8D /* PluginManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginManagerTests.swift; sourceTree = "<group>"; };
CE1F6DDA2BAE08B60064EB8D /* TidepoolManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TidepoolManager.swift; sourceTree = "<group>"; };
CE1F6DE62BAF1A180064EB8D /* BuildDetails.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = BuildDetails.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1611,13 +1621,15 @@
19012CDB291D2CB900FB8210 /* LoopStats.swift */,
FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */,
FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */,
CE0BF4B42BEA6CAB004C00DD /* NightscoutExercice.swift */,
191F62672AD6B05A004D7911 /* NightscoutSettings.swift */,
1967DFBD29D052C200759F30 /* Icons.swift */,
19D4E4EA29FC6A9F00351451 /* TIRforChart.swift */,
19A910352A24D6D700C8951B /* DateFilter.swift */,
193F6CDC2A512C8F001240FD /* Loops.swift */,
CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */,
BDF530D72B40F8AC002CAF43 /* LockScreenView.swift */,
CE02959A2BE65A40003D5E97 /* OverrideProfile.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -1665,6 +1677,7 @@
38F3B2EE25ED8E2A005C48AA /* TempTargetsStorage.swift */,
CE82E02428E867BA00473A9C /* AlertStorage.swift */,
1956FB202AFF79E200C7B4FF /* CoreDataStorage.swift */,
CE0295972BE65817003D5E97 /* OverrideStorage.swift */,
);
path = Storage;
sourceTree = "<group>";
Expand Down Expand Up @@ -1839,6 +1852,8 @@
38FCF3F825E902C20078B0D1 /* FileStorageTests.swift */,
CE1F6DD82BADF4620064EB8D /* PluginManagerTests.swift */,
CEE9A65D2BBC9F6500EB5194 /* CalibrationsTests.swift */,
CE02959E2BE7A003003D5E97 /* TestCoreData.swift */,
CE0295A02BE7A4F9003D5E97 /* OverrideTests.swift */,
);
path = FreeAPSTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -2722,6 +2737,7 @@
3883581C25EE79BB00E024B2 /* DecimalTextField.swift in Sources */,
6B1A8D2E2B156EEF00E76752 /* LiveActivityBridge.swift in Sources */,
38DAB28A260D349500F74C1A /* FetchGlucoseManager.swift in Sources */,
CE02959B2BE65A40003D5E97 /* OverrideProfile.swift in Sources */,
38F37828261260DC009DB701 /* Color+Extensions.swift in Sources */,
3811DE3F25C9D4A100A708ED /* SettingsStateModel.swift in Sources */,
CE7CA3582A064E2F004BE681 /* ListStateView.swift in Sources */,
Expand Down Expand Up @@ -2762,6 +2778,7 @@
E974172296125A5AE99E634C /* PumpConfigRootView.swift in Sources */,
CE7CA3522A064973004BE681 /* ListTempPresetsIntent.swift in Sources */,
448B6FCB252BD4796E2960C0 /* PumpSettingsEditorDataFlow.swift in Sources */,
CE0BF4B52BEA6CAB004C00DD /* NightscoutExercice.swift in Sources */,
38E44536274E411700EC9A94 /* Disk.swift in Sources */,
2BE9A6FA20875F6F4F9CD461 /* PumpSettingsEditorProvider.swift in Sources */,
6B9625766B697D1C98E455A2 /* PumpSettingsEditorStateModel.swift in Sources */,
Expand All @@ -2782,6 +2799,7 @@
FA630397F76B582C8D8681A7 /* BasalProfileEditorProvider.swift in Sources */,
63E890B4D951EAA91C071D5C /* BasalProfileEditorStateModel.swift in Sources */,
38FEF3FA2737E42000574A46 /* BaseStateModel.swift in Sources */,
CE0295982BE65817003D5E97 /* OverrideStorage.swift in Sources */,
CC6C406E2ACDD69E009B8058 /* RawFetchedProfile.swift in Sources */,
385CEA8225F23DFD002D6D5B /* NightscoutStatus.swift in Sources */,
F90692AA274B7AAE0037068D /* HealthKitManager.swift in Sources */,
Expand Down Expand Up @@ -2916,7 +2934,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE02959F2BE7A003003D5E97 /* TestCoreData.swift in Sources */,
CEE9A65E2BBC9F6500EB5194 /* CalibrationsTests.swift in Sources */,
CE0295A12BE7A4F9003D5E97 /* OverrideTests.swift in Sources */,
CE1F6DD92BADF4620064EB8D /* PluginManagerTests.swift in Sources */,
38FCF3F925E902C20078B0D1 /* FileStorageTests.swift in Sources */,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.843",
"green" : "0.341",
"red" : "0.639"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "0.830",
"blue" : "0.981",
"green" : "0.618",
"red" : "0.948"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"colors" : [
{
"color" : {
"color-space" : "srgb",
"color-space" : "display-p3",
"components" : {
"alpha" : "0.500",
"blue" : "0.976",
"green" : "0.839",
"red" : "0.635"
"alpha" : "1.000",
"blue" : "0.962",
"green" : "0.745",
"red" : "0.453"
}
},
"idiom" : "universal"
Expand Down
5 changes: 4 additions & 1 deletion FreeAPS/Sources/APS/APSManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final class BaseAPSManager: APSManager, Injectable {
@Injected() private var settingsManager: SettingsManager!
@Injected() private var broadcaster: Broadcaster!
@Injected() private var healthKitManager: HealthKitManager!
@Injected() private var overrideStorage: OverrideStorage!
@Persisted(key: "lastAutotuneDate") private var lastAutotuneDate = Date()
@Persisted(key: "lastStartLoopDate") private var lastStartLoopDate: Date = .distantPast
@Persisted(key: "lastLoopDate") var lastLoopDate: Date = .distantPast {
Expand Down Expand Up @@ -359,10 +360,12 @@ final class BaseAPSManager: APSManager, Injectable {
let now = Date()
let temp = currentTemp(date: now)

let eventualCurrentOverride: OverrideProfile? = overrideStorage.current()

let mainPublisher = makeProfiles()
.flatMap { _ in self.autosens() }
.flatMap { _ in self.dailyAutotune() }
.flatMap { _ in self.openAPS.determineBasal(currentTemp: temp, clock: now) }
.flatMap { _ in self.openAPS.determineBasal(currentTemp: temp, clock: now, override: eventualCurrentOverride) }
.map { suggestion -> Bool in
if let suggestion = suggestion {
DispatchQueue.main.async {
Expand Down
Loading