ngscopeclient v0.2.1
Loading...
Searching...
No Matches
Waterfall.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopeprotocols *
4* *
5* Copyright (c) 2012-2026 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 Waterfall_h
36#define Waterfall_h
37
38#include "../scopehal/DensityFunctionWaveform.h"
39
41{
42 uint32_t width;
43 uint32_t height;
44 uint32_t inlen;
45 uint32_t writerow;
46 float vrange;
47 float vfs;
48 float timescaleRatio;
49};
50
52{
53public:
54 WaterfallWaveform(size_t width, size_t height);
55 virtual ~WaterfallWaveform();
56
57 //not copyable or assignable
59 WaterfallWaveform& operator=(const WaterfallWaveform&) =delete;
60
61 virtual void FreeGpuMemory() override
62 {}
63
64 virtual bool HasGpuBuffer() override
65 { return false; }
66
67 uint32_t GetWriteRow()
68 { return m_writePtr; }
69
70 void BumpWriteRow()
71 { m_writePtr = (m_writePtr + 1) % m_height; }
72
73protected:
74 uint32_t m_writePtr;
75};
76
77class Waterfall : public Filter
78{
79public:
80 Waterfall(const std::string& color);
81
82 //not copyable or assignable
83 Waterfall(const Waterfall&) =delete;
84 Waterfall& operator=(const Waterfall&) =delete;
85
86 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue) override;
87 virtual uint32_t GetExecutionCapabilitiesMask() override;
88
89 static std::string GetProtocolName();
90
91 virtual float GetVoltageRange(size_t stream) override;
92 virtual float GetOffset(size_t stream) override;
93 virtual void ClearSweeps() override;
94
95 void SetWidth(size_t width)
96 { m_width = width; }
97
98 void SetHeight(size_t height)
99 { m_height = height; }
100
101 size_t GetWidth()
102 { return m_width; }
103
104 size_t GetHeight()
105 { return m_height; }
106
107 PROTOCOL_DECODER_INITPROC(Waterfall)
108
109protected:
110 double m_offsetHz;
111
112 size_t m_width;
113 size_t m_height;
114
115 FilterParameter& m_maxwidth;
116
117 ComputePipeline m_computePipeline;
118};
119
120#endif
Definition AcceleratorBuffer.h:204
Encapsulates a Vulkan compute pipeline and all necessary resources to use it.
Definition ComputePipeline.h:55
Base class for waveforms such as eye patterns, spectrograms, and waterfalls which are conceptually a ...
Definition DensityFunctionWaveform.h:51
size_t m_height
Buffer height, in pixels.
Definition DensityFunctionWaveform.h:134
A parameter to a filter.
Definition FilterParameter.h:86
Abstract base class for all filter graph blocks which are not physical instrument channels.
Definition Filter.h:105
Definition Waterfall.h:52
virtual void FreeGpuMemory() override
Free GPU-side memory if we are short on VRAM or do not anticipate using this waveform for a while.
Definition Waterfall.h:61
virtual bool HasGpuBuffer() override
Returns true if we have at least one buffer resident on the GPU.
Definition Waterfall.h:64
Definition Waterfall.h:78
virtual uint32_t GetExecutionCapabilitiesMask() override
Returns a bitmask of ExecutionCapabilities fields.
Definition Waterfall.cpp:102
virtual void ClearSweeps() override
Clears any integrated data from past triggers (e.g. eye patterns).
Definition Waterfall.cpp:97
Definition Waterfall.h:41