X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fsignalbase.hpp;h=4889d16acd4bc1ba75878cfe132e2d07b1202193;hp=54d9ee0adc2d337a87e9b3195a5223099e46e4c6;hb=472a80c58cfdbd37cb00b5ba2ef4bcd923f9b54b;hpb=6de38b17e7a9182b6557104dd3a902bb7784db95 diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index 54d9ee0a..4889d16a 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -15,8 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DATA_SIGNALBASE_HPP @@ -29,10 +28,10 @@ #include +using std::shared_ptr; namespace sigrok { class Channel; -class ChannelType; } namespace pv { @@ -47,18 +46,27 @@ class SignalBase : public QObject { Q_OBJECT +public: + enum ChannelType { + AnalogChannel = 1, + LogicChannel, + DecodeChannel, + A2LChannel, // Analog converted to logic, joint representation + MathChannel + }; + private: static const int ColourBGAlpha; public: - SignalBase(std::shared_ptr channel); + SignalBase(shared_ptr channel, ChannelType channel_type); virtual ~SignalBase() {} public: /** * Returns the underlying SR channel. */ - std::shared_ptr channel() const; + shared_ptr channel() const; /** * Returns enabled status of this channel. @@ -74,7 +82,7 @@ public: /** * Gets the type of this channel. */ - const sigrok::ChannelType *type() const; + ChannelType type() const; /** * Gets the index number of this channel. @@ -114,25 +122,24 @@ public: /** * Sets the internal data object. */ - void set_data(std::shared_ptr data); + void set_data(shared_ptr data); /** * Get the internal data as analog data object in case of analog type. */ - std::shared_ptr analog_data() const; + shared_ptr analog_data() const; /** * Get the internal data as logic data object in case of logic type. */ - std::shared_ptr logic_data() const; + shared_ptr logic_data() const; #ifdef ENABLE_DECODE bool is_decode_signal() const; - std::shared_ptr decoder_stack() const; + shared_ptr decoder_stack() const; - void set_decoder_stack(std::shared_ptr - decoder_stack); + void set_decoder_stack(shared_ptr decoder_stack); #endif void save_settings(QSettings &settings) const; @@ -147,11 +154,12 @@ Q_SIGNALS: void colour_changed(const QColor &colour); private: - std::shared_ptr channel_; - std::shared_ptr data_; + shared_ptr channel_; + ChannelType channel_type_; + shared_ptr data_; #ifdef ENABLE_DECODE - std::shared_ptr decoder_stack_; + shared_ptr decoder_stack_; #endif QString internal_name_, name_;