LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
StatsSummaryPanel.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <QChartView>
6#include <QComboBox>
7#include <QGroupBox>
8#include <QSpinBox>
9#include <QTableWidget>
10#include <QWidget>
11#include <memory>
12#include <vector>
13
14class QDateTime;
15
16namespace db {
17class EventsContainer;
18}
19
20namespace ui::qt {
21class EventsTableView;
22}
23
24namespace ui::qt {
25
41{
42 Q_OBJECT
43
44 public:
46 EventsTableView* eventsView,
47 QWidget* parent = nullptr);
48
49 public slots:
51 void Refresh();
52
53 private:
54 // ── Layout builder ────────────────────────────────────────────────────
55 void BuildLayout();
56
57 // ── Per-section refresh (all receive the already-computed index list) ─
58 void RefreshFormatStats (const std::vector<unsigned long>& indices);
59 void RefreshSummaryTable (const std::vector<unsigned long>& indices);
60 void RefreshTypeChart (const std::vector<unsigned long>& indices);
61 void RefreshTopNTable (const std::vector<unsigned long>& indices);
62 void RefreshFieldStats (const std::vector<unsigned long>& indices);
63
65 [[nodiscard]] std::unique_ptr<IStatisticsStrategy> SelectStrategy() const;
66
69
72 [[nodiscard]] std::vector<unsigned long> VisibleIndices() const;
73
74 // ── Static helpers ────────────────────────────────────────────────────
77 [[nodiscard]] static std::string DetectTimestampField(
78 db::EventsContainer& events,
79 const std::vector<unsigned long>& indices);
80
81 // ── Widgets ───────────────────────────────────────────────────────────
84
85 QGroupBox* m_formatStatsGroup {nullptr};
86 QTableWidget* m_formatStatsTable {nullptr};
87 QTableWidget* m_summaryTable {nullptr};
88 QChartView* m_typeChartView {nullptr};
89 QComboBox* m_columnCombo {nullptr};
90 QSpinBox* m_topNSpin {nullptr};
91 QTableWidget* m_topNTable {nullptr};
92 QTableWidget* m_fieldStatsTable {nullptr};
93};
94
95} // namespace ui::qt
High-performance, thread-safe container for managing large collections of LogEvent objects.
Definition EventsContainer.hpp:129
Definition EventsTableView.hpp:29
Docked panel showing aggregate statistics for the currently visible events.
Definition StatsSummaryPanel.hpp:41
void RefreshSummaryTable(const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:323
QGroupBox * m_formatStatsGroup
Hidden for non-CAN formats.
Definition StatsSummaryPanel.hpp:85
void PopulateColumnCombo()
Populates the column combo from the current model header names.
Definition StatsSummaryPanel.cpp:279
QChartView * m_typeChartView
Event-type horizontal bars.
Definition StatsSummaryPanel.hpp:88
QComboBox * m_columnCombo
Column selector for Top-N.
Definition StatsSummaryPanel.hpp:89
void RefreshFormatStats(const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:209
void BuildLayout()
Definition StatsSummaryPanel.cpp:49
void RefreshFieldStats(const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:582
QTableWidget * m_fieldStatsTable
Per-field unique/fill stats.
Definition StatsSummaryPanel.hpp:92
EventsTableView * m_eventsView
Definition StatsSummaryPanel.hpp:83
static std::string DetectTimestampField(db::EventsContainer &events, const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:301
QTableWidget * m_summaryTable
Key/value summary grid.
Definition StatsSummaryPanel.hpp:87
void Refresh()
Recompute all statistics from the current visible row set.
Definition StatsSummaryPanel.cpp:183
std::vector< unsigned long > VisibleIndices() const
Definition StatsSummaryPanel.cpp:263
QTableWidget * m_formatStatsTable
Format-specific rows from strategy.
Definition StatsSummaryPanel.hpp:86
db::EventsContainer & m_events
Definition StatsSummaryPanel.hpp:82
void RefreshTopNTable(const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:515
QTableWidget * m_topNTable
Top-N value frequency table.
Definition StatsSummaryPanel.hpp:91
std::unique_ptr< IStatisticsStrategy > SelectStrategy() const
Select the appropriate statistics strategy based on current event data.
Definition StatsSummaryPanel.cpp:202
QSpinBox * m_topNSpin
How many top values to show.
Definition StatsSummaryPanel.hpp:90
void RefreshTypeChart(const std::vector< unsigned long > &indices)
Definition StatsSummaryPanel.cpp:420
Database and data model components for the LogViewer application.
Definition EventsContainer.cpp:17
Definition ConfigEditorDialog.cpp:19