SILICON
Loading...
Searching...
No Matches
Viewer Class Reference

#include <waveformViewer.hpp>

Inheritance diagram for Viewer:
Collaboration diagram for Viewer:

Public Slots

void resetTrace (const QStringList &signalNames, int inputCount, const QList< int > &signalWidths)
 Replaces signal metadata and clears the current trace.
void appendSnapshots (const QList< QPair< qulonglong, std::vector< core::BusValue > > > &snapshots)
 Appends a batch of snapshots with a single deferred UI refresh.
void setEditMode (bool enabled)
 Enables input-waveform editing mode.

Signals

void editModeChanged (bool enabled)
 Emitted when waveform edit mode changes.
void editTraceCommitted (qulonglong duration, std::vector< Sample > inputSnapshots)
 Emitted when edit mode is left and the edited input waveform should run.

Public Member Functions

 Viewer (QWidget *parent=nullptr)

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 Tracks focus changes for precise interval edit fields.

Private Member Functions

void refreshSignalList ()
 Repaints the signal list while preserving scroll position.
void refreshCanvas ()
 Pushes current trace state into the waveform canvas.
void refreshViews ()
 Refreshes both synchronized waveform views.
void applyEditInterval (int signalIndex, quint64 startTime, quint64 endTime, const QString &rawValue)
 Applies a raw bit value to one input signal over a time interval.
void promptEditIntervalValue (int signalIndex, quint64 startTime, quint64 endTime)
 Prompts for and validates a value for an edit-mode interval.
void promptSelectedEditIntervalValue ()
 Prompts for a value using the current selected signal and text interval.
void setEditIntervalFields (quint64 startTime, quint64 endTime)
 Updates the precise interval fields from an edit gesture.
void commitEditIntervalFields ()
 Parses and clamps the precise interval text fields.
void updateDurationField ()
 Synchronizes the duration field with edit mode or the latest trace time.
void updateEditControls ()
 Synchronizes edit controls with the current mode and duration.
void scheduleRefresh ()
 Schedules a coalesced waveform refresh if one is not already pending.
int visibleSignalCount () const
 Returns the number of signals currently visible in the viewer.
QStringList visibleNames () const
 Returns the signal names currently visible in the viewer.
QStringList displayedValues () const
QString displayValue (int signalIndex, const core::BusValue &value) const
void setSelectedSignalIndex (int signalIndex)
void showSignalFormatMenu (int signalIndex, QPoint globalPosition)
void saveTrace ()

Private Attributes

SignalListWidget * signalList
Canvas * canvas
QScrollArea * labelScrollArea
QScrollArea * scrollArea
QAction * editAct
QLineEdit * durationEdit
QLineEdit * startEdit
QLineEdit * endEdit
Trace trace
int selectedSampleIndex = -1
int selectedSignalIndex = -1
double pixelsPerTick = 12.0
std::vector< SILICON::core::BusValueFormat > signalFormats
bool editMode = false
quint64 editDuration = 20
quint64 selectedEditStart = 0
quint64 selectedEditEnd = 1
bool preciseIntervalEditing = false
bool keepScrolledToEnd = false
 Preserves tail-following behavior across a deferred refresh.
QTimer * refreshTimer = nullptr
 Coalesces rapid snapshot arrivals into at most one refresh per frame.
ScopedEventFilter startEditFilter
ScopedEventFilter endEditFilter
CallbackScope callbacks

Detailed Description

Definition at line 225 of file waveformViewer.hpp.

Constructor & Destructor Documentation

◆ Viewer()

Viewer ( QWidget * parent = nullptr)
explicit

Definition at line 783 of file waveformViewer.cpp.

Member Function Documentation

◆ appendSnapshots

void appendSnapshots ( const QList< QPair< qulonglong, std::vector< core::BusValue > > > & snapshots)
slot

Appends a batch of snapshots with a single deferred UI refresh.

Parameters
snapshotsOrdered timestamp and signal-value snapshots

Definition at line 993 of file waveformViewer.cpp.

◆ applyEditInterval()

void applyEditInterval ( int signalIndex,
quint64 startTime,
quint64 endTime,
const QString & rawValue )
private

Applies a raw bit value to one input signal over a time interval.

Parameters
signalIndexInput signal index
startTimeInclusive interval start
endTimeExclusive interval end
rawValueRaw bit-string value to assign

Definition at line 1079 of file waveformViewer.cpp.

◆ commitEditIntervalFields()

void commitEditIntervalFields ( )
private

Parses and clamps the precise interval text fields.

Definition at line 1166 of file waveformViewer.cpp.

◆ displayedValues()

QStringList displayedValues ( ) const
nodiscardprivate

Definition at line 1223 of file waveformViewer.cpp.

◆ displayValue()

QString displayValue ( int signalIndex,
const core::BusValue & value ) const
nodiscardprivate

Definition at line 1241 of file waveformViewer.cpp.

◆ editModeChanged

void editModeChanged ( bool enabled)
signal

Emitted when waveform edit mode changes.

Parameters
enabledTrue while input waveform editing is active

◆ editTraceCommitted

void editTraceCommitted ( qulonglong duration,
std::vector< Sample > inputSnapshots )
signal

Emitted when edit mode is left and the edited input waveform should run.

Parameters
durationTotal edited waveform duration
inputSnapshotsEdited input-only snapshots

◆ eventFilter()

bool eventFilter ( QObject * watched,
QEvent * event )
overrideprotected

Tracks focus changes for precise interval edit fields.

Definition at line 976 of file waveformViewer.cpp.

◆ promptEditIntervalValue()

void promptEditIntervalValue ( int signalIndex,
quint64 startTime,
quint64 endTime )
private

Prompts for and validates a value for an edit-mode interval.

Parameters
signalIndexInput signal index
startTimeInclusive interval start
endTimeExclusive interval end

Definition at line 1101 of file waveformViewer.cpp.

◆ promptSelectedEditIntervalValue()

void promptSelectedEditIntervalValue ( )
private

Prompts for a value using the current selected signal and text interval.

Definition at line 1146 of file waveformViewer.cpp.

◆ refreshCanvas()

void refreshCanvas ( )
private

Pushes current trace state into the waveform canvas.

Definition at line 1060 of file waveformViewer.cpp.

◆ refreshSignalList()

void refreshSignalList ( )
private

Repaints the signal list while preserving scroll position.

Definition at line 1052 of file waveformViewer.cpp.

◆ refreshViews()

void refreshViews ( )
private

Refreshes both synchronized waveform views.

Definition at line 1073 of file waveformViewer.cpp.

◆ resetTrace

void resetTrace ( const QStringList & signalNames,
int inputCount,
const QList< int > & signalWidths )
slot

Replaces signal metadata and clears the current trace.

Parameters
signalNamesOrdered signal labels
inputCountNumber of leading signals belonging to the input group
signalWidthsWidth of each signal in bits

Definition at line 950 of file waveformViewer.cpp.

◆ saveTrace()

void saveTrace ( )
private

Definition at line 1303 of file waveformViewer.cpp.

◆ scheduleRefresh()

void scheduleRefresh ( )
private

Schedules a coalesced waveform refresh if one is not already pending.

Definition at line 1197 of file waveformViewer.cpp.

◆ setEditIntervalFields()

void setEditIntervalFields ( quint64 startTime,
quint64 endTime )
private

Updates the precise interval fields from an edit gesture.

Parameters
startTimeInclusive interval start
endTimeExclusive interval end

Definition at line 1152 of file waveformViewer.cpp.

◆ setEditMode

void setEditMode ( bool enabled)
slot

Enables input-waveform editing mode.

Edit mode drops output signals from the visible trace, clears transition history, and keeps one editable input waveform spanning the configured duration.

Definition at line 1017 of file waveformViewer.cpp.

◆ setSelectedSignalIndex()

void setSelectedSignalIndex ( int signalIndex)
private

Definition at line 1250 of file waveformViewer.cpp.

◆ showSignalFormatMenu()

void showSignalFormatMenu ( int signalIndex,
QPoint globalPosition )
private

Definition at line 1260 of file waveformViewer.cpp.

◆ updateDurationField()

void updateDurationField ( )
private

Synchronizes the duration field with edit mode or the latest trace time.

Definition at line 1177 of file waveformViewer.cpp.

◆ updateEditControls()

void updateEditControls ( )
private

Synchronizes edit controls with the current mode and duration.

Definition at line 1185 of file waveformViewer.cpp.

◆ visibleNames()

QStringList visibleNames ( ) const
nodiscardprivate

Returns the signal names currently visible in the viewer.

Definition at line 1211 of file waveformViewer.cpp.

◆ visibleSignalCount()

int visibleSignalCount ( ) const
nodiscardprivate

Returns the number of signals currently visible in the viewer.

Definition at line 1205 of file waveformViewer.cpp.

Member Data Documentation

◆ callbacks

CallbackScope callbacks
private

Definition at line 301 of file waveformViewer.hpp.

◆ canvas

Canvas* canvas
private

Definition at line 275 of file waveformViewer.hpp.

◆ durationEdit

QLineEdit* durationEdit
private

Definition at line 279 of file waveformViewer.hpp.

◆ editAct

QAction* editAct
private

Definition at line 278 of file waveformViewer.hpp.

◆ editDuration

quint64 editDuration = 20
private

Definition at line 289 of file waveformViewer.hpp.

◆ editMode

bool editMode = false
private

Definition at line 288 of file waveformViewer.hpp.

◆ endEdit

QLineEdit* endEdit
private

Definition at line 281 of file waveformViewer.hpp.

◆ endEditFilter

ScopedEventFilter endEditFilter
private

Definition at line 300 of file waveformViewer.hpp.

◆ keepScrolledToEnd

bool keepScrolledToEnd = false
private

Preserves tail-following behavior across a deferred refresh.

Definition at line 294 of file waveformViewer.hpp.

◆ labelScrollArea

QScrollArea* labelScrollArea
private

Definition at line 276 of file waveformViewer.hpp.

◆ pixelsPerTick

double pixelsPerTick = 12.0
private

Definition at line 286 of file waveformViewer.hpp.

◆ preciseIntervalEditing

bool preciseIntervalEditing = false
private

Definition at line 292 of file waveformViewer.hpp.

◆ refreshTimer

QTimer* refreshTimer = nullptr
private

Coalesces rapid snapshot arrivals into at most one refresh per frame.

Definition at line 297 of file waveformViewer.hpp.

◆ scrollArea

QScrollArea* scrollArea
private

Definition at line 277 of file waveformViewer.hpp.

◆ selectedEditEnd

quint64 selectedEditEnd = 1
private

Definition at line 291 of file waveformViewer.hpp.

◆ selectedEditStart

quint64 selectedEditStart = 0
private

Definition at line 290 of file waveformViewer.hpp.

◆ selectedSampleIndex

int selectedSampleIndex = -1
private

Definition at line 284 of file waveformViewer.hpp.

◆ selectedSignalIndex

int selectedSignalIndex = -1
private

Definition at line 285 of file waveformViewer.hpp.

◆ signalFormats

std::vector<SILICON::core::BusValueFormat> signalFormats
private

Definition at line 287 of file waveformViewer.hpp.

◆ signalList

SignalListWidget* signalList
private

Definition at line 274 of file waveformViewer.hpp.

◆ startEdit

QLineEdit* startEdit
private

Definition at line 280 of file waveformViewer.hpp.

◆ startEditFilter

ScopedEventFilter startEditFilter
private

Definition at line 299 of file waveformViewer.hpp.

◆ trace

Trace trace
private

Definition at line 283 of file waveformViewer.hpp.


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