37#ifndef DemoOscilloscope_h
38#define DemoOscilloscope_h
64 virtual std::string
IDPing()
override;
91 virtual void Start()
override;
93 virtual void Stop()
override;
101 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
197 static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
201 {
"Demo Oscilloscope", {{ SCPITransportType::TRANSPORT_NULL,
"" }}}
Definition AcceleratorBuffer.h:204
Simulated oscilloscope for demonstrations and testing.
Definition DemoOscilloscope.h:55
virtual bool AcquireData() override
Pull data from the instrument.
Definition DemoOscilloscope.cpp:537
uint64_t m_rate
Sample rate.
Definition DemoOscilloscope.h:177
std::vector< OscilloscopeChannel * > m_digitalChannels
Digital channels.
Definition DemoOscilloscope.h:155
ChannelModes
ADC mode selectors (used to select the simulated channel)
Definition DemoOscilloscope.h:159
@ CHANNEL_MODE_IDEAL
Ideal waveform with no impairments.
Definition DemoOscilloscope.h:161
@ CHANNEL_MODE_NOISE
5 mV RMS AWGN
Definition DemoOscilloscope.h:164
@ CHANNEL_MODE_NOISE_LPF
5 mV RMS AWGN + 300mm lossy S-parameter channel
Definition DemoOscilloscope.h:167
std::map< size_t, unsigned int > m_channelBandwidth
Map of channel ID to bandwidth limit.
Definition DemoOscilloscope.h:143
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition DemoOscilloscope.cpp:444
virtual void LoadConfiguration(int version, const YAML::Node &node, IDTable &idmap) override
Load instrument and channel configuration from a save file.
Definition DemoOscilloscope.cpp:251
static std::string GetDriverNameInternal()
Return the constant driver name "demopsu".
Definition DemoOscilloscope.cpp:194
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition DemoOscilloscope.cpp:314
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition DemoOscilloscope.cpp:238
TestWaveformSource * m_source[4]
Signal sources for each channel.
Definition DemoOscilloscope.h:188
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:204
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition DemoOscilloscope.cpp:220
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition DemoOscilloscope.cpp:439
std::map< size_t, size_t > m_channelModes
Map of channel ID to ADC mode.
Definition DemoOscilloscope.h:152
std::map< size_t, double > m_channelAttenuation
Map of channel ID to probe attenuation.
Definition DemoOscilloscope.h:140
virtual void SetADCMode(size_t channel, size_t mode) override
Sets the ADC mode for a channel.
Definition DemoOscilloscope.cpp:503
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition DemoOscilloscope.cpp:454
virtual std::vector< AnalogBank > GetAnalogBanks() override
Gets the analog banks for this instrument.
Definition DemoOscilloscope.cpp:519
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition DemoOscilloscope.cpp:299
std::map< size_t, OscilloscopeChannel::CouplingType > m_channelCoupling
Map of channel ID to coupling.
Definition DemoOscilloscope.h:137
virtual void SetChannelOffset(size_t i, size_t stream, float offset) override
Sets the offset for a given channel.
Definition DemoOscilloscope.cpp:371
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override
Gets the coupling used for an input channel.
Definition DemoOscilloscope.cpp:309
virtual float GetChannelVoltageRange(size_t i, size_t stream) override
Gets the range of the current channel configuration.
Definition DemoOscilloscope.cpp:346
virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override
Sets the range of the current channel configuration.
Definition DemoOscilloscope.cpp:351
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition DemoOscilloscope.cpp:449
virtual bool IsADCModePerChannel() override
Returns true if the ADC is a per-channel setting, false if global for the entire instrument.
Definition DemoOscilloscope.cpp:514
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition DemoOscilloscope.cpp:480
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition DemoOscilloscope.cpp:376
virtual bool IsHighRateOffsetCapable(size_t i) override
Checks if the channel supports high rate offset changes, or if the GUI should rate-limit.
Definition DemoOscilloscope.cpp:356
OscilloscopeChannel * m_extTrigger
External trigger.
Definition DemoOscilloscope.h:131
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition DemoOscilloscope.cpp:243
std::random_device m_rd
Random number source for seeding the generators.
Definition DemoOscilloscope.h:180
virtual std::string IDPing() override
Returns the instrument's identification string.
Definition DemoOscilloscope.cpp:178
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition DemoOscilloscope.cpp:475
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition DemoOscilloscope.cpp:394
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition DemoOscilloscope.cpp:331
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition DemoOscilloscope.cpp:434
virtual float GetChannelOffset(size_t i, size_t stream) override
Gets the offset, in volts, for a given channel.
Definition DemoOscilloscope.cpp:366
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition DemoOscilloscope.cpp:361
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition DemoOscilloscope.cpp:321
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition DemoOscilloscope.cpp:294
virtual size_t GetADCMode(size_t channel) override
Gets the ADC mode for a channel.
Definition DemoOscilloscope.cpp:497
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition DemoOscilloscope.cpp:429
virtual std::string GetTransportName() override
Gets the name of our transport.
Definition DemoOscilloscope.cpp:183
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition DemoOscilloscope.cpp:326
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition DemoOscilloscope.cpp:465
virtual AnalogBank GetAnalogBank(size_t channel) override
Gets the bank containing a given channel.
Definition DemoOscilloscope.cpp:527
virtual bool IsADCModeConfigurable() override
Returns true if the ADC is configurable, false if it can only run in one mode.
Definition DemoOscilloscope.cpp:509
virtual std::vector< DigitalBank > GetDigitalBanks() override
Gets the digital channel banks for this instrument.
Definition DemoOscilloscope.cpp:145
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition DemoOscilloscope.cpp:422
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition DemoOscilloscope.cpp:336
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition DemoOscilloscope.cpp:226
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition DemoOscilloscope.cpp:470
virtual std::string GetTransportConnectionString() override
Gets the connection string for our transport.
Definition DemoOscilloscope.cpp:188
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition DemoOscilloscope.cpp:341
virtual bool CanInterleave() override
Returns true if we have no interleave conflicts, false if we have conflicts.
Definition DemoOscilloscope.cpp:460
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition DemoOscilloscope.cpp:304
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:488
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition DemoOscilloscope.cpp:199
std::minstd_rand * m_rng[4]
Random number generators for AWGN synthesis.
Definition DemoOscilloscope.h:183
std::map< size_t, float > m_channelVoltageRange
Map of channel ID to vertical scale range.
Definition DemoOscilloscope.h:146
uint64_t m_depth
Memory depth.
Definition DemoOscilloscope.h:174
float m_sweepFreq
Current frequency within the sweep for channel 2.
Definition DemoOscilloscope.h:171
std::map< size_t, float > m_channelOffset
Map of channel ID to offset.
Definition DemoOscilloscope.h:149
std::map< size_t, bool > m_channelsEnabled
Map of channel ID to on/off state.
Definition DemoOscilloscope.h:134
virtual void Stop() override
Stops triggering.
Definition DemoOscilloscope.cpp:232
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition DemoOscilloscope.cpp:408
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition DemoOscilloscope.cpp:212
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:398
An SCPI-based oscilloscope.
Definition SCPIOscilloscope.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition SCPITransport.h:53