projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use QApplication metadata for persistent storage
[pulseview.git]
/
pv
/
view
/
decodetrace.cpp
diff --git
a/pv/view/decodetrace.cpp
b/pv/view/decodetrace.cpp
index f82175107adc998f8cfce5288c9e468b1fd54ab1..c8a20dc3c9c6cf7eb3888080351e624ba38349c7 100644
(file)
--- a/
pv/view/decodetrace.cpp
+++ b/
pv/view/decodetrace.cpp
@@
-24,7
+24,6
@@
extern "C" {
#include <extdef.h>
#include <extdef.h>
-#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <QAction>
#include <boost/functional/hash.hpp>
#include <QAction>
@@
-48,12
+47,12
@@
extern "C" {
#include <pv/widgets/decodergroupbox.h>
#include <pv/widgets/decodermenu.h>
#include <pv/widgets/decodergroupbox.h>
#include <pv/widgets/decodermenu.h>
-using boost::dynamic_pointer_cast;
-using boost::shared_ptr;
+using std::dynamic_pointer_cast;
using std::list;
using std::max;
using std::map;
using std::min;
using std::list;
using std::max;
using std::map;
using std::min;
+using std::shared_ptr;
using std::vector;
namespace pv {
using std::vector;
namespace pv {
@@
-112,7
+111,7
@@
const QColor DecodeTrace::OutlineColours[16] = {
};
DecodeTrace::DecodeTrace(pv::SigSession &session,
};
DecodeTrace::DecodeTrace(pv::SigSession &session,
-
boost
::shared_ptr<pv::data::DecoderStack> decoder_stack, int index) :
+
std
::shared_ptr<pv::data::DecoderStack> decoder_stack, int index) :
Trace(QString::fromUtf8(
decoder_stack->stack().front()->decoder()->name)),
_session(session),
Trace(QString::fromUtf8(
decoder_stack->stack().front()->decoder()->name)),
_session(session),
@@
-137,7
+136,7
@@
bool DecodeTrace::enabled() const
return true;
}
return true;
}
-const
boost
::shared_ptr<pv::data::DecoderStack>& DecodeTrace::decoder() const
+const
std
::shared_ptr<pv::data::DecoderStack>& DecodeTrace::decoder() const
{
return _decoder_stack;
}
{
return _decoder_stack;
}
@@
-214,7
+213,7
@@
void DecodeTrace::paint_mid(QPainter &p, int left, int right)
_decoder_stack->get_annotation_subset(annotations, row,
start_sample, end_sample);
if (!annotations.empty()) {
_decoder_stack->get_annotation_subset(annotations, row,
start_sample, end_sample);
if (!annotations.empty()) {
-
BOOST_FOREACH(const Annotation &a,
annotations)
+
for (const Annotation &a :
annotations)
draw_annotation(a, p, get_text_colour(),
annotation_height, left, right,
samples_per_pixel, pixels_offset, y,
draw_annotation(a, p, get_text_colour(),
annotation_height, left, right,
samples_per_pixel, pixels_offset, y,
@@
-289,7
+288,7
@@
void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form)
// Add the decoder options
_bindings.clear();
// Add the decoder options
_bindings.clear();
- _
probe
_selectors.clear();
+ _
channel
_selectors.clear();
_decoder_forms.clear();
const list< shared_ptr<Decoder> >& stack = _decoder_stack->stack();
_decoder_forms.clear();
const list< shared_ptr<Decoder> >& stack = _decoder_stack->stack();
@@
-429,7
+428,7
@@
void DecodeTrace::draw_range(const pv::data::decode::Annotation &a, QPainter &p,
QString best_annotation;
int best_width = 0;
QString best_annotation;
int best_width = 0;
-
BOOST_FOREACH(const QString &a,
annotations) {
+
for (const QString &a :
annotations) {
const int w = p.boundingRect(QRectF(), 0, a).width();
if (w <= rect.width() && w > best_width)
best_annotation = a, best_width = w;
const int w = p.boundingRect(QRectF(), 0, a).width();
if (w <= rect.width() && w > best_width)
best_annotation = a, best_width = w;
@@
-477,10
+476,10
@@
void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
const list< shared_ptr<Decoder> > &stack = _decoder_stack->stack();
const list< shared_ptr<Decoder> > &stack = _decoder_stack->stack();
- // We get the logic data of the first
probe
in the list.
+ // We get the logic data of the first
channel
in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
-
BOOST_FOREACH (const shared_ptr<Decoder> &dec,
stack)
+
for (const shared_ptr<Decoder> &dec :
stack)
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
@@
-545,30
+544,30
@@
void DecodeTrace::create_decoder_form(int index,
for(l = decoder->channels; l; l = l->next) {
const struct srd_channel *const pdch =
(struct srd_channel *)l->data;
for(l = decoder->channels; l; l = l->next) {
const struct srd_channel *const pdch =
(struct srd_channel *)l->data;
- QComboBox *const combo = create_
probe
_selector(parent, dec, pdch);
+ QComboBox *const combo = create_
channel
_selector(parent, dec, pdch);
connect(combo, SIGNAL(currentIndexChanged(int)),
connect(combo, SIGNAL(currentIndexChanged(int)),
- this, SLOT(on_
probe
_selected(int)));
+ this, SLOT(on_
channel
_selected(int)));
decoder_form->addRow(tr("<b>%1</b> (%2) *")
.arg(QString::fromUtf8(pdch->name))
.arg(QString::fromUtf8(pdch->desc)), combo);
decoder_form->addRow(tr("<b>%1</b> (%2) *")
.arg(QString::fromUtf8(pdch->name))
.arg(QString::fromUtf8(pdch->desc)), combo);
- const
Probe
Selector s = {combo, dec, pdch};
- _
probe
_selectors.push_back(s);
+ const
Channel
Selector s = {combo, dec, pdch};
+ _
channel
_selectors.push_back(s);
}
// Add the optional channels
for(l = decoder->opt_channels; l; l = l->next) {
const struct srd_channel *const pdch =
(struct srd_channel *)l->data;
}
// Add the optional channels
for(l = decoder->opt_channels; l; l = l->next) {
const struct srd_channel *const pdch =
(struct srd_channel *)l->data;
- QComboBox *const combo = create_
probe
_selector(parent, dec, pdch);
+ QComboBox *const combo = create_
channel
_selector(parent, dec, pdch);
connect(combo, SIGNAL(currentIndexChanged(int)),
connect(combo, SIGNAL(currentIndexChanged(int)),
- this, SLOT(on_
probe
_selected(int)));
+ this, SLOT(on_
channel
_selected(int)));
decoder_form->addRow(tr("<b>%1</b> (%2)")
.arg(QString::fromUtf8(pdch->name))
.arg(QString::fromUtf8(pdch->desc)), combo);
decoder_form->addRow(tr("<b>%1</b> (%2)")
.arg(QString::fromUtf8(pdch->name))
.arg(QString::fromUtf8(pdch->desc)), combo);
- const
Probe
Selector s = {combo, dec, pdch};
- _
probe
_selectors.push_back(s);
+ const
Channel
Selector s = {combo, dec, pdch};
+ _
channel
_selectors.push_back(s);
}
// Add the options
}
// Add the options
@@
-582,7
+581,7
@@
void DecodeTrace::create_decoder_form(int index,
_decoder_forms.push_back(group);
}
_decoder_forms.push_back(group);
}
-QComboBox* DecodeTrace::create_
probe
_selector(
+QComboBox* DecodeTrace::create_
channel
_selector(
QWidget *parent, const shared_ptr<data::decode::Decoder> &dec,
const srd_channel *const pdch)
{
QWidget *parent, const shared_ptr<data::decode::Decoder> &dec,
const srd_channel *const pdch)
{
@@
-591,13
+590,13
@@
QComboBox* DecodeTrace::create_probe_selector(
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
assert(_decoder_stack);
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
assert(_decoder_stack);
- const auto
probe
_iter = dec->channels().find(pdch);
+ const auto
channel
_iter = dec->channels().find(pdch);
QComboBox *selector = new QComboBox(parent);
selector->addItem("-", qVariantFromValue((void*)NULL));
QComboBox *selector = new QComboBox(parent);
selector->addItem("-", qVariantFromValue((void*)NULL));
- if (
probe
_iter == dec->channels().end())
+ if (
channel
_iter == dec->channels().end())
selector->setCurrentIndex(0);
for(size_t i = 0; i < sigs.size(); i++) {
selector->setCurrentIndex(0);
for(size_t i = 0; i < sigs.size(); i++) {
@@
-608,7
+607,7
@@
QComboBox* DecodeTrace::create_probe_selector(
{
selector->addItem(s->get_name(),
qVariantFromValue((void*)s.get()));
{
selector->addItem(s->get_name(),
qVariantFromValue((void*)s.get()));
- if ((*
probe
_iter).second == s)
+ if ((*
channel
_iter).second == s)
selector->setCurrentIndex(i + 1);
}
}
selector->setCurrentIndex(i + 1);
}
}
@@
-616,14
+615,14
@@
QComboBox* DecodeTrace::create_probe_selector(
return selector;
}
return selector;
}
-void DecodeTrace::commit_decoder_
probe
s(shared_ptr<data::decode::Decoder> &dec)
+void DecodeTrace::commit_decoder_
channel
s(shared_ptr<data::decode::Decoder> &dec)
{
assert(dec);
{
assert(dec);
- map<const srd_channel*, shared_ptr<LogicSignal> >
probe
_map;
+ map<const srd_channel*, shared_ptr<LogicSignal> >
channel
_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
-
BOOST_FOREACH(const ProbeSelector &s, _probe
_selectors)
+
for (const ChannelSelector &s : _channel
_selectors)
{
if(s._decoder != dec)
break;
{
if(s._decoder != dec)
break;
@@
-632,23
+631,22
@@
void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
(LogicSignal*)s._combo->itemData(
s._combo->currentIndex()).value<void*>();
(LogicSignal*)s._combo->itemData(
s._combo->currentIndex()).value<void*>();
-
BOOST_FOREACH(shared_ptr<Signal> sig,
sigs)
+
for (shared_ptr<Signal> sig :
sigs)
if(sig.get() == selection) {
if(sig.get() == selection) {
-
probe
_map[s._pdch] =
+
channel
_map[s._pdch] =
dynamic_pointer_cast<LogicSignal>(sig);
break;
}
}
dynamic_pointer_cast<LogicSignal>(sig);
break;
}
}
- dec->set_
probes(probe
_map);
+ dec->set_
channels(channel
_map);
}
}
-void DecodeTrace::commit_
probe
s()
+void DecodeTrace::commit_
channel
s()
{
assert(_decoder_stack);
{
assert(_decoder_stack);
- BOOST_FOREACH(shared_ptr<data::decode::Decoder> dec,
- _decoder_stack->stack())
- commit_decoder_probes(dec);
+ for (shared_ptr<data::decode::Decoder> dec : _decoder_stack->stack())
+ commit_decoder_channels(dec);
_decoder_stack->begin_decode();
}
_decoder_stack->begin_decode();
}
@@
-669,9
+667,9
@@
void DecodeTrace::on_delete()
_session.remove_decode_signal(this);
}
_session.remove_decode_signal(this);
}
-void DecodeTrace::on_
probe
_selected(int)
+void DecodeTrace::on_
channel
_selected(int)
{
{
- commit_
probe
s();
+ commit_
channel
s();
}
void DecodeTrace::on_stack_decoder(srd_decoder *decoder)
}
void DecodeTrace::on_stack_decoder(srd_decoder *decoder)