Commit Graph

1560 Commits

Author SHA1 Message Date
Paul Plant 08508fee1d Update GNSEntryBluetoothPeripheralViewModel.swift
- correct firmWareVersion typo
2023-01-08 11:14:45 +01:00
Paul Plant 21494c3e33 add GitHub repo link to info section in settings
- no translations are needed as the text only says "Github"
2023-01-08 11:13:27 +01:00
Paul Plant 5140734d6f BluetoothPeripheralViewModel label updates 2023-01-08 10:55:26 +01:00
Paul Plant 390a7318f3 enforce a minimum sensor warm-up time before processing new glucose values
- implemented to ensure a minimum time has passed since sensor activation
- especially necessary for Libre sensors (either Libre 2 BLE or Libre through transmitters) that can transmit glucose values immediately after activation. The first 50 minutes can often produce very unreliable values so it's better to just not process anything during this time.
- note that there is no set time after which the sensor values are reliable. Sometimes after 10 minutes, values are good. Sometimes it needs 30 or even 40 minutes.
- warm-up time is therefore initially set to 45 minutes warm-up time but minimumSensorWarmUpRequiredInMinutes can be edited in ConstantsMaster.swift
2023-01-08 10:42:11 +01:00
Paul Plant 2ad21ccfa9 add US Libre 1 E6 ROM compatibility 2023-01-07 21:12:13 +01:00
Paul Plant 1735a11778 correct askUser value in BluetoothPeripheralController
- don't ask the user for confirmation when automatically disconnecting the transmitter after a failed NFC scan
- the erroneous true value was left in by error whilst testing
2023-01-07 21:12:01 +01:00
Paul Plant 58185737f8 various UI changes for dates/texts/fields
- change "Follow Dexcom-app" to "Read from Dexcom app" to avoid confusion with Dexcom Follow
- changes to transmitter/sensor display formats to use Nightscout format and improve clarity
- label changes
- typo correction: disclosureAaccessoryView -> disclosureAccessoryView
- simplified sensor status UIAlert and now includes sensor duration (elapsed time since start) and remaining (time until end date)
2023-01-07 21:12:01 +01:00
Paul Plant 3109e01498 limit BG readings to absolute maximum of 600 before processing by RVC 2023-01-07 21:12:01 +01:00
Johan Degraeve ec99944bfa removed useless tracing 2023-01-05 23:12:46 +01:00
Paul Plant 1dac9ccb57 improvement to "notification interval" text 2023-01-04 13:26:59 +01:00
Paul Plant 603db60ff5 Libre 2 NFC re-write
- rewrite of NFC scan workflow
- initial scan of NFC-enabled sensors will now *not* initial BLE scanning
- NFC scan logic redone to perform several loops until a successful NFC scan with valid data is hopefully performed
- UI updated to inform user of scan attempts and give much clearer alert messages.
- haptic feedback (vibrations/noise) added to guide user during scan cycles
- a failed NFC scan will now inform the user and offer to immediately scan again. If the user declines the transmitter will be disconnected (if existing) or removed (if adding new)
- BLE Peripheral view should show correct status in connection row if pending NFC scan to continue
- once a valid NFC scan has been performed, the user will be informed and the superclass will be told to start BLE scanning to find the sensor/transmitter. This will avoid trying to connect before a valid NFC is performed
- the scanned sensor serial number is passed back through the delegate to update the expected device name at the same time as BLE scanning is started. This prevents the app from connecting to a different transmitter (i.e. Libre 2).
- when a Libre 2 sensor is disconnected, the active sensor is set to nil. This prevents the countdown from staying on screen with no valid sensor connected.
- as above but the libre1DerivedParameters are also set to nil to prevent an issue that can show very high readings when initially connecting to a new sensor
- related alert messages changed to improve clarity
- translations added for EN/NL/ES/FR/DE/PT/SV
2023-01-04 13:24:06 +01:00
Johan Degraeve ba90cbc628 after calibration, and if loopdelay, don't send values to loop
For an unexplainable reason, after a calibration, and if loopdelay is used, there's one single wrong value created and sent to Loop.
I couldn't it fix it
but this change suppresses creation of readings for a period of loopdelay + 5.5 minutes
2022-10-23 22:40:50 +02:00
Johan Degraeve ab1b5b9b72 version 4.10.6 - build 4181 2022-10-17 22:38:49 +02:00
Johan Degraeve b0d29ca2ad Merge branch 'fix-385-deleteLocalTreatments' into develop 2022-10-08 22:35:56 +02:00
Johan Degraeve 084b94a045 Fix #274 double readings uploaded to NS
This was only for Libre with smoothing enabled.

sometimes the older values reappear but with a slightly different timestamp
this caused readings being uploaded to NS with just a few seconds difference

Fixed by adding 10 seconds to timeStampLatestNightScoutUploadedBgReading
2022-10-07 23:02:38 +02:00
Johan Degraeve 64bd7f6014 Fix #385 delete treatments that are deleted at NS
This only works for treatments that are deleted within 24 hours after creation

Each time a list of treatments download from NS, there's a check to see if a treatment that was already uploaded previously, is in the list downloaded.
If not then we can assume it's been deleted, and will be marked as deleted also in xDrip4iOS
2022-10-07 17:19:27 +02:00
Johan Degraeve 7c89ba369c
Merge pull request #383 from pvavolas/patch-1
Fix translation issue on AlertManager
2022-10-07 14:38:40 +02:00
Johan Degraeve 0834c5e1de
Merge pull request #389 from pvavolas/develop
Add El (Greek) localizations
2022-10-06 21:53:56 +02:00
Johan Degraeve 68e0eb8ee5
Merge pull request #391 from paulplant/develop
Update minimum G6 Firefly ID from 8G to 8A
2022-10-06 20:49:19 +02:00
Paul Plant 58b202255f Update minimum G6 Firefly ID from 8G to 8A 2022-10-06 16:14:34 +02:00
Pavlos Vavolas b2ec3aec47 Add El (Greek) localizations 2022-10-04 21:24:02 +02:00
Zaremba cbc4ebd3e2 Fix name 2022-09-17 16:13:08 +03:00
Zaremba 0cd4a17202 Merge branch 'develop' 2022-09-17 16:04:49 +03:00
Paul Vavolas c90cabf198
Update AlertManager.swift
Minor bug in string replacement during translation. Change order of string replacement as "hour" is included in "hours". This affects all language translations
2022-09-10 23:48:11 +02:00
Johan Degraeve 9cf126f6a4 improve loop delay
now the loopdelay feature gives smoothed values per minute readings to loopshare, with the exact delay

before this change, the delay was much bigger than the actual configured delay, and readings came in every 5 minutes, in stead of every minute
2022-09-10 12:06:44 +02:00
Zaremba 9ad5aa3e8a small fix 2022-09-06 20:26:47 +03:00
Zaremba 9d59753bbf small fix 2022-09-06 18:04:38 +03:00
Johan Degraeve dbcbd9d79c version 4.10.5 - build 4180 2022-08-30 22:54:49 +02:00
Johan Degraeve bf4c33b794 Removed NDEF from entitlements
was necessary to fix an issue with upload to app store
more info : https://www.themobileentity.com/home/how-to-fix-ndef-is-disallowed-error-when-uploading-nfc-enabled-app-to-app-store-connect
2022-08-30 22:48:02 +02:00
Johan Degraeve 0b4b88dc5c version 4.10.4 - build 4180 2022-08-29 23:11:11 +02:00
Johan Degraeve 9ba6df7571 Russian translation : ';' was missing 2022-08-29 23:10:50 +02:00
Johan Degraeve fbafb25009 Russian : change "Insulin" text to "Bolus" 2022-08-28 22:20:36 +02:00
Paul Plant f1eedbd63a update "Insulin" string to "Bolus" to avoid confusion between bolus/basal 2022-08-28 15:29:06 +02:00
Paul Plant 551a78a88b treatments filter UI update 2022-08-28 15:21:54 +02:00
Zaremba 28f6ce83a5 alert fix 2022-08-20 13:34:05 +03:00
Zaremba d6c32ff361 fix calibrate 2022-08-19 15:52:40 +03:00
Zaremba e065d0894c small fix 2022-08-19 13:37:43 +03:00
Zaremba dd4d0434df small fix name 2022-08-19 13:21:04 +03:00
Zaremba e72a7c71d1 russian translate 2022-08-19 13:17:46 +03:00
Johan Degraeve b0ce08eeef fix calculation loopdelay 2022-07-27 18:40:21 +02:00
Johan Degraeve 36c2756ca7 suppress share cgm transmitter address with loop
if 'Suppress Loop Share' is enabled.

This is fix is only required if there's multiple instances of xDrip4iOS running on one device and if Loop is used
2022-07-25 23:28:48 +02:00
Johan Degraeve f50dbdbe28 fix Turkish : short for day 2022-07-25 21:47:00 +02:00
Johan Degraeve e54bfa3082 suppress treatments sync if nightscout schedule says off
If nightscout schedule is currently set to off, then don't sync treatments (to save battery)
except if app is in foreground
2022-07-21 13:35:26 +02:00
Johan Degraeve e9f6f08fc1 call cgmTransmitterInfoChanged only if blePeripheral is the active cgm transmitter
it's possible to create multiple cgm transmitters (eg a Libre 2 and a dexcom) but only one can be active, ie connected.
But one could go to the settings for the non-active CGM, and change the setting 'Use Transmitter algorithm'.
In that case, the setting was changed also for the active CGM, causing incorrect status.

this is fixed now
haha
2022-07-13 00:01:38 +02:00
Johan Degraeve 10cfcdb929 cleanup blePeripherals that have no type assigned, at startuyp
seems some blePeripherals remain in coredata without a type being assigned. Probably happens while scanning for a new device.

those are now cleaned up at app start
2022-07-12 22:58:47 +02:00
Johan Degraeve f04a9284a8 minor trace clean up 2022-07-12 16:54:16 +02:00
Johan Degraeve 3f2a021a51 Option to define loopDelay dependent on the time of day
loopDelay means that readings shared with Loop will be shifted forward with a predefined amount of minutes. Example : a reading that is for instance created at 15:00, to which a delay is applied of 5 minutes, then Loop will receive that reading at 15:05, while at 15:00, Loop will receive the reading that was created at 14:55.
This is only useful when used in combination with smoothing. Advantage is that readings that Loop will receive are more efficiently smoothed

- new setting is available in the Developer settings
- used SwiftUI to define a new View that allows to create loopDelays
- colors used in SwiftUI code are defined in Constants/ConstantsUI.swift

- deployment target increased from 12.0 to 13.0
- String extension getSchedule renamed to splitToInt
2022-07-11 18:15:28 +02:00
Johan Degraeve d764760e52 small fix in translations 2022-06-24 21:35:03 +02:00
Johan Degraeve aaabd04bdf Merge branch 'fixiOSVolumeTest' into develop 2022-06-23 19:21:22 +02:00
Paul Plant 87a36da32d prevent future BG checks being added
- if the user tries to add a new (or modify an existing) BG check and set it's date in the future, warn them that it is not allowed and set the date to now.
- this is a safety feature for APS system that can use BG checks as part of their prediction as well as CGM values
2022-06-23 17:33:07 +02:00
Paul Plant c816e307db Merge branch 'develop' into treatments-filters 2022-06-23 16:26:00 +02:00
Paul Plant 327a609aa5 implement treatment filtering in list
- the different treatment types (insulin, carbs, BG checks) can be filtered if required to show/hide them in the treatment table
- if boluses are shown, an option to filter micro-boluses is also enabled.
- button icon images are set individually as filled/unfilled to more clearly show if they are selected
- .getTreatments call reduced from 100 days to 21 days to save overhead
- previous settings options to show micro-boluses in the treatments table (and associated translations) removed as no longer needed
2022-06-23 16:21:59 +02:00
Johan Degraeve c02a4e117e suppress unlockPayload and suppress share readings
fix #362

- suppress sending unlockPayload : only for Libre 2. This allows to run/connect several apps to Libre 2
- suppress share readings with Loop : useful if more than one app (eg more than one instance of xDrip4iOS) run in parallel, to ensure only one instance stores readings in shared user defaults
- additonally, minor change in comments
- minor change in comments for LoopDelay
2022-06-23 07:23:25 +02:00
Johan Degraeve 498c454522
Merge pull request #363 from paulplant/mini-chart
Mini chart implementation
2022-06-21 20:18:33 +02:00
Paul Plant 3aa66d3ea6 Clean up GlucoseMiniChartManager
clean up old code that was commented out
2022-06-21 17:01:59 +02:00
Paul Plant 6e12461334 use unfilled lock icon if locked with value long press 2022-06-21 17:00:53 +02:00
Paul Plant e6d0861b08 fix speech "trending flat" bug 2022-06-21 16:20:56 +02:00
Paul Plant d247859716 mini-chart midnight marker(s) added for context
- any date range over 24 hours is now always displayed in days
2022-06-19 10:47:27 +02:00
Paul Plant 53432ced58 show/hide mini-chart with lock screen 2022-06-19 09:51:37 +02:00
Paul Plant 7cd23589e4 extra ranges for mini-chart
- added extra ranges to allow 24hr/48hr/3d and 7d options
- time period selected is now always shown but faded out
- when double tapped, the range changes to the next one and the label is turned white and then faded back out
2022-06-18 14:17:16 +02:00
Johan Degraeve a80a128b63 fix bug : Volume test iOS sound
wasn't working anymore, seems since iOS 14, see https://stackoverflow.com/questions/69023854/ios-15-notification-sounds-are-not-playing-for-foreground-notifications and https://developer.apple.com/forums/thread/700884 ("Displaying" sound only notifications is no longer possible.)

The solution is
- to add a dummy text and body in the test notification
- to add .list if iOS 14 or higher
2022-06-18 00:12:09 +02:00
Paul Plant 34bae76168 mini-chart initial implementation
This uses a new glucoseMiniGlucoseChart object to display a static 24hr or 48hr mini-chart beneath the main chart.
- simplified to display only glucose chart points with all axiis, guidelines and labels hidden.
- it will update every time new glucose readings are processed
- a double tap will toggle between 24hr and 48hr modes (default 24hrs)
- by default the mini-chart will be hidden (upon first ever launch) for users with "Zoomed Display" enabled. Otherwise, the mini-chart will be shown by default.
- as above but same logic also applied to the statistics view for first launch
- home screen settings menu edited to add option
- observer added to hide/show the chart after settings change and also to redraw the chart after hours are toggled by double tap
2022-06-17 17:48:06 +02:00
Johan Degraeve 48ee34a9bd version 4.10.3 build 4179 2022-06-15 22:30:44 +02:00
Johan Degraeve aac17aae0d fix bug : avoid crash in TreatmentsViewController when iOS 13 is not available 2022-06-12 23:37:19 +02:00
Johan Degraeve c580416e62 fix bug, no upload new readings after Internet failure
The bug was that after restore of failed Internet connection, new readings are not uploaded to NS.

- as mentioned in the comments of func uploadData(dataToUpload: Any, httpMethod: String?, path: String, completionHandler: (() -> ())?)
completionhandler should be called only when upload was successful.
But the result of the upload was never checked. So probably, in some error cases, completionhandler was called with success. As a result, the upload was considered as successful and not redone when internet comes back

- also some updates in func uploadDataAndGetResponse. Set nightScoutResult to .failed when there was an error.
2022-06-12 23:31:50 +02:00
eduardopietre 7a263e8326 Optimized GlucoseChartManager getTreatmentEntryChartPoints.
Optimized getTreatmentEntryChartPoints to run faster.

- Previously, getTreatmentEntryChartPoints was generating lag and spikes of CPU usage.
- The code was optimized by reducing the amount of calls to getBgReadings.
- Now getBgReadings is only called once inside getTreatmentEntryChartPoints.
- Now calculateClosestYAxisValues interpolates the SGV value from the two closest bgReadings, if there are. 
- Profiling registered a speed up of 500%.
2022-06-12 17:46:25 -03:00
Paul Plant 7a801a484e Update TreatmentsViewController.swift
add a disclosure indicator to each cell row to indicate to the user that they can click to edit the treatment
2022-06-05 20:57:47 +02:00
Paul Plant a4b8e67ff1 user locale implemented for all UI date and time displays
- chart hour axis label and scroll back timestamp will be shown in user locale
- treatment list time will be shown in user locale
- snooze screen times and dates will be shown in user locale
- BLE peripherals dates and times will be shown in user locale
- alarm dates and times will be shown in user locale
- landscape view date will be shown in user locale
- small improvements to layout of alarms screen
- schema updated to include location and allow region changes in simulator/debug
2022-06-05 20:54:24 +02:00
Johan Degraeve f27b691c1d
Merge pull request #359 from eduardopietre/develop
DataExporter improvements and progress bar.
2022-06-04 21:12:59 +02:00
eduardopietre 21788ac058 Improved DataExportation speed and added a loading bar.
- Date.fromISOString and Date.ISOStringFromDate now have an overload that accepts an optional reusableDateFormatter.

- ISODateFormatter unified between Date.fromISOString and Date.ISOStringFromDate and extracted to another func, Date.ISODateFormatter.

- BgReading dictionaryRepresentationForNightScoutUpload was a variable while the thing with same name at TreatmentEntry was a func. Now both are functions and accept an optional reuseDateFormatter as argument.

- Deleted dictionaryRepresentationForNightScoutUpload.swift.

- Implemented a progress bar named ProgressBarViewController and a struct used for updating it: ProgressBarStatus.

- SettingsSelectedRowAction callFunctionAndShareFile now updates the progress bar with each callback.

- DataExporter now reuses the same DateFormatter, speeding up the calls to dictionaryRepresentationForNightScoutUpload.

- DataExporter now receives the callback as argument at instantiation.

- DataExporter calls the callback to report progress during readingsAsDicts().
2022-06-01 20:54:20 -03:00
Johan Degraeve 0f71c6addd add strings to be translated, for all languages 2022-05-31 23:49:54 +02:00
Johan Degraeve 5d76d3c6a8 Add Ukranian language, needs translation 2022-05-31 23:42:51 +02:00
Johan Degraeve cb9e0b24dd LoopManager : allow Loop to fill up gaps of max 30 minutes
reduce timeStampLatestLoopSharedBgReading with 30 minutes. Because maybe Loop wasn't running for a while and so missed one or more readings. By adding 30 minutes of readings, we fill up a gap of maximum 30 minutes in Loop
2022-05-31 23:01:36 +02:00
Johan Degraeve ff780b482b
Merge pull request #358 from paulplant/data-export-changes
data export filename changes + text stings + settings menu + ES trans…
2022-05-31 22:33:17 +02:00
Paul Plant b67c212d8a data export filename changes + text stings + settings menu + ES translation 2022-05-31 15:51:37 +02:00
Johan Degraeve 45c189a87c
Merge pull request #353 from paulplant/additional_treatments
implement BG Check treatments + layout improvements
2022-05-30 22:22:36 +02:00
Johan Degraeve e2dd0f7f3f LoopManager : timeStampLatestLoopSharedBgReading is now assigned correct value in case Loopdelay is used
- also small improvement in case loopdelay = 0, add 5 seconds to timeStampLatestLoopSharedBgReading to avoid storing values that were already stored previously
2022-05-30 22:15:49 +02:00
Johan Degraeve 71f5831cc6 fix #357 - 12 hour snooze 2022-05-30 21:16:06 +02:00
Paul Plant 546408f854 housekeeping - remove redundant code
these public constants are not needed any more as BG Check values are now always stored in NS as mg/dl to prevent upload/download sync issues
2022-05-30 11:43:52 +02:00
Paul Plant dc43dacaee moved UIKit-dependant functions out of TreatmentEntry+CoreDataClass and into TreatmentTableViewCell 2022-05-30 11:41:40 +02:00
Paul Plant 1ef321fce4 treatment text corrections + auto text size 2022-05-30 10:01:40 +02:00
Paul Plant 39d2889604 treatment table + entry auto-layout corrections 2022-05-29 14:19:29 +02:00
Johan Degraeve aa2c1e7edf Loop delay : small fix
"from" field is used in freeaps. This is fix is only applicable to dev setting called "loopdelay"
2022-05-28 23:13:05 +02:00
Paul Plant f0d65ae0db update to mmol NS handling of BG Checks (clarification) 2022-05-23 18:23:53 +02:00
Paul Plant 57db5cd0fd correction to BG Check mmol unit handling during NS sync 2022-05-23 16:38:32 +02:00
Paul Plant 18bfd57f91 observer added to refresh treatments table when the micro-bolus threshold is changed 2022-05-23 11:02:01 +02:00
Paul Plant efe40c5872 Micro-bolus text EN string correction 2022-05-20 20:45:05 +02:00
Paul Plant 917a4432be improve handling of micro-bolus treatments
- micro-boluses can be hidden from the main chart
- micro-boluses can be excluded/hidden from the main treatment screen/list
2022-05-20 19:51:19 +02:00
Paul Plant 3d969db6fa improvements to treatments table layout 2022-05-20 19:13:42 +02:00
Paul Plant dd55733c0d BG Check treatments - initial translations 2022-05-20 14:52:38 +02:00
Paul Plant 87d2ae296f implement BG Check treatments
- BG Checks (finger prick) can be entered as a treatment
- will be converted and stored in coredata as mg/dl (to avoid having to add units to the treatment coredata model)
- will be converted and shown locally in the correct unit
- will be synced with Nightscout in the original unit
- Nightscout uploads will add the "GlucoseType"="Finger" and "units" attributes to align with BG checks entered via Care Portal.
- BG checks displayed on the main chart as a red circle with gray border as per Nightscout style
- observer added to refresh treatment table (values/units) if the bg unit is changed by the user
2022-05-20 13:22:33 +02:00
Johan Degraeve 22cfd4f850 DataExport : run on background thread
this change runs the generation of export file on a background thread, which ensures that readings are still received while exporting
2022-05-19 23:54:26 +02:00
Johan Degraeve 5fdf6b5117 LoopManager : add 5 seconds to timestamp last reading + tracing
- add 5 seconds to last Readings timestamp, because due to the way timestamp for libre readings is calculated, it may happen that the same reading shifts 1 or 2 seconds in next reading cycle
- add tracing, can be deleted later on
2022-05-19 23:54:20 +02:00
eduardopietre 75ec8e89da CallFunctionAndShareFile now displays a loading icon (ActivityIndicatorViewController). 2022-05-13 14:39:39 -03:00
eduardopietre c9d63fd399 DataExporter now correctly uses privateManagedObjectContext. 2022-05-13 14:39:07 -03:00
eduardopietre a634d08e5a Data exportation now sorts the JSON keys. 2022-05-11 15:47:14 -03:00
eduardopietre 9817210d66 Merge remote-tracking branch 'origin/develop' into develop 2022-05-11 15:26:56 -03:00
Johan Degraeve 08f827d1e3 Artificial delay in readings when sending to Loop
Libre transmitteris tend to show erratic values. Smoothing improves those values a lot but only for historic values, not for the most recent values.
To avoid that Loop takes actions based on those wrong values, this new option allows to introduce a delay. Most recent values will not be shown. Older values will shift in timestamp. To Loop it will look as if this is the most recent value. Advantage is that values used by Loop will be more reliable, but running a number of minutes behind the real values.

New setting in development section. Only to be used for developers.
2022-05-10 23:08:54 +02:00
eduardopietre 31c9d942ff Added traces to DataExporter. 2022-05-08 19:31:51 -03:00
eduardopietre f3ce6d7c57 Merge remote-tracking branch 'origin/develop' into develop 2022-05-08 19:24:03 -03:00
eduardopietre 1ff963799c Added comments to SettingsViewHousekeeperSettingsViewModel. 2022-05-08 19:22:32 -03:00
eduardopietre 3184affe76 Initial implementation of export data as JSON. 2022-05-08 19:16:42 -03:00
eduardopietre 7c1a4efa84 Created callFunctionAndShareFile at SettingsSelectedRowAction.
Created and implemented a new SettingsSelectedRowAction: callFunctionAndShareFile.
2022-05-08 12:48:11 -03:00
Paul Plant 5530948fa5
Merge branch 'JohanDegraeve:develop' into develop 2022-05-08 13:14:46 +02:00
Paul Plant a7d374df50 housekeeping - G5 transmitter check correction 2022-05-08 13:12:55 +02:00
eduardopietre 22bba1c37e Implemented data exporting. 2022-05-07 21:15:40 -03:00
eduardopietre 0defd2d6ce Housekeeping retention period can now be set in settings. 2022-05-07 20:20:39 -03:00
Johan Degraeve 64178a9a8a version 4.10.2 - build 4178 2022-05-06 13:41:09 +02:00
Paul Plant 342e9d63b1
Merge branch 'JohanDegraeve:develop' into develop 2022-05-06 10:41:09 +02:00
Paul Plant 110c0b69ae fix timezone error when working in 12hr clock mode (am/pm) 2022-05-06 10:40:48 +02:00
Johan Degraeve 9cbbe35221 Fix for deletion of treatments at NS
Bug was introduced by a previous commit
2022-05-04 16:53:33 +02:00
Johan Degraeve 287dcb97a1 Follower should be able to download treatments, even if token or api-secret is not set
- this was changed previous commit while fixing a crash issue, but change was not necessary
2022-05-03 22:55:59 +02:00
Johan Degraeve 64687d96ab version 4.10.1 - build 4177 2022-05-02 23:46:02 +02:00
Johan Degraeve 37111da537 Merge branch 'develop' of https://github.com/JohanDegraeve/xdripswift into develop 2022-05-02 23:36:45 +02:00
Johan Degraeve 3109a2f555 Fix crash in treatment when NS is not enabled, or treatment is not yet uploaded
- in function syncTreatmentsWithNightScout, first check that nightscout is enabled and nightscout url != nil
- before splitting id by '-', check first that id is not an empty string
2022-05-02 23:36:38 +02:00
Samuli Tamminen 84e529587c Add a Quick Action for toggling Speak Readings
Speak Readings setting can now be quickly accessed from home screen by long-pressing the app icon.
2022-05-01 13:59:27 +03:00
Johan Degraeve f487db5712 version 4.10.0 build 4176 2022-04-30 21:49:07 +02:00
Paul Plant 131fdc10f6 Treatment table UI update 2022-04-30 17:20:30 +02:00
Paul Plant e946889aaa Ignore invalid inputs to the treatments textfields to ensure that the original treatment isn't just deleted 2022-04-30 17:00:56 +02:00
Johan Degraeve e7f0b9e91a
Merge pull request #344 from paulplant/develop
prevent insulin unit fractions from being deleted in some locales
2022-04-30 13:28:56 +02:00
Paul Plant bba7d7aae5 prevent insulin unit fractions from being deleted in some locales 2022-04-30 11:55:49 +02:00
Johan Degraeve 7c5f20af5d treatments : delete treatments older than 90 days
deletion is done at app start up.
If user would go to treatments screen very fastly, after starting the app, then it may crash (only once). But that's probably not going to happen frequently
2022-04-30 11:36:33 +02:00
Paul Plant 233d0ff710 remove unwrapping of created_at as not needed 2022-04-29 23:57:56 +02:00
Paul Plant 9b4ffd8431 Adjust bolus triangle height scale to make them less "pointy"
Yes... I really did just write the work "pointy" in a commit message. :)
2022-04-29 21:26:49 +02:00
Paul Plant c6d4ac5c14 treatment label background and spacing to improve visibility 2022-04-29 21:14:59 +02:00
Paul Plant d62ef7ef52 Compatibility for AndroidAPS-populated Nightscout sites
AndroidAPS uploads "created_at" key pairs without milliseconds. We need to check if this is the case in order to convert correctly the date string.
2022-04-29 21:03:32 +02:00
Johan Degraeve f9e5d7a7e8 treatments : download 24 hours of treatments 2022-04-28 23:43:09 +02:00
Paul Plant dd25cd78e2 Nightscout follower now syncs every 15s and sync button removed from treatments screen 2022-04-28 20:09:23 +02:00
Johan Degraeve 9b9fcef5ba initiate treatments sync, every 15 seconds, if app is in foreground 2022-04-27 23:23:46 +02:00
Johan Degraeve ec58fd4787 treatment values with decimal : replace , by .
to support keyboards with , in stead of . as decimal
2022-04-26 21:40:21 +02:00
Johan Degraeve 4c4a39904c Merge branch 'libreproh' into develop 2022-04-26 20:46:26 +02:00
Johan Degraeve eb1e2d5056 trigger treatments sync each time there's a new reading
by setting UserDefaults.standard.nightScoutSyncTreatmentsRequired = true, a treatments sync is triggered
This is now done when initiating readings upload
In case of Libre 2, this is every minute, even though there's an upload only once every minute
Upload of new readings and sync of treatments is done simultaneously
2022-04-25 23:18:23 +02:00
Johan Degraeve 8f56397159 Merge branch 'develop' of https://github.com/JohanDegraeve/xdripswift into develop 2022-04-25 21:47:46 +02:00
Johan Degraeve 648dcfa28e trigger treatments sync every 5 minutes in follower mode
by setting UserDefaults.standard.nightScoutSyncTreatmentsRequired = true a treatments sync is triggered
This is now done when initiating download of readings.
Download of new readings and sync of treatments is done simultaneously
2022-04-25 21:47:40 +02:00
Johan Degraeve e917ac4bb4
Merge pull request #341 from paulplant/treatments_add_new_improvements
add treatments screen improvements
2022-04-25 21:00:57 +02:00
Paul Plant c3aba81cb2 add treatments screen improvements
- use .decimalPad keyboard for insulin entries
- change "New Entry" to "New Treatment" as the idea of a Treatment "Entry" is not intuitive to most users
- minor IB layout changes to enable future new treatment types to fit easily
2022-04-25 18:45:56 +02:00
Johan Degraeve 2cfdd9a40f libreproh support 2022-04-24 23:37:22 +02:00
Johan Degraeve 43cb5fa019
Merge pull request #340 from diabetlum/develop
Develop
2022-04-23 23:53:18 +02:00
Johan Degraeve 4f22c118dd added missing strings to translate (done with script findMissingStrings) 2022-04-12 21:28:55 +02:00
Johan Degraeve 622fcb30f1 Danish : folders added. Still need translation 2022-04-12 20:18:25 +02:00
Johan Degraeve 1c1c36e54f Merge branch 'loopheartbeat' into develop 2022-04-12 15:17:44 +02:00
Johan Degraeve d85d5235c3 treatments: udpate chart in home screen if there's an update done in NightScout sync 2022-04-11 20:50:50 +02:00
Johan Degraeve 2715ba5415 Merge branch 'fixSmooting' into develop 2022-04-11 20:14:52 +02:00
Diabetlum 36f9685ebd
Update Main.strings 2022-04-10 19:29:32 +02:00
Diabetlum 2cb18d16d4
some abbreviations 2022-04-10 19:28:45 +02:00
Diabetlum 9ad520b2d1
M5StickC 2022-04-10 19:25:57 +02:00
Johan Degraeve 396b6f1e50 Bugfix for Libre 2 smoothing
Bug that was there since long time, but (for unknown reason) created an issue only with the treatments enabled. Probably because of a small time difference (1 second) between timestamp of latest reading and actual timestamp
2022-04-10 18:01:21 +02:00
Paul Plant bb38fe2dec Update SettingsViewTreatmentsSettingsViewModel.swift
- correction to use the decimal keyboard when adjusting the micro-bolus threshold in the treatments section of the settings menu
2022-04-06 09:59:59 +02:00
Paul Plant ebd449a21d Update GlucoseChartManager.swift
- treatmentEntry.date window opened by ±50ms to avoid not returning treatments by date due to the ChartPoint class introducing small rounding errors.
2022-04-06 09:53:09 +02:00
Paul Plant 5e620cb2da clean-up of old commented-out code 2022-04-05 09:50:01 +02:00
Paul Plant 5f2f5fc7d9 improvement to micro-bolus triangles
- extra class added to add a drop-down line only to standard size bolus
- glucoseChartManager updated accordingly
2022-04-04 13:07:16 +02:00
Paul Plant e771deb333 small corrections + extra commenting added
- missing variable/constant declaration comments added
- corrections to some comments
- improvements to array handling to prevent needing to unwrap
- ChartPointsScatterDownTrianglesLayer.swift moved
2022-04-04 12:43:27 +02:00
Paul Plant 080490cf65 update treatments navigation icon
- replace placeholder icon (pencil) with a custom icon from icons8.com
2022-04-01 20:44:55 +02:00
Paul Plant 46a80325c5 initial commit for treatments implementation into main chart
- stored/synced treatments will be displayed on the main chart
- carbs will be shown as a floating circle aligned with closest glucose point values
- bolus will be shown as a triangle. Micro-bolus threshold can be configured in settings (default: 1.0U). Micro-bolus will then be shown as small triangle with no labels
- option in settings to show/hide treatments on the chart (default is to show)
- changes to TreatmentType structure
- functions added to treatmentEntryAccessor
- new userdefault keys added to store new user settings
- a new chartpoint class extension has been added. This is modified from Loopkit
- correction to the NSResponse to correctly filter exercise treatments
- initial translations implemented
2022-04-01 20:38:30 +02:00
Johan Degraeve f3dd64a67c Heartbeat for Loop with xdrip-client-swift
This release stores cgm transmitter address and characteristics in Shared userdefaults

xdrip-client-swift (also branch loopheartbeat) is also adapted. It reads the new shared user defaults and if necessary setsup a bluetoothTransmitter, scans and connects and subscribes to the receive characteristic
2022-03-24 22:23:25 +01:00
Johan Degraeve 201b362cd0 fixed previous commits that were removed due to errors while rebasing treatments branch to develop branch
help button and fixed related to NS auth were overwritten
2022-03-03 21:20:49 +01:00
Johan Degraeve ba45d6cae6 Treatments sync : supports updating and deleting treatmentEntries that were downloaded from NS in a combined event 2022-03-02 00:12:30 +01:00
Johan Degraeve 5f277e1f59 Treatments sync : when updating treatment that was downloaded from NS, then upload also other treatments that were in the same original NS event 2022-03-02 00:12:28 +01:00
Johan Degraeve 5c54bfc479 improvements treatments (not finished)
- TreatmentNSResponse : changed type of createdAt from String to Date
- TreatmentEntryAccessor : functions that use howOld as parameter, changed type from Int to TimeInterval
- created constant for maximum days to upload for treatments, default 7 days
- increased maximum amount of treatments to show in TreatmentsViewController to 100 days
- removed TODO : check that hTTPURLResponse.statusCode is 200
- removed checkIfDisReConnectAfterTimeStampFunction in comments of initializer NightScoutUploadManager (seems not used anymore)
- in DexcomShareUploadManager and NightScoutUploadManager : renamed upload to uploadLatestBgReadings to make clear distinction with other upload functions
- deleted xdrip/Texts/TextsNFCLibre.swift because it's not used (not related to treatments)
- renamed xdrip/Texts/TextsNightScoutTestResult.swift to xdrip/Texts/TextsNightScout.swift
- fix in getLatestTreatments, howOld
- removed getRequireUploadTreatments from TreatmentEntryAccessor, filter on treatments to upload is done in NightScoutUploader
- using a new value in UserDefaults to trigger a NightScout sync. Setting the value to true from anywhere will launch a new sync.
- quite some changes in NightScoutUploadManager
- TreatmentsViewController does not control the sync, it will just trigger it whenever necessary by setting UserDefaults.standard.nightScoutSyncTreatmentsRequired to true
- NightScoutSync is triggered from several places : create a new Treatment, update a Treatment, delete a Treatment, click the sync button
- Removed UIAlertController with result from NightScoutSync. It should always succeed. It's like uploading BgReading's.
- removed file TextsNightScoutTestResult.swift, seems not used
- in TreatmentNSResponse: matchesTreatmentEntry changed : check on date didn't work, not it compares date in milliseconds, that works.
- removed/changed some var's , coreDataManager for example which is now Implicitly Unwrapped Optionals, in stead of optional. This is something which could be improved throughout the project
- after download form NS : check if existing treatments are updated, and if so update locally
- delete treatments at NS : treatments deleted on the app are not permenanetly deleted from coredata, but there's a new attribute "treatmentDeleted" which is set to true. Which means will not be shown in table. It's needed to keep track of deletions at NS
2022-03-02 00:12:01 +01:00
eduardopietre f233893fb9 Changed TODO at TreatmentsViewController. 2022-03-02 00:09:55 +01:00
eduardopietre 1b67e3455d Fixes typo in work "success". 2022-03-02 00:09:51 +01:00
eduardopietre 685fba194d Changed treatments_upload_complete strings to treatments_sync_complete. 2022-03-02 00:09:21 +01:00
eduardopietre 7f859f985b Fixes race condition among get and post request. Not a bug by itself. 2022-03-02 00:09:18 +01:00
eduardopietre 38d9ce8b6a Fixes critical issue of treatments being fetched multiple times. 2022-03-02 00:08:54 +01:00
eduardopietre 67f1d9a272 Added fetch to syncButtonTapped. 2022-03-02 00:08:54 +01:00
eduardopietre 2d97a3e675 Renamed uploadButtonTapped to syncButtonTapped. 2022-03-02 00:08:54 +01:00
eduardopietre 59ed3b0caf Created TreatmentEntryAccessor newTreatmentsIfRequired and TreatmentNSResponse asNewTreatmentEntry. 2022-03-02 00:08:54 +01:00
eduardopietre 57d51c9fce Created date fromISOString. 2022-03-02 00:08:54 +01:00
eduardopietre 385374b605 Increased getLatestTreatments from 50 to 100. 2022-03-02 00:08:19 +01:00
eduardopietre 8f49e7b6f1 Created existsTreatmentWithId. 2022-03-02 00:08:19 +01:00
eduardopietre a901691f0c Created getTreatmentById. 2022-03-02 00:08:19 +01:00
eduardopietre 1c29ab69bf Fixes typos at TreatmentEntryAccessor logging. 2022-03-02 00:08:19 +01:00
eduardopietre 6f391432c2 Removed redundant and not used code at TreatmentEntryAccessor. 2022-03-02 00:08:19 +01:00
eduardopietre d1c8fbbee6 CVarArg changed to NSDate at getTreatments predicate. Was probably a typo. 2022-03-02 00:08:19 +01:00
eduardopietre 569552a61b Uploading treatments to nightscout sets the ids to coredata. 2022-03-02 00:08:16 +01:00
eduardopietre 861a27c9eb Fixes Treatment update displaying trailing zeroes. 2022-03-02 00:07:52 +01:00
Johan Degraeve bf3763eabc Introduced possibility to update treatments
- there's no sync yet with NS, that's for later
2022-03-02 00:07:52 +01:00
Johan Degraeve 6a4ec16445 call coreDataManager.saveChanges after deleting an treatment 2022-03-02 00:07:52 +01:00
eduardopietre b1b4d4942b Treatments buttons are now at the top of the screen. 2022-03-02 00:07:22 +01:00
Johan Degraeve 25609e5479 small code improvement
removed treatmentEntryAccessor as parameter in TreatmentsNavigationController - configure
2022-03-02 00:06:50 +01:00
Johan Degraeve f969563e75 minor changes
- when conforming to methods, then it's not needed to comment the methods. They are already commented in the protocol declaration
- same applies to overriden functions
- use /// in stead of // when commenting declarations. By using alt-tap one a function or variable, one can see the comments
2022-03-02 00:06:50 +01:00
Johan Degraeve 11a9e769ce minor changes 2022-03-02 00:06:50 +01:00
eduardopietre 34faa29944 Fix being able to insert 0 carbs / insulin / exercise as a valid treatment. 2022-03-02 00:06:50 +01:00
Johan Degraeve c19ac9cc8f minor changes in comments 2022-03-02 00:06:47 +01:00
Paul Plant 863ef481ac Update Info.plist 2022-03-02 00:05:55 +01:00
Johan Degraeve ebc206ed4b removed NSAllowsArbitraryLoads from info.plist 2022-03-02 00:05:55 +01:00
Johan Degraeve 34aac62347 minor changes 2022-03-02 00:05:55 +01:00
eduardopietre 0f2eba07aa Created TreatmentCollection, data struct that abstracts treatment grouping by date. Treatments table view now uses sections. 2022-03-02 00:05:51 +01:00
eduardopietre 58657b7a94 Added missing localization for Treatments unit and label. 2022-03-02 00:05:28 +01:00
eduardopietre 81565c8e4e Commented TreatmentEntry+CoreDataProperties.swift. 2022-03-02 00:05:28 +01:00
eduardopietre a11896cca2 Commented TreatmentEntry+CoreDataClass.swift. 2022-03-02 00:05:28 +01:00
eduardopietre 973cb1ac7a Added important comment to TreatmentType. 2022-03-02 00:05:28 +01:00
eduardopietre 48f63752a2 Improved UI. Now upload requires pressing upload. 2022-03-02 00:05:28 +01:00
eduardopietre 956c23b29d Implemented treatment, with persistence and uploading to nightscout. 2022-03-02 00:05:21 +01:00
Diabetlum bdb01e6df5
Update M5StackView.strings 2022-02-21 07:40:49 +01:00
Diabetlum 81d26bf4f7
Update HomeView.strings 2022-02-21 07:38:01 +01:00
Diabetlum dbd786076d
Update SpeakReading.strings 2022-02-21 07:33:36 +01:00
Diabetlum a728b847a5
Update SpeakReading.strings 2022-02-21 07:31:44 +01:00
Diabetlum dfeaed799d
small changes 2022-02-20 15:51:12 +01:00
Diabetlum a15895db93
Update SpeakReading.strings 2022-02-17 21:16:03 +01:00