##

FlashLightSetting Class Reference

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

`#include <FlashLightPlugin.hh>`

Inherited by LedSetting.

## Public Member Functions

| FlashLightSetting (const sdf::ElementPtr &_sdf, const physics::ModelPtr &_model, const common::Time &_currentTime)
| Constructor. More...
virtual | ~FlashLightSetting ()
| 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 | 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) final
| Set the color for all the blocks. More...
virtual void | SetColor (const ignition::math::Color &_color, const int _index) final
| Set the color for the specified block. More...
virtual void | SetDuration (const double _duration) final
| Set the duration time 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 | SetInterval (const double _interval) final
| Set the interval 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 | 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 flash light settings.

A setting for each flash light is separately stored in a FlashLightSetting class, which takes care of dynamic specifications such as duration and interval.

## Constructor & Destructor Documentation

## FlashLightSetting()

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

Constructor.

Initialize the setting by the data given to the base plugin.

Parameters

  [in] | _sdf | SDF data for the setting.
  [in] | _model | The Model pointer holding the light to control.
  [in] | _currentTime | The current time point.

## ~FlashLightSetting()

virtual ~FlashLightSetting | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## BlockCount()

virtual unsigned int BlockCount | ( |  | ) |

final virtual

Get the number of blocks.

Returns
  The number of blocks the object currently has.

## CurrentColor()

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

final protected virtual

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 | ( |  | ) |

protected virtual

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

Reimplemented in LedSetting.

## Flash()

virtual void Flash | ( |  | ) |

protected virtual

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

Reimplemented in LedSetting.

## InitPubLight()

virtual void InitPubLight | ( | const transport::PublisherPtr & | _pubLight | ) |

final virtual

Set the publisher and send an initial light command.

Parameters

  [in] | _pubLight | The publisher to send a message

## InsertBlock()

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

final virtual

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] | _duration | The duration for the block.
  [in] | _interval | The interval for the block.
  [in] | _color | The color for the block.
  [in] | _index | The index of the block to be inserted into the list.

## Link()

virtual const physics::LinkPtr Link | ( |  | ) | const

final virtual

Getter of link.

Returns
  A pointer to the link element.

## Name()

virtual const std::string Name | ( |  | ) | const

final virtual

Getter of name.

Returns
  The name of the light element.

## RemoveBlock()

virtual bool RemoveBlock | ( | const int | _index | ) |

final virtual

Remove a specified block.

Parameters

  [in] | _index | Index 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 | ) |

final virtual

Set the color for all the blocks.

Parameters

  [in] | _color | New color to set.

## SetColor() [2/2]

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

final virtual

Set the color for the specified block.

Parameters

  [in] | _color | New color to set.
  [in] | _index | The index to the block to update.

## SetDuration() [1/2]

virtual void SetDuration | ( | const double | _duration | ) |

final virtual

Set the duration time for all the blocks.

Parameters

  [in] | _duration | New duration time to set.

## SetDuration() [2/2]

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

final virtual

Set the duration time for the specified block.

Parameters

  [in] | _duration | New duration time to set.
  [in] | _index | The index to the block to update.

## SetInterval() [1/2]

virtual void SetInterval | ( | const double | _interval | ) |

final virtual

Set the interval time for all the blocks.

Parameters

  [in] | _interval | New interval time to set.

## SetInterval() [2/2]

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

final virtual

Set the interval time for the specified block.

Parameters

  [in] | _interval | New interval time to set.
  [in] | _index | The index to the block to update.

## SwitchOff()

virtual void SwitchOff | ( |  | ) |

final virtual

Switch off (disable the flashlight).

## SwitchOn()

virtual void SwitchOn | ( |  | ) |

final virtual

Switch on (enable the flashlight).

## UpdateLightInEnv()

virtual void UpdateLightInEnv | ( | const common::Time & | _currentTime | ) |

final virtual

Update the light based on the given time.

Parameters

  [in] | _currentTime | The current point of time to update the lights.

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

- FlashLightPlugin.hh