Skip to content

Working with Timebase and Cursor#

The timebase is the currently visible timestamp range that determines the extent of parameter values displayed by various standard displays such as Waveform, Scatterplot, Histogram etc.

The cursor is the currently selected timestamp and determines the parameter values displayed by various standard displays such as Numeric, Bit, Circuit etc.

Most standard displays are based on either timebase or cursor.

A notable exception is the Summary display that is based on laps.

The Waveform display uses both timebase and cursor and responds as they change. Interacting with the Waveform display changes the value of timebase and/or cursor.

Hint

To maintain consistency, custom displays should match the behaviour of standard displays (unless doing something different like Summary Display).

Timebase and Cursor timestamps#

To access the primary session timebase range and/or cursor

  • Get the F1 timeline extent for the primary session from ActiveCompositeSessionContainer.CompositeSessions.First(cs => cs.IsPrimary).TimebaseRange
  • Get the cursor timestamp for the primary session from ActiveCompositeSessionContainer.First(cs => cs.IsPrimary).CursorPoint

Tip

Ensure you check ActiveCompositeSessionContainer.IsPrimaryCompositeSessionAvailable is true before looking for the primary session.

Attention

Do not confuse TimeRange (extent of session) and TimebaseRange (extent of F1 timeline selection) properties.

Note

A timestamp is the number of nanoseconds since midnight.

A timestamp can be converted to a TimeSpan via

var timespan = TimeSpan.FromTicks(timestamp / 100);

The following DisplayPluginViewModel overrides are called whenever the timebase or cursor changes for a composite session

  • OnCursorDataPointChanged(ICompositeSession)
    • New timestamp value is obtained from ICompositeSession.CursorPoint
  • OnSessionTimeRangeChanged(ICompositeSession)
    • New timestamp range is obtained from ICompositeSession.TimebaseRange

Cursor Service#

Programmatic setting of the the cursor for the active session

  • ISessionCursorService
    • Use MoveCursor() to change the timestamp of the cursor