trikRuntime
trikControl::SoundSensor Class Reference

Implementation of sound sensor for real robot. More...

#include <soundSensor.h>

Inheritance diagram for trikControl::SoundSensor:
Collaboration diagram for trikControl::SoundSensor:

Public Slots

void init (bool showOnDisplay) override
 
void detect () override
 
void volume (int volCoeff) override
 
QVector< int > read () override
 
void stop () override
 
- Public Slots inherited from trikControl::SoundSensorInterface
virtual void init (bool showOnDisplay)=0
 Initializes an ALSA. More...
 
virtual void detect ()=0
 Not use. More...
 
virtual void volume (int volCoeff)=0
 Sets volume coefficient. More...
 
virtual QVector< int > read ()=0
 Returns angle and volume for both channels. More...
 
virtual void stop ()=0
 Stops detection until init() will be called again. More...
 

Public Member Functions

 SoundSensor (const QString &port, const trikKernel::Configurer &configurer, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~SoundSensor () override
 
Status status () const override
 Returns current status of the device. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Signals inherited from trikControl::SoundSensorInterface
void stopped ()
 Emitted when sensor is stopped successfully. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

Implementation of sound sensor for real robot.

Constructor & Destructor Documentation

SoundSensor::SoundSensor ( const QString &  port,
const trikKernel::Configurer configurer,
trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Parameters
port- port on which this sensor is configured.
configurer- configurer object containing preparsed XML files with sensor parameters.
SoundSensor::~SoundSensor ( )
override

Member Function Documentation

void SoundSensor::detect ( )
overrideslot
void SoundSensor::init ( bool  showOnDisplay)
overrideslot
QVector< int > SoundSensor::read ( )
overrideslot
SoundSensor::Status SoundSensor::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.

void SoundSensor::stop ( )
overrideslot
void SoundSensor::volume ( int  volCoeff)
overrideslot

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