LRAUV  revA
PeakDetectHorizontal Class Reference

Contains the PeakDetectHorizontal Behavior. More...

#include <PeakDetectHorizontal.h>

Inheritance diagram for PeakDetectHorizontal:
Collaboration diagram for PeakDetectHorizontal:

Classes

class  PointValue
 

Public Member Functions

 PeakDetectHorizontal (const Str &prefix, const Module *module)
 
virtual ~PeakDetectHorizontal ()
 
void initialize (void)
 Initialize function. More...
 
bool readParams ()
 Read in the parameters for satisfied or runIfUnsatisfied: return true if OK. More...
 
bool calcSatisfied ()
 Perform the satisfied: return true if envelope "satisfied". More...
 
void run ()
 Just do the run: ignore the results of the satisfied. More...
 
bool isSatisfied ()
 Just do the satisfied: return true if envelope "satisfied". More...
 
bool runIfUnsatisfied ()
 Do the run, and return true if envelope "satisfied". More...
 
void uninitialize (void)
 Uninit function. More...
 
- Public Member Functions inherited from Behavior
virtual ~Behavior ()
 
bool executeIfUnsatisfied ()
 Combined run and test with metrics generation. More...
 
virtual void preempted ()
 
virtual bool isRunnable ()
 
virtual bool isSatisfiable ()
 
virtual bool isCommand ()
 
BehaviorState getBehaviorState () const
 
void setBehaviorState (BehaviorState behaviorState)
 
virtual bool isCompleted (void)
 Query if this component is completed. More...
 
SettingReaderfindSettingReader (const Str &settingURI)
 
SettingReaderaddValueClause (const Str &uriPart, ValueClause *valueClause)
 
void addArgWriter (const Str &uriPart, DataWriter *argWriter)
 
const TimespangetTimeout ()
 
void setTimeout (const Timespan &timeout)
 
- 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)
 
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)
 

Static Public Member Functions

static BehaviorCreateBehavior (const Str &prefix, const Module *module)
 Mission Component factory interface. More...
 

Protected Member Functions

void reportPeak ()
 
- Protected Member Functions inherited from Behavior
 Behavior (const Str &name, const Module *module, const bool runnable, const bool satisfiable)
 Protected constructor for abstract base class. More...
 
 Behavior (const Behavior &old)
 
SettingReadernewSettingReader (const Str &uriPart, const DataValue *defaultValue, bool deleteDefaultValue=true)
 
SettingReadernewSettingReader (const SettingURI &uriPart)
 
DataWriterfindArgWriter (const OutputURI &uriPart)
 
- 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

SettingReaderdetectFromSettingReader_
 Sets variable to detect the peak of (i.e., chl concentration) More...
 
SettingReaderdepthFromSettingReader_
 Sets depth variable associated with the peak. More...
 
SettingReaderlatitudeFromSettingReader_
 Sets latitude variable associated with the peak. More...
 
SettingReaderlongitudeFromSettingReader_
 Sets latitude variable associated with the peak. More...
 
SettingReaderadvectValuesSettingReader_
 Sets advectValues (if true, advect values in space) More...
 
SettingReaderdetectTroughSettingReader_
 Sets detectTrough (if true, detect a low value) More...
 
SettingReaderbeginThresholdSettingReader_
 Sets beginThreshold. More...
 
SettingReaderoffPeakFractionSettingReader_
 Sets offPeakFraction. More...
 
SettingReaderfilterWidthSettingReader_
 Sets filterWidth. More...
 
SettingReadercenterPeakSettingReader_
 Sets centerPeak. More...
 
const UnitdetectFromBaseUnit_
 
int advectValuesSetting_
 
int detectTroughSetting_
 
float beginThresholdSetting_
 
float offPeakFractionSetting_
 
int filterWidthSetting_
 
int centerPeakSetting_
 
DataReaderdetectInputReader_
 The value being detected as a peak (i.e., chl concentration) More...
 
DataReaderdepthInputReader_
 Reads depth associated with value. More...
 
DataReaderlatitudeInputReader_
 Reads latitude associated with value. More...
 
DataReaderlongitudeInputReader_
 Reads longitude associated with value. More...
 
DataReaderdistanceWrtSeaWaterReader_
 Reads distance travelled with respect to sea water. More...
 
DataReaderlatitudeReader_
 Reads latitude. More...
 
DataReaderlongitudeReader_
 Reads longitude. More...
 
DataReadereastwardSeaWaterVelocityReader_
 Reads eastward sea water velocity. More...
 
DataReadernorthwardSeaWaterVelocityReader_
 Reads northward sea water velocity. More...
 
DataWriterpeakDetectWriter_
 
DataWriterpeakDepthWriter_
 
DataWriterpeakLatitudeWriter_
 
DataWriterpeakLongitudeWriter_
 
DataWriterpeakDistanceWriter_
 
float detect_
 Instantaneous values. More...
 
float depth_
 
float distance_
 
float latitude_
 
float longitude_
 
float eastwardVelocity_
 
float northwardVelocity_
 
float peakDetect_
 Value of the peak when it occurs. More...
 
bool inPeak_
 
int peakIndex_
 
FlexArray< PointValue * > history_
 History of data. More...
 
int historySize_
 
- Protected Attributes inherited from Behavior
bool runnable_
 
bool satisfiable_
 
BehaviorState behaviorState_
 
Timespan timeout_
 Time before this behavior must end – defaults no timeout. More...
 
FastMap< const Str, SettingReader * > * settingReaderMap_
 
FastMap< const Str, DataWriter * > * argWriterMap_
 
- 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...
 

Private Member Functions

 PeakDetectHorizontal (const PeakDetectHorizontal &old)
 
void initVars ()
 

Additional Inherited Members

- Public Types inherited from Behavior
enum  BehaviorState {
  BEHAVIOR_INACTIVE, BEHAVIOR_CALLED, BEHAVIOR_ACTIVE, BEHAVIOR_TIMEOUT,
  BEHAVIOR_COMPLETED
}
 
- 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
}
 
- Protected Types inherited from Component
enum  ConfigOption { CONFIG_SIMULATE_HARDWARE, CONFIG_POWER, CONFIG_FREQUENCY, CONFIG_LATENCY }
 

Detailed Description

Contains the PeakDetectHorizontal Behavior.

PeakDetectHorizontal.h should only be included by PeakDetectHorizontal.cpp Other classes should include PeakDetectHorizontalIF.h

Constructor & Destructor Documentation

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

Member Function Documentation

Behavior * PeakDetectHorizontal::CreateBehavior ( const Str prefix,
const Module module 
)
static

Mission Component factory interface.

References PeakDetectHorizontal().

Referenced by TriggerModule::loadComponents().

void PeakDetectHorizontal::initVars ( )
private
bool PeakDetectHorizontal::isSatisfied ( )
virtual

Just do the satisfied: return true if envelope "satisfied".

Reimplemented from Behavior.

References calcSatisfied(), and readParams().

void PeakDetectHorizontal::run ( void  )
virtual

Just do the run: ignore the results of the satisfied.

Reimplemented from Component.

References runIfUnsatisfied().

bool PeakDetectHorizontal::runIfUnsatisfied ( void  )
virtual

Do the run, and return true if envelope "satisfied".

Reimplemented from Behavior.

References calcSatisfied(), detectFromBaseUnit_, initialize(), readParams(), and reportPeak().

Referenced by run().

void PeakDetectHorizontal::uninitialize ( void  )
virtual

Uninit function.

Reimplemented from Component.

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

Member Data Documentation

int PeakDetectHorizontal::advectValuesSetting_
protected
SettingReader* PeakDetectHorizontal::advectValuesSettingReader_
protected

Sets advectValues (if true, advect values in space)

Referenced by initialize(), and PeakDetectHorizontal().

float PeakDetectHorizontal::beginThresholdSetting_
protected

Referenced by calcSatisfied(), and initialize().

SettingReader* PeakDetectHorizontal::beginThresholdSettingReader_
protected

Sets beginThreshold.

Referenced by initialize(), and PeakDetectHorizontal().

int PeakDetectHorizontal::centerPeakSetting_
protected

Referenced by initialize(), and reportPeak().

SettingReader* PeakDetectHorizontal::centerPeakSettingReader_
protected

Sets centerPeak.

Referenced by initialize(), and PeakDetectHorizontal().

float PeakDetectHorizontal::depth_
protected

Referenced by calcSatisfied(), and readParams().

SettingReader* PeakDetectHorizontal::depthFromSettingReader_
protected

Sets depth variable associated with the peak.

Referenced by initialize(), and PeakDetectHorizontal().

DataReader* PeakDetectHorizontal::depthInputReader_
protected

Reads depth associated with value.

Referenced by initialize(), PeakDetectHorizontal(), and readParams().

float PeakDetectHorizontal::detect_
protected

Instantaneous values.

Referenced by calcSatisfied(), and readParams().

const Unit* PeakDetectHorizontal::detectFromBaseUnit_
protected
SettingReader* PeakDetectHorizontal::detectFromSettingReader_
protected

Sets variable to detect the peak of (i.e., chl concentration)

Referenced by initialize(), and PeakDetectHorizontal().

DataReader* PeakDetectHorizontal::detectInputReader_
protected

The value being detected as a peak (i.e., chl concentration)

Referenced by calcSatisfied(), initialize(), PeakDetectHorizontal(), and readParams().

int PeakDetectHorizontal::detectTroughSetting_
protected
SettingReader* PeakDetectHorizontal::detectTroughSettingReader_
protected

Sets detectTrough (if true, detect a low value)

Referenced by initialize(), and PeakDetectHorizontal().

float PeakDetectHorizontal::distance_
protected

Referenced by calcSatisfied(), and readParams().

DataReader* PeakDetectHorizontal::distanceWrtSeaWaterReader_
protected

Reads distance travelled with respect to sea water.

Referenced by PeakDetectHorizontal(), readParams(), and reportPeak().

DataReader* PeakDetectHorizontal::eastwardSeaWaterVelocityReader_
protected

Reads eastward sea water velocity.

Referenced by PeakDetectHorizontal(), and readParams().

float PeakDetectHorizontal::eastwardVelocity_
protected

Referenced by calcSatisfied(), and readParams().

int PeakDetectHorizontal::filterWidthSetting_
protected
SettingReader* PeakDetectHorizontal::filterWidthSettingReader_
protected

Sets filterWidth.

Referenced by initialize(), and PeakDetectHorizontal().

FlexArray<PointValue*> PeakDetectHorizontal::history_
protected

History of data.

Referenced by calcSatisfied(), and reportPeak().

int PeakDetectHorizontal::historySize_
protected
bool PeakDetectHorizontal::inPeak_
protected
float PeakDetectHorizontal::latitude_
protected

Referenced by calcSatisfied(), and readParams().

SettingReader* PeakDetectHorizontal::latitudeFromSettingReader_
protected

Sets latitude variable associated with the peak.

Referenced by initialize(), and PeakDetectHorizontal().

DataReader* PeakDetectHorizontal::latitudeInputReader_
protected

Reads latitude associated with value.

Referenced by initialize(), PeakDetectHorizontal(), and readParams().

DataReader* PeakDetectHorizontal::latitudeReader_
protected

Reads latitude.

Referenced by PeakDetectHorizontal(), and reportPeak().

float PeakDetectHorizontal::longitude_
protected

Referenced by calcSatisfied(), and readParams().

SettingReader* PeakDetectHorizontal::longitudeFromSettingReader_
protected

Sets latitude variable associated with the peak.

Referenced by initialize(), and PeakDetectHorizontal().

DataReader* PeakDetectHorizontal::longitudeInputReader_
protected

Reads longitude associated with value.

Referenced by initialize(), PeakDetectHorizontal(), and readParams().

DataReader* PeakDetectHorizontal::longitudeReader_
protected

Reads longitude.

Referenced by PeakDetectHorizontal(), and reportPeak().

DataReader* PeakDetectHorizontal::northwardSeaWaterVelocityReader_
protected

Reads northward sea water velocity.

Referenced by PeakDetectHorizontal(), and readParams().

float PeakDetectHorizontal::northwardVelocity_
protected

Referenced by calcSatisfied(), and readParams().

float PeakDetectHorizontal::offPeakFractionSetting_
protected
SettingReader* PeakDetectHorizontal::offPeakFractionSettingReader_
protected

Sets offPeakFraction.

Referenced by initialize(), and PeakDetectHorizontal().

DataWriter* PeakDetectHorizontal::peakDepthWriter_
protected
float PeakDetectHorizontal::peakDetect_
protected

Value of the peak when it occurs.

Referenced by calcSatisfied(), and reportPeak().

DataWriter* PeakDetectHorizontal::peakDetectWriter_
protected
DataWriter* PeakDetectHorizontal::peakDistanceWriter_
protected
int PeakDetectHorizontal::peakIndex_
protected
DataWriter* PeakDetectHorizontal::peakLatitudeWriter_
protected
DataWriter* PeakDetectHorizontal::peakLongitudeWriter_
protected

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