ngscopeclient 0.1-dev+51fbda87c
SiglentLoad.h
1/***********************************************************************************************************************
2* *
3* libscopehal v0.1 *
4* *
5* Copyright (c) 2012-2023 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
30#ifndef SiglentLoad_h
31#define SiglentLoad_h
32
39 : public virtual SCPILoad
40{
41public:
42 SiglentLoad(SCPITransport* transport);
43 virtual ~SiglentLoad();
44
45 //Instrument
46 virtual unsigned int GetInstrumentTypes() const override;
47 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
48
49 //Load
50 virtual LoadMode GetLoadMode(size_t channel) override;
51 virtual void SetLoadMode(size_t channel, LoadMode mode) override;
52 virtual std::vector<float> GetLoadCurrentRanges(size_t channel) override;
53 virtual size_t GetLoadCurrentRange(size_t channel) override;
54 virtual std::vector<float> GetLoadVoltageRanges(size_t channel) override;
55 virtual size_t GetLoadVoltageRange(size_t channel) override;
56 virtual bool GetLoadActive(size_t channel) override;
57 virtual void SetLoadActive(size_t channel, bool active) override;
58 virtual void SetLoadVoltageRange(size_t channel, size_t rangeIndex) override;
59 virtual void SetLoadCurrentRange(size_t channel, size_t rangeIndex) override;
60
61 virtual float GetLoadSetPoint(size_t channel) override;
62 virtual void SetLoadSetPoint(size_t channel, float target) override;
63
64 //TODO: FlushConfigCache should get pulled up from Oscilloscope into Load
65
66public:
67 static std::string GetDriverNameInternal();
68 LOAD_INITPROC(SiglentLoad)
69
70protected:
71 LoadMode GetLoadModeUncached(size_t channel);
72
73 virtual float GetLoadVoltageActual(size_t channel) override;
74 virtual float GetLoadCurrentActual(size_t channel) override;
75 virtual float GetLoadSetPointActual(size_t channel);
76
77 //Cache config
78 LoadMode m_modeCached;
79 float m_setPointCached;
80};
81
82#endif
LoadMode
Operating modes for the load.
Definition: Load.h:62
An SCPI-based electronic load.
Definition: SCPILoad.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Siglent electronic load.
Definition: SiglentLoad.h:40
virtual size_t GetLoadCurrentRange(size_t channel) override
Returns the index of the load's selected current range, as returned by GetLoadCurrentRanges()
Definition: SiglentLoad.cpp:149
virtual float GetLoadCurrentActual(size_t channel) override
Get the measured current of the load (uncached instantaneous measurement)
Definition: SiglentLoad.cpp:320
virtual float GetLoadVoltageActual(size_t channel) override
Get the measured voltage of the load (uncached instantaneous measurement)
Definition: SiglentLoad.cpp:315
virtual std::vector< float > GetLoadCurrentRanges(size_t channel) override
Returns a sorted list of operating ranges for the load's current scale, in amps.
Definition: SiglentLoad.cpp:141
virtual void SetLoadSetPoint(size_t channel, float target) override
Sets the set point for the channel.
Definition: SiglentLoad.cpp:353
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: SiglentLoad.cpp:67
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: SiglentLoad.cpp:62
virtual std::vector< float > GetLoadVoltageRanges(size_t channel) override
Returns a sorted list of operating ranges for the load's voltage scale, in volts.
Definition: SiglentLoad.cpp:183
virtual void SetLoadVoltageRange(size_t channel, size_t rangeIndex) override
Select the voltage range to use.
Definition: SiglentLoad.cpp:225
virtual float GetLoadSetPoint(size_t channel) override
Gets the set point for the channel.
Definition: SiglentLoad.cpp:325
virtual void SetLoadMode(size_t channel, LoadMode mode) override
Sets the operating mode of the load.
Definition: SiglentLoad.cpp:110
virtual size_t GetLoadVoltageRange(size_t channel) override
Returns the index of the load's selected voltage range, as returned by GetLoadVoltageRanges()
Definition: SiglentLoad.cpp:191
virtual void SetLoadCurrentRange(size_t channel, size_t rangeIndex) override
Select the current range to use.
Definition: SiglentLoad.cpp:263
virtual LoadMode GetLoadMode(size_t channel) override
Returns the operating mode of the load.
Definition: SiglentLoad.cpp:88
virtual void SetLoadActive(size_t channel, bool active) override
Turns the load on or off.
Definition: SiglentLoad.cpp:307
virtual bool GetLoadActive(size_t channel) override
Returns true if the load is enabled (sinking power) and false if disabled (no load)
Definition: SiglentLoad.cpp:301