X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fsignalbase.hpp;h=a2d23244f0e1d007aad79543f909fce796c8ab0c;hp=322bdf48e8c3a026d2156aa6ab75e05b024e9935;hb=06b6ce26694bdde31c7d5b703c4dda36f4a25938;hpb=27a3f09baf61c7f9b8c07630d34df75ddfdd476b diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index 322bdf48..a2d23244 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -55,11 +55,11 @@ class SignalBase : public QObject public: enum ChannelType { - AnalogChannel = 1, - LogicChannel, - DecodeChannel, - A2LChannel, // Analog converted to logic, joint representation - MathChannel + AnalogChannel = 1, ///< Analog data + LogicChannel, ///< Logic data + DecodeChannel, ///< Protocol Decoder channel using libsigrokdecode + A2LChannel, ///< Analog converted to logic, joint representation + MathChannel ///< Virtual channel generated by math operations }; enum ConversionType { @@ -157,6 +157,11 @@ public: */ shared_ptr logic_data() const; + /** + * Queries the kind of conversion performed on this channel. + */ + ConversionType get_conversion_type() const; + /** * Changes the kind of conversion performed on this channel. */ @@ -171,6 +176,8 @@ 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); @@ -207,7 +214,7 @@ protected: ChannelType channel_type_; shared_ptr data_; shared_ptr converted_data_; - int conversion_type_; + ConversionType conversion_type_; std::thread conversion_thread_; atomic conversion_interrupt_;