LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::SignalPlotPanel Class Reference

Signal value plot panel. More...

#include <SignalPlotPanel.hpp>

Inheritance diagram for ui::qt::SignalPlotPanel:
Inheritance graph
Collaboration diagram for ui::qt::SignalPlotPanel:
Collaboration graph

Public Member Functions

 SignalPlotPanel (db::EventsContainer &events, QWidget *parent=nullptr)
 
void Refresh ()
 Called by MainWindow when the Signals tab becomes active.
 
Q_SLOT void SetSelectedSignals (const std::vector< std::string > &keys)
 Update the set of signals to plot and redraw the chart immediately.
 
void OnDataUpdated () override
 Called when the model's data is updated.
 
void OnCurrentIndexUpdated (int) override
 Called when the current item index in the model is updated.
 
virtual void OnAttachedToModel (class IModelObservable *)
 Called when the view is attached to a model.
 
virtual void OnDetachedFromModel ()
 Called when the view is detached from a model.
 

Private Member Functions

void BuildLayout ()
 
void RebuildChart ()
 

Static Private Member Functions

static double ToSeconds (const std::string &raw, double firstSec)
 

Private Attributes

db::EventsContainer & m_events
 
QChartView * m_chartView {nullptr}
 
QLabel * m_statusLabel {nullptr}
 
std::vector< std::string > m_selectedSignals
 
bool m_dirty {false}
 

Detailed Description

Signal value plot panel.

Plots the numeric/signal fields selected in the Signal Browser dock. Call SetSelectedSignals() whenever the selection changes; the chart updates immediately. Refresh() is also called lazily by MainWindow when the tab first becomes visible.

Constructor & Destructor Documentation

◆ SignalPlotPanel()

ui::qt::SignalPlotPanel::SignalPlotPanel ( db::EventsContainer &  events,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ BuildLayout()

void ui::qt::SignalPlotPanel::BuildLayout ( )
private
Here is the caller graph for this function:

◆ OnAttachedToModel()

virtual void mvc::IView::OnAttachedToModel ( class IModelObservable *  )
inlinevirtualinherited

Called when the view is attached to a model.

This method is called after the view is registered with a model. Views can use this to initialize model-specific state.

Parameters
modelThe model the view was attached to (optional)

◆ OnCurrentIndexUpdated()

void ui::qt::SignalPlotPanel::OnCurrentIndexUpdated ( int  index)
inlineoverridevirtual

Called when the current item index in the model is updated.

This method should be implemented to update the view based on the new current item index.

Parameters
indexThe new current item index in the model

Implements mvc::IView.

◆ OnDataUpdated()

void ui::qt::SignalPlotPanel::OnDataUpdated ( )
overridevirtual

Called when the model's data is updated.

This method should be implemented to refresh the view with the latest data from the model.

Implements mvc::IView.

◆ OnDetachedFromModel()

virtual void mvc::IView::OnDetachedFromModel ( )
inlinevirtualinherited

Called when the view is detached from a model.

This method is called when the view is unregistered from a model. Views can use this to clean up model-specific state.

◆ RebuildChart()

void ui::qt::SignalPlotPanel::RebuildChart ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Refresh()

void ui::qt::SignalPlotPanel::Refresh ( )

Called by MainWindow when the Signals tab becomes active.

Here is the call graph for this function:

◆ SetSelectedSignals()

void ui::qt::SignalPlotPanel::SetSelectedSignals ( const std::vector< std::string > &  keys)

Update the set of signals to plot and redraw the chart immediately.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToSeconds()

double ui::qt::SignalPlotPanel::ToSeconds ( const std::string &  raw,
double  firstSec 
)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_chartView

QChartView* ui::qt::SignalPlotPanel::m_chartView {nullptr}
private

◆ m_dirty

bool ui::qt::SignalPlotPanel::m_dirty {false}
private

◆ m_events

db::EventsContainer& ui::qt::SignalPlotPanel::m_events
private

◆ m_selectedSignals

std::vector<std::string> ui::qt::SignalPlotPanel::m_selectedSignals
private

◆ m_statusLabel

QLabel* ui::qt::SignalPlotPanel::m_statusLabel {nullptr}
private

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