37#ifndef DemoPowerSupply_h
38#define DemoPowerSupply_h
63 double GetPowerVoltageActual(
int chan)
override;
64 double GetPowerVoltageNominal(
int chan)
override;
65 double GetPowerCurrentActual(
int chan)
override;
66 double GetPowerCurrentNominal(
int chan)
override;
67 bool GetPowerChannelActive(
int chan)
override;
70 bool GetPowerOvercurrentShutdownEnabled(
int chan)
override;
72 void SetPowerOvercurrentShutdownEnabled(
int chan,
bool enable)
override;
73 bool GetPowerOvercurrentShutdownTripped(
int chan)
override;
74 void SetPowerVoltage(
int chan,
double volts)
override;
75 void SetPowerCurrent(
int chan,
double amps)
override;
76 void SetPowerChannelActive(
int chan,
bool on)
override;
77 bool IsPowerConstantCurrent(
int chan)
override;
79 bool GetMasterPowerEnable()
override;
80 void SetMasterPowerEnable(
bool enable)
override;
83 static constexpr int m_numChans = 4;
84 static constexpr double m_loads[m_numChans] = {10000000, 0.01, 1, 1000};
85 static constexpr const char* m_names[m_numChans] = {
"Open",
"Short",
"1Ohm",
"1KOhm"};
86 static constexpr double m_maxVoltage = 25;
87 static constexpr double m_maxAmperage = 5;
90 double m_voltages[m_numChans];
91 double m_currents[m_numChans];
92 bool m_enabled[m_numChans];
98 } m_ocpState[m_numChans];
A simulated power supply for demonstration.
Definition: DemoPowerSupply.h:48
bool SupportsSoftStart() override
Determines if the power supply supports soft start.
Definition: DemoPowerSupply.cpp:94
bool SupportsMasterOutputSwitching() override
Determines if the power supply supports ganged master switching of all outputs.
Definition: DemoPowerSupply.cpp:104
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: DemoPowerSupply.cpp:86
bool SupportsIndividualOutputSwitching() override
Determines if the power supply supports switching individual output channels.
Definition: DemoPowerSupply.cpp:99
DemoPowerSupply(SCPITransport *transport)
Initialize the driver.
Definition: DemoPowerSupply.cpp:50
static std::string GetDriverNameInternal()
Return the constant driver name string "demopsu".
Definition: DemoPowerSupply.cpp:81
bool SupportsOvercurrentShutdown() override
Determines if the power supply supports shutdown rather than constant-current mode on overcurrent.
Definition: DemoPowerSupply.cpp:109
An SCPI-based device.
Definition: SCPIDevice.h:37
An SCPI-based power supply.
Definition: SCPIPowerSupply.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47