Skip to content

Commit 25f8ed4

Browse files
committed
Documented ThunderScopeOscilloscope
1 parent 9c4608f commit 25f8ed4

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

scopehal/ThunderScopeOscilloscope.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
* *
2828
***********************************************************************************************************************/
2929

30+
/**
31+
@file
32+
@author Andrew D. Zonenberg
33+
@brief Implementation of ThunderScopeOscilloscope
34+
@ingroup scopedrivers
35+
*/
36+
3037
#ifdef _WIN32
3138
#include <chrono>
3239
#include <thread>
@@ -41,6 +48,11 @@ using namespace std;
4148
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4249
//Construction / destruction
4350

51+
/**
52+
@brief Initialize the driver
53+
54+
@param transport SCPITransport connected to a TS.NET instance
55+
*/
4456
ThunderScopeOscilloscope::ThunderScopeOscilloscope(SCPITransport* transport)
4557
: SCPIDevice(transport)
4658
, SCPIInstrument(transport)
@@ -148,6 +160,9 @@ ThunderScopeOscilloscope::ThunderScopeOscilloscope(SCPITransport* transport)
148160
m_clippingBuffer.resize(1);
149161
}
150162

163+
/**
164+
@brief Reset performance counters at the start of a capture
165+
*/
151166
void ThunderScopeOscilloscope::ResetPerCaptureDiagnostics()
152167
{
153168
m_diag_hardwareWFMHz.SetFloatVal(0);
@@ -159,11 +174,11 @@ void ThunderScopeOscilloscope::ResetPerCaptureDiagnostics()
159174
}
160175

161176
/**
162-
@brief Color the channels based on Pico's standard color sequence (blue-red-green-yellow-purple-gray-cyan-magenta)
177+
@brief Color the channels based on our standard color sequence (blue-red-green-yellow)
163178
*/
164179
string ThunderScopeOscilloscope::GetChannelColor(size_t i)
165180
{
166-
switch(i % 8)
181+
switch(i % 4)
167182
{
168183
case 0:
169184
return "#4040ff";
@@ -201,6 +216,7 @@ uint32_t ThunderScopeOscilloscope::GetInstrumentTypesForChannel(size_t /*i*/) co
201216
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
202217
//Device interface functions
203218

219+
///@brief Return the driver name "thunderscope"
204220
string ThunderScopeOscilloscope::GetDriverNameInternal()
205221
{
206222
return "thunderscope";

scopehal/ThunderScopeOscilloscope.h

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,23 @@
2727
* *
2828
***********************************************************************************************************************/
2929

30+
/**
31+
@file
32+
@author Andrew D. Zonenberg
33+
@brief Declaration of ThunderScopeOscilloscope
34+
@ingroup scopedrivers
35+
*/
36+
3037
#ifndef ThunderScopeOscilloscope_h
3138
#define ThunderScopeOscilloscope_h
3239

3340
#include "RemoteBridgeOscilloscope.h"
3441
#include "../xptools/HzClock.h"
3542

3643
/**
37-
@brief ThunderScopeOscilloscope - driver for talking to the TS.NET daemons
44+
@brief Driver for talking to the TS.NET server controlling a ThunderScope
45+
46+
@ingroup scopedrivers
3847
*/
3948
class ThunderScopeOscilloscope : public RemoteBridgeOscilloscope
4049
{
@@ -86,26 +95,46 @@ class ThunderScopeOscilloscope : public RemoteBridgeOscilloscope
8695

8796
std::string GetChannelColor(size_t i);
8897

98+
///@brief Number of analog channels (always 4 at the moment)
8999
size_t m_analogChannelCount;
90100

91-
// Cache
101+
///@brief Map of channel numbers to attenuation levels
92102
std::map<size_t, double> m_channelAttenuations;
93103

104+
///@brief Number of WFM/s acquired by hardware
94105
FilterParameter m_diag_hardwareWFMHz;
106+
107+
///@brief Number of WFM/s recieved by the driver
95108
FilterParameter m_diag_receivedWFMHz;
109+
110+
///@brief Number of waveforms acquired during this session
96111
FilterParameter m_diag_totalWFMs;
112+
113+
///@brief Number of waveforms dropped because some part of the pipeline couldn't keep up
97114
FilterParameter m_diag_droppedWFMs;
115+
116+
///@brief Percentage of waveforms which were dropped
98117
FilterParameter m_diag_droppedPercent;
118+
119+
///@brief Counter of average trigger rate
99120
HzClock m_receiveClock;
100121

101122
///@brief Buffers for storing raw ADC samples before converting to fp32
102123
std::vector<std::unique_ptr<AcceleratorBuffer<int16_t> > > m_analogRawWaveformBuffers;
103124

125+
///@brief Vulkan queue used for sample conversion
104126
std::shared_ptr<QueueHandle> m_queue;
127+
128+
///@brief Command pool from which m_cmdBuf was allocated
105129
std::unique_ptr<vk::raii::CommandPool> m_pool;
130+
131+
///@brief Command buffer for sample conversion
106132
std::unique_ptr<vk::raii::CommandBuffer> m_cmdBuf;
133+
134+
///@brief Compute pipeline for converting raw ADC codes to float32 samples
107135
std::unique_ptr<ComputePipeline> m_conversionPipeline;
108136

137+
///@brief Buffer for storing channel clip state
109138
AcceleratorBuffer<uint32_t> m_clippingBuffer;
110139

111140
public:

0 commit comments

Comments
 (0)