Hi Björn (slicke).
My own father had diabetes years ago (since passed away) so it's nice to see this sort of app. that measures blood sugar levels (as I had to did it manually every day with the old pin prick method).
I looked at your Github source and noticed that you had a 10 element fixed array for the TrendDots (dotArray: array[1..NUM_DOTS] of ^TDotControl;) and you also mentioned "When the last 2 most recent readings are missing". In my own graphics programs I noticed if I mix fixed arrays with dynamic arrays, there can be a misalignment of index values causing missing values and erratic behavior like missing pixels/etc. Are you able to work out why the 2 most recent readings are missing?
Also noticed you use 10 timers and a buffer ( const
MIN_REFRESH_INTERVAL_MS = 120000; // 2 minutes
REFRESH_RESYNC_BUFFER_MS = 15000;, reading := lastReading;, intervalMs := min(BG_REFRESH, BG_REFRESH - (secondsSinceLast * 1000));
// 5 min or less if there's a recent reading
intervalMs := max(MIN_REFRESH_INTERVAL_MS, intervalMs); // Don't allow too small refresh time (min 2 minutes)
tMain.Interval := intervalMs + REFRESH_RESYNC_BUFFER_MS;) so maybe refresh buffer/timers are mis-aligned or the Timer intervals are off a bit so some readings are not synced and become missing?
I will need to install Mormot2 to see your app in action.
Maybe I am way off, but when you mentioned "last 2 most recent readings are missing" it sort of reminded me of similar faults I was seeing in my own graphics programs when I mixed fixed arrays with dynamic arrays (most times I try to just use dynamic arrays to keep the index values consistent). Fixed arrays (1 based) and Dynamic arrays (0 based).