From: Soeren Apel Date: Sun, 28 Aug 2016 15:44:42 +0000 (+0200) Subject: SignalBase: Add internal name X-Git-Tag: pulseview-0.4.0~260 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=050b5a6c7d4864cff968d171b6cc4e68ea478835;p=pulseview.git SignalBase: Add internal name --- diff --git a/pv/data/signalbase.cpp b/pv/data/signalbase.cpp index 3adf3338..d2dd75ab 100644 --- a/pv/data/signalbase.cpp +++ b/pv/data/signalbase.cpp @@ -41,6 +41,8 @@ const int SignalBase::ColourBGAlpha = 8*256/100; SignalBase::SignalBase(shared_ptr channel) : channel_(channel) { + if (channel_) + internal_name_ = QString::fromStdString(channel_->name()); } shared_ptr 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_) diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index a682a56e..2b3f2f1c 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -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 decoder_stack_; #endif - QString name_; + QString internal_name_, name_; QColor colour_, bgcolour_; };