LRAUV  revA
LoadControl Class Reference

This class allows one to control loads on a load controller channel. More...

#include <LoadControl.h>

Collaboration diagram for LoadControl:

Public Types

enum  LCBError {
  OK = 0, WDT_RESET = 0x01, INVALID_CMD = 0x02, HW_OVERCURRENT_SHUTDOWN = 0x04,
  SW_OVERCURRENT_WARNING = 0x08, CL_ACTIVATED = 0x10
}
 LCB Fault Byte. More...
 
enum  PowerState {
  POWER_UNKNOWN, POWER_UP, ON, POWER_DOWN_READY,
  POWER_DOWN, OFF
}
 
enum  LCBData {
  REQUESTVOLTAGE, PARSEVOLTAGE, REQUESTCURRENT, PARSECURRENT,
  DONE
}
 

Public Member Functions

 LoadControl (const ConfigURI &loadControlCfg, bool useHardware, Logger &logger, Component *component)
 Constructor. More...
 
virtual ~LoadControl ()
 
bool powerUp ()
 Turns on the device. More...
 
bool powerDown ()
 Turns off the device. More...
 
bool isolateLoad ()
 Turns off and isolates device. More...
 
bool deisolateLoad ()
 Turns off and de-isolates device (i.e. closes relay) More...
 
bool discreteOn ()
 Turns on discrete;. More...
 
bool discreteOff ()
 Turns off discrete;. More...
 
void requestVoltageAndCurrent ()
 Requests voltage information from LCB and writes it to component writers. More...
 
void requestFaults ()
 Requests the fault byte. More...
 
void readFaults ()
 Reads back the fault byte. To be called after requestFaults. More...
 
PowerState getPowerState ()
 
bool setPowerStateOn ()
 
bool setPowerStateOff ()
 
bool hasError ()
 
Str errorString ()
 

Private Member Functions

 LoadControl (const LoadControl &old)
 
void initialize ()
 Initializes power switching to the load control backplane. More...
 
unsigned short extractCount (char *convertCount, int pos)
 

Private Attributes

LCBData dataState_
 
DeviceIOStream io_
 
PowerState powerState_
 
bool initialized_
 
Timespan requestTimeout_
 
Timestamp startTime_
 
int errorStatus_
 
Componentcomponent_
 

Detailed Description

This class allows one to control loads on a load controller channel.

Constructor & Destructor Documentation

LoadControl::LoadControl ( const ConfigURI loadControlCfg,
bool  useHardware,
Logger logger,
Component component 
)

Constructor.

References initialize(), and initialized_.

LoadControl::~LoadControl ( )
virtual
LoadControl::LoadControl ( const LoadControl old)
private

Member Function Documentation

bool LoadControl::deisolateLoad ( )

Turns off and de-isolates device (i.e. closes relay)

References initialized_, io_, POWER_DOWN, powerState_, and DeviceIOStream::write().

Referenced by PAR_Licor::initialize(), and Depth_Keller::initialize().

bool LoadControl::discreteOff ( )

Turns off discrete;.

References initialized_, io_, and DeviceIOStream::write().

Referenced by ISUS::stop(), and ISUS::uninitialize().

bool LoadControl::discreteOn ( )

Turns on discrete;.

References initialized_, io_, and DeviceIOStream::write().

Referenced by ISUS::start().

unsigned short LoadControl::extractCount ( char *  convertCount,
int  pos 
)
private
void LoadControl::initialize ( void  )
private

Initializes power switching to the load control backplane.

References dataState_, initialized_, LPC3Reg::PowerOnLoads(), and REQUESTVOLTAGE.

Referenced by LoadControl().

bool LoadControl::isolateLoad ( )

Turns off and isolates device.

Turns off and isolated the device;.

References initialized_, io_, POWER_DOWN, powerState_, and DeviceIOStream::write().

Referenced by AHRS_sp3003D::pause(), and AHRS_sp3003D::uninitialize().

void LoadControl::requestFaults ( )

Requests the fault byte.

References initialized_, io_, and DeviceIOStream::write().

bool LoadControl::setPowerStateOff ( )
inline

References OFF, POWER_DOWN, and powerState_.

bool LoadControl::setPowerStateOn ( )
inline

References ON, POWER_UP, and powerState_.

Member Data Documentation

Component* LoadControl::component_
private
LCBData LoadControl::dataState_
private
int LoadControl::errorStatus_
private
Timespan LoadControl::requestTimeout_
private
Timestamp LoadControl::startTime_
private

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