LRAUV  revA
IBIT Class Reference

The IBIT built-in-test component provides monitoring of vehicle health on demand. More...

#include <IBIT.h>

Inheritance diagram for IBIT:
Collaboration diagram for IBIT:

Public Member Functions

 IBIT (const Module *module)
 
virtual ~IBIT ()
 
void initialize (void)
 Initialize function. More...
 
void run ()
 The actual "payload" of the component. More...
 
void uninitialize (void)
 Uninit function. More...
 
- Public Member Functions inherited from SyncComponent
CycleOrder getCycleOrder (void)
 Getter function for controlThreadOrderPreference. More...
 
void setRepeating (bool repeating)
 
int getDivisor () const
 
int getModulo () const
 
bool isRepeater ()
 
bool isRepeating ()
 
- Public Member Functions inherited from Component
virtual ~Component ()
 Destructor cleans up readers_ and writers_. More...
 
void registerReader (DataReader *reader)
 
void unregisterReader (DataReader *reader)
 
void registerWriter (DataWriter *writer)
 
void unregisterWriter (DataWriter *writer)
 
void disableMetering (void)
 
FlexArray< DataReader * > & getReaderList (void)
 
FlexArray< DataWriter * > & getWriterList (void)
 
const ModulegetModule ()
 
virtual void configure ()
 Read (or re-read!) configuration settings. More...
 
virtual void execute (void)
 
bool isActive () const
 Indicates if the component is active. More...
 
const CodedStrgetName (void) const
 Returns the name. More...
 
const TimestampgetTimeOfLastRun (void) const
 
ComponentState getState (void)
 Return the component's current state. More...
 
void setState (ComponentState state)
 
RunState getRunState (void)
 Return the component's run state. More...
 
bool isUsingRunState ()
 Return true if using runState. More...
 
void requestData (bool requestingData)
 Tell the component to start (or stop) sending data. More...
 
void requestStart ()
 Tell the component to start runnning. More...
 
void requestPause (const Timespan expectedPauseTime)
 Tell the component to pause runnning. More...
 
void requestResume ()
 Tell the component resume from pause. More...
 
void requestStop ()
 Tell the component to stop runnning. More...
 
virtual RunState start ()
 Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence. More...
 
virtual RunState starting ()
 Might follow a STOP...START sequence Subseqent. More...
 
virtual RunState runnable ()
 Should eventually follow a START request or RESETTING. More...
 
virtual RunState satisfied ()
 Possible return value of a Behavior. More...
 
virtual RunState pause ()
 Pause for a short period (indicated by pauseTime) More...
 
virtual RunState pausing ()
 Might follow a PAUSE request. More...
 
virtual RunState paused ()
 Should eventually follow a PAUSE request: should set continueTime. More...
 
virtual RunState resume ()
 Resume from PAUSE. More...
 
virtual RunState resuming ()
 Might follow a PAUSE...RESUME sequence. More...
 
virtual RunState resetting ()
 Might occur in case of Error. More...
 
virtual RunState stop ()
 Initial state – can be later followed by START. More...
 
virtual RunState stopping ()
 Might follow a STOP request. More...
 
virtual RunState stopped ()
 Should eventually follow a STOP request. More...
 
void setCriticalFailureReported (bool boolVal)
 
void setRecoveringFromCritical (bool boolVal)
 
void setFailureReported (bool boolVal)
 
bool isFailureUninitialized ()
 
void setFailureUninitialized (bool boolVal)
 
void setRetryTimeout (const Timespan &timeout)
 
virtual bool isCompleted (void)
 Query if this component is completed. More...
 
void setPeriod (const Timespan &period)
 Set the period of this component... used if it is periodic. More...
 
const TimespangetPeriod (void)
 Returns the component's period (regardless of whether it is periodic) More...
 
ComponentType getComponentType ()
 Getter function for ComponentType. More...
 
virtual bool isFailed (void) const
 
virtual FailureMode::FailType getFailureType (void) const
 
virtual bool getCriticalFailureReported (void) const
 
virtual bool getFailureReported (void) const
 
virtual Timespan getRetryTimeout (void) const
 
virtual FailureMode::FailType setFailure (FailureMode::FailType failureType)
 
virtual int getFailCount (void) const
 
virtual bool isFailureMissionCritical ()
 
virtual int getAllowableFailures (void) const
 
virtual void setAllowableFailures (int fails)
 
LoggergetLogger (void)
 
virtual int incrementFailCount (void)
 
virtual void resetFailCount (void)
 
virtual int getSkippedRunsSinceFail (void) const
 
virtual int incrementSkippedRunsSinceFail (void)
 
virtual void logVoltage (float voltage, float averageVoltage)
 
virtual void logCurrent (float current, float averageCurrent)
 
const TimestampgetWriteTimestamp (void)
 
void setWriteTimestamp (const Timestamp &writeTimestamp)
 
BlobReadernewBlobReader (const BlobURI &blobURI)
 
BlobReadernewBlobReaderFromUniversal (const Str &componentName, const UniversalBlobURI &blobURI)
 
BlobWriternewBlobWriter (const BlobURI &blobURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS)
 
ConfigReadernewConfigReader (const ConfigURI &configURI)
 
DataReadernewDataReader (const DataURI &dataURI)
 
DataReadernewDataReaderFromUniversal (const Str &componentName, const UniversalURI &universalURI)
 
DataWriternewDataWriter (const DataURI &dataURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS)
 
UniversalBlobReadernewUniversalBlobReader (const UniversalBlobURI &universalURI)
 
UniversalBlobWriternewUniversalBlobWriter (const UniversalBlobURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS)
 
UniversalDataReadernewUniversalReader (const UniversalURI &universalURI)
 
UniversalDataWriternewUniversalWriter (const UniversalURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS)
 

Private Types

enum  IBITState {
  START, CTRLHI, CTRLLO, CTRLCTR,
  COMMS, BATT, ENV, DONE,
  IDLE
}
 

Private Member Functions

bool readConfig (void)
 
bool ctrlSurfaceCheckPos (float elevExpect, float ruddExpect)
 

Private Attributes

bool ok_
 
bool ibitPass_
 
DataWriteribitRunningStateWriter_
 
DataWriterelevatorAngleCmdWriter_
 
DataWriterverticalModeWriter_
 
DataWriterhorizontalModeWriter_
 
DataWriterrudderAngleCmdWriter_
 
DataReaderelevatorAngleReader_
 
DataReaderrudderAngleReader_
 
DataReadersBITRunningReader_
 
DataReadersigQualityReader_
 
DataReadergoodFixReader_
 
DataReadertimeFixReader_
 
DataReaderlatitudeFixReader_
 
DataReaderlongitudeFixReader_
 
DataReaderbatteryChargeReader_
 
DataReaderbatteryVoltageReader_
 
DataReaderpressureReader_
 
DataReaderhumidityReader_
 
ConfigReaderbatteryCapacityThresholdCfgReader_
 Configuration Readers. More...
 
ConfigReaderbatteryVoltageThresholdCfgReader_
 
ConfigReaderabortDepthCfgReader_
 
ConfigReaderstopDepthCfgReader_
 
ConfigReaderhumidityThresholdCfgReader_
 
ConfigReaderpressureThresholdCfgReader_
 
ConfigReaderbuoyancyNeutralCfgReader_
 
ConfigReaderelevatorLimitCfgReader_
 
ConfigReaderrudderLimitCfgReader_
 
ConfigReadersurfaceThresholdCfgReader_
 
ConfigReadermassDefaultCfgReader_
 
ConfigReaderruddDeviationCfgReader_
 
ConfigReaderelevDeviationCfgReader_
 
float surfaceThreshold_
 *----------------— vehicle parameters -----------------------—*/ More...
 
float batteryCapacityThreshold_
 
float batteryVoltageThreshold_
 
float abortDepth_
 
float stopDepth_
 
float bitHumidityThreshold_
 
float bitPressureThreshold_
 
float buoyancyNeutral_
 
float massDefault_
 
float elevatorLimit_
 
float rudderLimit_
 
float ruddDeviation_
 
float elevDeviation_
 
Timespan ctrlTimeout_
 
Timespan commsTimeout_
 
Timestamp startTime_
 
int sigQuality_
 
bool goodFix_
 
IBITState ibitState_
 

Additional Inherited Members

- Public Types inherited from Component
enum  ComponentState {
  BLOCK_CONTINUOUS, BLOCK_PERIODIC, BLOCK_NORMAL, BLOCK_COMPLETED,
  BLOCK_UNKNOWN
}
 In this model, the component has basically two states: wanting to run, and completed (no longer needing to run). More...
 
enum  ComponentType { COMPONENT_ASYNC, COMPONENT_CONFIG, COMPONENT_BEHAVIOR, COMPONENT_SYNC }
 Components can indicate how they want to be handled by their type. More...
 
enum  RunState {
  NO_RUN_STATE = 0, START, STARTING, RUNNABLE,
  SATISFIED, PAUSE, PAUSING, PAUSED,
  RESUME, RESUMING, RESETTING, STOP,
  STOPPING, STOPPED
}
 
- Static Public Attributes inherited from SyncComponent
static const int CYCLE_INCREMENT
 
static const int CYCLE_REPEAT_OFFSET
 
static const CycleOrder CYCLE_STARTER
 
static const CycleOrder CYCLE_SIMULATOR
 
static const CycleOrder CYCLE_SENSOR
 
static const CycleOrder CYCLE_DERIVATION
 
static const CycleOrder CYCLE_ESTIMATION
 
static const CycleOrder CYCLE_NAVIGATION
 
static const CycleOrder CYCLE_MISSION_MANAGER
 
static const CycleOrder CYCLE_MISSION
 
static const CycleOrder CYCLE_CONTROL
 
static const CycleOrder CYCLE_SERVO
 
static const CycleOrder CYCLE_TEST
 
static const CycleOrder CYCLE_REPORTER
 
static const CycleOrder CYCLE_LOGGER
 
- Protected Types inherited from Component
enum  ConfigOption { CONFIG_SIMULATE_HARDWARE, CONFIG_POWER, CONFIG_FREQUENCY, CONFIG_LATENCY }
 
- Protected Member Functions inherited from SyncTestComponent
 SyncTestComponent (const Str &name, const Module *module, int divisor=1, int modulo=0)
 
- Protected Member Functions inherited from SyncComponent
void setRepeater (bool repeater)
 
- Protected Member Functions inherited from Component
virtual ConfigURI getConfigURI (ConfigOption configOption) const
 Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc. More...
 
virtual ConfigURI getConfigURI (ConfigOption configOption, ElementURI forElement) const
 Should return [myNamespace]::POWER_[forElement], [myNamespace]::LATENCY_[forElement], etc. More...
 
virtual void setDurationOfLastRun (const Timespan &span)
 
virtual void setTimeOfRun (const Timestamp &time)
 
virtual void setTimeOfLastRun (const Timestamp &time)
 
virtual void setDt (const Timespan &dt)
 
virtual bool setEnabled (bool enabled=true)
 
void setRunState (const RunState runState)
 
const Timespan getPauseTime () const
 
virtual void setFailureMissionCritical (bool failureMissionCritical)
 
bool simulateHardware ()
 
- Protected Attributes inherited from Component
Logger logger_
 
Syslog::Severity debugLevel_
 
ComponentState state_
 Keep track of whether the component has "completed" or should be run again. More...
 
Timespan desiredPeriod_
 
CodedStrname_
 Store the component's name (used for logging purposes) More...
 
Timestamp timeOfRun_
 
Timestamp timeOfLastRun_
 
Timespan durationOfLastRun_
 
Timespan dt_
 
Timespan retryTimeout_
 
bool enabled_
 
bool failureReported_
 Indicates if the failure has been reported – cuts down on syslog. More...
 
bool criticalFailureReported_
 Indicates if a "Critical" failure has been reported – cuts down on syslog. More...
 
bool recoveringFromCritical_
 Indicates that a component had a previous critical failure that has been cleared temporarily awaiting final word from the component itself. More...
 
bool failureUninitialized_
 Indicates if the failure has resulted in an uninitialize call. More...
 
int failCount_
 Number of failures logged by PCaller. More...
 
bool failureMissionCritical_
 If true (default), complete failure ends mission. More...
 
int allowableFailures_
 Number of failures allowed to occur. More...
 
int skippedRunsSinceFail_
 Number of skipped runs since failureMode_ set by failCount_. More...
 
FailureMode::FailType failureType_
 Failed status. If failCount_ > 0, then this may be reset. More...
 
Timestamp timeOfFailure_
 Time of last failure. Relevant only if failed=true. More...
 
Timestamp writeTimestamp_
 Time of last write. More...
 
FlexArray< DataReader * > readers_
 
FlexArray< DataWriter * > writers_
 
const Modulemodule_
 
Timespan pauseTime_
 
bool meteringEnabled_
 If true, metering is enabled. More...
 
DataWriterdurationOfLastRunWriter_
 Writer for durationOfLastRun. More...
 
DataWritervoltageWriter_
 
DataWriteravgVoltageWriter_
 
DataWritercurrentWriter_
 
DataWriteravgCurrentWriter_
 
bool persistentPause_
 True if data is persistent while component is paused. More...
 

Detailed Description

The IBIT built-in-test component provides monitoring of vehicle health on demand.

If it sees a fault, it will write to a fault flag.

IBIT.h should only be included by IBIT.cpp Other classes should include IBITIF.h

Constructor & Destructor Documentation

IBIT::~IBIT ( )
virtual

Member Function Documentation

bool IBIT::ctrlSurfaceCheckPos ( float  elevExpect,
float  ruddExpect 
)
private
void IBIT::initialize ( void  )
virtual
void IBIT::uninitialize ( void  )
virtual

Uninit function.

Reimplemented from Component.

References Component::logger_, and Logger::syslog().

Member Data Documentation

float IBIT::abortDepth_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::abortDepthCfgReader_
private

Referenced by IBIT(), and readConfig().

float IBIT::batteryCapacityThreshold_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::batteryCapacityThresholdCfgReader_
private

Configuration Readers.

Referenced by IBIT(), and readConfig().

DataReader* IBIT::batteryChargeReader_
private

Referenced by IBIT(), and run().

DataReader* IBIT::batteryVoltageReader_
private

Referenced by IBIT(), and run().

float IBIT::batteryVoltageThreshold_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::batteryVoltageThresholdCfgReader_
private

Referenced by IBIT(), and readConfig().

float IBIT::bitHumidityThreshold_
private

Referenced by readConfig(), and run().

float IBIT::bitPressureThreshold_
private

Referenced by readConfig(), and run().

float IBIT::buoyancyNeutral_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::buoyancyNeutralCfgReader_
private

Referenced by IBIT(), and readConfig().

Timespan IBIT::commsTimeout_
private

Referenced by run().

Timespan IBIT::ctrlTimeout_
private

Referenced by run().

DataWriter* IBIT::elevatorAngleCmdWriter_
private

Referenced by IBIT(), and run().

DataReader* IBIT::elevatorAngleReader_
private

Referenced by ctrlSurfaceCheckPos(), and IBIT().

float IBIT::elevatorLimit_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::elevatorLimitCfgReader_
private

Referenced by IBIT(), and readConfig().

float IBIT::elevDeviation_
private

Referenced by ctrlSurfaceCheckPos(), and readConfig().

ConfigReader* IBIT::elevDeviationCfgReader_
private

Referenced by IBIT(), and readConfig().

bool IBIT::goodFix_
private

Referenced by run().

DataReader* IBIT::goodFixReader_
private

Referenced by IBIT(), and run().

DataWriter* IBIT::horizontalModeWriter_
private

Referenced by IBIT(), and run().

DataReader* IBIT::humidityReader_
private

Referenced by IBIT(), and run().

ConfigReader* IBIT::humidityThresholdCfgReader_
private

Referenced by IBIT(), and readConfig().

bool IBIT::ibitPass_
private

Referenced by run().

DataWriter* IBIT::ibitRunningStateWriter_
private

Referenced by IBIT(), initialize(), and run().

IBITState IBIT::ibitState_
private

Referenced by run().

DataReader* IBIT::latitudeFixReader_
private

Referenced by IBIT(), and run().

DataReader* IBIT::longitudeFixReader_
private

Referenced by IBIT(), and run().

float IBIT::massDefault_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::massDefaultCfgReader_
private

Referenced by IBIT(), and readConfig().

bool IBIT::ok_
private

Referenced by initialize().

DataReader* IBIT::pressureReader_
private

Referenced by IBIT(), and run().

ConfigReader* IBIT::pressureThresholdCfgReader_
private

Referenced by IBIT(), and readConfig().

float IBIT::ruddDeviation_
private

Referenced by ctrlSurfaceCheckPos(), and readConfig().

ConfigReader* IBIT::ruddDeviationCfgReader_
private

Referenced by IBIT(), and readConfig().

DataWriter* IBIT::rudderAngleCmdWriter_
private

Referenced by IBIT(), and run().

DataReader* IBIT::rudderAngleReader_
private

Referenced by ctrlSurfaceCheckPos(), and IBIT().

float IBIT::rudderLimit_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::rudderLimitCfgReader_
private

Referenced by IBIT(), and readConfig().

DataReader* IBIT::sBITRunningReader_
private

Referenced by IBIT(), and run().

int IBIT::sigQuality_
private

Referenced by run().

DataReader* IBIT::sigQualityReader_
private

Referenced by IBIT(), and run().

Timestamp IBIT::startTime_
private

Referenced by run().

float IBIT::stopDepth_
private

Referenced by readConfig(), and run().

ConfigReader* IBIT::stopDepthCfgReader_
private

Referenced by IBIT(), and readConfig().

float IBIT::surfaceThreshold_
private

*----------------— vehicle parameters -----------------------—*/

Referenced by readConfig(), and run().

ConfigReader* IBIT::surfaceThresholdCfgReader_
private

Referenced by IBIT(), and readConfig().

DataReader* IBIT::timeFixReader_
private

Referenced by IBIT(), and run().

DataWriter* IBIT::verticalModeWriter_
private

Referenced by IBIT(), and run().


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