From: Joel Holdsworth Date: Sat, 26 Oct 2013 08:25:22 +0000 (+0100) Subject: Moved decoder config into the popup X-Git-Tag: pulseview-0.2.0~225 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=4e5a4405482a296ebb6014e627298ad156c78d55 Moved decoder config into the popup --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ea44dba..03d856b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,7 +114,6 @@ set(pulseview_SOURCES pv/data/snapshot.cpp pv/dialogs/about.cpp pv/dialogs/connect.cpp - pv/dialogs/decoder.cpp pv/popups/deviceoptions.cpp pv/popups/probes.cpp pv/prop/bool.cpp diff --git a/pv/data/decoder.cpp b/pv/data/decoder.cpp index 9e7145f3..a9168ae2 100644 --- a/pv/data/decoder.cpp +++ b/pv/data/decoder.cpp @@ -45,17 +45,11 @@ const int64_t Decoder::DecodeChunkLength = 4096; mutex Decoder::_global_decode_mutex; -Decoder::Decoder(const srd_decoder *const dec, - std::map > probes, - GHashTable *options) : +Decoder::Decoder(const srd_decoder *const dec) : _decoder(dec), - _probes(probes), - _options(options) + _options(g_hash_table_new_full(g_str_hash, + g_str_equal, g_free, (GDestroyNotify)g_variant_unref)) { - init_decoder(); - - begin_decode(); } Decoder::~Decoder() @@ -66,11 +60,36 @@ Decoder::~Decoder() g_hash_table_destroy(_options); } -const srd_decoder* Decoder::get_decoder() const +const srd_decoder* Decoder::decoder() const { return _decoder; } +const map >& +Decoder::probes() const +{ + return _probes; +} + +void Decoder::set_probes(std::map > probes) +{ + _probes = probes; + begin_decode(); +} + +const GHashTable* Decoder::options() const +{ + return _options; +} + +void Decoder::set_option(const char *id, GVariant *value) +{ + g_variant_ref(value); + g_hash_table_replace(_options, (void*)g_strdup(id), value); + begin_decode(); +} + const vector< shared_ptr > Decoder::annotations() const { @@ -89,9 +108,26 @@ void Decoder::begin_decode() _decode_thread.interrupt(); _decode_thread.join(); + _annotations.clear(); + if (_probes.empty()) return; + // Get the samplerate and start time + shared_ptr logic_signal = + dynamic_pointer_cast( + (*_probes.begin()).second); + if (logic_signal) { + shared_ptr data( + logic_signal->data()); + if (data) { + _start_time = data->get_start_time(); + _samplerate = data->get_samplerate(); + if (_samplerate == 0.0) + _samplerate = 1.0; + } + } + // We get the logic data of the first probe in the list. // This works because we are currently assuming all // LogicSignals have the same data/snapshot @@ -107,26 +143,6 @@ void Decoder::clear_snapshots() { } -void Decoder::init_decoder() -{ - if (!_probes.empty()) - { - shared_ptr logic_signal = - dynamic_pointer_cast( - (*_probes.begin()).second); - if (logic_signal) { - shared_ptr data( - logic_signal->data()); - if (data) { - _start_time = data->get_start_time(); - _samplerate = data->get_samplerate(); - if (_samplerate == 0.0) - _samplerate = 1.0; - } - } - } -} - void Decoder::decode_proc(shared_ptr data) { srd_session *session; @@ -134,8 +150,6 @@ void Decoder::decode_proc(shared_ptr data) assert(data); - _annotations.clear(); - const deque< shared_ptr > &snapshots = data->get_snapshots(); if (snapshots.empty()) diff --git a/pv/data/decoder.h b/pv/data/decoder.h index b8608d2c..72ccd2ec 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -66,14 +66,20 @@ private: static const int64_t DecodeChunkLength; public: - Decoder(const srd_decoder *const decoder, - std::map > probes, - GHashTable *options); + Decoder(const srd_decoder *const decoder); virtual ~Decoder(); - const srd_decoder* get_decoder() const; + const srd_decoder* decoder() const; + + const std::map >& + probes() const; + void set_probes(std::map > probes); + + const GHashTable* options() const; + + void set_option(const char *id, GVariant *value); const std::vector< boost::shared_ptr > annotations() const; @@ -85,8 +91,6 @@ public: private: void begin_decode(); - void init_decoder(); - void decode_proc(boost::shared_ptr data); static void annotation_callback(srd_proto_data *pdata, diff --git a/pv/dialogs/decoder.cpp b/pv/dialogs/decoder.cpp deleted file mode 100644 index 07375f64..00000000 --- a/pv/dialogs/decoder.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -extern "C" { -#include -} - -#include - -#include - -#include - -#include "decoder.h" - -#include -#include - -using namespace boost; -using namespace std; - -namespace pv { -namespace dialogs { - -Decoder::Decoder(QWidget *parent, const srd_decoder *decoder, - const vector< shared_ptr > &sigs, - GHashTable *options) : - QDialog(parent), - _sigs(sigs), - _binding(decoder, options), - _layout(this), - _form(this), - _form_layout(&_form), - _heading(this), - _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, - Qt::Horizontal, this) -{ - const GSList *probe; - - setWindowTitle(tr("Configure %1").arg(decoder->name)); - - _heading.setText(tr("

%1

%2") - .arg(decoder->longname) - .arg(decoder->desc)); - - connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); - connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); - - _form.setLayout(&_form_layout); - - setLayout(&_layout); - _layout.addWidget(&_heading); - _layout.addWidget(&_form); - _layout.addWidget(&_button_box); - - _form_layout.addRow(new QLabel(tr("

Probes

"), &_form)); - - // Add the mandatory probes - for(probe = decoder->probes; probe; probe = probe->next) { - const struct srd_probe *const p = - (struct srd_probe *)probe->data; - QComboBox *const combo = create_probe_selector( - &_form, p->name); - _form_layout.addRow(tr("%1 (%2) *") - .arg(p->name).arg(p->desc), combo); - - _probe_selector_map[p] = combo; - } - - // Add the optional probes - for(probe = decoder->opt_probes; probe; probe = probe->next) { - const struct srd_probe *const p = - (struct srd_probe *)probe->data; - QComboBox *const combo = create_probe_selector( - &_form, p->name); - _form_layout.addRow(tr("%1 (%2)") - .arg(p->name).arg(p->desc), combo); - - _probe_selector_map[p] = combo; - } - - _form_layout.addRow(new QLabel( - tr("* Required Probes"), &_form)); - - // Add the options - if (!_binding.properties().empty()) { - _form_layout.addRow(new QLabel(tr("

Options

"), - &_form)); - _binding.add_properties_to_form(&_form_layout); - } -} - -void Decoder::accept() -{ - QDialog::accept(); - _binding.commit(); -} - -QComboBox* Decoder::create_probe_selector( - QWidget *parent, const char *name) -{ - QComboBox *selector = new QComboBox(parent); - - selector->addItem("-", qVariantFromValue(-1)); - selector->setCurrentIndex(0); - - for(size_t i = 0; i < _sigs.size(); i++) { - const shared_ptr s(_sigs[i]); - assert(s); - - if (s->enabled()) - { - selector->addItem(s->get_name(), qVariantFromValue(i)); - if(s->get_name().toLower().contains( - QString(name).toLower())) - selector->setCurrentIndex(i + 1); - } - } - - return selector; -} - -map > Decoder::get_probes() -{ - map > probe_map; - for(map::const_iterator i = - _probe_selector_map.begin(); - i != _probe_selector_map.end(); i++) - { - const QComboBox *const combo = (*i).second; - const int probe_index = - combo->itemData(combo->currentIndex()).value(); - if(probe_index >= 0) { - shared_ptr sig = _sigs[probe_index]; - probe_map[(*i).first] = sig; - } - } - - return probe_map; -} - -} // namespace dialogs -} // namespace pv diff --git a/pv/dialogs/decoder.h b/pv/dialogs/decoder.h deleted file mode 100644 index 926d015b..00000000 --- a/pv/dialogs/decoder.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PULSEVIEW_PV_DECODER_H -#define PULSEVIEW_PV_DECODER_H - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - -struct srd_decoder; - -namespace pv { - -namespace view { -class LogicSignal; -} - -namespace dialogs { - -class Decoder : public QDialog -{ -public: - Decoder(QWidget *parent, const srd_decoder *decoder, - const std::vector< boost::shared_ptr > &sigs, - GHashTable *options); - - void accept(); - - std::map > - get_probes(); - -private: - QComboBox* create_probe_selector( - QWidget *parent, const char *name); - -private: - const std::vector< boost::shared_ptr > &_sigs; - - std::map _probe_selector_map; - - pv::prop::binding::DecoderOptions _binding; - - QVBoxLayout _layout; - - QWidget _form; - QFormLayout _form_layout; - - QLabel _heading; - QDialogButtonBox _button_box; -}; - -} // namespace dialogs -} // namespace pv - -#endif // PULSEVIEW_PV_DECODER_H diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 183e841e..e1f83140 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -39,7 +39,6 @@ #include "devicemanager.h" #include "dialogs/about.h" #include "dialogs/connect.h" -#include "dialogs/decoder.h" #include "toolbars/samplingbar.h" #include "view/logicsignal.h" #include "view/view.h" @@ -376,27 +375,7 @@ void MainWindow::add_decoder(QObject *action) (srd_decoder*)((QAction*)action)->data().value(); assert(dec); - vector< shared_ptr > logic_sigs; - const vector< shared_ptr > &sigs = - _session.get_signals(); - BOOST_FOREACH(shared_ptr s, sigs) { - assert(s); - shared_ptr l = - dynamic_pointer_cast(s); - if (l) - logic_sigs.push_back(l); - } - - GHashTable *const options = g_hash_table_new_full(g_str_hash, - g_str_equal, g_free, (GDestroyNotify)g_variant_unref); - - dialogs::Decoder dlg(this, dec, logic_sigs, options); - if(dlg.exec() != QDialog::Accepted) { - g_hash_table_destroy(options); - return; - } - - _session.add_decoder(dec, dlg.get_probes(), options); + _session.add_decoder(dec); } void MainWindow::run_stop() diff --git a/pv/prop/binding/binding.h b/pv/prop/binding/binding.h index 4de4af33..9b63c162 100644 --- a/pv/prop/binding/binding.h +++ b/pv/prop/binding/binding.h @@ -24,6 +24,7 @@ #include #include +class QFormLayout; class QWidget; namespace pv { diff --git a/pv/prop/binding/decoderoptions.cpp b/pv/prop/binding/decoderoptions.cpp index dc3a8e97..5ad7e356 100644 --- a/pv/prop/binding/decoderoptions.cpp +++ b/pv/prop/binding/decoderoptions.cpp @@ -18,11 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "decoderoptions.h" #include #include +#include #include #include @@ -33,15 +36,15 @@ namespace pv { namespace prop { namespace binding { -DecoderOptions::DecoderOptions(const srd_decoder *decoder, - GHashTable *options) : - _decoder(decoder), - _options(options) +DecoderOptions::DecoderOptions(shared_ptr decoder) : + _decoder(decoder) { - assert(decoder); + assert(_decoder); + const srd_decoder *const dec = _decoder->decoder(); + assert(dec); - for (GSList *l = decoder->options; l; l = l->next) + for (GSList *l = dec->options; l; l = l->next) { const srd_decoder_option *const opt = (srd_decoder_option*)l->data; @@ -70,13 +73,18 @@ DecoderOptions::DecoderOptions(const srd_decoder *decoder, GVariant* DecoderOptions::getter(const char *id) { + assert(_decoder); + // Get the value from the hash table if it is already present - GVariant *val = (GVariant*)g_hash_table_lookup(_options, id); + GVariant *val = (GVariant*)g_hash_table_lookup( + (GHashTable*)_decoder->options(), id); if (!val) { + assert(_decoder->decoder()); + // Get the default value if not - for (GSList *l = _decoder->options; l; l = l->next) + for (GSList *l = _decoder->decoder()->options; l; l = l->next) { const srd_decoder_option *const opt = (srd_decoder_option*)l->data; @@ -95,8 +103,8 @@ GVariant* DecoderOptions::getter(const char *id) void DecoderOptions::setter(const char *id, GVariant *value) { - g_variant_ref(value); - g_hash_table_insert(_options, (void*)g_strdup(id), value); + assert(_decoder); + _decoder->set_option(id, value); } } // binding diff --git a/pv/prop/binding/decoderoptions.h b/pv/prop/binding/decoderoptions.h index 8217b479..11b0be72 100644 --- a/pv/prop/binding/decoderoptions.h +++ b/pv/prop/binding/decoderoptions.h @@ -21,18 +21,23 @@ #ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H #define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H -#include +#include #include "binding.h" namespace pv { + +namespace data { +class Decoder; +} + namespace prop { namespace binding { class DecoderOptions : public Binding { public: - DecoderOptions(const srd_decoder *decoder, GHashTable *options); + DecoderOptions(boost::shared_ptr decoder); private: GVariant* getter(const char *id); @@ -40,8 +45,7 @@ private: void setter(const char *id, GVariant *value); private: - const srd_decoder *const _decoder; - GHashTable *const _options; + boost::shared_ptr _decoder; }; } // binding diff --git a/pv/prop/string.cpp b/pv/prop/string.cpp index b8f3351c..c2b2c67c 100644 --- a/pv/prop/string.cpp +++ b/pv/prop/string.cpp @@ -20,6 +20,7 @@ #include +#include #include #include "string.h" diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index b27fd6ec..aeb6d220 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "sigsession.h" #include "devicemanager.h" @@ -36,6 +38,8 @@ #include +#include + #include #include @@ -195,17 +199,34 @@ boost::shared_ptr SigSession::get_data() return _logic_data; } -bool SigSession::add_decoder(srd_decoder *const dec, - std::map > probes, - GHashTable *options) +bool SigSession::add_decoder(srd_decoder *const dec) { + map > probes; + try { lock_guard lock(_signals_mutex); - shared_ptr decoder( - new data::Decoder(dec, probes, options)); + // Create the decoder + shared_ptr decoder(new data::Decoder(dec)); + + // Auto select the initial probes + for(const GSList *i = dec->probes; i; i = i->next) + { + const srd_probe *const probe = (const srd_probe*)i->data; + BOOST_FOREACH(shared_ptr s, _signals) + { + shared_ptr l = + dynamic_pointer_cast(s); + if (l && QString(probe->name).toLower().contains( + l->get_name().toLower())) + probes[probe] = l; + } + } + + decoder->set_probes(probes); + + // Create the decode signal shared_ptr d( new view::DecodeSignal(*this, decoder, _decode_traces.size())); diff --git a/pv/sigsession.h b/pv/sigsession.h index 5c69a9bc..801c0a57 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -94,10 +94,7 @@ public: boost::shared_ptr get_data(); - bool add_decoder(srd_decoder *const dec, - std::map > probes, - GHashTable *options); + bool add_decoder(srd_decoder *const dec); std::vector< boost::shared_ptr > get_decode_signals() const; diff --git a/pv/view/decodesignal.cpp b/pv/view/decodesignal.cpp index 1cbce00d..9f81ab42 100644 --- a/pv/view/decodesignal.cpp +++ b/pv/view/decodesignal.cpp @@ -27,12 +27,16 @@ extern "C" { #include #include +#include +#include +#include #include #include "decodesignal.h" #include #include +#include #include #include @@ -53,8 +57,9 @@ const QColor DecodeSignal::ErrorBgColour = QColor(0xEF, 0x29, 0x29); DecodeSignal::DecodeSignal(pv::SigSession &session, boost::shared_ptr decoder, int index) : - Trace(session, QString(decoder->get_decoder()->name)), - _decoder(decoder) + Trace(session, QString(decoder->decoder()->name)), + _decoder(decoder), + _binding(decoder) { assert(_decoder); @@ -121,6 +126,61 @@ void DecodeSignal::paint_mid(QPainter &p, int left, int right) } } +void DecodeSignal::populate_popup_form(QWidget *parent, QFormLayout *form) +{ + const GSList *probe; + + assert(form); + assert(parent); + assert(_decoder); + + const srd_decoder *const decoder = _decoder->decoder(); + + assert(decoder); + + Trace::populate_popup_form(parent, form); + + form->addRow(new QLabel(tr("

Probes

"), parent)); + + _probe_selector_map.clear(); + + // Add the mandatory probes + for(probe = decoder->probes; probe; probe = probe->next) { + const struct srd_probe *const p = + (struct srd_probe *)probe->data; + QComboBox *const combo = create_probe_selector(parent, p); + connect(combo, SIGNAL(currentIndexChanged(int)), + this, SLOT(on_probe_selected(int))); + form->addRow(tr("%1 (%2) *") + .arg(p->name).arg(p->desc), combo); + + _probe_selector_map[p] = combo; + } + + // Add the optional probes + for(probe = decoder->opt_probes; probe; probe = probe->next) { + const struct srd_probe *const p = + (struct srd_probe *)probe->data; + QComboBox *const combo = create_probe_selector(parent, p); + connect(combo, SIGNAL(currentIndexChanged(int)), + this, SLOT(on_probe_selected(int))); + form->addRow(tr("%1 (%2)") + .arg(p->name).arg(p->desc), combo); + + _probe_selector_map[p] = combo; + } + + form->addRow(new QLabel( + tr("* Required Probes"), parent)); + + // Add the options + if (!_binding.properties().empty()) { + form->addRow(new QLabel(tr("

Options

"), + parent)); + _binding.add_properties_to_form(form, true); + } +} + QMenu* DecodeSignal::create_context_menu(QWidget *parent) { QMenu *const menu = Trace::create_context_menu(parent); @@ -156,6 +216,66 @@ void DecodeSignal::draw_error(QPainter &p, const QString &message, p.drawText(text_rect, message); } +QComboBox* DecodeSignal::create_probe_selector( + QWidget *parent, const srd_probe *const probe) +{ + const vector< shared_ptr > sigs = _session.get_signals(); + + assert(_decoder); + const map >::const_iterator probe_iter = + _decoder->probes().find(probe); + + QComboBox *selector = new QComboBox(parent); + + selector->addItem("-", qVariantFromValue((void*)NULL)); + + if (probe_iter == _decoder->probes().end()) + selector->setCurrentIndex(0); + + for(size_t i = 0; i < sigs.size(); i++) { + const shared_ptr s(sigs[i]); + assert(s); + + if (dynamic_pointer_cast(s) && s->enabled()) + { + selector->addItem(s->get_name(), + qVariantFromValue((void*)s.get())); + if ((*probe_iter).second == s) + selector->setCurrentIndex(i + 1); + } + } + + return selector; +} + +void DecodeSignal::commit_probes() +{ + assert(_decoder); + + map > probe_map; + const vector< shared_ptr > sigs = _session.get_signals(); + + for(map::const_iterator i = + _probe_selector_map.begin(); + i != _probe_selector_map.end(); i++) + { + const QComboBox *const combo = (*i).second; + const LogicSignal *const selection = + (LogicSignal*)combo->itemData(combo->currentIndex()). + value(); + + BOOST_FOREACH(shared_ptr s, sigs) + if(s.get() == selection) { + probe_map[(*i).first] = + dynamic_pointer_cast(s); + break; + } + } + + _decoder->set_probes(probe_map); +} + void DecodeSignal::on_new_decode_data() { if (_view) @@ -172,5 +292,10 @@ void DecodeSignal::on_delete() _session.remove_decode_signal(this); } +void DecodeSignal::on_probe_selected(int) +{ + commit_probes(); +} + } // namespace view } // namespace pv diff --git a/pv/view/decodesignal.h b/pv/view/decodesignal.h index efa34495..7977c1c3 100644 --- a/pv/view/decodesignal.h +++ b/pv/view/decodesignal.h @@ -23,8 +23,16 @@ #include "trace.h" +#include + #include +#include + +struct srd_probe; + +class QComboBox; + namespace pv { namespace data { @@ -67,6 +75,8 @@ public: **/ void paint_mid(QPainter &p, int left, int right); + void populate_popup_form(QWidget *parent, QFormLayout *form); + QMenu* create_context_menu(QWidget *parent); void delete_pressed(); @@ -75,15 +85,26 @@ private: void draw_error(QPainter &p, const QString &message, int left, int right); + QComboBox* create_probe_selector( + QWidget *parent, const srd_probe *const probe); + + void commit_probes(); + private slots: void on_new_decode_data(); void on_delete(); + void on_probe_selected(int); + private: boost::shared_ptr _decoder; uint64_t _decode_start, _decode_end; + + pv::prop::binding::DecoderOptions _binding; + + std::map _probe_selector_map; }; } // namespace view diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 6af03c9c..42a2f79f 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include #include #include diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a58cde8..e55e20de 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -46,6 +46,11 @@ set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/data/logicsnapshot.cpp ${PROJECT_SOURCE_DIR}/pv/data/snapshot.cpp ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/binding/binding.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/binding/decoderoptions.cpp ${PROJECT_SOURCE_DIR}/pv/view/analogsignal.cpp ${PROJECT_SOURCE_DIR}/pv/view/cursor.cpp ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp @@ -76,6 +81,9 @@ set(pulseview_TEST_SOURCES set(pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/sigsession.h ${PROJECT_SOURCE_DIR}/pv/data/decoder.h + ${PROJECT_SOURCE_DIR}/pv/prop/int.h + ${PROJECT_SOURCE_DIR}/pv/prop/property.h + ${PROJECT_SOURCE_DIR}/pv/prop/string.h ${PROJECT_SOURCE_DIR}/pv/view/cursor.h ${PROJECT_SOURCE_DIR}/pv/view/decodesignal.h ${PROJECT_SOURCE_DIR}/pv/view/header.h diff --git a/test/data/decoder.cpp b/test/data/decoder.cpp index 4ea4b10f..0a54a866 100644 --- a/test/data/decoder.cpp +++ b/test/data/decoder.cpp @@ -55,14 +55,8 @@ BOOST_AUTO_TEST_CASE(TwoDecoder) srd_decoder *const dec = (struct srd_decoder*)l->data; BOOST_REQUIRE(dec); - map > probes; - ss.add_decoder(dec, probes, - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, - (GDestroyNotify)g_variant_unref)); - - ss.add_decoder(dec, probes, - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, - (GDestroyNotify)g_variant_unref)); + ss.add_decoder(dec); + ss.add_decoder(dec); // Check the signals were created const vector< shared_ptr > sigs =