ngscopeclient 0.1-dev+51fbda87c
CopperMountainVNA.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
36#ifndef CopperMountainVNA_h
37#define CopperMountainVNA_h
38
45class CopperMountainVNA : public virtual SCPIVNA
46{
47public:
49 virtual ~CopperMountainVNA();
50
51 //Channel configuration
52 virtual OscilloscopeChannel* GetExternalTrigger() override;
53
54 //Triggering
55 virtual Oscilloscope::TriggerMode PollTrigger() override;
56 virtual bool AcquireData() override;
57 virtual void Start() override;
58 virtual void StartSingleTrigger() override;
59 virtual void Stop() override;
60 virtual void ForceTrigger() override;
61 virtual bool IsTriggerArmed() override;
62 virtual void PushTrigger() override;
63 virtual void PullTrigger() override;
64
65 //Timebase
66 virtual std::vector<uint64_t> GetSampleDepthsNonInterleaved() override;
67 virtual uint64_t GetSampleDepth() override;
68 virtual void SetSampleDepth(uint64_t depth) override;
69 virtual void SetSpan(int64_t span) override;
70 virtual int64_t GetSpan() override;
71 virtual void SetCenterFrequency(size_t channel, int64_t freq) override;
72 virtual int64_t GetCenterFrequency(size_t channel) override;
73
74 //TODO: Sweep configuration
75 virtual int64_t GetResolutionBandwidth() override;
76
77protected:
78
79 std::string GetChannelColor(size_t i);
80
81 bool m_triggerArmed;
82 bool m_triggerOneShot;
83
84 int64_t m_memoryDepth;
85 int64_t m_sweepStart;
86 int64_t m_sweepStop;
87
88 int64_t m_freqMin;
89 int64_t m_freqMax;
90
91 int64_t m_rbw;
92
93public:
94 static std::string GetDriverNameInternal();
95 VNA_INITPROC(CopperMountainVNA)
96};
97
98#endif
Driver for Copper Mountain VNAs.
Definition: CopperMountainVNA.h:46
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: CopperMountainVNA.cpp:233
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: CopperMountainVNA.cpp:342
virtual int64_t GetResolutionBandwidth() override
Gets the resolution bandwidth for frequency-domain channels.
Definition: CopperMountainVNA.cpp:353
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: CopperMountainVNA.cpp:239
virtual void Stop() override
Stops triggering.
Definition: CopperMountainVNA.cpp:218
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition: CopperMountainVNA.cpp:243
virtual bool AcquireData() override
Pull data from the instrument.
Definition: CopperMountainVNA.cpp:247
virtual void SetSpan(int64_t span) override
Sets the span for frequency-domain channels.
Definition: CopperMountainVNA.cpp:358
virtual int64_t GetCenterFrequency(size_t channel) override
Gets the center frequency for a frequency-domain channel.
Definition: CopperMountainVNA.cpp:395
virtual int64_t GetSpan() override
Gets the span for frequency-domain channels.
Definition: CopperMountainVNA.cpp:374
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: CopperMountainVNA.cpp:202
std::string GetChannelColor(size_t i)
Color the channels (blue-red-green-yellow-purple-gray-cyan-magenta)
Definition: CopperMountainVNA.cpp:136
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: CopperMountainVNA.cpp:210
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: CopperMountainVNA.cpp:329
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: CopperMountainVNA.cpp:225
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: CopperMountainVNA.cpp:185
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: CopperMountainVNA.cpp:347
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: CopperMountainVNA.cpp:180
virtual void SetCenterFrequency(size_t channel, int64_t freq) override
Sets the center frequency for frequency-domain channels.
Definition: CopperMountainVNA.cpp:379
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Generic representation of a vector network analyzer.
Definition: SCPIVNA.h:43