Apnea Board Forum - CPAP | Sleep Apnea
(OSCAR) Bookmarks not using clock offset properly - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: (OSCAR) Bookmarks not using clock offset properly (/Thread-OSCAR-Bookmarks-not-using-clock-offset-properly)



(OSCAR) Bookmarks not using clock offset properly - Ratchick - 05-10-2021

Hi all

So it appears that when you click on a bookmark in OSCAR, it doesn't take into account the clock offset preferences when displaying the selected area of the chart.

How to recreate:
1) Set your clock offset to an hour (or whatever is easiest for testing)
2) Select an area of the chart (for example at 02:00 to 02:05)
3) Click to create the bookmark. The bookmark time will correctly show the selected time.
4) Zoom into a different area of the chart (or back out to 100%).
5) Click on the bookmark. When you do so, note the start time for the chart area will be different from the time you bookmarked, and so will not show the correct area you wanted to display.

Expected behaviour:

The bookmark time and the area of the chart shown should be the same, both should take into account the clock offset setting in the preferences.

Current behaviour:

I suspect that the code that selects the area of the graph simply doesn't take into account the clock drift/offset in the preferences. If you have created a bookmark for a time at/near the beginning or end of the chart, depending on the direction of the offset) and you click on that bookmark, OSCAR will display an error message saying that the bookmark is in a currently disabled area of the chart.

[attachment=32143]

The image included above shows the selected time immediately after creating the bookmark (correctly showing as approximately 02:00 to 02:05, with the bookmark starting at 01:58 and change) at the top and the chart displayed when you click on that bookmark (incorrectly showing the time an hour beforehand, because it hasn't taken into account the offset). The dialog box was from clicking on the first bookmark in the list, which started at the vest start of the chart, and so OSCAR tried to zoom the chart to a time that doesn't exist in the data.


RE: (OSCAR) Bookmarks not using clock offset properly - pholynyk - 05-10-2021

I think the whole notion of clock drift was not well understood and poorly implemented.

My preference would be to eliminate it.


RE: (OSCAR) Bookmarks not using clock offset properly - Ratchick - 05-10-2021

To be honest, I still have no real idea how it works, and how I managed to get it to only apply to some data but not the rest. Because now when I alter it, it affects ALL the data which is... very frustrating as I found an easier way (tweaking the Viatom data file) than using the drift, but now if I turn it off NONE of my CPAP data lines up with my PulseOx data. Otherwise, I'd turn it off and be done with it, especially as editing the file isn't exactly tough. So if anyone can explain how I can turn the setting off without having it mess up the time sync between all of my CPAP/PulseOX data, that'd be good!


RE: (OSCAR) Bookmarks not using clock offset properly - kappa - 05-10-2021

I find clock drift very useful as I have data sources that are well synchronized to real time (BLE motion sensor and Wellue SleepU) as well as CPAPs which are difficult to synchronize and drift. (Or impossible to change the clock on in the case of my old PR 50 series System One). There is an outstanding request to make the drift code more flexible.

The OSCAR 1.2 bookmark code is broken in that it stores the bookmark with drift removed (if CPAP data is present for that day) in order to cater for the situation where you are using the bookmark after changing drift (although the text label would not match in that case), but does not apply drift when using the bookmark. This is day 0 behavior looking at the original commit back from SleepyHead in Jan 2012.

I think the simplest approach for now is to keep storing the bookmarks in the same way and have the inverse action on using the bookmark. There are still some issues with that approach but that can be dealt with as part of a broader drift rework should it occur.

Edit: Bookmarks work correctly if you move to a different day and then come back and use the bookmark. However, if you then add another bookmark to that day or change the journal then the old bookmarks will move by the drift value. I'll submit a fix shortly.


RE: (OSCAR) Bookmarks not using clock offset properly - Ratchick - 05-11-2021

Thanks for that (and for pointing out the workaround). I greatly appreciate all the hard work that the people working on OSCAR put in to produce such a wonderful and free too.