37#ifndef ThunderScopeOscilloscope_h
38#define ThunderScopeOscilloscope_h
40#include "RemoteBridgeOscilloscope.h"
41#include "../xptools/HzClock.h"
74 virtual void SetChannelCoupling(
size_t i, OscilloscopeChannel::CouplingType type)
override;
83 virtual void Start()
override;
85 virtual void Stop()
override;
91 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
103 virtual std::vector<std::string>
GetADCModeNames(
size_t channel)
override;
104 virtual size_t GetADCMode(
size_t channel)
override;
105 virtual void SetADCMode(
size_t channel,
size_t mode)
override;
109 void RefreshSampleRate();
110 bool DoAcquireData(
bool keep);
145 std::unique_ptr<vk::raii::CommandPool>
m_pool;
Simple edge trigger.
Definition: EdgeTrigger.h:44
A parameter to a filter.
Definition: FilterParameter.h:86
Clock that measures rate at which it is called; windowed average.
Definition: HzClock.h:52
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:396
An oscilloscope connected over a SDK-to-SCPI bridge that follows our pattern (i.e....
Definition: RemoteBridgeOscilloscope.h:40
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Driver for talking to the TS.NET server controlling a ThunderScope.
Definition: ThunderScopeOscilloscope.h:49
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition: ThunderScopeOscilloscope.cpp:789
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition: ThunderScopeOscilloscope.cpp:270
virtual bool HasInterleavingControls() override
Returns true if the scope has a user controllavble interleaving feature, false if not.
Definition: ThunderScopeOscilloscope.cpp:754
size_t m_analogChannelCount
Number of analog channels (always 4 at the moment)
Definition: ThunderScopeOscilloscope.h:115
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition: ThunderScopeOscilloscope.cpp:252
virtual size_t GetADCMode(size_t channel) override
Gets the ADC mode for a channel.
Definition: ThunderScopeOscilloscope.cpp:877
virtual void SetADCMode(size_t channel, size_t mode) override
Sets the ADC mode for a channel.
Definition: ThunderScopeOscilloscope.cpp:882
std::unique_ptr< ComputePipeline > m_conversion8BitPipeline
Compute pipeline for converting raw ADC codes to float32 samples.
Definition: ThunderScopeOscilloscope.h:151
HzClock m_receiveClock
Counter of average trigger rate.
Definition: ThunderScopeOscilloscope.h:136
uint32_t m_lastSeq
Most recently received sequence number.
Definition: ThunderScopeOscilloscope.h:170
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: ThunderScopeOscilloscope.cpp:320
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition: ThunderScopeOscilloscope.cpp:796
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition: ThunderScopeOscilloscope.cpp:276
virtual bool IsADCModeConfigurable() override
Returns true if the ADC is configurable, false if it can only run in one mode.
Definition: ThunderScopeOscilloscope.cpp:864
std::unique_ptr< vk::raii::CommandBuffer > m_cmdBuf
Command buffer for sample conversion.
Definition: ThunderScopeOscilloscope.h:148
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: ThunderScopeOscilloscope.cpp:652
virtual std::vector< unsigned int > GetChannelBandwidthLimiters(size_t i) override
Gets the set of available bandwidth limiters for an input channel.
Definition: ThunderScopeOscilloscope.cpp:307
FilterParameter m_diag_hardwareWFMHz
Number of WFM/s acquired by hardware.
Definition: ThunderScopeOscilloscope.h:121
virtual bool CanInterleave() override
Returns true if we have no interleave conflicts, false if we have conflicts.
Definition: ThunderScopeOscilloscope.cpp:749
std::unique_ptr< ComputePipeline > m_conversion16BitPipeline
Compute pipeline for converting raw ADC codes to float32 samples.
Definition: ThunderScopeOscilloscope.h:154
void ResetPerCaptureDiagnostics()
Reset performance counters at the start of a capture.
Definition: ThunderScopeOscilloscope.cpp:193
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: ThunderScopeOscilloscope.cpp:766
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition: ThunderScopeOscilloscope.cpp:716
ThunderScopeOscilloscope(SCPITransport *transport)
Initialize the driver.
Definition: ThunderScopeOscilloscope.cpp:61
FilterParameter m_diag_receivedWFMHz
Number of WFM/s recieved by the driver.
Definition: ThunderScopeOscilloscope.h:124
virtual void PushEdgeTrigger(EdgeTrigger *trig) override
Pushes settings for an edge trigger to the instrument.
Definition: ThunderScopeOscilloscope.cpp:669
static std::string GetDriverNameInternal()
Return the driver name "thunderscope".
Definition: ThunderScopeOscilloscope.cpp:247
ADCMode
ADC modes.
Definition: ThunderScopeOscilloscope.h:164
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: ThunderScopeOscilloscope.cpp:629
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: ThunderScopeOscilloscope.cpp:238
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition: ThunderScopeOscilloscope.cpp:741
std::string GetChannelColor(size_t i)
Color the channels based on our standard color sequence (blue-red-green-yellow)
Definition: ThunderScopeOscilloscope.cpp:206
uint32_t m_dropUntilSeq
Sequence number to drop until (if we get stale data after stopping the trigger)
Definition: ThunderScopeOscilloscope.h:173
virtual bool AcquireData() override
Pull data from the instrument.
Definition: ThunderScopeOscilloscope.cpp:352
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: ThunderScopeOscilloscope.cpp:233
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition: ThunderScopeOscilloscope.cpp:818
void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition: ThunderScopeOscilloscope.cpp:710
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: ThunderScopeOscilloscope.cpp:658
void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: ThunderScopeOscilloscope.cpp:704
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition: ThunderScopeOscilloscope.cpp:802
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition: ThunderScopeOscilloscope.cpp:294
FilterParameter m_diag_droppedPercent
Percentage of waveforms which were dropped.
Definition: ThunderScopeOscilloscope.h:133
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition: ThunderScopeOscilloscope.cpp:808
virtual void Stop() override
Stops triggering.
Definition: ThunderScopeOscilloscope.cpp:642
FilterParameter m_diag_droppedWFMs
Number of waveforms dropped because some part of the pipeline couldn't keep up.
Definition: ThunderScopeOscilloscope.h:130
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: ThunderScopeOscilloscope.cpp:326
FilterParameter m_diag_totalWFMs
Number of waveforms acquired during this session.
Definition: ThunderScopeOscilloscope.h:127
std::unique_ptr< vk::raii::CommandPool > m_pool
Command pool from which m_cmdBuf was allocated.
Definition: ThunderScopeOscilloscope.h:145
virtual bool CanEnableChannel(size_t i) override
Determines if a channel can be enabled.
Definition: ThunderScopeOscilloscope.cpp:906
std::vector< unsigned int > m_bandwidthLimits
Bandwidth limiters.
Definition: ThunderScopeOscilloscope.h:160
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition: ThunderScopeOscilloscope.cpp:288
std::map< size_t, double > m_channelAttenuations
Map of channel numbers to attenuation levels.
Definition: ThunderScopeOscilloscope.h:118
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition: ThunderScopeOscilloscope.cpp:264
std::shared_ptr< QueueHandle > m_queue
Vulkan queue used for sample conversion.
Definition: ThunderScopeOscilloscope.h:142
AcceleratorBuffer< uint32_t > m_clippingBuffer
Buffer for storing channel clip state.
Definition: ThunderScopeOscilloscope.h:157
std::vector< std::unique_ptr< AcceleratorBuffer< int16_t > > > m_analogRawWaveformBuffers
Buffers for storing raw ADC samples before converting to fp32.
Definition: ThunderScopeOscilloscope.h:139
virtual std::vector< std::string > GetADCModeNames(size_t channel) override
Gets the names of the ADC modes for the bank a given channel is located in.
Definition: ThunderScopeOscilloscope.cpp:869