|
LRAUV
revA
|
Provides software interface to the Wetlabs puck. More...
#include <WetLabsBB2FL.h>


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 Module * | getModule () |
| 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 CodedStr & | getName (void) const |
| Returns the name. More... | |
| const Timestamp & | getTimeOfLastRun (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 Timespan & | getPeriod (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) |
| Logger & | getLogger (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 Timestamp & | getWriteTimestamp (void) |
| void | setWriteTimestamp (const Timestamp &writeTimestamp) |
| BlobReader * | newBlobReader (const BlobURI &blobURI) |
| BlobReader * | newBlobReaderFromUniversal (const Str &componentName, const UniversalBlobURI &blobURI) |
| BlobWriter * | newBlobWriter (const BlobURI &blobURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| ConfigReader * | newConfigReader (const ConfigURI &configURI) |
| DataReader * | newDataReader (const DataURI &dataURI) |
| DataReader * | newDataReaderFromUniversal (const Str &componentName, const UniversalURI &universalURI) |
| DataWriter * | newDataWriter (const DataURI &dataURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalBlobReader * | newUniversalBlobReader (const UniversalBlobURI &universalURI) |
| UniversalBlobWriter * | newUniversalBlobWriter (const UniversalBlobURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalDataReader * | newUniversalReader (const UniversalURI &universalURI) |
| UniversalDataWriter * | newUniversalWriter (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 () |
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_ |
| CodedStr & | name_ |
| 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 Module * | module_ |
| Timespan | pauseTime_ |
| bool | meteringEnabled_ |
| If true, metering is enabled. More... | |
| DataWriter * | durationOfLastRunWriter_ |
| Writer for durationOfLastRun. More... | |
| DataWriter * | voltageWriter_ |
| DataWriter * | avgVoltageWriter_ |
| DataWriter * | currentWriter_ |
| DataWriter * | avgCurrentWriter_ |
| bool | persistentPause_ |
| True if data is persistent while component is paused. More... | |
Provides software interface to the Wetlabs puck.
| WetLabsBB2FL::WetLabsBB2FL | ( | const Module * | module | ) |
References backScat470Writer_, backScat650Writer_, binMeanChlWriter_, binMedianChlWriter_, binVarianceChlWriter_, chlAccuracyCfgReader_, chlConcWriter_, darkCounts470CfgReader_, darkCounts650CfgReader_, darkCountsChlCfgReader_, UniversalURI::MASS_CONCENTRATION_OF_CHLOROPHYLL_IN_SEA_WATER, Component::newConfigReader(), Component::newDataWriter(), Component::newUniversalReader(), Component::newUniversalWriter(), output470Writer_, output650Writer_, outputChlWriter_, periodCfgReader_, salinityReader_, scaleFactor470CfgReader_, scaleFactor650CfgReader_, scaleFactorChlCfgReader_, UniversalURI::SEA_WATER_SALINITY, serialCfgReader_, Component::setAllowableFailures(), Component::setFailureMissionCritical(), Component::setRetryTimeout(), Component::setRunState(), Component::STOPPED, timeoutCfgReader_, volScat470Writer_, and volScat650Writer_.
|
virtual |
|
private |
|
private |
References binMeanChlWriter_, binMedianChlWriter_, binTime_, binVarianceChlWriter_, Units::MICROGRAM_PER_LITER, temporal_bin_, temporal_bin_count_, and DataWriter::write().
Referenced by update_temporal_bin().
|
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.
|
private |
References chlConcWriter_, DataWriter::isDataRequested(), volScat470Writer_, and volScat650Writer_.
Referenced by runnable(), and stopped().
|
private |
References chlConc_, chlConcWriter_, darkCounts470_, darkCounts650_, darkCountsChl_, Syslog::DEBUG, deviceResponse_, Component::logger_, output470_, output470Writer_, output650_, output650Writer_, outputChl_, outputChlWriter_, scaleFactor470_, scaleFactor650_, scaleFactorChl_, DataWriter::setInvalid(), Logger::syslog(), volScat470_, volScat470Writer_, volScat650_, and volScat650Writer_.
Referenced by runnable(), and starting().
|
private |
References currentSamplesToAverage_, Syslog::DEBUG, deviceResponse_, Syslog::ERROR, Component::logger_, serial_, and Logger::syslog().
|
virtual |
Pause for a short period (indicated by pauseTime)
Reimplemented from Component.
References debug_, Syslog::INFO, Component::logger_, Component::STOPPED, and Logger::syslog().
|
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().
|
private |
References StrValue::asString(), chlAccuracyCfgReader_, chlConcWriter_, Units::COUNT, darkCounts470_, darkCounts470CfgReader_, darkCounts650_, darkCounts650CfgReader_, darkCountsChl_, darkCountsChlCfgReader_, Str::EMPTY_STR, Units::MICROGRAM_PER_LITER, Units::MICROGRAM_PER_LITER_PER_COUNT, DataElement::NO_ACCURACY, DataReader::read(), Units::RECIPROCAL_METER_PER_STERADIAN_PER_COUNT, scaleFactor470_, scaleFactor470CfgReader_, scaleFactor650_, scaleFactor650CfgReader_, scaleFactorChl_, scaleFactorChlCfgReader_, Units::SECOND, serial_, serialCfgReader_, UniversalDataWriter::setAccuracy(), and timeoutCfgReader_.
Referenced by stopped().
|
inlinevirtual |
|
virtual |
Resume from PAUSE.
Reimplemented from Component.
References debug_, Syslog::INFO, Component::logger_, Component::STOPPED, and Logger::syslog().
|
virtual |
Might follow a PAUSE...RESUME sequence.
Reimplemented from Component.
References Component::STOPPED.
|
virtual |
The actual "payload" of the component.
Reimplemented from Component.
|
virtual |
Should eventually follow a START request or RESETTING.
Reimplemented from Component.
References InStream::bytesRead(), chlConc_, FailureMode::COMMUNICATIONS, dataTime_, Syslog::DEBUG, debug_, deviceResponse_, Timestamp::elapsed(), Syslog::ERROR, LoadControl::errorString(), UartStream::errorString(), Syslog::FAULT, Str::find(), UartStream::getError(), FailureMode::HARDWARE, LoadControl::hasError(), UartStream::hasError(), Syslog::INFO, isDataRequested(), loadControl_, Component::logger_, SimSlate::MASS_CONCENTRATION_OF_CHLOROPHYLL_UG_PER_L, MAX_DEVICE_RESPONSE, AuvMath::Min(), Timestamp::Now(), OUTPUT_LEN, parse(), pausePeriod_, SimSlate::Read(), UartStream::readUntil(), LoadControl::requestVoltageAndCurrent(), Component::resetFailCount(), Component::RUNNABLE, Component::setFailure(), Component::setRunState(), Component::simulateHardware(), Timespan::sleepFor(), startTime_, stop(), Component::STOP, Logger::syslog(), UartStream::TIMEOUT, timeout_, uart_, update_temporal_bin(), volScat470_, volScat650_, and writeData().
|
virtual |
Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence.
Reimplemented from Component.
References UartStream::close(), FailureMode::COMMUNICATIONS, debug_, UartStream::errorString(), Syslog::FAULT, FailureMode::HARDWARE, UartStream::hasError(), Syslog::INFO, UartStream::isReadable(), loadControl_, Component::logger_, Timestamp::Now(), UartStream::open(), LoadControl::powerUp(), Component::setFailure(), Component::simulateHardware(), Component::START, Component::STARTING, startTime_, Logger::syslog(), and uart_.
Referenced by stopped().
|
virtual |
Might follow a STOP...START sequence.
Reimplemented from Component.
References InStream::bytesRead(), FailureMode::COMMUNICATIONS, FailureMode::DATA, debug_, deviceResponse_, Timestamp::elapsed(), Syslog::ERROR, UartStream::errorString(), UartStream::getError(), UartStream::hasError(), Syslog::INFO, Component::logger_, MAX_DEVICE_RESPONSE, AuvMath::Min(), Timestamp::Now(), OUTPUT_LEN, parse(), UartStream::readUntil(), Component::RUNNABLE, Component::setFailure(), Component::simulateHardware(), Component::STARTING, startTime_, Component::STOP, Logger::syslog(), UartStream::TIMEOUT, timeout_, and uart_.
|
virtual |
Initial state – can be later followed by START.
Reimplemented from Component.
References backScat470_, backScat650_, chlConc_, debug_, Syslog::INFO, Component::logger_, output470_, output650_, outputChl_, pausePeriod_, Component::simulateHardware(), Timespan::sleepFor(), Component::STOPPING, Logger::syslog(), uninitialize(), volScat470_, volScat650_, and writeData().
Referenced by resetting(), runnable(), and stopped().
|
virtual |
Initial state – can be later followed by START.
Reimplemented from Component.
References UartStream::close(), debug_, LoadControl::getPowerState(), Syslog::INFO, isDataRequested(), UartStream::isReadable(), loadControl_, Component::logger_, LoadControl::OFF, pausePeriod_, LoadControl::POWER_DOWN, readConfig(), Component::simulateHardware(), Timespan::sleepFor(), start(), stop(), Component::STOPPED, Logger::syslog(), and uart_.
|
virtual |
Might follow a STOP request.
Reimplemented from Component.
References debug_, LoadControl::errorString(), Syslog::FAULT, FailureMode::HARDWARE, LoadControl::hasError(), Syslog::INFO, loadControl_, Component::logger_, LoadControl::readFaults(), Component::setFailure(), Component::simulateHardware(), Component::STOPPED, and Logger::syslog().
|
virtual |
Provide a space for uninitialization.
Reimplemented from Component.
References UartStream::close(), Syslog::FAULT, FailureMode::HARDWARE, Syslog::INFO, loadControl_, Component::logger_, LoadControl::powerDown(), Component::setFailure(), Component::simulateHardware(), Logger::syslog(), and uart_.
Referenced by stop().
|
private |
References binTime_, calculate_and_report_temporal_bin_statistics(), chlConc_, dataTime_, Syslog::DEBUG, Component::logger_, Logger::syslog(), temporal_bin_, and temporal_bin_count_.
Referenced by runnable().
|
private |
References backScat470_, backScat470Writer_, backScat650_, backScat650Writer_, chlConc_, chlConcWriter_, Units::COUNT, D2R, dataTime_, DataWriter::isInvalid(), M_2PI, Units::MICROGRAM_PER_LITER, output470_, output470Writer_, output650_, output650Writer_, outputChl_, outputChlWriter_, Units::PRACTICAL_SALINITY_UNIT, DataReader::read(), Units::RECIPROCAL_METER, Units::RECIPROCAL_METER_PER_STERADIAN, salinityReader_, DataWriter::setInvalid(), volScat470_, volScat470Writer_, volScat650_, volScat650Writer_, DataReader::wasTouchedSinceLastRun(), and DataWriter::write().
Referenced by runnable(), and stop().
|
private |
Referenced by stop(), and writeData().
|
private |
Referenced by WetLabsBB2FL(), and writeData().
|
private |
Referenced by stop(), and writeData().
|
private |
Referenced by WetLabsBB2FL(), and writeData().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and WetLabsBB2FL().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and WetLabsBB2FL().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and update_temporal_bin().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and WetLabsBB2FL().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parse(), runnable(), stop(), update_temporal_bin(), and writeData().
|
private |
Referenced by isDataRequested(), parse(), readConfig(), WetLabsBB2FL(), and writeData().
|
private |
Current umber of samples to average.
Referenced by parseHeader().
|
private |
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Time the data was collected.
Referenced by runnable(), update_temporal_bin(), and writeData().
|
private |
Debugging outputs.
Referenced by pause(), paused(), resume(), runnable(), start(), starting(), stop(), stopped(), and stopping().
|
private |
Referenced by parse(), parseHeader(), runnable(), and starting().
|
private |
Power.
Referenced by runnable(), start(), stopped(), stopping(), and uninitialize().
|
private |
Referenced by parse(), stop(), and writeData().
|
private |
Outputs.
Referenced by parse(), WetLabsBB2FL(), and writeData().
|
private |
Referenced by parse(), stop(), and writeData().
|
private |
Referenced by parse(), WetLabsBB2FL(), and writeData().
|
private |
Referenced by parse(), stop(), and writeData().
|
private |
Referenced by parse(), WetLabsBB2FL(), and writeData().
|
private |
How often to run the loop when paused.
Referenced by paused(), runnable(), stop(), and stopped().
|
private |
Referenced by WetLabsBB2FL().
|
private |
Referenced by WetLabsBB2FL(), and writeData().
|
private |
Desired number of samples to average.
|
private |
Calibration coefficients.
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parse(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Referenced by parseHeader(), and readConfig().
|
private |
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Time data request started.
Referenced by runnable(), start(), and starting().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and update_temporal_bin().
|
private |
Referenced by calculate_and_report_temporal_bin_statistics(), and update_temporal_bin().
|
private |
Timeout for getting data.
Referenced by runnable(), and starting().
|
private |
Inputs.
Referenced by readConfig(), and WetLabsBB2FL().
|
private |
Holds the communications device.
Referenced by runnable(), start(), starting(), stopped(), and uninitialize().
|
private |
Referenced by parse(), runnable(), stop(), and writeData().
|
private |
Referenced by isDataRequested(), parse(), WetLabsBB2FL(), and writeData().
|
private |
Referenced by parse(), runnable(), stop(), and writeData().
|
private |
Referenced by isDataRequested(), parse(), WetLabsBB2FL(), and writeData().