ngscopeclient v0.2
Loading...
Searching...
No Matches
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
57 {
58 //Conventional time-series waveforms (or similar graphs like a FFT)
59 STREAM_TYPE_ANALOG,
60 STREAM_TYPE_DIGITAL,
61 STREAM_TYPE_DIGITAL_BUS,
62
63 //2D density plots
64 STREAM_TYPE_EYE,
65 STREAM_TYPE_SPECTROGRAM,
66 STREAM_TYPE_WATERFALL,
67 STREAM_TYPE_CONSTELLATION,
68
69 //Special channels not used for display
70 STREAM_TYPE_TRIGGER, //external trigger input, doesn't have data capture
71
72 //Class datatype from a protocol decoder
73 STREAM_TYPE_PROTOCOL,
74
75 //Single analog value
76 STREAM_TYPE_ANALOG_SCALAR,
77
78 //Single digital value
79 STREAM_TYPE_DIGITAL_SCALAR,
80
81 //Other / unspecified
82 STREAM_TYPE_UNDEFINED
83 };
84
85 Stream()
86 : m_yAxisUnit(Unit::UNIT_VOLTS)
87 , m_name("stream")
89 , m_value(0)
92 , m_stype(Stream::STREAM_TYPE_ANALOG)
93 , m_flags(0)
94 {}
95
96 Stream(Unit yunit, std::string name, StreamType type, uint8_t flags = 0)
97 : m_yAxisUnit(yunit)
98 , m_name(name)
100 , m_value(0)
101 , m_digitalValue(0)
103 , m_stype(type)
104 , m_flags(flags)
105 {}
106
109
111 std::string m_name;
112
115
117 double m_value;
118
121
124
127
128
141
142 enum
143 {
144 STREAM_DO_NOT_INTERPOLATE = 1,
145 STREAM_FILL_UNDER = 2,
146 STREAM_INFREQUENTLY_USED = 4
147 };
148};
149
150#endif
Declaration of WaveformBase, SparseWaveformBase, UniformWaveformBase.
Definition AcceleratorBuffer.h:204
Information associated with a single stream.
Definition Stream.h:48
StreamType
General data type stored in a stream.
Definition Stream.h:57
StreamType m_stype
General datatype stored in the stream.
Definition Stream.h:126
uint64_t m_digitalValue
The digital value (only meaningful for digital scalar type)
Definition Stream.h:120
WaveformBase * m_waveform
The current waveform (or null if nothing here)
Definition Stream.h:114
Unit m_yAxisUnit
Unit of measurement for our vertical axis.
Definition Stream.h:108
size_t m_digitalValueWidth
Width of the digital value, in bits (1 to 64)
Definition Stream.h:123
std::string m_name
Name of the stream.
Definition Stream.h:111
double m_value
The current value (only meaningful for analog scalar type)
Definition Stream.h:117
uint8_t m_flags
Flags that apply to this waveform. Bitfield. STREAM_DO_NOT_INTERPOLATE: hint that this stream should ...
Definition Stream.h:140
A unit of measurement, plus conversion to pretty-printed output.
Definition Unit.h:59
Base class for all Waveform specializations.
Definition Waveform.h:59