ngscopeclient v0.2.2
Loading...
Searching...
No Matches
OwonXDMMultimeter.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2026 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
35#ifndef OwonXDMMultimeter_h
36#define OwonXDMMultimeter_h
37
42 : public virtual SCPIMultimeter
43{
44public:
46 virtual ~OwonXDMMultimeter();
47
48 virtual unsigned int GetInstrumentTypes() const override;
49 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
50
51 virtual unsigned int GetMeasurementTypes() override;
52 virtual unsigned int GetSecondaryMeasurementTypes() override;
53
54 //Channel info
55 virtual int GetCurrentMeterChannel() override;
56 virtual void SetCurrentMeterChannel(int chan) override;
57
58 //Meter operating mode
59 virtual MeasurementTypes GetMeterMode() override;
60 virtual MeasurementTypes GetSecondaryMeterMode() override;
61 virtual void SetMeterMode(MeasurementTypes type) override;
62 virtual void SetSecondaryMeterMode(MeasurementTypes type) override;
63
64 //Control
65 virtual void SetMeterAutoRange(bool enable) override;
66 virtual bool GetMeterAutoRange() override;
67 virtual void StartMeter() override;
68 virtual void StopMeter() override;
69
70 virtual int GetMeterDigits() override;
71
72 //Get readings
73 virtual double GetMeterValue() override;
74 virtual double GetSecondaryMeterValue() override;
75
76protected:
77 bool m_modeValid;
78 bool m_secmodeValid;
79 MeasurementTypes m_mode;
80 MeasurementTypes m_secmode;
81
82public:
83 static std::string GetDriverNameInternal();
84
85 //This is intentionally not virtual since it's a static method used by enumeration
86 //cppcheck-suppress duplInheritedMember
87 static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
88 {
89 return {
90 #ifdef _WIN32
91 {"Owon XDM1041", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
92 {"Owon XDM1241", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
93 {"Owon XDM2041", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}}
94 #else
95 {"Owon XDM1041", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
96 {"Owon XDM1241", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
97 {"Owon XDM2041", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}}
98 #endif
99 };
100 }
101 METER_INITPROC(OwonXDMMultimeter)
102};
103
104#endif
Definition AcceleratorBuffer.h:204
Driver for Owon XDM multimeter.
Definition OwonXDMMultimeter.h:43
virtual double GetSecondaryMeterValue() override
Get the value of the secondary measurement.
Definition OwonXDMMultimeter.cpp:159
virtual void SetSecondaryMeterMode(MeasurementTypes type) override
Sets the active secondary mode.
virtual int GetMeterDigits() override
Returns the digit resolution of the meter.
Definition OwonXDMMultimeter.cpp:107
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition OwonXDMMultimeter.cpp:76
virtual double GetMeterValue() override
Get the value of the primary measurement.
Definition OwonXDMMultimeter.cpp:138
virtual MeasurementTypes GetSecondaryMeterMode() override
Gets the active secondary mode.
virtual unsigned int GetSecondaryMeasurementTypes() override
Gets a bitmask of secondary measurement types currently available.
Definition OwonXDMMultimeter.cpp:86
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition OwonXDMMultimeter.cpp:99
An SCPI-based multimeter.
Definition SCPIMultimeter.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition SCPITransport.h:53