]> sigrok.org Git - pulseview.git/blobdiff - pv/view/logicsignal.h
LogicSignal: Ported triggers to new API
[pulseview.git] / pv / view / logicsignal.h
index 8b977ae285b5dd3098637db533a6e78abd25b0e2..958abd8f1890c26f7661ee75884b9d3cc096b3ed 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_LOGICSIGNAL_H
-#define PULSEVIEW_PV_LOGICSIGNAL_H
+#ifndef PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
+#define PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
 
 #include "signal.h"
 
-#include <boost/shared_ptr.hpp>
+#include <memory>
+
+class QToolBar;
+
+namespace sigrok {
+       class Device;
+       class TriggerMatchType;
+}
 
 namespace pv {
 
@@ -47,12 +54,16 @@ private:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(pv::SigSession &session, const 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::Logic> data() const;
+       std::shared_ptr<pv::data::SignalData> data() const;
+
+       std::shared_ptr<pv::data::Logic> logic_data() const;
 
        /**
         * Paints the background layer of the signal with a QPainter
@@ -71,27 +82,27 @@ 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,
                float x_offset, float y_offset);
 
-       void update_trigger_actions();
+       void init_trigger_actions(QWidget *parent);
 
-       void set_trigger(char type);
+       QAction* match_action(const sigrok::TriggerMatchType *match);
+       const sigrok::TriggerMatchType *action_match(QAction *action);
+       void populate_popup_form(QWidget *parent, QFormLayout *form);
+       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;
        QAction *_trigger_high;
@@ -103,4 +114,4 @@ private:
 } // namespace view
 } // namespace pv
 
-#endif // PULSEVIEW_PV_LOGICSIGNAL_H
+#endif // PULSEVIEW_PV_VIEW_LOGICSIGNAL_H