ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members

An Alientek DP-100 power supply or other equivalent model. More...

#include <AlientekPowerSupply.h>

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

Public Member Functions

 AlientekPowerSupply (SCPITransport *transport)
 
virtual uint32_t GetInstrumentTypesForChannel (size_t i) const override
 Returns a bitfield describing the set of instrument types that a given channel supports. More...
 
virtual bool SupportsIndividualOutputSwitching () override
 Determines if the power supply supports switching individual output channels. More...
 
virtual bool SupportsVoltageCurrentControl (int chan) override
 Determines if the power supply supports voltage/current control for the given channel. More...
 
virtual double GetPowerVoltageActual (int chan) override
 
virtual double GetPowerVoltageNominal (int chan) override
 
virtual double GetPowerCurrentActual (int chan) override
 
virtual double GetPowerCurrentNominal (int chan) override
 
virtual bool GetPowerChannelActive (int chan) override
 
virtual void SetPowerVoltage (int chan, double volts) override
 
virtual void SetPowerCurrent (int chan, double amps) override
 
virtual void SetPowerChannelActive (int chan, bool on) override
 
virtual bool IsPowerConstantCurrent (int chan) override
 
 POWER_INITPROC (AlientekPowerSupply)
 
- 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. More...
 
virtual bool SupportsSoftStart ()
 Determines if the power supply supports soft start. More...
 
virtual bool SupportsIndividualOutputSwitching ()
 Determines if the power supply supports switching individual output channels. More...
 
virtual bool SupportsMasterOutputSwitching ()
 Determines if the power supply supports ganged master switching of all outputs. More...
 
virtual bool SupportsOvercurrentShutdown ()
 Determines if the power supply supports shutdown rather than constant-current mode on overcurrent. More...
 
virtual bool SupportsVoltageCurrentControl (int chan)
 Determines if the power supply supports voltage/current control for the given channel. More...
 
virtual bool AcquireData () override
 Pulls data from hardware and updates our measurements. More...
 
virtual double GetPowerVoltageActual (int chan)=0
 
virtual double GetPowerVoltageNominal (int chan)=0
 
virtual double GetPowerCurrentActual (int chan)=0
 
virtual double GetPowerCurrentNominal (int chan)=0
 
virtual bool GetPowerChannelActive (int chan)
 
virtual bool GetPowerOvercurrentShutdownEnabled (int chan)
 
virtual void SetPowerOvercurrentShutdownEnabled (int chan, bool enable)
 
virtual bool GetPowerOvercurrentShutdownTripped (int chan)
 
virtual void SetPowerVoltage (int chan, double volts)=0
 
virtual void SetPowerCurrent (int chan, double amps)=0
 
virtual void SetPowerChannelActive (int chan, bool on)
 
virtual bool IsPowerConstantCurrent (int chan)=0
 
virtual bool GetMasterPowerEnable ()
 
virtual void SetMasterPowerEnable (bool enable)
 
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. More...
 
virtual void SetSoftStartRampTime (int chan, int64_t time)
 Sets the ramp time for use with soft-start mode. More...
 
- Public Member Functions inherited from Instrument
virtual unsigned int GetInstrumentTypes () const =0
 Returns a bitfield describing the set of instrument types that this instrument supports. More...
 
virtual std::string GetName () const =0
 
virtual std::string GetVendor () const =0
 
virtual std::string GetSerial () const =0
 
virtual std::string GetTransportConnectionString ()=0
 Gets the connection string for our transport. More...
 
virtual std::string GetTransportName ()=0
 Gets the name of our transport. More...
 
virtual uint32_t GetInstrumentTypesForChannel (size_t i) const =0
 Returns a bitfield describing the set of instrument types that a given channel supports. More...
 
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. More...
 
virtual std::string GetChannelDisplayName (size_t i)
 Gets the hardware display name for a channel. This is an arbitrary user-selected string. More...
 
virtual void SetChannelDisplayName (size_t i, std::string name)
 Sets the hardware display name for a channel. This is an arbitrary user-selected string. More...
 
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 bool AcquireData ()=0
 Pull data from the instrument. More...
 
virtual YAML::Node SerializeConfiguration (IDTable &table) const
 Serializes this instrument's configuration to a YAML node. More...
 
virtual void LoadConfiguration (int version, const YAML::Node &node, IDTable &idmap)
 Load instrument and channel configuration from a save file. More...
 
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. More...
 
- Public Member Functions inherited from SCPIInstrument
 SCPIInstrument (SCPITransport *transport, bool identify=true)
 
virtual std::string GetTransportConnectionString ()
 Gets the connection string for our transport. More...
 
virtual std::string GetTransportName ()
 Gets the name of our transport. More...
 
virtual std::string GetName () const
 
virtual std::string GetVendor () const
 
virtual std::string GetSerial () const
 
virtual std::string GetDriverName () const =0
 
- Public Member Functions inherited from SCPIDevice
 SCPIDevice (SCPITransport *transport, bool identify=true)
 
SCPITransportGetTransport () const
 
- Public Member Functions inherited from HIDInstrument
 HIDInstrument (SCPITransport *transport)
 

Static Public Member Functions

static std::string GetDriverNameInternal ()
 Return the constant driver name "alientek_dp".
 
- Static Public Member Functions inherited from SCPIPowerSupply
static void DoAddDriverClass (std::string name, PowerCreateProcType proc)
 
static void EnumDrivers (std::vector< std::string > &names)
 
static std::shared_ptr< SCPIPowerSupplyCreatePowerSupply (std::string driver, SCPITransport *transport)
 

Protected Types

enum  Function : uint8_t {
  DEVICE_INFO = 0x10 , FIRM_INFO = 0x11 , START_TRANS = 0x12 , DATA_TRANS = 0x13 ,
  END_TRANS = 0x14 , DEV_UPGRADE = 0x15 , BASIC_INFO = 0x30 , BASIC_SET = 0x35 ,
  SYSTEM_INFO = 0x40 , SYSTEM_SET = 0x45 , SCAN_OUT = 0x50 , SERIAL_OUT = 0x55 ,
  DISCONNECT = 0x80 , NONE = 0xFF
}
 
enum  Operation : uint8_t { OUTPUT = 0x20 , SETTING = 0x40 , READ = 0x80 }
 
- Protected Types inherited from SCPIPowerSupply
typedef std::map< std::string, PowerCreateProcType > PowerCreateMapType
 

Protected Member Functions

void SendReceiveReport (Function function, int sequence=-1, std::vector< uint8_t > *data=nullptr)
 
void SendGetBasicSetReport ()
 
void SendSetBasicSetReport ()
 
- 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.
 
- Protected Member Functions inherited from SCPIInstrument
void DoSerializeConfiguration (YAML::Node &node, IDTable &table)
 
- Protected Member Functions inherited from HIDInstrument
size_t Converse (uint8_t reportNumber, size_t responseReportSize, const std::vector< uint8_t > &sendData, std::vector< uint8_t > *receiveData)
 
void SendReport (uint8_t reportNumber, const std::vector< uint8_t > &data)
 Send a HID report. More...
 
size_t ReadReport (size_t reportSize, std::vector< uint8_t > *data)
 
- Protected Member Functions inherited from BinaryDriver
void PushUint16 (std::vector< uint8_t > *data, uint16_t value, bool littleEndian=true)
 Helper function to push a uint16 to a std::vector of bytes, as two consecutive bytes (either little-endian or big-endian according to littleEndian parameter) More...
 
uint16_t ReadUint16 (const std::vector< uint8_t > &data, uint8_t index, bool littleEndian=true)
 Bounds-checked read of a 16-bit value from a byte vector. More...
 
uint8_t ReadUint8 (const std::vector< uint8_t > &data, uint8_t index)
 Bounds-checked read of an 8-bit value from a byte vector. More...
 
uint16_t CalculateCRC (const uint8_t *buff, size_t len)
 

Protected Attributes

uint8_t m_deviceAdress = 0xFB
 
std::chrono::system_clock::time_point m_nextBasicInfoUpdate
 
std::chrono::milliseconds m_basicInfoCacheDuration = std::chrono::milliseconds(10)
 
std::chrono::system_clock::time_point m_nextBasicSetUpdate
 
std::chrono::milliseconds m_basicSetCacheDuration = std::chrono::milliseconds(1000)
 
double m_vIn
 Input voltage in V.
 
double m_vOut
 Actual output voltage in V.
 
double m_vOutSet
 Set output voltage in V.
 
double m_iOut
 Actual output current in A.
 
double m_iOutSet
 Set output current in A.
 
double m_vOutMax
 Max output voltage in V.
 
double m_temp1
 Temperature 1 in °C.
 
double m_temp2
 Temperature 2 in °C.
 
double m_dc5V
 5V rail in V.
 
uint8_t m_outMode
 Output mode => 0 = CC, 1 = CV, 2 = OVP/OCP (according to workState)
 
uint8_t m_workState
 Work state => 1 = OVP, 2 = OCP.
 
double m_ovpSet
 Over-voltage protection setting in V.
 
double m_ocpSet
 Over-current protection setting in A.
 
bool m_powerState
 Power state.
 
- 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
 
- Protected Attributes inherited from HIDInstrument
std::recursive_mutex m_hidMutex
 Mutex to make sure several requests don't collide before we received the corresponding response.
 

Additional Inherited Members

- Public Types inherited from SCPIPowerSupply
typedef std::shared_ptr< SCPIPowerSupply >(* PowerCreateProcType) (SCPITransport *)
 
- 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 Attributes inherited from Instrument
std::string m_nickname
 Optional user-selected nickname of the instrument. More...
 
- Static Protected Attributes inherited from SCPIPowerSupply
static PowerCreateMapType m_powercreateprocs
 

Detailed Description

An Alientek DP-100 power supply or other equivalent model.

Member Function Documentation

◆ GetInstrumentTypesForChannel()

uint32_t AlientekPowerSupply::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.

◆ GetPowerChannelActive()

bool AlientekPowerSupply::GetPowerChannelActive ( int  chan)
overridevirtual

Reimplemented from PowerSupply.

◆ GetPowerCurrentActual()

double AlientekPowerSupply::GetPowerCurrentActual ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerCurrentNominal()

double AlientekPowerSupply::GetPowerCurrentNominal ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerVoltageActual()

double AlientekPowerSupply::GetPowerVoltageActual ( int  chan)
overridevirtual

Implements PowerSupply.

◆ GetPowerVoltageNominal()

double AlientekPowerSupply::GetPowerVoltageNominal ( int  chan)
overridevirtual

Implements PowerSupply.

◆ IsPowerConstantCurrent()

bool AlientekPowerSupply::IsPowerConstantCurrent ( int  chan)
overridevirtual

Implements PowerSupply.

◆ SetPowerChannelActive()

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

Reimplemented from PowerSupply.

◆ SetPowerCurrent()

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

Implements PowerSupply.

◆ SetPowerVoltage()

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

Implements PowerSupply.

◆ SupportsIndividualOutputSwitching()

bool AlientekPowerSupply::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.

◆ SupportsVoltageCurrentControl()

bool AlientekPowerSupply::SupportsVoltageCurrentControl ( int  chan)
overridevirtual

Determines if the power supply supports voltage/current control for the given channel.

If this function returns false, GetPowerVoltage* and GetPowerCurrent* will always return zero, and SetPowerCurrent*, and SetPowerVoltage* are no-ops.

Reimplemented from PowerSupply.


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