pv/sigsession.cpp
pv/data/analog.cpp
pv/data/analogsnapshot.cpp
+ pv/data/decoder.cpp
pv/data/logic.cpp
pv/data/logicsnapshot.cpp
pv/data/signaldata.cpp
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * 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
+ */
+
+#include "decoder.h"
+
+namespace pv {
+namespace data {
+
+Decoder::Decoder(const srd_decoder *const dec) :
+ _decoder(dec)
+{
+}
+
+const srd_decoder* Decoder::get_decoder() const
+{
+ return _decoder;
+}
+
+void Decoder::clear_snapshots()
+{
+}
+
+} // namespace data
+} // namespace pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * 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_DATA_DECODER_H
+#define PULSEVIEW_PV_DATA_DECODER_H
+
+#include "signaldata.h"
+
+struct srd_decoder;
+
+namespace pv {
+namespace data {
+
+class Decoder : public SignalData
+{
+public:
+ Decoder(const srd_decoder *const dec);
+
+ const srd_decoder* get_decoder() const;
+
+ void clear_snapshots();
+
+private:
+ const srd_decoder *const _decoder;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_DECODER_H
#include "sigsession.h"
#include "devicemanager.h"
+
#include "data/analog.h"
#include "data/analogsnapshot.h"
+#include "data/decoder.h"
#include "data/logic.h"
#include "data/logicsnapshot.h"
void SigSession::add_decoder(srd_decoder *const dec)
{
{
- shared_ptr<view::DecodeSignal> d(new view::DecodeSignal(*this, dec));
+ lock_guard<mutex> lock(_signals_mutex);
+ shared_ptr<data::Decoder> decoder(
+ new data::Decoder(dec));
+ shared_ptr<view::DecodeSignal> d(
+ new view::DecodeSignal(*this, decoder));
_decode_traces.push_back(d);
}
signals_changed();
#include "decodesignal.h"
+#include <pv/data/decoder.h>
+
using namespace boost;
using namespace std;
namespace pv {
namespace view {
-DecodeSignal::DecodeSignal(pv::SigSession &session, srd_decoder *const dec) :
- Trace(session, QString(dec->name)),
- _decoder(dec)
+DecodeSignal::DecodeSignal(pv::SigSession &session,
+ boost::shared_ptr<pv::data::Decoder> decoder) :
+ Trace(session, QString(decoder->get_decoder()->name)),
+ _decoder(decoder)
{
_colour = Qt::red;
}
#include <boost/shared_ptr.hpp>
namespace pv {
+
+namespace data {
+class Decoder;
+}
+
namespace view {
class DecodeSignal : public Trace
{
public:
- DecodeSignal(pv::SigSession &session, srd_decoder *const dec);
+ DecodeSignal(pv::SigSession &session,
+ boost::shared_ptr<pv::data::Decoder> decoder);
void init_context_bar_actions(QWidget *parent);
int get_nominal_offset(const QRect &rect) const;
private:
- srd_decoder *const _decoder;
+ boost::shared_ptr<pv::data::Decoder> _decoder;
};
} // namespace view