LedInterface Fawkes BlackBoard Interface. More...
#include <>>
Classes | |
struct | LedInterface_data_t |
Internal data storage, do NOT modify! | |
class | SetIntensityMessage |
SetIntensityMessage Fawkes BlackBoard Interface Message. More... | |
class | TurnOffMessage |
TurnOffMessage Fawkes BlackBoard Interface Message. More... | |
class | TurnOnMessage |
TurnOnMessage Fawkes BlackBoard Interface Message. More... | |
Public Member Functions | |
virtual bool | message_valid (const Message *message) const |
Check if message is valid and can be enqueued. | |
float | intensity () const |
Get intensity value. | |
void | set_intensity (const float new_intensity) |
Set intensity value. | |
size_t | maxlenof_intensity () const |
Get maximum length of intensity value. | |
virtual Message * | create_message (const char *type) const |
Create message based on type name. | |
virtual void | copy_values (const Interface *other) |
Copy values from other interface. | |
virtual const char * | enum_tostring (const char *enumtype, int val) const |
Convert arbitrary enum value to string. | |
Static Public Attributes | |
static const float | ON = 1.0 |
ON constant. | |
static const float | OFF = 0.0 |
OFF constant. |
LedInterface Fawkes BlackBoard Interface.
This interface provides access to LEDs. The interface controls an intensity value between 0.0 (off) and 1.0 (on, max intensity). LEDs that do not support intensity setting can only be set to on and off.
Definition at line 33 of file LedInterface.h.
void fawkes::LedInterface::copy_values | ( | const Interface * | other | ) | [virtual] |
Copy values from other interface.
other | other interface to copy values from |
Implements fawkes::Interface.
Definition at line 123 of file LedInterface.cpp.
References fawkes::Interface::type().
Message * fawkes::LedInterface::create_message | ( | const char * | type | ) | const [virtual] |
Create message based on type name.
This will create a new message of the given type. The type must be given without the InterfaceName:: prefix but just the plain class name of the message.
type | message type |
UnknownTypeException | thrown if this interface cannot create a message of the given type. |
Implements fawkes::Interface.
Definition at line 104 of file LedInterface.cpp.
const char * fawkes::LedInterface::enum_tostring | ( | const char * | enumtype, | |
int | val | |||
) | const [virtual] |
Convert arbitrary enum value to string.
Given the string representation of the enum type and the value this method returns the string representation of the specific value, or the string UNKNOWN if the value is not defined. An exception is thrown if the enum type is invalid.
enumtype | enum type as string | |
val | value to convert |
UnknownTypeException | thrown if enumtype is not specified for interface. |
Implements fawkes::Interface.
Definition at line 134 of file LedInterface.cpp.
float fawkes::LedInterface::intensity | ( | ) | const |
Get intensity value.
Intensity value.
Definition at line 76 of file LedInterface.cpp.
size_t fawkes::LedInterface::maxlenof_intensity | ( | ) | const |
Get maximum length of intensity value.
Definition at line 86 of file LedInterface.cpp.
bool fawkes::LedInterface::message_valid | ( | const Message * | message | ) | const [virtual] |
Check if message is valid and can be enqueued.
message | Message to check |
Implements fawkes::Interface.
Definition at line 365 of file LedInterface.cpp.
void fawkes::LedInterface::set_intensity | ( | const float | new_intensity | ) |
Set intensity value.
Intensity value.
new_intensity | new intensity value |
Definition at line 96 of file LedInterface.cpp.
References fawkes::Interface::data_changed.
const float fawkes::LedInterface::OFF = 0.0 [static] |
OFF constant.
Definition at line 41 of file LedInterface.h.
const float fawkes::LedInterface::ON = 1.0 [static] |
ON constant.
Definition at line 40 of file LedInterface.h.