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

#include <SideBySidePanel.hpp>

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

Classes

struct  LoadJob
 

Signals

void CloseRequested ()
 

Public Member Functions

 SideBySidePanel (QWidget *parent=nullptr)
 
 ~SideBySidePanel () override
 
void OpenLeft (const QString &path)
 
void OpenRight (const QString &path)
 

Static Public Member Functions

static int FindNearestByTimestamp (db::EventsContainer &container, double target, int fallbackRow)
 

Private Types

enum class  SyncMode { Timestamp , Manual , None }
 

Private Slots

void OnOpenLeftFile ()
 
void OnOpenRightFile ()
 
void OnSyncModeChanged (int index)
 
void OnSetLeftRef ()
 
void OnSetRightRef ()
 
void OnLeftSelectionChanged (int actualRow)
 
void OnRightSelectionChanged (int actualRow)
 
void OnLeftLoadFinished ()
 
void OnRightLoadFinished ()
 

Private Member Functions

void BuildUi ()
 
QWidget * BuildSide (bool isLeft)
 
void UpdateManualControls ()
 
void UpdateSyncStatus ()
 
void LoadFile (bool isLeft)
 
void LoadFileDirect (bool isLeft, const QString &path)
 
void StartAsyncLoad (bool isLeft, std::unique_ptr< parser::IDataParser > parser, const std::filesystem::path &path)
 
double GetTimestamp (db::EventsContainer &container, size_t actualRow) const
 
void SyncFromLeft (int actualRow)
 
void SyncFromRight (int actualRow)
 

Private Attributes

db::EventsContainer m_leftEvents
 
db::EventsContainer m_rightEvents
 
EventsTableView * m_leftView {nullptr}
 
EventsTableView * m_rightView {nullptr}
 
QLabel * m_leftFileLabel {nullptr}
 
QLabel * m_rightFileLabel {nullptr}
 
QPushButton * m_leftOpenBtn {nullptr}
 
QPushButton * m_rightOpenBtn {nullptr}
 
QComboBox * m_syncModeCombo {nullptr}
 
QPushButton * m_setLeftRefBtn {nullptr}
 
QPushButton * m_setRightRefBtn {nullptr}
 
QLabel * m_syncStatusLabel {nullptr}
 
SyncMode m_syncMode {SyncMode::Timestamp}
 
bool m_leftRefSet {false}
 
bool m_rightRefSet {false}
 
double m_leftRefTs {0.0}
 
double m_rightRefTs {0.0}
 
int m_leftRefRow {-1}
 
int m_rightRefRow {-1}
 
double m_syncOffset {0.0}
 
bool m_syncInProgress {false}
 
LoadJob m_leftJob
 
LoadJob m_rightJob
 
QFutureWatcher< void > * m_leftWatcher {nullptr}
 
QFutureWatcher< void > * m_rightWatcher {nullptr}
 

Detailed Description

Panel that displays two independently-loaded log files side by side, with three synchronisation modes:

Timestamp — when the user selects a row on one side the other side scrolls to the event with the nearest timestamp.

Manual — the user marks one reference event on each side; the panel computes a constant timestamp offset between the two logs and from then on uses that offset for the nearest-timestamp lookup. Useful when the two files use incompatible time bases (e.g. DLT epoch vs ASC elapsed seconds).

None — the two views are completely independent.

Member Enumeration Documentation

◆ SyncMode

enum class ui::qt::SideBySidePanel::SyncMode
strongprivate
Enumerator
Timestamp 
Manual 
None 

Constructor & Destructor Documentation

◆ SideBySidePanel()

ui::qt::SideBySidePanel::SideBySidePanel ( QWidget *  parent = nullptr)
explicit
Here is the call graph for this function:

◆ ~SideBySidePanel()

ui::qt::SideBySidePanel::~SideBySidePanel ( )
overridedefault

Member Function Documentation

◆ BuildSide()

QWidget * ui::qt::SideBySidePanel::BuildSide ( bool  isLeft)
private
Here is the caller graph for this function:

◆ BuildUi()

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

◆ CloseRequested

void ui::qt::SideBySidePanel::CloseRequested ( )
signal
Here is the caller graph for this function:

◆ FindNearestByTimestamp()

int ui::qt::SideBySidePanel::FindNearestByTimestamp ( db::EventsContainer &  container,
double  target,
int  fallbackRow 
)
static

Returns the row in container whose timestamp is closest to target. Uses binary search (assumes timestamps are monotonically increasing, which is true for virtually all real log files). Falls back to fallbackRow when the container has no parseable timestamps.

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

◆ GetTimestamp()

double ui::qt::SideBySidePanel::GetTimestamp ( db::EventsContainer &  container,
size_t  actualRow 
) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFile()

void ui::qt::SideBySidePanel::LoadFile ( bool  isLeft)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFileDirect()

void ui::qt::SideBySidePanel::LoadFileDirect ( bool  isLeft,
const QString &  path 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnLeftLoadFinished

void ui::qt::SideBySidePanel::OnLeftLoadFinished ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnLeftSelectionChanged

void ui::qt::SideBySidePanel::OnLeftSelectionChanged ( int  actualRow)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOpenLeftFile

void ui::qt::SideBySidePanel::OnOpenLeftFile ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOpenRightFile

void ui::qt::SideBySidePanel::OnOpenRightFile ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRightLoadFinished

void ui::qt::SideBySidePanel::OnRightLoadFinished ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRightSelectionChanged

void ui::qt::SideBySidePanel::OnRightSelectionChanged ( int  actualRow)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSetLeftRef

void ui::qt::SideBySidePanel::OnSetLeftRef ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSetRightRef

void ui::qt::SideBySidePanel::OnSetRightRef ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSyncModeChanged

void ui::qt::SideBySidePanel::OnSyncModeChanged ( int  index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenLeft()

void ui::qt::SideBySidePanel::OpenLeft ( const QString &  path)
Here is the call graph for this function:

◆ OpenRight()

void ui::qt::SideBySidePanel::OpenRight ( const QString &  path)
Here is the call graph for this function:

◆ StartAsyncLoad()

void ui::qt::SideBySidePanel::StartAsyncLoad ( bool  isLeft,
std::unique_ptr< parser::IDataParser >  parser,
const std::filesystem::path &  path 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SyncFromLeft()

void ui::qt::SideBySidePanel::SyncFromLeft ( int  actualRow)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SyncFromRight()

void ui::qt::SideBySidePanel::SyncFromRight ( int  actualRow)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateManualControls()

void ui::qt::SideBySidePanel::UpdateManualControls ( )
private
Here is the caller graph for this function:

◆ UpdateSyncStatus()

void ui::qt::SideBySidePanel::UpdateSyncStatus ( )
private
Here is the caller graph for this function:

Member Data Documentation

◆ m_leftEvents

db::EventsContainer ui::qt::SideBySidePanel::m_leftEvents
private

◆ m_leftFileLabel

QLabel* ui::qt::SideBySidePanel::m_leftFileLabel {nullptr}
private

◆ m_leftJob

LoadJob ui::qt::SideBySidePanel::m_leftJob
private

◆ m_leftOpenBtn

QPushButton* ui::qt::SideBySidePanel::m_leftOpenBtn {nullptr}
private

◆ m_leftRefRow

int ui::qt::SideBySidePanel::m_leftRefRow {-1}
private

◆ m_leftRefSet

bool ui::qt::SideBySidePanel::m_leftRefSet {false}
private

◆ m_leftRefTs

double ui::qt::SideBySidePanel::m_leftRefTs {0.0}
private

◆ m_leftView

EventsTableView* ui::qt::SideBySidePanel::m_leftView {nullptr}
private

◆ m_leftWatcher

QFutureWatcher<void>* ui::qt::SideBySidePanel::m_leftWatcher {nullptr}
private

◆ m_rightEvents

db::EventsContainer ui::qt::SideBySidePanel::m_rightEvents
private

◆ m_rightFileLabel

QLabel* ui::qt::SideBySidePanel::m_rightFileLabel {nullptr}
private

◆ m_rightJob

LoadJob ui::qt::SideBySidePanel::m_rightJob
private

◆ m_rightOpenBtn

QPushButton* ui::qt::SideBySidePanel::m_rightOpenBtn {nullptr}
private

◆ m_rightRefRow

int ui::qt::SideBySidePanel::m_rightRefRow {-1}
private

◆ m_rightRefSet

bool ui::qt::SideBySidePanel::m_rightRefSet {false}
private

◆ m_rightRefTs

double ui::qt::SideBySidePanel::m_rightRefTs {0.0}
private

◆ m_rightView

EventsTableView* ui::qt::SideBySidePanel::m_rightView {nullptr}
private

◆ m_rightWatcher

QFutureWatcher<void>* ui::qt::SideBySidePanel::m_rightWatcher {nullptr}
private

◆ m_setLeftRefBtn

QPushButton* ui::qt::SideBySidePanel::m_setLeftRefBtn {nullptr}
private

◆ m_setRightRefBtn

QPushButton* ui::qt::SideBySidePanel::m_setRightRefBtn {nullptr}
private

◆ m_syncInProgress

bool ui::qt::SideBySidePanel::m_syncInProgress {false}
private

◆ m_syncMode

SyncMode ui::qt::SideBySidePanel::m_syncMode {SyncMode::Timestamp}
private

◆ m_syncModeCombo

QComboBox* ui::qt::SideBySidePanel::m_syncModeCombo {nullptr}
private

◆ m_syncOffset

double ui::qt::SideBySidePanel::m_syncOffset {0.0}
private

◆ m_syncStatusLabel

QLabel* ui::qt::SideBySidePanel::m_syncStatusLabel {nullptr}
private

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