]> sigrok.org Git - pulseview.git/blobdiff - pv/views/decoder_binary/QHexView.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / views / decoder_binary / QHexView.hpp
index c39dcb2099064064570fd45b52da834303f76ea4..4ba995e30148e44ed479adb01fe46dd14e4f18be 100644 (file)
@@ -27,8 +27,8 @@
  * SOFTWARE.
  */
 
-#ifndef PULSEVIEW_PV_VIEWS_DECODERBINARY_QHEXVIEW_H
-#define PULSEVIEW_PV_VIEWS_DECODERBINARY_QHEXVIEW_H
+#ifndef PULSEVIEW_PV_VIEWS_DECODER_BINARY_QHEXVIEW_HPP
+#define PULSEVIEW_PV_VIEWS_DECODER_BINARY_QHEXVIEW_HPP
 
 #include <QAbstractScrollArea>
 
@@ -54,6 +54,13 @@ public:
 
        void set_mode(Mode m);
        void set_data(const DecodeBinaryClass* data);
+
+       /* Sets range of samples that are visible in the main view */
+       void set_visible_sample_range(uint64_t start, uint64_t end);
+
+       /* Sets sample whose associated data we should highlight */
+       void set_highlighted_data_sample(uint64_t sample);
+
        unsigned int get_bytes_per_line() const;
 
        void clear();
@@ -67,7 +74,7 @@ public:
 
 protected:
        void initialize_byte_iterator(size_t offset);
-       uint8_t get_next_byte(bool* is_next_chunk = nullptr);
+       uint8_t get_next_byte(bool* is_new_chunk = nullptr);
 
        void paintEvent(QPaintEvent *event);
        void keyPressEvent(QKeyEvent *event);
@@ -91,11 +98,17 @@ private:
        size_t posAddr_, posHex_, posAscii_;
        size_t charWidth_, charHeight_;
        size_t selectBegin_, selectEnd_, selectInit_, cursorPos_;
+       uint8_t address_digits_;
 
        size_t current_chunk_id_, current_chunk_offset_, current_offset_;
        DecodeBinaryDataChunk current_chunk_; // Cache locally so that we're not messed up when the vector is re-allocating its data
+       uint64_t current_chunk_sample_, next_chunk_sample_;
+
+       pair<uint64_t, uint64_t> visible_range_;
+       uint64_t highlighted_sample_;
 
        vector<QColor> chunk_colors_;
+       QColor visible_range_color_;
 };
 
-#endif /* PULSEVIEW_PV_VIEWS_DECODERBINARY_QHEXVIEW_H */
+#endif // PULSEVIEW_PV_VIEWS_DECODER_BINARY_QHEXVIEW_HPP