30#ifndef RSRTO6Oscilloscope_h
31#define RSRTO6Oscilloscope_h
60 virtual void SetChannelCoupling(
size_t i, OscilloscopeChannel::CouplingType type)
override;
70 virtual void SetChannelOffset(
size_t i,
size_t stream,
float offset)
override;
86 virtual void Start()
override;
88 virtual void Stop()
override;
97 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
144 unsigned int m_analogChannelCount;
145 unsigned int m_digitalChannelBase;
146 unsigned int m_digitalChannelCount;
148 unsigned int m_firstAFGIndex;
150 const static std::map<const std::string, const WaveShape> m_waveShapeNames;
152 bool IsAnalog(
size_t index)
153 {
return index < m_analogChannelCount; }
155 int HWDigitalNumber(
size_t index)
156 {
return index - m_digitalChannelBase; }
158 template <
typename T>
size_t AcquireHeader(T* cap, std::string chname);
161 std::map<size_t, float> m_channelOffsets;
162 std::map<size_t, float> m_channelVoltageRanges;
163 std::map<int, bool> m_channelsEnabled;
164 std::map<size_t, float> m_channelDigitalThresholds;
165 std::map<size_t, OscilloscopeChannel::CouplingType> m_channelCouplings;
166 std::map<size_t, int> m_channelBandwidthLimits;
167 std::map<size_t, double> m_channelAttenuations;
170 bool m_triggerOneShot;
172 bool m_sampleRateValid;
173 uint64_t m_sampleRate;
174 bool m_sampleDepthValid;
175 uint64_t m_sampleDepth;
176 bool m_triggerOffsetValid;
177 uint64_t m_triggerOffset;
183 static std::string GetDriverNameInternal();
Simple edge trigger.
Definition: EdgeTrigger.h:44
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
OutputImpedance
Nominal output impedance for a function generator channel.
Definition: FunctionGenerator.h:259
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
Definition: RSRTO6Oscilloscope.h:38
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition: RSRTO6Oscilloscope.cpp:400
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition: RSRTO6Oscilloscope.cpp:1255
virtual bool AcquireData() override
Pull data from the instrument.
Definition: RSRTO6Oscilloscope.cpp:761
virtual float GetDigitalThreshold(size_t channel) override
Gets the threshold for a digital input.
Definition: RSRTO6Oscilloscope.cpp:658
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition: RSRTO6Oscilloscope.cpp:1044
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition: RSRTO6Oscilloscope.cpp:307
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition: RSRTO6Oscilloscope.cpp:1211
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: RSRTO6Oscilloscope.cpp:1177
virtual float GetChannelVoltageRange(size_t i, size_t stream) override
Gets the range of the current channel configuration.
Definition: RSRTO6Oscilloscope.cpp:553
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: RSRTO6Oscilloscope.cpp:1033
virtual std::vector< unsigned int > GetChannelBandwidthLimiters(size_t i) override
Gets the set of available bandwidth limiters for an input channel.
Definition: RSRTO6Oscilloscope.cpp:539
virtual void Stop() override
Stops triggering.
Definition: RSRTO6Oscilloscope.cpp:1023
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: RSRTO6Oscilloscope.cpp:1039
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition: RSRTO6Oscilloscope.cpp:1260
virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override
Gets the currently selected output impedance for a function generator output (if supported)
Definition: RSRTO6Oscilloscope.cpp:1469
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: RSRTO6Oscilloscope.cpp:228
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1432
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition: RSRTO6Oscilloscope.cpp:323
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: RSRTO6Oscilloscope.cpp:1326
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition: RSRTO6Oscilloscope.cpp:1156
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition: RSRTO6Oscilloscope.cpp:466
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1437
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition: RSRTO6Oscilloscope.cpp:504
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1450
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition: RSRTO6Oscilloscope.cpp:435
virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override
Sets the range of the current channel configuration.
Definition: RSRTO6Oscilloscope.cpp:572
virtual std::vector< DigitalBank > GetDigitalBanks() override
Gets the digital channel banks for this instrument.
Definition: RSRTO6Oscilloscope.cpp:626
virtual DigitalBank GetDigitalBank(size_t channel) override
Gets the bank containing a given channel.
Definition: RSRTO6Oscilloscope.cpp:641
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition: RSRTO6Oscilloscope.cpp:239
virtual bool IsDigitalThresholdConfigurable() override
Checks if digital input threshold is configurable or fixed.
Definition: RSRTO6Oscilloscope.cpp:653
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition: RSRTO6Oscilloscope.cpp:1265
virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override
Sets the currently selected output impedance for a function generator output (if supported)
Definition: RSRTO6Oscilloscope.cpp:1475
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: RSRTO6Oscilloscope.cpp:1195
virtual void SetDigitalThreshold(size_t channel, float level) override
Gets the threshold for a digital input.
Definition: RSRTO6Oscilloscope.cpp:677
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition: RSRTO6Oscilloscope.cpp:259
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1422
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition: RSRTO6Oscilloscope.cpp:1387
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: RSRTO6Oscilloscope.cpp:218
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition: RSRTO6Oscilloscope.cpp:289
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: RSRTO6Oscilloscope.cpp:684
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition: RSRTO6Oscilloscope.cpp:368
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1427
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition: RSRTO6Oscilloscope.cpp:1382
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition: RSRTO6Oscilloscope.cpp:1161
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: RSRTO6Oscilloscope.cpp:1120
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: RSRTO6Oscilloscope.cpp:1003
void PullEdgeTrigger()
Reads settings for an edge trigger from the instrument.
Definition: RSRTO6Oscilloscope.cpp:1293
virtual bool HasFunctionDutyCycleControls(int chan) override
Determines if the function generator allows control over duty cycles.
Definition: RSRTO6Oscilloscope.cpp:1392
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition: RSRTO6Oscilloscope.cpp:1370
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition: RSRTO6Oscilloscope.cpp:1239
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: RSRTO6Oscilloscope.cpp:1464
virtual void SetFunctionChannelDutyCycle(int chan, float duty) override
Sets the duty cycle for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1402
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: RSRTO6Oscilloscope.cpp:254
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1412
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1407
virtual float GetChannelOffset(size_t i, size_t stream) override
Gets the offset, in volts, for a given channel.
Definition: RSRTO6Oscilloscope.cpp:586
virtual void SetChannelOffset(size_t i, size_t stream, float offset) override
Sets the offset for a given channel.
Definition: RSRTO6Oscilloscope.cpp:609
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition: RSRTO6Oscilloscope.cpp:1106
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1417
void PushEdgeTrigger(EdgeTrigger *trig)
Pushes settings for an edge trigger to the instrument.
Definition: RSRTO6Oscilloscope.cpp:1338
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition: RSRTO6Oscilloscope.cpp:1227
virtual float GetFunctionChannelDutyCycle(int chan) override
Gets the duty cycle for a function generator output.
Definition: RSRTO6Oscilloscope.cpp:1397
virtual bool IsDigitalHysteresisConfigurable() override
Checks if digital input hysteresis is configurable or fixed.
Definition: RSRTO6Oscilloscope.cpp:646
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override
Gets the coupling used for an input channel.
Definition: RSRTO6Oscilloscope.cpp:337
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: RSRTO6Oscilloscope.cpp:1013
virtual std::string GetProbeName(size_t i) override
Returns the name of the probe connected to the scope, if possible.
Definition: RSRTO6Oscilloscope.cpp:457
An SCPI-based function generator.
Definition: SCPIFunctionGenerator.h:38
An SCPI-based oscilloscope.
Definition: SCPIOscilloscope.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47