ngscopeclient v0.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members

A simulated power supply for demonstration. More...

#include <MockPowerSupply.h>

Inheritance diagram for MockPowerSupply:
Inheritance graph
[legend]
Collaboration diagram for MockPowerSupply:
Collaboration graph
[legend]

Public Member Functions

 MockPowerSupply (const std::string &name, const std::string &vendor, const std::string &serial, const std::string &transport, const std::string &driver, const std::string &args)
 Initialize the driver.
 
bool SupportsSoftStart () override
 Determines if the power supply supports soft start.
 
bool SupportsIndividualOutputSwitching () override
 Determines if the power supply supports switching individual output channels.
 
bool SupportsMasterOutputSwitching () override
 Determines if the power supply supports ganged master switching of all outputs.
 
bool SupportsOvercurrentShutdown () override
 Determines if the power supply supports shutdown rather than constant-current mode on overcurrent.
 
double GetPowerVoltageActual (int chan) override
 
double GetPowerVoltageNominal (int chan) override
 
double GetPowerCurrentActual (int chan) override
 
double GetPowerCurrentNominal (int chan) override
 
bool GetPowerChannelActive (int chan) override
 
bool GetPowerOvercurrentShutdownEnabled (int chan) override
 
void SetPowerOvercurrentShutdownEnabled (int chan, bool enable) override
 
bool GetPowerOvercurrentShutdownTripped (int chan) override
 
void SetPowerVoltage (int chan, double volts) override
 
void SetPowerCurrent (int chan, double amps) override
 
void SetPowerChannelActive (int chan, bool on) override
 
bool IsPowerConstantCurrent (int chan) override
 
bool GetMasterPowerEnable () override
 
void SetMasterPowerEnable (bool enable) override
 
void DoPreLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &warnings)
 
virtual void BackgroundProcessing () override
 Run various background processing typically done by a second thread (e.g. InstrumentThread)
 
virtual uint32_t GetInstrumentTypesForChannel (size_t i) const override
 Returns a bitfield describing the set of instrument types that a given channel supports.
 
- Public Member Functions inherited from MockInstrument
 MockInstrument (const std::string &name, const std::string &vendor, const std::string &serial, const std::string &transport, const std::string &driver, const std::string &args)
 Initialize the driver.
 
virtual bool IsOffline () override
 Checks if the instrument is currently online.
 
virtual std::string GetTransportConnectionString () override
 Gets the connection string for our transport.
 
virtual void SetTransportConnectionString (const std::string &args)
 
virtual std::string GetTransportName () override
 Gets the name of our transport.
 
virtual std::string GetName () const override
 
virtual std::string GetVendor () const override
 
virtual std::string GetSerial () const override
 
void DoSerializeConfiguration (YAML::Node &node, IDTable &table)
 
void ClearWarnings (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &warnings)
 
virtual std::string GetDriverName () const override
 
- Public Member Functions inherited from SCPIInstrument
 SCPIInstrument (SCPITransport *transport, bool identify=true)
 
- Public Member Functions inherited from Instrument
size_t GetChannelCount () const
 Gets the number of channels (of any type) this instrument has.
 
InstrumentChannelGetChannel (size_t i) const
 Gets a given channel on the instrument.
 
virtual std::string GetChannelDisplayName (size_t i)
 Gets the hardware display name for a channel. This is an arbitrary user-selected string.
 
virtual void SetChannelDisplayName (size_t i, std::string name)
 Sets the hardware display name for a channel. This is an arbitrary user-selected string.
 
InstrumentChannelGetChannelByDisplayName (const std::string &name)
 Gets a channel given the display name.
 
InstrumentChannelGetChannelByHwName (const std::string &name)
 Gets a channel given the hardware name.
 
virtual void FlushConfigCache ()
 Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
 
virtual YAML::Node SerializeConfiguration (IDTable &table) const
 Serializes this instrument's configuration to a YAML node.
 
virtual void LoadConfiguration (int version, const YAML::Node &node, IDTable &idmap)
 Load instrument and channel configuration from a save file.
 
virtual void PreLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &warnings)
 Parse a limited subset of instrument configuration but do not apply it.
 
- Public Member Functions inherited from SCPIDevice
 SCPIDevice (SCPITransport *transport, bool identify=true, unsigned int identify_timeout_us=5000000)
 
 SCPIDevice (const SCPIDevice &rhs)=delete
 
SCPIDeviceoperator= (const SCPIDevice &rhs)=delete
 
SCPITransportGetTransport () const
 
- Public Member Functions inherited from PowerSupply
virtual unsigned int GetInstrumentTypes () const override
 Returns a bitfield describing the set of instrument types that this instrument supports.
 
virtual bool SupportsVoltageCurrentControl (int chan)
 Determines if the power supply supports voltage/current control for the given channel.
 
virtual bool AcquireData () override
 Pulls data from hardware and updates our measurements.
 
virtual bool IsSoftStartEnabled (int chan)
 
virtual void SetSoftStartEnabled (int chan, bool enable)
 
virtual int64_t GetSoftStartRampTime (int chan)
 Gets the ramp time for use with soft-start mode.
 
virtual void SetSoftStartRampTime (int chan, int64_t time)
 Sets the ramp time for use with soft-start mode.
 

Protected Attributes

bool m_masterEnabled
 
bool m_hasSoftStart
 
bool m_hasIndividualOutputSwitching
 
bool m_hasMasterOutputSwitching
 
bool m_hasOvercurrentShutdown
 
std::map< size_t, boolm_enabled
 
std::map< size_t, boolm_constantCurrent
 
std::map< size_t, boolm_overcurrentShutdown
 
std::map< size_t, boolm_overcurrentTripped
 
std::map< size_t, doublem_voltagesActual
 
std::map< size_t, doublem_currentsActual
 
std::map< size_t, doublem_voltagesNominal
 
std::map< size_t, doublem_currentsNominal
 
std::map< size_t, doublem_voltageSetPoints
 
std::map< size_t, doublem_currentSetPoints
 
- Protected Attributes inherited from MockInstrument
std::string m_transportName
 
std::string m_driver
 
std::string m_args
 
- Protected Attributes inherited from Instrument
std::list< sigc::slot< void(YAML::Node &, IDTable &)> > m_serializers
 List of methods which need to be called to serialize this node's configuration.
 
std::list< sigc::slot< void(int, const YAML::Node &, IDTable &)> > m_loaders
 List of methods which need to be called to deserialize this node's configuration.
 
std::list< sigc::slot< void(int, const YAML::Node &, IDTable &, ConfigWarningList &)> > m_preloaders
 List of methods which need to be called to pre-load this node's configuration.
 
std::vector< InstrumentChannel * > m_channels
 Set of all channels on this instrument.
 
- Protected Attributes inherited from SCPIDevice
SCPITransportm_transport
 
std::string m_vendor
 
std::string m_model
 
std::string m_serial
 
std::string m_fwVersion
 

Additional Inherited Members

- Public Types inherited from SCPIInstrument
typedef std::vector< SCPIInstrumentModel >(* GetTransportsProcType) ()
 
- Public Types inherited from Instrument
enum  InstrumentTypes {
  INST_OSCILLOSCOPE = 0x01 , INST_DMM = 0x02 , INST_PSU = 0x04 , INST_FUNCTION = 0x08 ,
  INST_RF_GEN = 0x10 , INST_LOAD = 0x20 , INST_BERT = 0x40 , INST_MISC = 0x80 ,
  INST_SWITCH_MATRIX = 0x100
}
 
- Public Types inherited from SCPIPowerSupply
typedef std::shared_ptr< SCPIPowerSupply >(* PowerCreateProcType) (SCPITransport *)
 
- Static Public Member Functions inherited from SCPIInstrument
static void DoAddDriverClass (const std::string &name, GetTransportsProcType proc)
 
static std::vector< SCPIInstrumentModelGetSupportedModels (const std::string &driver)
 
static std::vector< SCPIInstrumentModelGetDriverSupportedModels ()
 
- Static Public Member Functions inherited from SCPIPowerSupply
static void DoAddDriverClass (const std::string &name, PowerCreateProcType proc)
 
static void EnumDrivers (std::vector< std::string > &names)
 
static std::shared_ptr< SCPIPowerSupplyCreatePowerSupply (const std::string &driver, SCPITransport *transport)
 
- Public Attributes inherited from Instrument
std::string m_nickname
 Optional user-selected nickname of the instrument.
 
- Protected Types inherited from SCPIInstrument
typedef std::map< std::string, GetTransportsProcType > GetTransportMapType
 
- Protected Types inherited from SCPIPowerSupply
typedef std::map< std::string, PowerCreateProcType > PowerCreateMapType
 
- Protected Member Functions inherited from SCPIInstrument
void DoSerializeConfiguration (YAML::Node &node, IDTable &table)
 
- Protected Member Functions inherited from PowerSupply
void DoSerializeConfiguration (YAML::Node &node, IDTable &table)
 Serializes this oscilloscope's configuration to a YAML node.
 
void DoLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap)
 Load instrument and channel configuration from a save file.
 
void DoPreLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &list)
 Validate instrument and channel configuration from a save file.
 
- Static Protected Attributes inherited from SCPIInstrument
static GetTransportMapType m_getTransportProcs
 
- Static Protected Attributes inherited from SCPIPowerSupply
static PowerCreateMapType m_powercreateprocs
 

Detailed Description

A simulated power supply for demonstration.

Member Function Documentation

◆ BackgroundProcessing()

virtual void MockPowerSupply::BackgroundProcessing ( )
inlineoverridevirtual

Run various background processing typically done by a second thread (e.g. InstrumentThread)

This function must be called constantly in a loop to push pending commands to the instrument, complete nonblocking IO, etc

Reimplemented from MockInstrument.

◆ GetInstrumentTypesForChannel()

uint32_t MockPowerSupply::GetInstrumentTypesForChannel ( size_t  i) const
overridevirtual

Returns a bitfield describing the set of instrument types that a given channel supports.

Parameters
iChannel index

Implements Instrument.

◆ GetMasterPowerEnable()

bool MockPowerSupply::GetMasterPowerEnable ( )
overridevirtual

Reimplemented from PowerSupply.

◆ GetPowerChannelActive()

bool MockPowerSupply::GetPowerChannelActive ( int  chan)
overridevirtual

Reimplemented from PowerSupply.

◆ GetPowerCurrentActual()

double MockPowerSupply::GetPowerCurrentActual ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerCurrentNominal()

double MockPowerSupply::GetPowerCurrentNominal ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerOvercurrentShutdownEnabled()

bool MockPowerSupply::GetPowerOvercurrentShutdownEnabled ( int  chan)
overridevirtual

Reimplemented from PowerSupply.

◆ GetPowerOvercurrentShutdownTripped()

bool MockPowerSupply::GetPowerOvercurrentShutdownTripped ( int  chan)
overridevirtual

Reimplemented from PowerSupply.

◆ GetPowerVoltageActual()

double MockPowerSupply::GetPowerVoltageActual ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerVoltageNominal()

double MockPowerSupply::GetPowerVoltageNominal ( int  chan)
overridevirtual

Implements PowerSupply.

◆ IsPowerConstantCurrent()

bool MockPowerSupply::IsPowerConstantCurrent ( int  chan)
overridevirtual

Implements PowerSupply.

◆ SetMasterPowerEnable()

void MockPowerSupply::SetMasterPowerEnable ( bool  enable)
overridevirtual

Reimplemented from PowerSupply.

◆ SetPowerChannelActive()

void MockPowerSupply::SetPowerChannelActive ( int  chan,
bool  on 
)
overridevirtual

Reimplemented from PowerSupply.

◆ SetPowerCurrent()

void MockPowerSupply::SetPowerCurrent ( int  chan,
double  amps 
)
overridevirtual

Implements PowerSupply.

◆ SetPowerOvercurrentShutdownEnabled()

void MockPowerSupply::SetPowerOvercurrentShutdownEnabled ( int  chan,
bool  enable 
)
overridevirtual

Reimplemented from PowerSupply.

◆ SetPowerVoltage()

void MockPowerSupply::SetPowerVoltage ( int  chan,
double  volts 
)
overridevirtual

Implements PowerSupply.

◆ SupportsIndividualOutputSwitching()

bool MockPowerSupply::SupportsIndividualOutputSwitching ( )
overridevirtual

Determines if the power supply supports switching individual output channels.

If this function returns false, GetPowerChannelActive() will always return true, and SetPowerChannelActive() is a no-op.

Reimplemented from PowerSupply.

◆ SupportsMasterOutputSwitching()

bool MockPowerSupply::SupportsMasterOutputSwitching ( )
overridevirtual

Determines if the power supply supports ganged master switching of all outputs.

If this function returns false, GetMasterPowerEnable() will always return true, and SetMasterPowerEnable() is a no-op.

Reimplemented from PowerSupply.

◆ SupportsOvercurrentShutdown()

bool MockPowerSupply::SupportsOvercurrentShutdown ( )
overridevirtual

Determines if the power supply supports shutdown rather than constant-current mode on overcurrent.

If this function returns false, GetPowerOvercurrentShutdownEnabled() and GetPowerOvercurrentShutdownTripped() will always return false, and SetPowerOvercurrentShutdownEnabled() is a no-op.

Reimplemented from PowerSupply.

◆ SupportsSoftStart()

bool MockPowerSupply::SupportsSoftStart ( )
overridevirtual

Determines if the power supply supports soft start.

If this function returns false, IsSoftStartEnabled() will always return false, and SetSoftStartEnabled() is a no-op.

Reimplemented from PowerSupply.


The documentation for this class was generated from the following files: