return _decode_traces;
}
+void SigSession::remove_decode_signal(view::DecodeSignal *signal)
+{
+ for (vector< shared_ptr<view::DecodeSignal> >::iterator i =
+ _decode_traces.begin();
+ i != _decode_traces.end();
+ i++)
+ if ((*i).get() == signal)
+ {
+ _decode_traces.erase(i);
+ signals_changed();
+ return;
+ }
+}
+
void SigSession::set_capture_state(capture_state state)
{
lock_guard<mutex> lock(_sampling_mutex);
std::vector< boost::shared_ptr<view::DecodeSignal> >
get_decode_signals() const;
+ void remove_decode_signal(view::DecodeSignal *signal);
+
private:
void set_capture_state(capture_state state);
#include <extdef.h>
+#include <QAction>
+
#include "decodesignal.h"
#include <pv/sigsession.h>
return actions;
}
+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);
+ connect(del, SIGNAL(triggered()), this, SLOT(on_delete()));
+ menu->addAction(del);
+
+ return menu;
+}
+
void DecodeSignal::on_new_decode_data()
{
if (_view)
_view->update_viewport();
}
+void DecodeSignal::on_delete()
+{
+ _session.remove_decode_signal(this);
+}
+
} // namespace view
} // namespace pv
const std::list<QAction*> get_context_bar_actions();
+ QMenu* create_context_menu(QWidget *parent);
+
private:
/**
private slots:
void on_new_decode_data();
+ void on_delete();
+
private:
boost::shared_ptr<pv::data::Decoder> _decoder;