fastcat 0.13.15
C++ EtherCAT Device Command & Control Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
fastcat::Faulter Class Reference

Fastcat device class that can be used to trigger a fault based on a signal. More...

#include "faulter.h"

Inheritance diagram for fastcat::Faulter:
Inheritance graph
[legend]
Collaboration diagram for fastcat::Faulter:
Collaboration graph
[legend]

Public Member Functions

 Faulter ()
 Faulter constructor.
 
bool ConfigFromYaml (const YAML::Node &node) override
 Parses input yaml file to set sensor parameters.
 
bool Read () override
 Updates device state.
 
FaultType Process () override
 Checks if fault-trigger signal is present.
 
bool Write (DeviceCmd &cmd) override
 Commands device. Only FaulterEnableCmd is accepted currently.
 
void Fault () override
 Disables device.
 
void Reset () override
 Enables device if device starts enabled.
 
- Public Member Functions inherited from fastcat::DeviceBase
virtual ~DeviceBase ()
 
virtual void SetInitializationTime (double time_sec, double monotonic_time_sec)
 
void RegisterCmdQueue (std::shared_ptr< ThreadSafeQueue< DeviceCmd > > cmd_queue)
 
std::string GetName ()
 
std::shared_ptr< DeviceState > GetState ()
 
void SetTime (double time, double monotonic_time)
 
void SetLoopPeriod (double loop_period)
 

Protected Attributes

bool start_enabled_ {true}
 YAML configurable, recommended value is true.
 
- Protected Attributes inherited from fastcat::DeviceBase
std::string name_
 unique device name
 
double last_monotonic_time_ = 0.0
 
double loop_period_ = 0.0
 only some devices need
 
double initialization_time_sec_ = -1
 only some devices need
 
double monotonic_initialization_time_sec_ = -1
 only some devices need
 
bool device_fault_active_ = false
 device-level fault, manager also has fault status flag
 
std::shared_ptr< DeviceState > state_
 Fastcat state data.
 
std::shared_ptr< ThreadSafeQueue< DeviceCmd > > cmd_queue_
 for intra-device commands
 

Additional Inherited Members

- Public Attributes inherited from fastcat::DeviceBase
std::vector< Signal > signals_
 

Detailed Description

Fastcat device class that can be used to trigger a fault based on a signal.

Constructor & Destructor Documentation

◆ Faulter()

fastcat::Faulter::Faulter ( )

Faulter constructor.

Member Function Documentation

◆ ConfigFromYaml()

bool fastcat::Faulter::ConfigFromYaml ( const YAML::Node &  node)
overridevirtual

Parses input yaml file to set sensor parameters.

Parameters
nodeThe portion of the yaml file corresponding to this Faulter device.
Returns
True if configuration completes without error; false otherwise.

Implements fastcat::DeviceBase.

Here is the call graph for this function:

◆ Fault()

void fastcat::Faulter::Fault ( )
overridevirtual

Disables device.

Reimplemented from fastcat::DeviceBase.

Here is the call graph for this function:

◆ Process()

fastcat::FaultType fastcat::Faulter::Process ( )
overridevirtual

Checks if fault-trigger signal is present.

Returns
FaultType enum value corresponding to appropriate fault state.

Reimplemented from fastcat::DeviceBase.

◆ Read()

bool fastcat::Faulter::Read ( )
overridevirtual

Updates device state.

Returns
True if device state is read without error; false otherwise.

Implements fastcat::DeviceBase.

Here is the call graph for this function:

◆ Reset()

void fastcat::Faulter::Reset ( )
overridevirtual

Enables device if device starts enabled.

Reimplemented from fastcat::DeviceBase.

Here is the call graph for this function:

◆ Write()

bool fastcat::Faulter::Write ( DeviceCmd &  cmd)
overridevirtual

Commands device. Only FaulterEnableCmd is accepted currently.

Parameters
cmdCommand provided to Faulter device, of a type that is a subclass of DeviceCmd.
Returns
True if command is accepted; false otherwise.

Reimplemented from fastcat::DeviceBase.

Member Data Documentation

◆ start_enabled_

bool fastcat::Faulter::start_enabled_ {true}
protected

YAML configurable, recommended value is true.


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