shared_ptr<data::Decoder> decoder(
new data::Decoder(dec, probes));
shared_ptr<view::DecodeSignal> d(
- new view::DecodeSignal(*this, decoder));
+ new view::DecodeSignal(*this, decoder,
+ _decode_traces.size()));
_decode_traces.push_back(d);
}
signals_changed();
#include <libsigrokdecode/libsigrokdecode.h>
}
+#include <extdef.h>
+
#include "decodesignal.h"
+#include <pv/sigsession.h>
#include <pv/data/decoder.h>
#include <pv/view/view.h>
#include <pv/view/decode/annotation.h>
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
+};
+
DecodeSignal::DecodeSignal(pv::SigSession &session,
- boost::shared_ptr<pv::data::Decoder> decoder) :
+ boost::shared_ptr<pv::data::Decoder> decoder, int index) :
Trace(session, QString(decoder->get_decoder()->name)),
_decoder(decoder)
{
assert(_decoder);
- _colour = Qt::red;
+ _colour = DecodeColours[index % countof(DecodeColours)];
}
void DecodeSignal::init_context_bar_actions(QWidget *parent)
{
Q_OBJECT
+private:
+ static const QColor DecodeColours[4];
+
public:
DecodeSignal(pv::SigSession &session,
- boost::shared_ptr<pv::data::Decoder> decoder);
+ boost::shared_ptr<pv::data::Decoder> decoder, int index);
void init_context_bar_actions(QWidget *parent);