DUNE: Uniform Navigational Environment  2016.05.0
Sensors::Klein3500::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceRelease (void)
 
void onResourceInitialization (void)
 
void queueState (StateMachineStates state)
 
bool hasQueuedStates (void) const
 
StateMachineStates getCurrentState (void) const
 
StateMachineStates dequeueState (void)
 
void onRequestActivation (void)
 
bool tryConnect (void)
 
bool isConnected (void)
 
void failActivation (const std::string &message)
 
void onRequestDeactivation (void)
 
bool disconnect (void)
 
void onDeactivation (void)
 
void controlPulseDetection (IMC::PulseDetectionControl::OperationEnum op)
 
void onActivation (void)
 
void requestLogName (void)
 
void consume (const IMC::PowerChannelState *msg)
 
void consume (const IMC::EstimatedState *msg)
 
void consume (const IMC::LoggingControl *msg)
 
std::string computeRecordingPath (const std::string &log_name)
 
void openLog (const std::string &name)
 
bool logIsOpen (void)
 
void closeLog (void)
 
void setFramingMode (void)
 
void initConfig (void)
 
void controlPower (IMC::PowerChannelControl::OperationEnum op)
 
void turnPowerOn (void)
 
void turnPowerOff (void)
 
bool isPowered (void)
 
void updateStateMachine (void)
 
void onMain (void)
 

Public Attributes

Parser m_parser
 
Counter< double > m_wdog
 
StateMachineStates m_sm_state
 
std::queue< StateMachineStatesm_sm_state_queue
 
bool m_powered
 
CommandLinkm_cmd
 
std::string m_log_path
 
Arguments m_args
 

Constructor & Destructor Documentation

Member Function Documentation

void Sensors::Klein3500::Task::closeLog ( void  )
inline
std::string Sensors::Klein3500::Task::computeRecordingPath ( const std::string &  log_name)
inline
void Sensors::Klein3500::Task::consume ( const IMC::PowerChannelState *  msg)
inline
void Sensors::Klein3500::Task::consume ( const IMC::EstimatedState *  msg)
inline
void Sensors::Klein3500::Task::consume ( const IMC::LoggingControl *  msg)
inline
void Sensors::Klein3500::Task::controlPower ( IMC::PowerChannelControl::OperationEnum  op)
inline
void Sensors::Klein3500::Task::controlPulseDetection ( IMC::PulseDetectionControl::OperationEnum  op)
inline
StateMachineStates Sensors::Klein3500::Task::dequeueState ( void  )
inline
void Sensors::Klein3500::Task::failActivation ( const std::string &  message)
inline

References controlPower().

Referenced by updateStateMachine().

StateMachineStates Sensors::Klein3500::Task::getCurrentState ( void  ) const
inline

References m_sm_state.

Referenced by consume().

bool Sensors::Klein3500::Task::hasQueuedStates ( void  ) const
inline

Test if state queue has pending state transitions.

Returns
true if state queue has pending states, false otherwise.

References m_sm_state_queue.

Referenced by dequeueState(), and onMain().

bool Sensors::Klein3500::Task::isConnected ( void  )
inline

Test if a connection exists to the sidescan.

Returns
true if a connection exists, false otherwise.

References m_cmd.

Referenced by closeLog(), consume(), onResourceRelease(), and onUpdateParameters().

bool Sensors::Klein3500::Task::isPowered ( void  )
inline

Test if power channel is on.

Returns
true if power channel is on, false otherwise.

References m_powered.

Referenced by updateStateMachine().

bool Sensors::Klein3500::Task::logIsOpen ( void  )
inline

References m_log_path.

Referenced by updateStateMachine().

void Sensors::Klein3500::Task::onActivation ( void  )
inline
void Sensors::Klein3500::Task::onDeactivation ( void  )
inline
void Sensors::Klein3500::Task::onMain ( void  )
inline
void Sensors::Klein3500::Task::onRequestActivation ( void  )
inline
void Sensors::Klein3500::Task::onRequestDeactivation ( void  )
inline
void Sensors::Klein3500::Task::onResourceInitialization ( void  )
inline
void Sensors::Klein3500::Task::onResourceRelease ( void  )
inline

References disconnect(), and isConnected().

void Sensors::Klein3500::Task::queueState ( StateMachineStates  state)
inline

Push a new state to the state queue.

Parameters
[in]statestate machine state.

References m_sm_state_queue.

Referenced by onRequestActivation(), onRequestDeactivation(), and updateStateMachine().

void Sensors::Klein3500::Task::requestLogName ( void  )
inline

Referenced by updateStateMachine().

bool Sensors::Klein3500::Task::tryConnect ( void  )
inline

Try to connect to the sidescan.

Returns
true if connection was established, false otherwise.

References Sensors::Klein3500::Arguments::addr, initConfig(), m_args, m_cmd, and Sensors::Klein3500::Arguments::port.

Referenced by updateStateMachine().

void Sensors::Klein3500::Task::turnPowerOff ( void  )
inline

References controlPower().

Referenced by updateStateMachine().

void Sensors::Klein3500::Task::turnPowerOn ( void  )
inline

References controlPower().

Referenced by updateStateMachine().

Member Data Documentation

std::string Sensors::Klein3500::Task::m_log_path

Current log path.

Referenced by closeLog(), logIsOpen(), and openLog().

Parser Sensors::Klein3500::Task::m_parser
bool Sensors::Klein3500::Task::m_powered

True if device is powered on.

Referenced by consume(), isPowered(), and onUpdateParameters().

StateMachineStates Sensors::Klein3500::Task::m_sm_state

Current state machine state.

Referenced by dequeueState(), and getCurrentState().

std::queue<StateMachineStates> Sensors::Klein3500::Task::m_sm_state_queue

State machine state queue.

Referenced by dequeueState(), hasQueuedStates(), and queueState().

Counter<double> Sensors::Klein3500::Task::m_wdog

Watchdog timer.

Referenced by onActivation(), and updateStateMachine().

Collaboration diagram for Sensors::Klein3500::Task:
Collaboration graph