X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fsignalbase.hpp;h=8b60c36688dcf6f1665ae8c4c7745bb4b60bcc90;hp=ca3cd5c47c8b0489490c65a66905cc0c000c3a47;hb=6f925ba9d6faf1077b73c5a5808259576081716a;hpb=cbd2a2de848f957507096785d3be1cc97d30df9a diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index ca3cd5c..8b60c36 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 @@ -24,10 +23,12 @@ #include #include +#include #include #include +using std::shared_ptr; namespace sigrok { class Channel; @@ -38,6 +39,7 @@ namespace pv { namespace data { class Analog; +class DecoderStack; class Logic; class SignalData; @@ -49,14 +51,14 @@ private: static const int ColourBGAlpha; public: - SignalBase(std::shared_ptr channel); + SignalBase(shared_ptr channel); virtual ~SignalBase() {} public: /** * Returns the underlying SR channel. */ - std::shared_ptr channel() const; + shared_ptr channel() const; /** * Returns enabled status of this channel. @@ -84,6 +86,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. */ @@ -107,18 +114,29 @@ 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; + shared_ptr decoder_stack() const; + + void set_decoder_stack(shared_ptr decoder_stack); +#endif + + void save_settings(QSettings &settings) const; + + void restore_settings(QSettings &settings); Q_SIGNALS: void enabled_changed(const bool &value); @@ -128,10 +146,14 @@ Q_SIGNALS: void colour_changed(const QColor &colour); private: - std::shared_ptr channel_; - std::shared_ptr data_; + shared_ptr channel_; + shared_ptr data_; + +#ifdef ENABLE_DECODE + shared_ptr decoder_stack_; +#endif - QString name_; + QString internal_name_, name_; QColor colour_, bgcolour_; };