From: Joel Holdsworth Date: Sat, 26 Oct 2013 11:54:58 +0000 (+0100) Subject: Renamed DecodeSignal to DecodeTrace X-Git-Tag: pulseview-0.2.0~224 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b93295580db08d9008b9c9e49a3a3a86ef562f14;p=pulseview.git Renamed DecodeSignal to DecodeTrace --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d856b7..ca89c107 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,7 +129,7 @@ set(pulseview_SOURCES pv/view/analogsignal.cpp pv/view/cursor.cpp pv/view/cursorpair.cpp - pv/view/decodesignal.cpp + pv/view/decodetrace.cpp pv/view/header.cpp pv/view/marginwidget.cpp pv/view/logicsignal.cpp @@ -166,7 +166,7 @@ set(pulseview_HEADERS pv/prop/string.h pv/toolbars/samplingbar.h pv/view/cursor.h - pv/view/decodesignal.h + pv/view/decodetrace.h pv/view/header.h pv/view/logicsignal.h pv/view/marginwidget.h diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index aeb6d220..24a059ea 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -31,7 +31,7 @@ #include "data/logicsnapshot.h" #include "view/analogsignal.h" -#include "view/decodesignal.h" +#include "view/decodetrace.h" #include "view/logicsignal.h" #include @@ -227,8 +227,8 @@ bool SigSession::add_decoder(srd_decoder *const dec) decoder->set_probes(probes); // Create the decode signal - shared_ptr d( - new view::DecodeSignal(*this, decoder, + shared_ptr d( + new view::DecodeTrace(*this, decoder, _decode_traces.size())); _decode_traces.push_back(d); } @@ -242,15 +242,15 @@ bool SigSession::add_decoder(srd_decoder *const dec) return true; } -vector< shared_ptr > SigSession::get_decode_signals() const +vector< shared_ptr > SigSession::get_decode_signals() const { lock_guard lock(_signals_mutex); return _decode_traces; } -void SigSession::remove_decode_signal(view::DecodeSignal *signal) +void SigSession::remove_decode_signal(view::DecodeTrace *signal) { - for (vector< shared_ptr >::iterator i = + for (vector< shared_ptr >::iterator i = _decode_traces.begin(); i != _decode_traces.end(); i++) diff --git a/pv/sigsession.h b/pv/sigsession.h index 801c0a57..980fef94 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -49,7 +49,7 @@ class LogicSnapshot; } namespace view { -class DecodeSignal; +class DecodeTrace; class LogicSignal; class Signal; } @@ -96,10 +96,10 @@ public: bool add_decoder(srd_decoder *const dec); - std::vector< boost::shared_ptr > + std::vector< boost::shared_ptr > get_decode_signals() const; - void remove_decode_signal(view::DecodeSignal *signal); + void remove_decode_signal(view::DecodeTrace *signal); private: void set_capture_state(capture_state state); @@ -159,7 +159,7 @@ private: */ struct sr_dev_inst *_sdi; - std::vector< boost::shared_ptr > _decode_traces; + std::vector< boost::shared_ptr > _decode_traces; mutable boost::mutex _sampling_mutex; capture_state _capture_state; diff --git a/pv/view/decodesignal.cpp b/pv/view/decodesignal.cpp deleted file mode 100644 index 9f81ab42..00000000 --- a/pv/view/decodesignal.cpp +++ /dev/null @@ -1,301 +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 -#include -#include -#include - -#include "decodesignal.h" - -#include -#include -#include -#include -#include - -using namespace boost; -using namespace std; - -namespace pv { -namespace view { - -const QColor DecodeSignal::DecodeColours[4] = { - QColor(0xEF, 0x29, 0x29), // Red - QColor(0xFC, 0xE9, 0x4F), // Yellow - QColor(0x8A, 0xE2, 0x34), // Green - QColor(0x72, 0x9F, 0xCF) // Blue -}; - -const QColor DecodeSignal::ErrorBgColour = QColor(0xEF, 0x29, 0x29); - -DecodeSignal::DecodeSignal(pv::SigSession &session, - boost::shared_ptr decoder, int index) : - Trace(session, QString(decoder->decoder()->name)), - _decoder(decoder), - _binding(decoder) -{ - assert(_decoder); - - _colour = DecodeColours[index % countof(DecodeColours)]; - - connect(_decoder.get(), SIGNAL(new_decode_data()), - this, SLOT(on_new_decode_data())); -} - -bool DecodeSignal::enabled() const -{ - return true; -} - -const boost::shared_ptr& DecodeSignal::decoder() const -{ - return _decoder; -} - -void DecodeSignal::set_view(pv::view::View *view) -{ - assert(view); - Trace::set_view(view); -} - -void DecodeSignal::paint_back(QPainter &p, int left, int right) -{ - paint_axis(p, get_y(), left, right); -} - -void DecodeSignal::paint_mid(QPainter &p, int left, int right) -{ - using namespace pv::view::decode; - - assert(_decoder); - const QString err = _decoder->error_message(); - if (!err.isEmpty()) { - draw_error(p, err, left, right); - return; - } - - assert(_view); - const int y = get_y(); - - const double scale = _view->scale(); - assert(scale > 0); - - double samplerate = _decoder->get_samplerate(); - - // Show sample rate as 1Hz when it is unknown - if (samplerate == 0.0) - samplerate = 1.0; - - const double pixels_offset = (_view->offset() - - _decoder->get_start_time()) / scale; - const double samples_per_pixel = samplerate * scale; - - assert(_decoder); - vector< shared_ptr > annotations(_decoder->annotations()); - BOOST_FOREACH(shared_ptr a, annotations) { - assert(a); - a->paint(p, get_text_colour(), _text_size.height(), - left, right, samples_per_pixel, pixels_offset, y); - } -} - -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); - - menu->addSeparator(); - - QAction *const del = new QAction(tr("Delete"), this); - del->setShortcuts(QKeySequence::Delete); - connect(del, SIGNAL(triggered()), this, SLOT(on_delete())); - menu->addAction(del); - - return menu; -} - -void DecodeSignal::draw_error(QPainter &p, const QString &message, - int left, int right) -{ - const int y = get_y(); - - p.setPen(ErrorBgColour.darker()); - p.setBrush(ErrorBgColour); - - const QRectF bounding_rect = - QRectF(left, INT_MIN / 2 + y, right - left, INT_MAX); - const QRectF text_rect = p.boundingRect(bounding_rect, - Qt::AlignCenter, message); - const float r = text_rect.height() / 4; - - p.drawRoundedRect(text_rect.adjusted(-r, -r, r, r), r, r, - Qt::AbsoluteSize); - - p.setPen(get_text_colour()); - 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) - _view->update_viewport(); -} - -void DecodeSignal::delete_pressed() -{ - on_delete(); -} - -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 deleted file mode 100644 index 7977c1c3..00000000 --- a/pv/view/decodesignal.h +++ /dev/null @@ -1,113 +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_VIEW_DECODESIGNAL_H -#define PULSEVIEW_PV_VIEW_DECODESIGNAL_H - -#include "trace.h" - -#include - -#include - -#include - -struct srd_probe; - -class QComboBox; - -namespace pv { - -namespace data { -class Decoder; -} - -namespace view { - -class DecodeSignal : public Trace -{ - Q_OBJECT - -private: - static const QColor DecodeColours[4]; - static const QColor ErrorBgColour; - -public: - DecodeSignal(pv::SigSession &session, - boost::shared_ptr decoder, int index); - - bool enabled() const; - - const boost::shared_ptr& decoder() const; - - void set_view(pv::view::View *view); - - /** - * Paints the background layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param left the x-coordinate of the left edge of the signal. - * @param right the x-coordinate of the right edge of the signal. - **/ - void paint_back(QPainter &p, int left, int right); - - /** - * Paints the mid-layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param left the x-coordinate of the left edge of the signal - * @param right the x-coordinate of the right edge of the signal - **/ - 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(); - -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 -} // namespace pv - -#endif // PULSEVIEW_PV_VIEW_DECODESIGNAL_H diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp new file mode 100644 index 00000000..28443673 --- /dev/null +++ b/pv/view/decodetrace.cpp @@ -0,0 +1,301 @@ +/* + * 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 +#include +#include +#include + +#include "decodetrace.h" + +#include +#include +#include +#include +#include + +using namespace boost; +using namespace std; + +namespace pv { +namespace view { + +const QColor DecodeTrace::DecodeColours[4] = { + QColor(0xEF, 0x29, 0x29), // Red + QColor(0xFC, 0xE9, 0x4F), // Yellow + QColor(0x8A, 0xE2, 0x34), // Green + QColor(0x72, 0x9F, 0xCF) // Blue +}; + +const QColor DecodeTrace::ErrorBgColour = QColor(0xEF, 0x29, 0x29); + +DecodeTrace::DecodeTrace(pv::SigSession &session, + boost::shared_ptr decoder, int index) : + Trace(session, QString(decoder->decoder()->name)), + _decoder(decoder), + _binding(decoder) +{ + assert(_decoder); + + _colour = DecodeColours[index % countof(DecodeColours)]; + + connect(_decoder.get(), SIGNAL(new_decode_data()), + this, SLOT(on_new_decode_data())); +} + +bool DecodeTrace::enabled() const +{ + return true; +} + +const boost::shared_ptr& DecodeTrace::decoder() const +{ + return _decoder; +} + +void DecodeTrace::set_view(pv::view::View *view) +{ + assert(view); + Trace::set_view(view); +} + +void DecodeTrace::paint_back(QPainter &p, int left, int right) +{ + paint_axis(p, get_y(), left, right); +} + +void DecodeTrace::paint_mid(QPainter &p, int left, int right) +{ + using namespace pv::view::decode; + + assert(_decoder); + const QString err = _decoder->error_message(); + if (!err.isEmpty()) { + draw_error(p, err, left, right); + return; + } + + assert(_view); + const int y = get_y(); + + const double scale = _view->scale(); + assert(scale > 0); + + double samplerate = _decoder->get_samplerate(); + + // Show sample rate as 1Hz when it is unknown + if (samplerate == 0.0) + samplerate = 1.0; + + const double pixels_offset = (_view->offset() - + _decoder->get_start_time()) / scale; + const double samples_per_pixel = samplerate * scale; + + assert(_decoder); + vector< shared_ptr > annotations(_decoder->annotations()); + BOOST_FOREACH(shared_ptr a, annotations) { + assert(a); + a->paint(p, get_text_colour(), _text_size.height(), + left, right, samples_per_pixel, pixels_offset, y); + } +} + +void DecodeTrace::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* DecodeTrace::create_context_menu(QWidget *parent) +{ + QMenu *const menu = Trace::create_context_menu(parent); + + menu->addSeparator(); + + QAction *const del = new QAction(tr("Delete"), this); + del->setShortcuts(QKeySequence::Delete); + connect(del, SIGNAL(triggered()), this, SLOT(on_delete())); + menu->addAction(del); + + return menu; +} + +void DecodeTrace::draw_error(QPainter &p, const QString &message, + int left, int right) +{ + const int y = get_y(); + + p.setPen(ErrorBgColour.darker()); + p.setBrush(ErrorBgColour); + + const QRectF bounding_rect = + QRectF(left, INT_MIN / 2 + y, right - left, INT_MAX); + const QRectF text_rect = p.boundingRect(bounding_rect, + Qt::AlignCenter, message); + const float r = text_rect.height() / 4; + + p.drawRoundedRect(text_rect.adjusted(-r, -r, r, r), r, r, + Qt::AbsoluteSize); + + p.setPen(get_text_colour()); + p.drawText(text_rect, message); +} + +QComboBox* DecodeTrace::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 DecodeTrace::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 DecodeTrace::on_new_decode_data() +{ + if (_view) + _view->update_viewport(); +} + +void DecodeTrace::delete_pressed() +{ + on_delete(); +} + +void DecodeTrace::on_delete() +{ + _session.remove_decode_signal(this); +} + +void DecodeTrace::on_probe_selected(int) +{ + commit_probes(); +} + +} // namespace view +} // namespace pv diff --git a/pv/view/decodetrace.h b/pv/view/decodetrace.h new file mode 100644 index 00000000..6f7182f4 --- /dev/null +++ b/pv/view/decodetrace.h @@ -0,0 +1,113 @@ +/* + * 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_VIEW_DECODETRACE_H +#define PULSEVIEW_PV_VIEW_DECODETRACE_H + +#include "trace.h" + +#include + +#include + +#include + +struct srd_probe; + +class QComboBox; + +namespace pv { + +namespace data { +class Decoder; +} + +namespace view { + +class DecodeTrace : public Trace +{ + Q_OBJECT + +private: + static const QColor DecodeColours[4]; + static const QColor ErrorBgColour; + +public: + DecodeTrace(pv::SigSession &session, + boost::shared_ptr decoder, int index); + + bool enabled() const; + + const boost::shared_ptr& decoder() const; + + void set_view(pv::view::View *view); + + /** + * Paints the background layer of the trace with a QPainter + * @param p the QPainter to paint into. + * @param left the x-coordinate of the left edge of the signal. + * @param right the x-coordinate of the right edge of the signal. + **/ + void paint_back(QPainter &p, int left, int right); + + /** + * Paints the mid-layer of the trace with a QPainter + * @param p the QPainter to paint into. + * @param left the x-coordinate of the left edge of the signal + * @param right the x-coordinate of the right edge of the signal + **/ + 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(); + +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 +} // namespace pv + +#endif // PULSEVIEW_PV_VIEW_DECODETRACE_H diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 42a2f79f..4cfb3978 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -30,7 +30,7 @@ #include #include -#include "decodesignal.h" +#include "decodetrace.h" #include "header.h" #include "ruler.h" #include "signal.h" @@ -168,7 +168,7 @@ vector< shared_ptr > View::get_traces() const { const vector< shared_ptr > sigs( session().get_signals()); - const vector< shared_ptr > decode_sigs( + const vector< shared_ptr > decode_sigs( session().get_decode_signals()); vector< shared_ptr > traces( sigs.size() + decode_sigs.size()); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e55e20de..6e578b70 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -54,7 +54,7 @@ set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/view/analogsignal.cpp ${PROJECT_SOURCE_DIR}/pv/view/cursor.cpp ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp - ${PROJECT_SOURCE_DIR}/pv/view/decodesignal.cpp + ${PROJECT_SOURCE_DIR}/pv/view/decodetrace.cpp ${PROJECT_SOURCE_DIR}/pv/view/header.cpp ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.cpp ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.cpp @@ -85,7 +85,7 @@ set(pulseview_TEST_HEADERS ${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/decodetrace.h ${PROJECT_SOURCE_DIR}/pv/view/header.h ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.h ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.h diff --git a/test/data/decoder.cpp b/test/data/decoder.cpp index 0a54a866..6a48fb04 100644 --- a/test/data/decoder.cpp +++ b/test/data/decoder.cpp @@ -26,7 +26,7 @@ #include "../../pv/data/decoder.h" #include "../../pv/devicemanager.h" #include "../../pv/sigsession.h" -#include "../../pv/view/decodesignal.h" +#include "../../pv/view/decodetrace.h" using namespace boost; using namespace std; @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(TwoDecoder) ss.add_decoder(dec); // Check the signals were created - const vector< shared_ptr > sigs = + const vector< shared_ptr > sigs = ss.get_decode_signals(); shared_ptr dec0 = sigs[0]->decoder();