37#ifndef DemoOscilloscope_h
38#define DemoOscilloscope_h
63 virtual std::string
IDPing()
override;
74 virtual void SetChannelCoupling(
size_t i, OscilloscopeChannel::CouplingType type)
override;
84 virtual void SetChannelOffset(
size_t i,
size_t stream,
float offset)
override;
89 virtual void Start()
override;
91 virtual void Stop()
override;
99 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
112 virtual std::vector<std::string>
GetADCModeNames(
size_t channel)
override;
113 virtual size_t GetADCMode(
size_t channel)
override;
114 virtual void SetADCMode(
size_t channel,
size_t mode)
override;
192 std::unique_ptr<vk::raii::CommandPool>
m_pool[4];
195 std::unique_ptr<vk::raii::CommandBuffer>
m_cmdBuf[4];
Simulated oscilloscope for demonstrations and testing.
Definition: DemoOscilloscope.h:54
virtual bool AcquireData() override
Pull data from the instrument.
Definition: DemoOscilloscope.cpp:497
uint64_t m_rate
Sample rate.
Definition: DemoOscilloscope.h:173
ChannelModes
ADC mode selectors (used to select the simulated channel)
Definition: DemoOscilloscope.h:149
@ CHANNEL_MODE_IDEAL
Ideal waveform with no impairments.
Definition: DemoOscilloscope.h:151
@ CHANNEL_MODE_NOISE
5 mV RMS AWGN
Definition: DemoOscilloscope.h:154
@ CHANNEL_MODE_NOISE_LPF
5 mV RMS AWGN + 300mm lossy S-parameter channel
Definition: DemoOscilloscope.h:157
std::map< size_t, unsigned int > m_channelBandwidth
Map of channel ID to bandwidth limit.
Definition: DemoOscilloscope.h:136
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition: DemoOscilloscope.cpp:414
virtual void LoadConfiguration(int version, const YAML::Node &node, IDTable &idmap) override
Load instrument and channel configuration from a save file.
Definition: DemoOscilloscope.cpp:227
static std::string GetDriverNameInternal()
Return the constant driver name "demopsu".
Definition: DemoOscilloscope.cpp:170
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition: DemoOscilloscope.cpp:290
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: DemoOscilloscope.cpp:214
TestWaveformSource * m_source[4]
Signal sources for each channel.
Definition: DemoOscilloscope.h:186
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: DemoOscilloscope.cpp:180
std::unique_ptr< vk::raii::CommandBuffer > m_cmdBuf[4]
Vulkan command buffer for ISI channel.
Definition: DemoOscilloscope.h:195
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: DemoOscilloscope.cpp:196
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: DemoOscilloscope.cpp:409
std::map< size_t, size_t > m_channelModes
Map of channel ID to ADC mode.
Definition: DemoOscilloscope.h:145
std::map< size_t, double > m_channelAttenuation
Map of channel ID to probe attenuation.
Definition: DemoOscilloscope.h:133
virtual void SetADCMode(size_t channel, size_t mode) override
Sets the ADC mode for a channel.
Definition: DemoOscilloscope.cpp:468
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition: DemoOscilloscope.cpp:424
virtual std::vector< AnalogBank > GetAnalogBanks() override
Gets the analog banks for this instrument.
Definition: DemoOscilloscope.cpp:479
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition: DemoOscilloscope.cpp:275
DemoOscilloscope(SCPITransport *transport)
Initialize the driver.
Definition: DemoOscilloscope.cpp:52
std::map< size_t, OscilloscopeChannel::CouplingType > m_channelCoupling
Map of channel ID to coupling.
Definition: DemoOscilloscope.h:130
virtual void SetChannelOffset(size_t i, size_t stream, float offset) override
Sets the offset for a given channel.
Definition: DemoOscilloscope.cpp:342
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override
Gets the coupling used for an input channel.
Definition: DemoOscilloscope.cpp:285
virtual float GetChannelVoltageRange(size_t i, size_t stream) override
Gets the range of the current channel configuration.
Definition: DemoOscilloscope.cpp:322
virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override
Sets the range of the current channel configuration.
Definition: DemoOscilloscope.cpp:327
bool m_triggerOneShot
True if most recent trigger arm was a single-shot trigger.
Definition: DemoOscilloscope.h:164
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition: DemoOscilloscope.cpp:419
std::unique_ptr< vk::raii::CommandPool > m_pool[4]
Vulkan command pool for ISI channel.
Definition: DemoOscilloscope.h:192
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition: DemoOscilloscope.cpp:445
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition: DemoOscilloscope.cpp:347
OscilloscopeChannel * m_extTrigger
External trigger.
Definition: DemoOscilloscope.h:124
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: DemoOscilloscope.cpp:219
std::random_device m_rd
Random number source for seeding the generators.
Definition: DemoOscilloscope.h:176
virtual std::string IDPing() override
Returns the instrument's identification string.
Definition: DemoOscilloscope.cpp:154
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: DemoOscilloscope.cpp:440
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition: DemoOscilloscope.cpp:365
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition: DemoOscilloscope.cpp:307
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: DemoOscilloscope.cpp:404
virtual float GetChannelOffset(size_t i, size_t stream) override
Gets the offset, in volts, for a given channel.
Definition: DemoOscilloscope.cpp:337
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: DemoOscilloscope.cpp:332
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition: DemoOscilloscope.cpp:297
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition: DemoOscilloscope.cpp:270
virtual size_t GetADCMode(size_t channel) override
Gets the ADC mode for a channel.
Definition: DemoOscilloscope.cpp:462
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition: DemoOscilloscope.cpp:399
virtual std::string GetTransportName() override
Gets the name of our transport.
Definition: DemoOscilloscope.cpp:159
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition: DemoOscilloscope.cpp:302
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition: DemoOscilloscope.cpp:430
std::shared_ptr< QueueHandle > m_queue[4]
Vulkan queue for ISI channel.
Definition: DemoOscilloscope.h:189
virtual AnalogBank GetAnalogBank(size_t channel) override
Gets the bank containing a given channel.
Definition: DemoOscilloscope.cpp:487
virtual bool IsADCModeConfigurable() override
Returns true if the ADC is configurable, false if it can only run in one mode.
Definition: DemoOscilloscope.cpp:474
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition: DemoOscilloscope.cpp:392
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition: DemoOscilloscope.cpp:312
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: DemoOscilloscope.cpp:202
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition: DemoOscilloscope.cpp:435
bool m_triggerArmed
True if trigger is armed.
Definition: DemoOscilloscope.h:161
virtual std::string GetTransportConnectionString() override
Gets the connection string for our transport.
Definition: DemoOscilloscope.cpp:164
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition: DemoOscilloscope.cpp:317
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition: DemoOscilloscope.cpp:280
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: DemoOscilloscope.cpp:453
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: DemoOscilloscope.cpp:175
std::minstd_rand * m_rng[4]
Random number generators for AWGN synthesis.
Definition: DemoOscilloscope.h:179
std::map< size_t, float > m_channelVoltageRange
Map of channel ID to vertical scale range.
Definition: DemoOscilloscope.h:139
uint64_t m_depth
Memory depth.
Definition: DemoOscilloscope.h:170
float m_sweepFreq
Current frequency within the sweep for channel 2.
Definition: DemoOscilloscope.h:167
std::map< size_t, float > m_channelOffset
Map of channel ID to offset.
Definition: DemoOscilloscope.h:142
std::map< size_t, bool > m_channelsEnabled
Map of channel ID to on/off state.
Definition: DemoOscilloscope.h:127
virtual void Stop() override
Stops triggering.
Definition: DemoOscilloscope.cpp:208
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: DemoOscilloscope.cpp:379
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: DemoOscilloscope.cpp:188
Bidirectional table mapping integer IDs in scopesession files to object pointers.
Definition: IDTable.h:49
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
An SCPI-based oscilloscope.
Definition: SCPIOscilloscope.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47