ngscopeclient 0.1-dev+51fbda87c
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
WaveformGroup Class Reference

A WaveformGroup is a container for one or more WaveformArea's. More...

#include <WaveformGroup.h>

Collaboration diagram for WaveformGroup:
Collaboration graph
[legend]

Public Types

enum  CursorMode_t { X_CURSOR_NONE , X_CURSOR_SINGLE , X_CURSOR_DUAL }
 Type of X axis cursor we're displaying.
 

Public Member Functions

 WaveformGroup (MainWindow *parent, const std::string &title)
 
void Clear ()
 
bool Render ()
 
void ToneMapAllWaveforms (vk::raii::CommandBuffer &cmdbuf)
 Run the tone-mapping shader on all of our waveforms. More...
 
void ReferenceWaveformTextures ()
 
void RenderWaveformTextures (vk::raii::CommandBuffer &cmdbuf, std::vector< std::shared_ptr< DisplayedChannel > > &channels, bool clearPersistence)
 
const std::string GetID ()
 
const std::string GetRawID ()
 
const std::string & GetTitle ()
 
void AddArea (std::shared_ptr< WaveformArea > &area)
 
void OnZoomInHorizontal (int64_t target, float step)
 Zoom in, keeping timestamp "target" at the same pixel position.
 
void OnZoomOutHorizontal (int64_t target, float step)
 
void OnPanHorizontal (float step)
 
void NavigateToTimestamp (int64_t timestamp, int64_t duration=0, StreamDescriptor target=StreamDescriptor(nullptr, 0))
 Scrolls the group so the specified timestamp is visible. More...
 
void ClearPersistenceOfChannel (OscilloscopeChannel *chan)
 Clear saved persistence waveforms of any WaveformArea's within this group containing a stream of one channel. More...
 
Unit GetXAxisUnit ()
 Gets the X axis unit for this group.
 
int64_t XPositionToXAxisUnits (float pix)
 Converts a position in pixels (relative to left side of plot) to X axis units (relative to time zero)
 
int64_t PixelsToXAxisUnits (float pix)
 Converts a distance measurement in pixels to X axis units.
 
float XAxisUnitsToPixels (int64_t t)
 Converts a distance measurement in X axis units to pixels.
 
float XAxisUnitsToXPosition (int64_t t)
 Converts a position in X axis units to pixels (in window coordinates)
 
float GetPixelsPerXUnit ()
 
int64_t GetXAxisOffset ()
 
void ClearPersistence ()
 Clear saved persistence waveforms.
 
float GetYAxisWidth ()
 
float GetSpacing ()
 
std::vector< std::shared_ptr< WaveformArea > > GetWaveformAreas ()
 Gets an atomic snapshot of the waveform areas in this group.
 
bool LoadConfiguration (const YAML::Node &node)
 
YAML::Node SerializeConfiguration (IDTable &table)
 
bool IsDraggingTrigger ()
 

Public Attributes

enum WaveformGroup::CursorMode_t m_xAxisCursorMode
 
int64_t m_xAxisCursorPositions [2]
 Position (in X axis units) of each cursor.
 

Protected Types

enum  DragState {
  DRAG_STATE_NONE , DRAG_STATE_TIMELINE , DRAG_STATE_X_CURSOR0 , DRAG_STATE_X_CURSOR1 ,
  DRAG_STATE_MARKER , DRAG_STATE_TRIGGER
}
 

Protected Member Functions

void RenderTimeline (float width, float height)
 
void RenderTriggerPositionArrows (ImVec2 pos, float height)
 Draws an arrow for each scope's trigger position.
 
void RenderXAxisCursors (ImVec2 pos, ImVec2 size)
 Render our cursors.
 
void RenderMarkers (ImVec2 pos, ImVec2 size)
 Render our markers (and the hovered-packet indicator if any)
 
void DoCursorReadouts ()
 Run the popup window with cursor values.
 
void TitleHoverHelp ()
 
float GetInBandPower (WaveformBase *wfm, Unit yunit, int64_t t1, int64_t t2)
 Calculates the in-band power between two frequencies.
 
bool IsMouseOverButtonInWaveformArea ()
 Returns true if the mouse is over a channel button or similar UI element in a WaveformArea.
 
void DoCursor (int iCursor, DragState state)
 
int64_t GetRoundingDivisor (int64_t width_xunits)
 Decide on reasonable rounding intervals for X axis scale ticks.
 
void OnMouseWheel (float delta)
 Handles a mouse wheel scroll step.
 

Protected Attributes

MainWindowm_parent
 Top level window we're attached to.
 
float m_xpos
 X position of our child windows.
 
float m_width
 Width of the window (used for autoscaling)
 
float m_pixelsPerXUnit
 Display scale factor.
 
int64_t m_xAxisOffset
 X axis position of the left edge of our view.
 
std::string m_title
 Display title of the group.
 
std::string m_id
 Internal ImGui ID of the group.
 
Unit m_xAxisUnit
 X axis unit.
 
std::vector< std::shared_ptr< WaveformArea > > m_areas
 The set of waveform areas within this group.
 
std::mutex m_areaMutex
 
DragState m_dragState
 Description of item being dragged, if any.
 
Markerm_dragMarker
 Marker being dragged, if any.
 
double m_tLastMouseMove
 Time of last mouse movement.
 
std::vector< size_t > m_areasToClose
 List of waveform areas to close next frame.
 
float m_timelineHeight
 Height of the timeline.
 
std::atomic< bool > m_clearPersistence
 True if clearing persistence.
 
bool m_mouseOverTriggerArrow
 True if mouse is over a trigger arrow.
 
bool m_mouseOverMarker
 True if mouse is over a marker.
 
std::shared_ptr< Oscilloscopem_scopeTriggerDuringDrag
 The scope whose trigger being dragged when in DRAG_STATE_TRIGGER.
 
bool m_displayingEye
 True if we're displaying an eye pattern (fixed x axis scale)
 

Detailed Description

A WaveformGroup is a container for one or more WaveformArea's.

Member Function Documentation

◆ ClearPersistenceOfChannel()

void WaveformGroup::ClearPersistenceOfChannel ( OscilloscopeChannel chan)

Clear saved persistence waveforms of any WaveformArea's within this group containing a stream of one channel.

Typically called when a channel is reconfigured.

◆ NavigateToTimestamp()

void WaveformGroup::NavigateToTimestamp ( int64_t  timestamp,
int64_t  duration = 0,
StreamDescriptor  target = StreamDescriptor(nullptr, 0) 
)

Scrolls the group so the specified timestamp is visible.

If the duration is nonzero: If the entire requested region is visible, center the packet in the visible area of the plot If the region is too large to see, move the start to the left 10% of the view.

If a target stream is requested, we should only navigate if the provided stream is displayed somewhere within this group.

◆ ToneMapAllWaveforms()

void WaveformGroup::ToneMapAllWaveforms ( vk::raii::CommandBuffer &  cmdbuf)

Run the tone-mapping shader on all of our waveforms.

Called by MainWindow::ToneMapAllWaveforms() at the start of each frame if new data is ready to render


The documentation for this class was generated from the following files: