ngscopeclient 0.1-dev+51fbda87c
Waterfall.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopeprotocols *
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 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 float vrange;
46 float vfs;
47 float timescaleRatio;
48};
49
51{
52public:
53 WaterfallWaveform(size_t width, size_t height);
54 virtual ~WaterfallWaveform();
55
56 //not copyable or assignable
58 WaterfallWaveform& operator=(const WaterfallWaveform&) =delete;
59
60 virtual void FreeGpuMemory() override
61 {}
62
63 virtual bool HasGpuBuffer() override
64 { return false; }
65
67};
68
69class Waterfall : public Filter
70{
71public:
72 Waterfall(const std::string& color);
73
74 //not copyable or assignable
75 Waterfall(const Waterfall&) =delete;
76 Waterfall& operator=(const Waterfall&) =delete;
77
78 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue) override;
79
80 static std::string GetProtocolName();
81
82 virtual float GetVoltageRange(size_t stream) override;
83 virtual float GetOffset(size_t stream) override;
84 virtual bool ValidateChannel(size_t i, StreamDescriptor stream) override;
85 virtual void ClearSweeps() override;
86
87 void SetWidth(size_t width)
88 { m_width = width; }
89
90 void SetHeight(size_t height)
91 { m_height = height; }
92
93 size_t GetWidth()
94 { return m_width; }
95
96 size_t GetHeight()
97 { return m_height; }
98
99 PROTOCOL_DECODER_INITPROC(Waterfall)
100
101protected:
102 double m_offsetHz;
103
104 size_t m_width;
105 size_t m_height;
106
107 std::string m_maxwidth;
108
109 ComputePipeline m_computePipeline;
110};
111
112#endif
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
Abstract base class for all filter graph blocks which are not physical instrument channels.
Definition: Filter.h:95
virtual void Refresh() override
Evaluates a filter graph node.
Definition: Filter.cpp:816
Descriptor for a single stream coming off a channel.
Definition: StreamDescriptor.h:46
Definition: Waterfall.h:51
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:60
virtual bool HasGpuBuffer() override
Returns true if we have at least one buffer resident on the GPU.
Definition: Waterfall.h:63
Definition: Waterfall.h:70
virtual void ClearSweeps() override
Clears any integrated data from past triggers (e.g. eye patterns).
Definition: Waterfall.cpp:114
Definition: Waterfall.h:41