X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fsignalbase.hpp;h=6667dd76847cab8ce3235c99d6ec19deb73544fb;hp=db1af1c718e4ddb0b8262b6790b5e2fd9afea2da;hb=efdec55aec1a137460fa362a381ed1904182bfed;hpb=bf0edd2b0cbb5f4bd5d69b0f00bcea7d037e2287 diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index db1af1c..6667dd7 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,6 +23,7 @@ #include #include +#include #include #include @@ -37,6 +37,11 @@ class ChannelType; namespace pv { namespace data { +class Analog; +class DecoderStack; +class Logic; +class SignalData; + class SignalBase : public QObject { Q_OBJECT @@ -80,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. */ @@ -100,6 +110,34 @@ public: */ QColor bgcolour() const; + /** + * Sets the internal data object. + */ + void set_data(std::shared_ptr data); + + /** + * Get the internal data as analog data object in case of analog type. + */ + std::shared_ptr analog_data() const; + + /** + * Get the internal data as logic data object in case of logic type. + */ + std::shared_ptr logic_data() const; + +#ifdef ENABLE_DECODE + bool is_decode_signal() const; + + std::shared_ptr decoder_stack() const; + + void set_decoder_stack(std::shared_ptr + decoder_stack); +#endif + + void save_settings(QSettings &settings) const; + + void restore_settings(QSettings &settings); + Q_SIGNALS: void enabled_changed(const bool &value); @@ -109,7 +147,13 @@ Q_SIGNALS: private: std::shared_ptr channel_; - QString name_; + std::shared_ptr data_; + +#ifdef ENABLE_DECODE + std::shared_ptr decoder_stack_; +#endif + + QString internal_name_, name_; QColor colour_, bgcolour_; };