return result;
}
-vector<Row> DecodeSignal::visible_rows() const
+vector<Row> DecodeSignal::get_rows(bool visible_only) const
{
lock_guard<mutex> lock(output_mutex_);
for (const shared_ptr<decode::Decoder>& dec : stack_) {
assert(dec);
- if (!dec->shown())
+ if (visible_only && !dec->shown())
continue;
const srd_decoder *const decc = dec->decoder();
{
// Note: We put all vectors and lists on the heap, not the stack
- const vector<Row> rows = visible_rows();
+ const vector<Row> rows = get_rows(true);
// Use forward_lists for faster merging
forward_list<Annotation> *all_ann_list = new forward_list<Annotation>();
int64_t get_decoded_sample_count(uint32_t segment_id,
bool include_processing) const;
- vector<decode::Row> visible_rows() const;
+ vector<decode::Row> get_rows(bool visible_only) const;
/**
* Extracts annotations from a single row into a vector.
SLOT(on_dec_initialStateConfigurable_changed(int)));
decoder_layout->addRow(tr("Allow configuration of &initial signal state"), cb);
+ cb = create_checkbox(GlobalSettings::Key_Dec_AlwaysShowAllRows,
+ SLOT(on_dec_alwaysshowallrows_changed(int)));
+ decoder_layout->addRow(tr("Always show all &rows, even if no annotation is visible"), cb);
+
// Annotation export settings
ann_export_format_ = new QLineEdit();
ann_export_format_->setText(
GlobalSettings settings;
settings.setValue(GlobalSettings::Key_Dec_ExportFormat, text);
}
+
+void Settings::on_dec_alwaysshowallrows_changed(int state)
+{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_Dec_AlwaysShowAllRows, state ? true : false);
+}
#endif
void Settings::on_log_logLevel_changed(int value)
#ifdef ENABLE_DECODE
void on_dec_initialStateConfigurable_changed(int state);
void on_dec_exportFormat_changed(const QString &text);
+ void on_dec_alwaysshowallrows_changed(int state);
#endif
void on_log_logLevel_changed(int value);
void on_log_bufferSize_changed(int value);
const QString GlobalSettings::Key_View_CursorFillColor = "View_CursorFillColor";
const QString GlobalSettings::Key_Dec_InitialStateConfigurable = "Dec_InitialStateConfigurable";
const QString GlobalSettings::Key_Dec_ExportFormat = "Dec_ExportFormat";
+const QString GlobalSettings::Key_Dec_AlwaysShowAllRows = "Dec_AlwaysShowAllRows";
const QString GlobalSettings::Key_Log_BufferSize = "Log_BufferSize";
const QString GlobalSettings::Key_Log_NotifyOfStacktrace = "Log_NotifyOfStacktrace";
static const QString Key_View_CursorFillColor;
static const QString Key_Dec_InitialStateConfigurable;
static const QString Key_Dec_ExportFormat;
+ static const QString Key_Dec_AlwaysShowAllRows;
static const QString Key_Log_BufferSize;
static const QString Key_Log_NotifyOfStacktrace;
{
decode_signal_ = dynamic_pointer_cast<data::DecodeSignal>(base_);
+ GlobalSettings settings;
+ always_show_all_rows_ = settings.value(GlobalSettings::Key_Dec_AlwaysShowAllRows).toBool();
+
+ GlobalSettings::add_change_handler(this);
+
// Determine shortest string we want to see displayed in full
QFontMetrics m(QApplication::font());
min_useful_label_width_ = m.width("XX"); // e.g. two hex characters
delayed_trace_updater_.setInterval(1000 / MaxTraceUpdateRate);
}
+DecodeTrace::~DecodeTrace()
+{
+ GlobalSettings::remove_change_handler(this);
+}
+
bool DecodeTrace::enabled() const
{
return true;
sample_range.second = min((int64_t)sample_range.second,
decode_signal_->get_decoded_sample_count(current_segment_, false));
- const vector<Row> rows = decode_signal_->visible_rows();
+ const vector<Row> rows = decode_signal_->get_rows(!always_show_all_rows_);
visible_rows_.clear();
for (const Row& row : rows) {
vector<Annotation> annotations;
decode_signal_->get_annotation_subset(annotations, row,
current_segment_, sample_range.first, sample_range.second);
- if (!annotations.empty()) {
+ if (always_show_all_rows_ || !annotations.empty()) {
draw_annotations(annotations, p, annotation_height, pp, y,
get_row_color(row.index()), row_title_width);
y += row_height_;
msg.exec();
}
+void DecodeTrace::on_setting_changed(const QString &key, const QVariant &value)
+{
+ if (key == GlobalSettings::Key_Dec_AlwaysShowAllRows) {
+ visible_rows_.clear();
+ max_visible_rows_ = 0;
+ always_show_all_rows_ = value.toBool();
+ }
+}
+
void DecodeTrace::on_new_annotations()
{
if (!delayed_trace_updater_.isActive())
DecodeTrace(pv::Session &session, shared_ptr<data::SignalBase> signalbase,
int index);
+ ~DecodeTrace();
+
bool enabled() const;
shared_ptr<data::SignalBase> base() const;
virtual void hover_point_changed(const QPoint &hp);
private Q_SLOTS:
+ void on_setting_changed(const QString &key, const QVariant &value);
+
void on_new_annotations();
void on_delayed_trace_update();
void on_decode_reset();
shared_ptr<data::DecodeSignal> decode_signal_;
vector<data::decode::Row> visible_rows_;
+ bool always_show_all_rows_;
map<QComboBox*, uint16_t> channel_id_map_; // channel selector -> decode channel ID
map<QComboBox*, uint16_t> init_state_map_; // init state selector -> decode channel ID