REVLib - C++
rev::spark::AnalogSensorConfig Class Reference

#include <AnalogSensorConfig.h>

Inherits rev::spark::BaseConfig.

Public Member Functions

 AnalogSensorConfig ()=default
 
 ~AnalogSensorConfig () override=default
 
 AnalogSensorConfig (const AnalogSensorConfig &)=delete
 
AnalogSensorConfigoperator= (const AnalogSensorConfig &)=delete
 
 AnalogSensorConfig (AnalogSensorConfig &&) noexcept=delete
 
AnalogSensorConfigoperator= (AnalogSensorConfig &&) noexcept=delete
 
AnalogSensorConfigApply (AnalogSensorConfig &config)
 
AnalogSensorConfigInverted (bool inverted)
 
AnalogSensorConfigPositionConversionFactor (double factor)
 
AnalogSensorConfigVelocityConversionFactor (double factor)
 
- Public Member Functions inherited from rev::spark::BaseConfig
virtual ~BaseConfig ()=default
 
virtual std::string Flatten ()
 

Additional Inherited Members

- Protected Types inherited from rev::spark::BaseConfig
using SparkConfig_t = std::variant< int32_t, uint32_t, float, bool >
 
- Protected Member Functions inherited from rev::spark::BaseConfig
 BaseConfig ()=default
 
 BaseConfig (const BaseConfig &)=delete
 
BaseConfigoperator= (const BaseConfig &)=delete
 
 BaseConfig (BaseConfig &&) noexcept=delete
 
BaseConfigoperator= (BaseConfig &&) noexcept=delete
 
template<typename ConfigType >
void PutParameter (uint8_t parameterId, ConfigType value)
 
std::optional< SparkConfig_tGetParameter (uint8_t parameterId)
 
std::optional< SparkConfig_tGetParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void RemoveParameter (uint8_t parameterId)
 
void RemoveParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void Apply (BaseConfig &config)
 

Constructor & Destructor Documentation

◆ AnalogSensorConfig() [1/3]

rev::spark::AnalogSensorConfig::AnalogSensorConfig ( )
default

◆ ~AnalogSensorConfig()

rev::spark::AnalogSensorConfig::~AnalogSensorConfig ( )
overridedefault

◆ AnalogSensorConfig() [2/3]

rev::spark::AnalogSensorConfig::AnalogSensorConfig ( const AnalogSensorConfig )
delete

◆ AnalogSensorConfig() [3/3]

rev::spark::AnalogSensorConfig::AnalogSensorConfig ( AnalogSensorConfig &&  )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

AnalogSensorConfig & rev::spark::AnalogSensorConfig::operator= ( const AnalogSensorConfig )
delete

◆ operator=() [2/2]

AnalogSensorConfig & rev::spark::AnalogSensorConfig::operator= ( AnalogSensorConfig &&  )
deletenoexcept

◆ Apply()

AnalogSensorConfig & AnalogSensorConfig::Apply ( AnalogSensorConfig config)

Applies settings from another AnalogSensorConfig to this one.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe AnalogSensorConfig to copy settings from
Returns
The updated AnalogSensorConfig for method chaining

◆ Inverted()

AnalogSensorConfig & AnalogSensorConfig::Inverted ( bool  inverted)

Set the phase of the analog sensor so that it is in phase with the motor itself.

Parameters
invertedThe phase of the analog sensor
Returns
The modified AnalogSensorConfig object for method chaining

◆ PositionConversionFactor()

AnalogSensorConfig & AnalogSensorConfig::PositionConversionFactor ( double  factor)

Set the conversion factor for the position of the analog sensor. Position is returned in native units of volts and will be multiplied by this conversion factor.

Parameters
factorThe conversion factor to multiply the native units by
Returns
The modified AnalogSensorConfig object for method chaining

◆ VelocityConversionFactor()

AnalogSensorConfig & AnalogSensorConfig::VelocityConversionFactor ( double  factor)

Set the conversion factor for the velocity of the analog sensor. Velocity is returned in native units of volts per second and will be multiplied by this conversion factor.

Parameters
factorThe conversion factor to multiply the native units by
Returns
The modified AnalogSensorConfig object for method chaining

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