Overview
The Log Viewer is currently desktop-only. Supporting it on mobile (iOS/Android) requires reducing the memory footprint of loaded log data, since mobile devices have strict memory limits and large .ulg/.bin files can easily consume hundreds of MB of samples.
Problem
LogFileParser currently stores every parsed sample in memory (QHash<QString, QVector<QPointF>> _fieldSamples). A typical 10-minute PX4 flight at 250 Hz across dozens of topics can produce millions of points — unacceptable on mobile.
The rendering layer already handles downsampling at display time via fieldSamplesFiltered(), but the full dataset is still held in RAM.
Proposed Solution
At parse time, apply configurable stride-based or LTTB (Largest-Triangle-Three-Buckets) downsampling when the device is identified as mobile, capping stored samples per field to a platform-tuned maximum (e.g. 10 000 points on mobile vs. unlimited on desktop).
Key considerations:
- The cap should be applied per-field during
_applyResult(), before storing into _fieldSamples.
AppSettings (or a new LogViewerSettings key) could expose a maxSamplesPerField preference, defaulting to 0 (unlimited) on desktop.
fieldSamplesFiltered() remains unchanged — it already handles zoom/pixel decimation on top of whatever is stored.
- GPS path data (
_gpsPathULogVehicleGlobalPosition etc.) should be sampled separately to preserve spatial resolution.
- Unit tests should verify that parse results with a sample cap produce the correct number of stored points and that
fieldMinMax() still returns accurate extremes.
Acceptance Criteria
Overview
The Log Viewer is currently desktop-only. Supporting it on mobile (iOS/Android) requires reducing the memory footprint of loaded log data, since mobile devices have strict memory limits and large
.ulg/.binfiles can easily consume hundreds of MB of samples.Problem
LogFileParsercurrently stores every parsed sample in memory (QHash<QString, QVector<QPointF>> _fieldSamples). A typical 10-minute PX4 flight at 250 Hz across dozens of topics can produce millions of points — unacceptable on mobile.The rendering layer already handles downsampling at display time via
fieldSamplesFiltered(), but the full dataset is still held in RAM.Proposed Solution
At parse time, apply configurable stride-based or LTTB (Largest-Triangle-Three-Buckets) downsampling when the device is identified as mobile, capping stored samples per field to a platform-tuned maximum (e.g. 10 000 points on mobile vs. unlimited on desktop).
Key considerations:
_applyResult(), before storing into_fieldSamples.AppSettings(or a newLogViewerSettingskey) could expose amaxSamplesPerFieldpreference, defaulting to0(unlimited) on desktop.fieldSamplesFiltered()remains unchanged — it already handles zoom/pixel decimation on top of whatever is stored._gpsPathULogVehicleGlobalPositionetc.) should be sampled separately to preserve spatial resolution.fieldMinMax()still returns accurate extremes.Acceptance Criteria
maxSamplesPerFieldsetting (or equivalent) controls the cap, defaulting to unlimited on desktop.