projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decode: Improve signaling
[pulseview.git]
/
pv
/
views
/
trace
/
decodetrace.cpp
diff --git
a/pv/views/trace/decodetrace.cpp
b/pv/views/trace/decodetrace.cpp
index d8f04c582ef5a6c9c76696e344e034a52db6bace..21d88923ef1c5732f3a0f3ef1394219c2ead7907 100644
(file)
--- a/
pv/views/trace/decodetrace.cpp
+++ b/
pv/views/trace/decodetrace.cpp
@@
-90,6
+90,8
@@
const double DecodeTrace::EndCapWidth = 5;
const int DecodeTrace::RowTitleMargin = 10;
const int DecodeTrace::DrawPadding = 100;
const int DecodeTrace::RowTitleMargin = 10;
const int DecodeTrace::DrawPadding = 100;
+const int DecodeTrace::MaxTraceUpdateRate = 1; // No more than 1 Hz
+
const QColor DecodeTrace::Colours[16] = {
QColor(0xEF, 0x29, 0x29),
QColor(0xF6, 0x6A, 0x32),
const QColor DecodeTrace::Colours[16] = {
QColor(0xEF, 0x29, 0x29),
QColor(0xF6, 0x6A, 0x32),
@@
-147,6
+149,8
@@
DecodeTrace::DecodeTrace(pv::Session &session,
connect(decode_signal_.get(), SIGNAL(new_annotations()),
this, SLOT(on_new_annotations()));
connect(decode_signal_.get(), SIGNAL(new_annotations()),
this, SLOT(on_new_annotations()));
+ connect(decode_signal_.get(), SIGNAL(decode_finished()),
+ this, SLOT(on_decode_finished()));
connect(decode_signal_.get(), SIGNAL(channels_updated()),
this, SLOT(on_channels_updated()));
connect(decode_signal_.get(), SIGNAL(channels_updated()),
this, SLOT(on_channels_updated()));
@@
-154,6
+158,11
@@
DecodeTrace::DecodeTrace(pv::Session &session,
this, SLOT(on_delete_decoder(int)));
connect(&show_hide_mapper_, SIGNAL(mapped(int)),
this, SLOT(on_show_hide_decoder(int)));
this, SLOT(on_delete_decoder(int)));
connect(&show_hide_mapper_, SIGNAL(mapped(int)),
this, SLOT(on_show_hide_decoder(int)));
+
+ connect(&delayed_trace_updater_, SIGNAL(timeout()),
+ this, SLOT(on_delayed_trace_update()));
+ delayed_trace_updater_.setSingleShot(true);
+ delayed_trace_updater_.setInterval(1000 / MaxTraceUpdateRate);
}
bool DecodeTrace::enabled() const
}
bool DecodeTrace::enabled() const
@@
-865,6
+874,18
@@
QComboBox* DecodeTrace::create_channel_selector_init_state(QWidget *parent,
}
void DecodeTrace::on_new_annotations()
}
void DecodeTrace::on_new_annotations()
+{
+ if (!delayed_trace_updater_.isActive())
+ delayed_trace_updater_.start();
+}
+
+void DecodeTrace::on_delayed_trace_update()
+{
+ if (owner_)
+ owner_->row_item_appearance_changed(false, true);
+}
+
+void DecodeTrace::on_decode_finished()
{
if (owner_)
owner_->row_item_appearance_changed(false, true);
{
if (owner_)
owner_->row_item_appearance_changed(false, true);