X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fruler.hpp;h=55c156f5942e34f8a97912322b25a3b2df4c669b;hb=20c99cfc69d3c7430817abd9a1f810698deb4a18;hp=8c1876cced37f5e2598f655a51e309eff0c4fbd7;hpb=4bc9230c442427a27a3934ce5ff6ff4fdd4e0855;p=pulseview.git diff --git a/pv/views/trace/ruler.hpp b/pv/views/trace/ruler.hpp index 8c1876cc..55c156f5 100644 --- a/pv/views/trace/ruler.hpp +++ b/pv/views/trace/ruler.hpp @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP -#define PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP +#ifndef PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP #include #include @@ -117,11 +117,18 @@ public: unsigned precision = 0, bool sign = true); - pv::util::Timestamp get_time_from_x_pos(uint32_t x); + pv::util::Timestamp get_absolute_time_from_x_pos(uint32_t x) const; + pv::util::Timestamp get_ruler_time_from_x_pos(uint32_t x) const; + + pv::util::Timestamp get_ruler_time_from_absolute_time(const pv::util::Timestamp& abs_time) const; + pv::util::Timestamp get_absolute_time_from_ruler_time(const pv::util::Timestamp& ruler_time) const; + + shared_ptr get_reference_item() const; protected: virtual void contextMenuEvent(QContextMenuEvent *event) override; void resizeEvent(QResizeEvent*) override; + virtual void item_hover(const shared_ptr &item, QPoint pos) override; private: /** @@ -171,11 +178,13 @@ private: function format_function); private Q_SLOTS: - void hover_point_changed(const QPoint &hp); + void on_hover_point_changed(const QWidget* widget, const QPoint &hp); void invalidate_tick_position_cache(); void on_createMarker(); + void on_setZeroPosition(); + void on_resetZeroPosition(); void on_toggleHoverMarker(); private: @@ -185,6 +194,8 @@ private: */ boost::optional tick_position_cache_; + shared_ptr hover_item_; + uint32_t context_menu_x_pos_; }; @@ -192,4 +203,4 @@ private: } // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP