LRAUV  revA
WetLabsBB2FL Class Reference

Provides software interface to the Wetlabs puck. More...

#include <WetLabsBB2FL.h>

Inheritance diagram for WetLabsBB2FL:
Collaboration diagram for WetLabsBB2FL:

Public Member Functions

 WetLabsBB2FL (const Module *module)
 
virtual ~WetLabsBB2FL ()
 
virtual void run ()
 The actual "payload" of the component. 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. More...
 
virtual RunState pause ()
 Pause for a short period (indicated by pauseTime) 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 runnable ()
 Should eventually follow a START request or RESETTING. 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 ()
 Initial state – can be later followed by START. More...
 
void uninitialize (void)
 Provide a space for uninitialization. More...
 
virtual ConfigURI getConfigURI (ConfigOption configOption) const
 Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc. More...
 
- Public Member Functions inherited from AsyncComponent
bool isIdlePriority ()
 
- 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 initialize ()
 Provide a space for initialization before being run. More...
 
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 satisfied ()
 Possible return value of a Behavior. More...
 
virtual RunState pausing ()
 Might follow a PAUSE 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 Member Functions

 WetLabsBB2FL (const WetLabsBB2FL &old)
 
void readConfig ()
 
bool parseHeader ()
 
bool parse ()
 
bool isDataRequested ()
 
void writeData ()
 
void update_temporal_bin ()
 
void calculate_and_report_temporal_bin_statistics ()
 

Private Attributes

char deviceResponse_ [MAX_DEVICE_RESPONSE+1]
 
UartStream uart_
 Holds the communications device. More...
 
LoadControl loadControl_
 Power. More...
 
Timestamp startTime_
 Time data request started. More...
 
Timespan timeout_
 Timeout for getting data. More...
 
Timespan pausePeriod_
 How often to run the loop when paused. More...
 
Timestamp dataTime_
 Time the data was collected. More...
 
DataWriteroutput470Writer_
 Outputs. More...
 
DataWriteroutput650Writer_
 
DataWriteroutputChlWriter_
 
DataWritervolScat470Writer_
 
DataWritervolScat650Writer_
 
DataWriterbackScat470Writer_
 
DataWriterbackScat650Writer_
 
DataWriterbinMedianChlWriter_
 
DataWriterbinMeanChlWriter_
 
DataWriterbinVarianceChlWriter_
 
UniversalDataWriterchlConcWriter_
 
ConfigReadertimeoutCfgReader_
 Inputs. More...
 
ConfigReaderperiodCfgReader_
 
ConfigReaderserialCfgReader_
 
ConfigReaderscaleFactor470CfgReader_
 
ConfigReaderdarkCounts470CfgReader_
 
ConfigReaderscaleFactor650CfgReader_
 
ConfigReaderdarkCounts650CfgReader_
 
ConfigReaderscaleFactorChlCfgReader_
 
ConfigReaderdarkCountsChlCfgReader_
 
ConfigReaderchlAccuracyCfgReader_
 
UniversalDataReadersalinityReader_
 
float scaleFactor470_
 Calibration coefficients. More...
 
int darkCounts470_
 
float scaleFactor650_
 
int darkCounts650_
 
float scaleFactorChl_
 
int darkCountsChl_
 
int samplesToAverage_
 Desired number of samples to average. More...
 
int currentSamplesToAverage_
 Current umber of samples to average. More...
 
size_t temporal_bin_count_
 
std::vector< float > temporal_bin_
 
Timestamp binTime_
 
Str serial_
 
bool debug_
 Debugging outputs. More...
 
int output470_
 
int output650_
 
int outputChl_
 
float volScat470_
 
float backScat470_
 
float volScat650_
 
float backScat650_
 
float chlConc_
 

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
}
 
- Protected Types inherited from Component
enum  ConfigOption { CONFIG_SIMULATE_HARDWARE, CONFIG_POWER, CONFIG_FREQUENCY, CONFIG_LATENCY }
 
- Protected Member Functions inherited from AsyncComponent
 AsyncComponent (const Str &name, const Module *module, const Timespan period, bool idlePriority=false)
 Protected constructor for components that run in periodic asynchronous threads. More...
 
 AsyncComponent (const Str &name, const Module *module, bool idlePriority=false)
 Protected constructor for components that run in continuous asynchronous threads. More...
 
- Protected Member Functions inherited from Component
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 AsyncComponent
bool idlePriority_
 
- 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

Provides software interface to the Wetlabs puck.

Constructor & Destructor Documentation

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

Member Function Documentation

void WetLabsBB2FL::calculate_and_report_temporal_bin_statistics ( )
private
ConfigURI WetLabsBB2FL::getConfigURI ( ConfigOption  configOption) const
virtual

Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc.

Reimplemented from Component.

References Component::CONFIG_POWER, Component::CONFIG_SIMULATE_HARDWARE, and ConfigURI::NO_CONFIG_URI.

bool WetLabsBB2FL::isDataRequested ( )
private
bool WetLabsBB2FL::parseHeader ( )
private
Component::RunState WetLabsBB2FL::pause ( )
virtual

Pause for a short period (indicated by pauseTime)

Reimplemented from Component.

References debug_, Syslog::INFO, Component::logger_, Component::STOPPED, and Logger::syslog().

Component::RunState WetLabsBB2FL::paused ( )
virtual

Should eventually follow a PAUSE request: should set continueTime.

Reimplemented from Component.

References debug_, Syslog::INFO, Component::logger_, pausePeriod_, Timespan::sleepFor(), Component::STOPPED, and Logger::syslog().

virtual RunState WetLabsBB2FL::resetting ( )
inlinevirtual

Might occur in case of Error.

Reimplemented from Component.

References stop().

Component::RunState WetLabsBB2FL::resume ( )
virtual

Resume from PAUSE.

Reimplemented from Component.

References debug_, Syslog::INFO, Component::logger_, Component::STOPPED, and Logger::syslog().

Component::RunState WetLabsBB2FL::resuming ( )
virtual

Might follow a PAUSE...RESUME sequence.

Reimplemented from Component.

References Component::STOPPED.

void WetLabsBB2FL::run ( void  )
virtual

The actual "payload" of the component.

Reimplemented from Component.

void WetLabsBB2FL::uninitialize ( void  )
virtual

Member Data Documentation

float WetLabsBB2FL::backScat470_
private

Referenced by stop(), and writeData().

DataWriter* WetLabsBB2FL::backScat470Writer_
private

Referenced by WetLabsBB2FL(), and writeData().

float WetLabsBB2FL::backScat650_
private

Referenced by stop(), and writeData().

DataWriter* WetLabsBB2FL::backScat650Writer_
private

Referenced by WetLabsBB2FL(), and writeData().

DataWriter* WetLabsBB2FL::binMeanChlWriter_
private
DataWriter* WetLabsBB2FL::binMedianChlWriter_
private
Timestamp WetLabsBB2FL::binTime_
private
DataWriter* WetLabsBB2FL::binVarianceChlWriter_
private
ConfigReader* WetLabsBB2FL::chlAccuracyCfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

float WetLabsBB2FL::chlConc_
private
UniversalDataWriter* WetLabsBB2FL::chlConcWriter_
private
int WetLabsBB2FL::currentSamplesToAverage_
private

Current umber of samples to average.

Referenced by parseHeader().

int WetLabsBB2FL::darkCounts470_
private

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::darkCounts470CfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

int WetLabsBB2FL::darkCounts650_
private

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::darkCounts650CfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

int WetLabsBB2FL::darkCountsChl_
private

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::darkCountsChlCfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

Timestamp WetLabsBB2FL::dataTime_
private

Time the data was collected.

Referenced by runnable(), update_temporal_bin(), and writeData().

bool WetLabsBB2FL::debug_
private

Debugging outputs.

Referenced by pause(), paused(), resume(), runnable(), start(), starting(), stop(), stopped(), and stopping().

char WetLabsBB2FL::deviceResponse_[MAX_DEVICE_RESPONSE+1]
private

Referenced by parse(), parseHeader(), runnable(), and starting().

LoadControl WetLabsBB2FL::loadControl_
private

Power.

Referenced by runnable(), start(), stopped(), stopping(), and uninitialize().

int WetLabsBB2FL::output470_
private

Referenced by parse(), stop(), and writeData().

DataWriter* WetLabsBB2FL::output470Writer_
private

Outputs.

Referenced by parse(), WetLabsBB2FL(), and writeData().

int WetLabsBB2FL::output650_
private

Referenced by parse(), stop(), and writeData().

DataWriter* WetLabsBB2FL::output650Writer_
private

Referenced by parse(), WetLabsBB2FL(), and writeData().

int WetLabsBB2FL::outputChl_
private

Referenced by parse(), stop(), and writeData().

DataWriter* WetLabsBB2FL::outputChlWriter_
private

Referenced by parse(), WetLabsBB2FL(), and writeData().

Timespan WetLabsBB2FL::pausePeriod_
private

How often to run the loop when paused.

Referenced by paused(), runnable(), stop(), and stopped().

ConfigReader* WetLabsBB2FL::periodCfgReader_
private

Referenced by WetLabsBB2FL().

UniversalDataReader* WetLabsBB2FL::salinityReader_
private

Referenced by WetLabsBB2FL(), and writeData().

int WetLabsBB2FL::samplesToAverage_
private

Desired number of samples to average.

float WetLabsBB2FL::scaleFactor470_
private

Calibration coefficients.

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::scaleFactor470CfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

float WetLabsBB2FL::scaleFactor650_
private

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::scaleFactor650CfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

float WetLabsBB2FL::scaleFactorChl_
private

Referenced by parse(), and readConfig().

ConfigReader* WetLabsBB2FL::scaleFactorChlCfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

Str WetLabsBB2FL::serial_
private

Referenced by parseHeader(), and readConfig().

ConfigReader* WetLabsBB2FL::serialCfgReader_
private

Referenced by readConfig(), and WetLabsBB2FL().

Timestamp WetLabsBB2FL::startTime_
private

Time data request started.

Referenced by runnable(), start(), and starting().

std::vector<float> WetLabsBB2FL::temporal_bin_
private
size_t WetLabsBB2FL::temporal_bin_count_
private
Timespan WetLabsBB2FL::timeout_
private

Timeout for getting data.

Referenced by runnable(), and starting().

ConfigReader* WetLabsBB2FL::timeoutCfgReader_
private

Inputs.

Referenced by readConfig(), and WetLabsBB2FL().

UartStream WetLabsBB2FL::uart_
private

Holds the communications device.

Referenced by runnable(), start(), starting(), stopped(), and uninitialize().

float WetLabsBB2FL::volScat470_
private

Referenced by parse(), runnable(), stop(), and writeData().

DataWriter* WetLabsBB2FL::volScat470Writer_
private
float WetLabsBB2FL::volScat650_
private

Referenced by parse(), runnable(), stop(), and writeData().

DataWriter* WetLabsBB2FL::volScat650Writer_
private

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