LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
SignalPlotPanel.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "IView.hpp"
4
5#include <QChartView>
6#include <QLabel>
7#include <QWidget>
8
9#include <string>
10#include <vector>
11
12namespace db {
13class EventsContainer;
14}
15
16namespace ui::qt {
17
26class SignalPlotPanel : public QWidget, public mvc::IView
27{
28 Q_OBJECT
29
30 public:
31 explicit SignalPlotPanel(db::EventsContainer& events, QWidget* parent = nullptr);
32
34 void Refresh();
35
37 Q_SLOT void SetSelectedSignals(const std::vector<std::string>& keys);
38
39 // mvc::IView ---------------------------------------------------------------
40 void OnDataUpdated() override;
41 void OnCurrentIndexUpdated(int) override {}
42
43 private:
44 void BuildLayout();
45 void RebuildChart();
46
47 static double ToSeconds(const std::string& raw, double firstSec);
48
50
51 QChartView* m_chartView {nullptr};
52 QLabel* m_statusLabel {nullptr};
53
54 std::vector<std::string> m_selectedSignals;
55 bool m_dirty {false};
56};
57
58} // namespace ui::qt
Interface for view components in the MVC architecture.
High-performance, thread-safe container for managing large collections of LogEvent objects.
Definition EventsContainer.hpp:129
Interface for view components in the MVC architecture.
Definition IView.hpp:26
Signal value plot panel.
Definition SignalPlotPanel.hpp:27
QLabel * m_statusLabel
Definition SignalPlotPanel.hpp:52
void OnCurrentIndexUpdated(int) override
Called when the current item index in the model is updated.
Definition SignalPlotPanel.hpp:41
std::vector< std::string > m_selectedSignals
Definition SignalPlotPanel.hpp:54
void Refresh()
Called by MainWindow when the Signals tab becomes active.
Definition SignalPlotPanel.cpp:74
bool m_dirty
Definition SignalPlotPanel.hpp:55
void BuildLayout()
Definition SignalPlotPanel.cpp:44
void RebuildChart()
Definition SignalPlotPanel.cpp:112
Q_SLOT void SetSelectedSignals(const std::vector< std::string > &keys)
Update the set of signals to plot and redraw the chart immediately.
Definition SignalPlotPanel.cpp:83
void OnDataUpdated() override
Called when the model's data is updated.
Definition SignalPlotPanel.cpp:65
QChartView * m_chartView
Definition SignalPlotPanel.hpp:51
db::EventsContainer & m_events
Definition SignalPlotPanel.hpp:49
static double ToSeconds(const std::string &raw, double firstSec)
Definition SignalPlotPanel.cpp:94
Database and data model components for the LogViewer application.
Definition EventsContainer.cpp:17
Definition ConfigEditorDialog.cpp:19