]> sigrok.org Git - pulseview.git/commitdiff
SignalBase: Add internal name
authorSoeren Apel <redacted>
Sun, 28 Aug 2016 15:44:42 +0000 (17:44 +0200)
committerSoeren Apel <redacted>
Sun, 28 Aug 2016 15:44:42 +0000 (17:44 +0200)
pv/data/signalbase.cpp
pv/data/signalbase.hpp

index 3adf3338dc4d7cd4f6f41988bf667fab90ad1af3..d2dd75ab60f684b65a02611a24c6b4b6283baedb 100644 (file)
@@ -41,6 +41,8 @@ const int SignalBase::ColourBGAlpha = 8*256/100;
 SignalBase::SignalBase(shared_ptr<sigrok::Channel> channel) :
        channel_(channel)
 {
+       if (channel_)
+               internal_name_ = QString::fromStdString(channel_->name());
 }
 
 shared_ptr<sigrok::Channel> SignalBase::channel() const
@@ -53,6 +55,11 @@ QString SignalBase::name() const
        return (channel_) ? QString::fromStdString(channel_->name()) : name_;
 }
 
+QString SignalBase::internal_name() const
+{
+       return internal_name_;
+}
+
 void SignalBase::set_name(QString name)
 {
        if (channel_)
index a682a56e1f52cadbb60a8a3a1dba9a80e2eacbc2..2b3f2f1cb5a35368c5fefae6cd03e2902c531bbd 100644 (file)
@@ -85,6 +85,11 @@ public:
         */
        QString name() const;
 
+       /**
+        * Gets the internal name of this signal, i.e. how the device calls it.
+        */
+       QString internal_name() const;
+
        /**
         * Sets the name of the signal.
         */
@@ -144,7 +149,7 @@ private:
        std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
 #endif
 
-       QString name_;
+       QString internal_name_, name_;
        QColor colour_, bgcolour_;
 };