X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fsignalbase.hpp;h=468a2032812cba3b7611f1d6cf5dcfa718fe0bc5;hb=963be49714665b5b12b29937875d432660ff4bc1;hp=90a13555fb41938db36eb6063aef096bc6da20ef;hpb=bcaf033478ecf9a482f53b3dc973b7d2b9c4c52b;p=pulseview.git diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index 90a13555..468a2032 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -21,6 +21,8 @@ #ifndef PULSEVIEW_PV_DATA_SIGNALBASE_HPP #define PULSEVIEW_PV_DATA_SIGNALBASE_HPP +#include +#include #include #include @@ -30,6 +32,9 @@ #include +using std::atomic; +using std::condition_variable; +using std::mutex; using std::shared_ptr; namespace sigrok { @@ -94,10 +99,19 @@ public: ChannelType type() const; /** - * Gets the index number of this channel. + * Gets the index number of this channel, i.e. a unique ID assigned by + * the device driver. */ unsigned int index() const; + /** + * Returns which bit of a given sample for this signal represents the + * signal itself. This is relevant for compound signals like logic, + * rather meaningless for everything else but provided in case there + * is a conversion active that provides a digital signal using bit #0. + */ + unsigned int logic_bit_index() const; + /** * Gets the name of this signal. */ @@ -157,12 +171,16 @@ public: virtual void restore_settings(QSettings &settings); private: + bool conversion_is_a2l() const; + uint8_t convert_a2l_threshold(float threshold, float value); uint8_t convert_a2l_schmitt_trigger(float lo_thr, float hi_thr, float value, uint8_t &state); - void conversion_thread_proc(QObject* segment, uint64_t start_sample, - uint64_t end_sample); + void conversion_thread_proc(QObject* segment); + + void start_conversion(); + void stop_conversion(); Q_SIGNALS: void enabled_changed(const bool &value); @@ -194,6 +212,9 @@ protected: int conversion_type_; std::thread conversion_thread_; + atomic conversion_interrupt_; + mutex conversion_input_mutex_; + condition_variable conversion_input_cond_; QString internal_name_, name_; QColor colour_, bgcolour_;