@@ -11,33 +11,81 @@ import Foundation
1111let FeatureFlags = FeatureFlagConfiguration ( )
1212
1313struct FeatureFlagConfiguration : Decodable {
14- let sensitivityOverridesEnabled : Bool
14+ let criticalAlertsEnabled : Bool
15+ let deleteAllButtonEnabled : Bool
16+ let fiaspInsulinModelEnabled : Bool
17+ let includeServicesInSettingsEnabled : Bool
18+ let mockTherapySettingsEnabled : Bool
1519 let nonlinearCarbModelEnabled : Bool
20+ let observeHealthKitSamplesFromOtherApps : Bool
1621 let remoteOverridesEnabled : Bool
17- let criticalAlertsEnabled : Bool
22+ let predictedGlucoseChartClampEnabled : Bool
1823 let scenariosEnabled : Bool
24+ let sensitivityOverridesEnabled : Bool
1925 let simulatedCoreDataEnabled : Bool
2026 let walshInsulinModelEnabled : Bool
21- let fiaspInsulinModelEnabled : Bool
22- let observeHealthKitSamplesFromOtherApps : Bool
23- let includeServicesInSettingsEnabled : Bool
24- let mockTherapySettingsEnabled : Bool
25- let deleteAllButtonEnabled : Bool
2627
2728 fileprivate init ( ) {
29+ #if CRITICAL_ALERTS_ENABLED
30+ self . criticalAlertsEnabled = true
31+ #else
32+ self . criticalAlertsEnabled = false
33+ #endif
34+
35+ // Swift compiler config is inverse, since the default state is enabled.
36+ #if DELETE_ALL_BUTTON_DISABLED
37+ self . deleteAllButtonEnabled = false
38+ #else
39+ self . deleteAllButtonEnabled = true
40+ #endif
41+
2842 // Swift compiler config is inverse, since the default state is enabled.
2943 #if FEATURE_OVERRIDES_DISABLED
3044 self . sensitivityOverridesEnabled = false
3145 #else
3246 self . sensitivityOverridesEnabled = true
3347 #endif
3448
49+ // Swift compiler config is inverse, since the default state is enabled.
50+ #if FIASP_INSULIN_MODEL_DISABLED
51+ self . fiaspInsulinModelEnabled = false
52+ #else
53+ self . fiaspInsulinModelEnabled = true
54+ #endif
55+
56+ // Swift compiler config is inverse, since the default state is enabled.
57+ #if INCLUDE_SERVICES_IN_SETTINGS_DISABLED
58+ self . includeServicesInSettingsEnabled = false
59+ #else
60+ self . includeServicesInSettingsEnabled = true
61+ #endif
62+
63+ // Swift compiler config is inverse, since the default state is enabled.
64+ #if MOCK_THERAPY_SETTINGS_ENABLED
65+ self . mockTherapySettingsEnabled = true
66+ #else
67+ self . mockTherapySettingsEnabled = false
68+ #endif
69+
3570 // Swift compiler config is inverse, since the default state is enabled.
3671 #if NONLINEAR_CARB_MODEL_DISABLED
3772 self . nonlinearCarbModelEnabled = false
3873 #else
3974 self . nonlinearCarbModelEnabled = true
4075 #endif
76+
77+ // Swift compiler config is inverse, since the default state is enabled.
78+ #if OBSERVE_HEALTH_KIT_SAMPLES_FROM_OTHER_APPS_DISABLED
79+ self . observeHealthKitSamplesFromOtherApps = false
80+ #else
81+ self . observeHealthKitSamplesFromOtherApps = true
82+ #endif
83+
84+ #if PREDICTED_GLUCOSE_CHART_CLAMP_ENABLED
85+ self . predictedGlucoseChartClampEnabled = true
86+ #else
87+ self . predictedGlucoseChartClampEnabled = false
88+ #endif
4189
4290 // Swift compiler config is inverse, since the default state is enabled.
4391 #if REMOTE_OVERRIDES_DISABLED
@@ -46,12 +94,6 @@ struct FeatureFlagConfiguration: Decodable {
4694 self . remoteOverridesEnabled = true
4795 #endif
4896
49- #if CRITICAL_ALERTS_ENABLED
50- self . criticalAlertsEnabled = true
51- #else
52- self . criticalAlertsEnabled = false
53- #endif
54-
5597 #if SCENARIOS_ENABLED
5698 self . scenariosEnabled = true
5799 #else
@@ -70,59 +112,26 @@ struct FeatureFlagConfiguration: Decodable {
70112 #else
71113 self . walshInsulinModelEnabled = true
72114 #endif
73-
74- // Swift compiler config is inverse, since the default state is enabled.
75- #if FIASP_INSULIN_MODEL_DISABLED
76- self . fiaspInsulinModelEnabled = false
77- #else
78- self . fiaspInsulinModelEnabled = true
79- #endif
80-
81- // Swift compiler config is inverse, since the default state is enabled.
82- #if OBSERVE_HEALTH_KIT_SAMPLES_FROM_OTHER_APPS_DISABLED
83- self . observeHealthKitSamplesFromOtherApps = false
84- #else
85- self . observeHealthKitSamplesFromOtherApps = true
86- #endif
87-
88- // Swift compiler config is inverse, since the default state is enabled.
89- #if INCLUDE_SERVICES_IN_SETTINGS_DISABLED
90- self . includeServicesInSettingsEnabled = false
91- #else
92- self . includeServicesInSettingsEnabled = true
93- #endif
94-
95- #if MOCK_THERAPY_SETTINGS_ENABLED
96- self . mockTherapySettingsEnabled = true
97- #else
98- self . mockTherapySettingsEnabled = false
99- #endif
100-
101- // Swift compiler config is inverse, since the default state is enabled.
102- #if DELETE_ALL_BUTTON_DISABLED
103- self . deleteAllButtonEnabled = false
104- #else
105- self . deleteAllButtonEnabled = true
106- #endif
107115 }
108116}
109117
110118
111119extension FeatureFlagConfiguration : CustomDebugStringConvertible {
112120 var debugDescription : String {
113121 return [
114- " * sensitivityOverridesEnabled: \( sensitivityOverridesEnabled) " ,
115- " * nonlinearCarbModelEnabled: \( nonlinearCarbModelEnabled) " ,
116- " * remoteOverridesEnabled: \( remoteOverridesEnabled) " ,
117122 " * criticalAlertsEnabled: \( criticalAlertsEnabled) " ,
118- " * scenariosEnabled: \( scenariosEnabled) " ,
119- " * simulatedCoreDataEnabled: \( simulatedCoreDataEnabled) " ,
120- " * walshInsulinModelEnabled: \( walshInsulinModelEnabled) " ,
123+ " * deleteAllButtonEnabled: \( deleteAllButtonEnabled) " ,
121124 " * fiaspInsulinModelEnabled: \( fiaspInsulinModelEnabled) " ,
122- " * observeHealthKitSamplesFromOtherApps: \( observeHealthKitSamplesFromOtherApps) " ,
123125 " * includeServicesInSettingsEnabled: \( includeServicesInSettingsEnabled) " ,
124126 " * mockTherapySettingsEnabled: \( mockTherapySettingsEnabled) " ,
125- " * deleteAllButtonEnabled: \( deleteAllButtonEnabled) "
127+ " * nonlinearCarbModelEnabled: \( nonlinearCarbModelEnabled) " ,
128+ " * observeHealthKitSamplesFromOtherApps: \( observeHealthKitSamplesFromOtherApps) " ,
129+ " * predictedGlucoseChartClampEnabled: \( predictedGlucoseChartClampEnabled) " ,
130+ " * remoteOverridesEnabled: \( remoteOverridesEnabled) " ,
131+ " * scenariosEnabled: \( scenariosEnabled) " ,
132+ " * sensitivityOverridesEnabled: \( sensitivityOverridesEnabled) " ,
133+ " * simulatedCoreDataEnabled: \( simulatedCoreDataEnabled) " ,
134+ " * walshInsulinModelEnabled: \( walshInsulinModelEnabled) "
126135 ] . joined ( separator: " \n " )
127136 }
128137}
0 commit comments