ngscopeclient 0.1-dev+51fbda87c
Stream.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef Stream_h
36#define Stream_h
37
38#include "Waveform.h"
39
47class Stream
48{
49public:
50 Stream();
51
58 {
59 //Conventional time-series waveforms (or similar graphs like a FFT)
60 STREAM_TYPE_ANALOG,
61 STREAM_TYPE_DIGITAL,
62 STREAM_TYPE_DIGITAL_BUS,
63
64 //2D density plots
65 STREAM_TYPE_EYE,
66 STREAM_TYPE_SPECTROGRAM,
67 STREAM_TYPE_WATERFALL,
68 STREAM_TYPE_CONSTELLATION,
69
70 //Special channels not used for display
71 STREAM_TYPE_TRIGGER, //external trigger input, doesn't have data capture
72
73 //Class datatype from a protocol decoder
74 STREAM_TYPE_PROTOCOL,
75
76 //Single analog value
77 STREAM_TYPE_ANALOG_SCALAR,
78
79 //Other / unspecified
80 STREAM_TYPE_UNDEFINED
81 };
82
83 Stream(Unit yunit, std::string name, StreamType type, uint8_t flags = 0)
84 : m_yAxisUnit(yunit)
85 , m_name(name)
86 , m_waveform(nullptr)
87 , m_value(0)
88 , m_stype(type)
89 , m_flags(flags)
90 {}
91
94
96 std::string m_name;
97
100
102 double m_value;
103
106
107
119 uint8_t m_flags;
120
121 enum
122 {
123 STREAM_DO_NOT_INTERPOLATE = 1,
124 STREAM_FILL_UNDER = 2,
125 STREAM_INFREQUENTLY_USED = 4
126 };
127};
128
129#endif
Declaration of WaveformBase, SparseWaveformBase, UniformWaveformBase.
Information associated with a single stream.
Definition: Stream.h:48
StreamType
General data type stored in a stream.
Definition: Stream.h:58
StreamType m_stype
General datatype stored in the stream.
Definition: Stream.h:105
WaveformBase * m_waveform
The current waveform (or null if nothing here)
Definition: Stream.h:99
Unit m_yAxisUnit
Unit of measurement for our vertical axis.
Definition: Stream.h:93
std::string m_name
Name of the stream.
Definition: Stream.h:96
double m_value
The current value (only meaningful for analog scalar type)
Definition: Stream.h:102
uint8_t m_flags
Flags that apply to this waveform. Bitfield. STREAM_DO_NOT_INTERPOLATE: hint that this stream should ...
Definition: Stream.h:119
A unit of measurement, plus conversion to pretty-printed output.
Definition: Unit.h:57
Base class for all Waveform specializations.
Definition: Waveform.h:59