LedSetting Class Reference

Internal data class to hold individual LED light settings. More...

#include <LedPlugin.hh>

Inherits FlashLightSetting.

Public Member Functions

 LedSetting (const sdf::ElementPtr &_sdf, const physics::ModelPtr &_model, const common::Time &_currentTime)
 Constructor. More...
 
virtual ~LedSetting ()
 Destructor. More...
 
virtual unsigned int BlockCount () final
 Get the number of blocks. More...
 
virtual void InitPubLight (const transport::PublisherPtr &_pubLight) final
 Set the publisher and send an initial light command. More...
 
virtual void InitPubVisual (const transport::PublisherPtr &_pubVisual) final
 Set the publisher and send an initial visual command. More...
 
virtual void InsertBlock (const double _duration, const double _interval, const ignition::math::Color &_color, const int _index) final
 Insert a block. More...
 
virtual const physics::LinkPtr Link () const final
 Getter of link. More...
 
virtual const std::string Name () const final
 Getter of name. More...
 
virtual bool RemoveBlock (const int _index) final
 Remove a specified block. More...
 
virtual void SetColor (const ignition::math::Color &_color, const int _index) final
 Set the color for the specified block. More...
 
virtual void SetColor (const ignition::math::Color &_color) final
 Set the color for all the blocks. More...
 
virtual void SetDuration (const double _duration, const int _index) final
 Set the duration time for the specified block. More...
 
virtual void SetDuration (const double _duration) final
 Set the duration time for all the blocks. More...
 
virtual void SetInterval (const double _interval, const int _index) final
 Set the interval time for the specified block. More...
 
virtual void SetInterval (const double _interval) final
 Set the interval time for all the blocks. More...
 
virtual void SwitchOff () final
 Switch off (disable the flashlight). More...
 
virtual void SwitchOn () final
 Switch on (enable the flashlight). More...
 
virtual void UpdateLightInEnv (const common::Time &_currentTime) final
 Update the light based on the given time. More...
 

Protected Member Functions

virtual ignition::math::Color CurrentColor () final
 Get the current color of the light. More...
 
virtual void Dim ()
 Dim the light This function is internally used to update the light in the environment. More...
 
virtual void Flash ()
 Flash the light This function is internally used to update the light in the environment. More...
 

Detailed Description

Internal data class to hold individual LED light settings.

Constructor & Destructor Documentation

◆ LedSetting()

LedSetting ( const sdf::ElementPtr &  _sdf,
const physics::ModelPtr _model,
const common::Time _currentTime 
)

Constructor.

◆ ~LedSetting()

virtual ~LedSetting ( )
virtual

Destructor.

Member Function Documentation

◆ BlockCount()

virtual unsigned int BlockCount ( )
finalvirtualinherited

Get the number of blocks.

Returns
The number of blocks the object currently has.

◆ CurrentColor()

virtual ignition::math::Color CurrentColor ( )
finalprotectedvirtualinherited

Get the current color of the light.

This is to be used by an inheriting class of FlashLightSetting class.

Returns
the color for the current block which the object is using. It returns Black if there is no update about color.

◆ Dim()

virtual void Dim ( )
protectedvirtual

Dim the light This function is internally used to update the light in the environment.

Reimplemented from FlashLightSetting.

◆ Flash()

virtual void Flash ( )
protectedvirtual

Flash the light This function is internally used to update the light in the environment.

Reimplemented from FlashLightSetting.

◆ InitPubLight()

virtual void InitPubLight ( const transport::PublisherPtr _pubLight)
finalvirtualinherited

Set the publisher and send an initial light command.

Parameters
[in]_pubLightThe publisher to send a message

◆ InitPubVisual()

virtual void InitPubVisual ( const transport::PublisherPtr _pubVisual)
finalvirtual

Set the publisher and send an initial visual command.

Parameters
[in]_pubVisualThe publisher to send a message

◆ InsertBlock()

virtual void InsertBlock ( const double  _duration,
const double  _interval,
const ignition::math::Color &  _color,
const int  _index 
)
finalvirtualinherited

Insert a block.

Create a block with specified parameters. If the index is out of range, the block will be appended at the end of the list.

Parameters
[in]_durationThe duration for the block.
[in]_intervalThe interval for the block.
[in]_colorThe color for the block.
[in]_indexThe index of the block to be inserted into the list.

◆ Link()

virtual const physics::LinkPtr Link ( ) const
finalvirtualinherited

Getter of link.

Returns
A pointer to the link element.

◆ Name()

virtual const std::string Name ( ) const
finalvirtualinherited

Getter of name.

Returns
The name of the light element.

◆ RemoveBlock()

virtual bool RemoveBlock ( const int  _index)
finalvirtualinherited

Remove a specified block.

Parameters
[in]_indexIndex to the block to remove
Returns
True if the block exists and it was removed.

◆ SetColor() [1/2]

virtual void SetColor ( const ignition::math::Color &  _color,
const int  _index 
)
finalvirtualinherited

Set the color for the specified block.

Parameters
[in]_colorNew color to set.
[in]_indexThe index to the block to update.

◆ SetColor() [2/2]

virtual void SetColor ( const ignition::math::Color &  _color)
finalvirtualinherited

Set the color for all the blocks.

Parameters
[in]_colorNew color to set.

◆ SetDuration() [1/2]

virtual void SetDuration ( const double  _duration,
const int  _index 
)
finalvirtualinherited

Set the duration time for the specified block.

Parameters
[in]_durationNew duration time to set.
[in]_indexThe index to the block to update.

◆ SetDuration() [2/2]

virtual void SetDuration ( const double  _duration)
finalvirtualinherited

Set the duration time for all the blocks.

Parameters
[in]_durationNew duration time to set.

◆ SetInterval() [1/2]

virtual void SetInterval ( const double  _interval,
const int  _index 
)
finalvirtualinherited

Set the interval time for the specified block.

Parameters
[in]_intervalNew interval time to set.
[in]_indexThe index to the block to update.

◆ SetInterval() [2/2]

virtual void SetInterval ( const double  _interval)
finalvirtualinherited

Set the interval time for all the blocks.

Parameters
[in]_intervalNew interval time to set.

◆ SwitchOff()

virtual void SwitchOff ( )
finalvirtualinherited

Switch off (disable the flashlight).

◆ SwitchOn()

virtual void SwitchOn ( )
finalvirtualinherited

Switch on (enable the flashlight).

◆ UpdateLightInEnv()

virtual void UpdateLightInEnv ( const common::Time _currentTime)
finalvirtualinherited

Update the light based on the given time.

Parameters
[in]_currentTimeThe current point of time to update the lights.

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