|
LRAUV
revA
|
This class allows one to control loads on a load controller channel. More...
#include <LoadControl.h>

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_ |
| Component * | component_ |
This class allows one to control loads on a load controller channel.
| LoadControl::LoadControl | ( | const ConfigURI & | loadControlCfg, |
| bool | useHardware, | ||
| Logger & | logger, | ||
| Component * | component | ||
| ) |
Constructor.
References initialize(), and initialized_.
|
virtual |
|
private |
| 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().
| Str LoadControl::errorString | ( | ) |
References CL_ACTIVATED, errorStatus_, HW_OVERCURRENT_SHUTDOWN, INVALID_CMD, SW_OVERCURRENT_WARNING, and WDT_RESET.
Referenced by DVL_micro::logVoltageAndCurrent(), CANONSampler::logVoltageAndCurrent(), VemcoVR2C::logVoltageAndCurrent(), ISUS::logVoltageAndCurrent(), AcousticModem_Benthos_ATM900::logVoltageAndCurrent(), DAT::logVoltageAndCurrent(), ESPComponent::logVoltageAndCurrent(), Turbulence_NPS::receive(), SCPI::runnable(), ElevatorServo::runnable(), MassServo::runnable(), Aanderaa_O2::runnable(), BuoyancyServo::runnable(), RudderServo::runnable(), Radio_Surface::runnable(), WetLabsBB2FL::runnable(), AHRS_3DMGX3::runnable(), ThrusterServo::runnable(), PNI_TCM::runnable(), CTD_NeilBrown::runnable(), AHRS_sp3003D::runnable(), Rowe_600LCM::runnable(), Rowe_600::runnable(), NAL9602::runnable(), DVL_micro::stopping(), SCPI::stopping(), ElevatorServo::stopping(), MassServo::stopping(), BuoyancyServo::stopping(), ISUS::stopping(), RudderServo::stopping(), Turner_Cyclops_rhodamine::stopping(), Aanderaa_O2::stopping(), CANONSampler::stopping(), VemcoVR2C::stopping(), Radio_Surface::stopping(), AcousticModem_Benthos_ATM900::stopping(), WetLabsBB2FL::stopping(), Turbulence_NPS::stopping(), ESPComponent::stopping(), DAT::stopping(), AHRS_3DMGX3::stopping(), ThrusterServo::stopping(), PNI_TCM::stopping(), CTD_NeilBrown::stopping(), AHRS_sp3003D::stopping(), Rowe_600LCM::stopping(), Rowe_600::stopping(), and NAL9602::stopping().
|
private |
Referenced by requestVoltageAndCurrent().
|
inline |
References powerState_.
Referenced by ThrusterServo::runnable(), DVL_micro::stopped(), MassServo::stopped(), ElevatorServo::stopped(), BuoyancyServo::stopped(), RudderServo::stopped(), AcousticModem_Benthos_ATM900::stopped(), WetLabsBB2FL::stopped(), Turbulence_NPS::stopped(), DAT::stopped(), AHRS_3DMGX3::stopped(), ThrusterServo::stopped(), PNI_TCM::stopped(), CTD_NeilBrown::stopped(), AHRS_sp3003D::stopped(), and NAL9602::stopped().
|
inline |
References errorStatus_.
Referenced by DVL_micro::logVoltageAndCurrent(), CANONSampler::logVoltageAndCurrent(), VemcoVR2C::logVoltageAndCurrent(), ISUS::logVoltageAndCurrent(), AcousticModem_Benthos_ATM900::logVoltageAndCurrent(), DAT::logVoltageAndCurrent(), ESPComponent::logVoltageAndCurrent(), Turbulence_NPS::receive(), SCPI::runnable(), ElevatorServo::runnable(), MassServo::runnable(), Aanderaa_O2::runnable(), BuoyancyServo::runnable(), RudderServo::runnable(), Radio_Surface::runnable(), WetLabsBB2FL::runnable(), AHRS_3DMGX3::runnable(), ThrusterServo::runnable(), PNI_TCM::runnable(), CTD_NeilBrown::runnable(), AHRS_sp3003D::runnable(), Rowe_600LCM::runnable(), Rowe_600::runnable(), NAL9602::runnable(), DVL_micro::stopping(), SCPI::stopping(), ElevatorServo::stopping(), MassServo::stopping(), BuoyancyServo::stopping(), ISUS::stopping(), RudderServo::stopping(), Turner_Cyclops_rhodamine::stopping(), Aanderaa_O2::stopping(), CANONSampler::stopping(), VemcoVR2C::stopping(), Radio_Surface::stopping(), AcousticModem_Benthos_ATM900::stopping(), WetLabsBB2FL::stopping(), Turbulence_NPS::stopping(), ESPComponent::stopping(), DAT::stopping(), AHRS_3DMGX3::stopping(), ThrusterServo::stopping(), PNI_TCM::stopping(), CTD_NeilBrown::stopping(), AHRS_sp3003D::stopping(), Rowe_600LCM::stopping(), Rowe_600::stopping(), and NAL9602::stopping().
|
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().
| bool LoadControl::powerDown | ( | ) |
Turns off the device.
Turns off the device;.
References component_, initialized_, io_, Component::logCurrent(), Component::logVoltage(), POWER_DOWN, powerState_, and DeviceIOStream::write().
Referenced by ElevatorServo::pause(), MassServo::pause(), Aanderaa_O2::pause(), BuoyancyServo::pause(), DVL_micro::pause(), RudderServo::pause(), Turbulence_NPS::pause(), AHRS_3DMGX3::pause(), ThrusterServo::pause(), PNI_TCM::pause(), CTD_NeilBrown::pause(), NAL9602::pause(), ESPComponent::powerDownESP(), SCPI::stop(), ISUS::stop(), CANONSampler::stop(), Turner_Cyclops_rhodamine::stop(), VemcoVR2C::stop(), Radio_Surface::stop(), Rowe_600::stop(), DVL_micro::uninitialize(), ElevatorServo::uninitialize(), Aanderaa_O2::uninitialize(), MassServo::uninitialize(), CANONSampler::uninitialize(), ISUS::uninitialize(), VemcoVR2C::uninitialize(), RudderServo::uninitialize(), AcousticModem_Benthos_ATM900::uninitialize(), BuoyancyServo::uninitialize(), WetLabsBB2FL::uninitialize(), DAT::uninitialize(), Turbulence_NPS::uninitialize(), ESPComponent::uninitialize(), AHRS_3DMGX3::uninitialize(), PNI_TCM::uninitialize(), ThrusterServo::uninitialize(), CTD_NeilBrown::uninitialize(), Rowe_600LCM::uninitialize(), Rowe_600::uninitialize(), and NAL9602::uninitialize().
| bool LoadControl::powerUp | ( | ) |
Turns on the device.
References errorStatus_, initialized_, io_, POWER_UP, powerState_, and DeviceIOStream::write().
Referenced by ElevatorServo::paused(), MassServo::paused(), BuoyancyServo::paused(), RudderServo::paused(), NAL9602::paused(), ESPComponent::powerUpESP(), DVL_micro::resume(), BuoyancyServo::resume(), Turbulence_NPS::resume(), ThrusterServo::resume(), PNI_TCM::resume(), AHRS_3DMGX3::resume(), CTD_NeilBrown::resume(), AHRS_sp3003D::resume(), SCPI::start(), MassServo::start(), ElevatorServo::start(), BuoyancyServo::start(), RudderServo::start(), Turner_Cyclops_rhodamine::start(), Aanderaa_O2::start(), VemcoVR2C::start(), ISUS::start(), CANONSampler::start(), Radio_Surface::start(), AcousticModem_Benthos_ATM900::start(), WetLabsBB2FL::start(), Turbulence_NPS::start(), DAT::start(), AHRS_3DMGX3::start(), PNI_TCM::start(), DVL_micro::start(), ThrusterServo::start(), CTD_NeilBrown::start(), AHRS_sp3003D::start(), Rowe_600LCM::start(), Rowe_600::start(), and NAL9602::start().
| void LoadControl::readFaults | ( | ) |
Reads back the fault byte. To be called after requestFaults.
References InStream::bytesRead(), errorStatus_, initialized_, io_, and DeviceIOStream::read().
Referenced by DVL_micro::stopping(), SCPI::stopping(), ElevatorServo::stopping(), MassServo::stopping(), VemcoVR2C::stopping(), ISUS::stopping(), BuoyancyServo::stopping(), CANONSampler::stopping(), Aanderaa_O2::stopping(), RudderServo::stopping(), Turner_Cyclops_rhodamine::stopping(), Radio_Surface::stopping(), AcousticModem_Benthos_ATM900::stopping(), WetLabsBB2FL::stopping(), ESPComponent::stopping(), DAT::stopping(), Turbulence_NPS::stopping(), ThrusterServo::stopping(), AHRS_3DMGX3::stopping(), PNI_TCM::stopping(), CTD_NeilBrown::stopping(), AHRS_sp3003D::stopping(), Rowe_600LCM::stopping(), Rowe_600::stopping(), and NAL9602::stopping().
| void LoadControl::requestFaults | ( | ) |
Requests the fault byte.
References initialized_, io_, and DeviceIOStream::write().
| void LoadControl::requestVoltageAndCurrent | ( | ) |
Requests voltage information from LCB and writes it to component writers.
References InStream::bytesRead(), component_, dataState_, DONE, Timestamp::elapsed(), errorStatus_, extractCount(), initialized_, io_, Component::logCurrent(), Component::logVoltage(), Timestamp::Now(), PARSECURRENT, PARSEVOLTAGE, DeviceIOStream::read(), REQUESTCURRENT, requestTimeout_, REQUESTVOLTAGE, startTime_, and DeviceIOStream::write().
Referenced by DVL_micro::logVoltageAndCurrent(), CANONSampler::logVoltageAndCurrent(), VemcoVR2C::logVoltageAndCurrent(), ISUS::logVoltageAndCurrent(), AcousticModem_Benthos_ATM900::logVoltageAndCurrent(), DAT::logVoltageAndCurrent(), ESPComponent::logVoltageAndCurrent(), Turbulence_NPS::receive(), SCPI::runnable(), ElevatorServo::runnable(), MassServo::runnable(), Aanderaa_O2::runnable(), BuoyancyServo::runnable(), RudderServo::runnable(), Radio_Surface::runnable(), WetLabsBB2FL::runnable(), PNI_TCM::runnable(), ThrusterServo::runnable(), AHRS_3DMGX3::runnable(), CTD_NeilBrown::runnable(), AHRS_sp3003D::runnable(), Rowe_600LCM::runnable(), Rowe_600::runnable(), and NAL9602::runnable().
|
inline |
References OFF, POWER_DOWN, and powerState_.
|
inline |
References ON, POWER_UP, and powerState_.
|
private |
Referenced by powerDown(), and requestVoltageAndCurrent().
|
private |
Referenced by initialize(), and requestVoltageAndCurrent().
|
private |
Referenced by errorString(), hasError(), powerUp(), readFaults(), and requestVoltageAndCurrent().
|
private |
Referenced by deisolateLoad(), discreteOff(), discreteOn(), initialize(), isolateLoad(), LoadControl(), powerDown(), powerUp(), readFaults(), requestFaults(), and requestVoltageAndCurrent().
|
private |
Referenced by deisolateLoad(), discreteOff(), discreteOn(), isolateLoad(), powerDown(), powerUp(), readFaults(), requestFaults(), and requestVoltageAndCurrent().
|
private |
Referenced by deisolateLoad(), getPowerState(), isolateLoad(), powerDown(), powerUp(), setPowerStateOff(), and setPowerStateOn().
|
private |
Referenced by requestVoltageAndCurrent().
|
private |
Referenced by requestVoltageAndCurrent().