|
QtIndustrialWidgets 2.3.0
Modern, High-Performance Industrial Instruments & SCADA Widgets for Qt
|
Offline review of recorded multi-channel data (#25). More...
#include <AnalysisChart.h>
Offline review of recorded multi-channel data (#25).
Each channel holds its own copy of timestamp + value arrays: absolute std::chrono::nanoseconds timestamps, non-decreasing, with values as double. Channels may have different or irregular sample rates. All channels share one Y axis.
Dropouts and gaps follow exactly the rules of StripChart, so the same data never looks different in the two charts: a non-finite value breaks the trace, and so does a time gap between two samples larger than gapThreshold() (0, the default, means 4 times an exponential moving average of the sampling interval, computed in sample order as StripChart does).
Decimation: with more samples in the view than device columns of the plot, a channel is drawn M4-decimated with one bucket per device column, as in StripChart (DecimationMode::Auto, the default): each column shows the first, minimum, maximum and last finite sample of its bucket, and the column of a bucket that holds a non-finite sample stays blank. The buckets come from a min/max pyramid built by setChannelData(), so a redraw does not scan every sample.
Time axis labels: Relative shows the time elapsed since dataStart(); Absolute shows timeOrigin() + t as wall-clock time (HH:mm:ss.zzz), or t itself when timeOrigin() is invalid.
Interaction: the wheel zooms X around the mouse (x1.25 per step), Ctrl+wheel zooms Y around the mouse, a left drag pans, a right drag (or Shift+left drag) zooms to a box, a double-click or Home resets the view, + and - zoom X around the centre, the left and right arrows pan X and the up and down arrows pan Y by 10 % of the view. A left drag that starts within 4 logical pixels of a visible cursor moves that cursor instead of panning.
Cursors: two vertical cursors, A and B, hidden until shown. When the first data is loaded they are placed at 1/3 and 2/3 of the view. The readout band below the plot shows, for each visible cursor, its time, then for each visible channel the nearest sample in time (no interpolation), Δt and Δy; "---" when the cursor lies outside the channel's data or the nearest sample is non-finite. The band shows at most 6 channel rows; further channels are summarised in a last row (their readouts stay available through cursorReadout()). The band is part of minimumSizeHint(), so from that size up no text of the band is clipped.
Fonts: the texts use the widget font at sizes derived from the widget geometry and scaled by the ratio between the effective pixel sizes of the widget font and of the application font, as in StripChart; the room kept for the axis labels and the legend grows with it.