]> sigrok.org Git - pulseview.git/blobdiff - pv/view/logicsignal.h
LogicSignal: Ported triggers to new API
[pulseview.git] / pv / view / logicsignal.h
index cc63884e586b9f5ae253067e25aa3303be8af3cc..958abd8f1890c26f7661ee75884b9d3cc096b3ed 100644 (file)
 
 #include "signal.h"
 
-#include <boost/shared_ptr.hpp>
+#include <memory>
 
 class QToolBar;
 
+namespace sigrok {
+       class Device;
+       class TriggerMatchType;
+}
+
 namespace pv {
 
 namespace data {
@@ -49,15 +54,16 @@ private:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(boost::shared_ptr<pv::DevInst> dev_inst,
-               sr_probe *const probe,
-               boost::shared_ptr<pv::data::Logic> data);
+       LogicSignal(pv::SigSession &session,
+               std::shared_ptr<sigrok::Device> device,
+               std::shared_ptr<sigrok::Channel> channel,
+               std::shared_ptr<pv::data::Logic> data);
 
        virtual ~LogicSignal();
 
-       boost::shared_ptr<pv::data::SignalData> data() const;
+       std::shared_ptr<pv::data::SignalData> data() const;
 
-       boost::shared_ptr<pv::data::Logic> logic_data() const;
+       std::shared_ptr<pv::data::Logic> logic_data() const;
 
        /**
         * Paints the background layer of the signal with a QPainter
@@ -76,7 +82,6 @@ public:
        void paint_mid(QPainter &p, int left, int right);
 
 private:
-
        void paint_caps(QPainter &p, QLineF *const lines,
                std::vector< std::pair<int64_t, bool> > &edges,
                bool level, double samples_per_pixel, double pixels_offset,
@@ -84,26 +89,19 @@ private:
 
        void init_trigger_actions(QWidget *parent);
 
+       QAction* match_action(const sigrok::TriggerMatchType *match);
+       const sigrok::TriggerMatchType *action_match(QAction *action);
        void populate_popup_form(QWidget *parent, QFormLayout *form);
-       
-       void add_trigger_action(const char *trig_types, char type,
-               QAction *action);
-
-       void update_trigger_actions();
-
-       void set_trigger(char type);
+       void modify_trigger();
 
-private slots:
-       void on_trigger_none();
-       void on_trigger_rising();
-       void on_trigger_high();
-       void on_trigger_falling();
-       void on_trigger_low();
-       void on_trigger_change();
+private Q_SLOTS:
+       void on_trigger();
 
 private:
-       boost::shared_ptr<pv::data::Logic> _data;
+       std::shared_ptr<sigrok::Device> _device;
+       std::shared_ptr<pv::data::Logic> _data;
 
+       const sigrok::TriggerMatchType *_trigger_match;
        QToolBar *_trigger_bar;
        QAction *_trigger_none;
        QAction *_trigger_rising;