24 #include <interfaces/CameraControlInterface.h> 26 #include <core/exceptions/software.h> 45 CameraControlInterface::CameraControlInterface() : Interface()
47 data_size =
sizeof(CameraControlInterface_data_t);
49 data = (CameraControlInterface_data_t *)
data_ptr;
52 enum_map_Effect[(int)EFF_NONE] =
"EFF_NONE";
53 enum_map_Effect[(int)EFF_PASTEL] =
"EFF_PASTEL";
54 enum_map_Effect[(int)EFF_NEGATIVE] =
"EFF_NEGATIVE";
55 enum_map_Effect[(int)EFF_BW] =
"EFF_BW";
56 enum_map_Effect[(int)EFF_SOLARIZE] =
"EFF_SOLARIZE";
68 unsigned char tmp_hash[] = {0xc, 0xc9, 0x4a, 0x24, 0x89, 0xb8, 0x9c, 0xd1, 0x7f, 0xf5, 0xc4, 0xa3, 0x41, 0xca, 0x9a, 0xc1};
73 CameraControlInterface::~CameraControlInterface()
85 case EFF_NONE:
return "EFF_NONE";
86 case EFF_PASTEL:
return "EFF_PASTEL";
87 case EFF_NEGATIVE:
return "EFF_NEGATIVE";
88 case EFF_BW:
return "EFF_BW";
89 case EFF_SOLARIZE:
return "EFF_SOLARIZE";
90 default:
return "UNKNOWN";
121 data->effect = new_effect;
132 return data->effect_supported;
152 data->effect_supported = new_effect_supported;
183 data->zoom = new_zoom;
194 return data->zoom_supported;
214 data->zoom_supported = new_zoom_supported;
225 return data->zoom_max;
245 data->zoom_max = new_zoom_max;
256 return data->zoom_min;
276 data->zoom_min = new_zoom_min;
307 data->mirror = new_mirror;
318 return data->mirror_supported;
338 data->mirror_supported = new_mirror_supported;
346 if ( strncmp(
"SetEffectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
348 }
else if ( strncmp(
"SetZoomMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
350 }
else if ( strncmp(
"SetMirrorMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
354 "message type for this interface type.", type);
370 memcpy(data, oi->data,
sizeof(CameraControlInterface_data_t));
376 if (strcmp(enumtype,
"Effect") == 0) {
377 return tostring_Effect((
Effect)val);
395 data_size =
sizeof(SetEffectMessage_data_t);
398 data = (SetEffectMessage_data_t *)
data_ptr;
400 data->effect = ini_effect;
401 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
402 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
404 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
411 data_size =
sizeof(SetEffectMessage_data_t);
414 data = (SetEffectMessage_data_t *)
data_ptr;
416 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
417 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
419 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
438 data = (SetEffectMessage_data_t *)
data_ptr;
470 data->effect = new_effect;
495 data_size =
sizeof(SetZoomMessage_data_t);
498 data = (SetZoomMessage_data_t *)
data_ptr;
500 data->zoom = ini_zoom;
501 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
502 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
504 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
511 data_size =
sizeof(SetZoomMessage_data_t);
514 data = (SetZoomMessage_data_t *)
data_ptr;
516 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
517 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
519 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
538 data = (SetZoomMessage_data_t *)
data_ptr;
570 data->zoom = new_zoom;
595 data_size =
sizeof(SetMirrorMessage_data_t);
598 data = (SetMirrorMessage_data_t *)
data_ptr;
600 data->mirror = ini_mirror;
601 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
602 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
604 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
611 data_size =
sizeof(SetMirrorMessage_data_t);
614 data = (SetMirrorMessage_data_t *)
data_ptr;
616 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
617 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
619 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
638 data = (SetMirrorMessage_data_t *)
data_ptr;
670 data->mirror = new_mirror;
bool is_mirror() const
Get mirror value.
void * data_ptr
Pointer to memory that contains local data.
void set_zoom_max(const uint32_t new_zoom_max)
Set zoom_max value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_zoom_min(const uint32_t new_zoom_min)
Set zoom_min value.
virtual Message * clone() const
Clone this message.
void set_zoom(const uint32_t new_zoom)
Set zoom value.
void set_effect(const Effect new_effect)
Set effect value.
void set_zoom_supported(const bool new_zoom_supported)
Set zoom_supported value.
bool is_zoom_supported() const
Get zoom_supported value.
void set_mirror_supported(const bool new_mirror_supported)
Set mirror_supported value.
void set_hash(unsigned char *ihash)
Set hash.
size_t maxlenof_mirror_supported() const
Get maximum length of mirror_supported value.
Fawkes library namespace.
size_t maxlenof_zoom() const
Get maximum length of zoom value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
uint32_t zoom_max() const
Get zoom_max value.
CameraControlInterface Fawkes BlackBoard Interface.
Base class for all Fawkes BlackBoard interfaces.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
~SetMirrorMessage()
Destructor.
void set_effect(const Effect new_effect)
Set effect value.
bool is_mirror_supported() const
Get mirror_supported value.
void set_mirror(const bool new_mirror)
Set mirror value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
size_t maxlenof_effect() const
Get maximum length of effect value.
size_t maxlenof_mirror() const
Get maximum length of mirror value.
unsigned int data_size
Size of memory needed to hold all data.
~SetZoomMessage()
Destructor.
uint32_t zoom_min() const
Get zoom_min value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
bool data_changed
Indicator if data has changed.
SetEffectMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
size_t maxlenof_zoom() const
Get maximum length of zoom value.
void set_effect_supported(const bool new_effect_supported)
Set effect_supported value.
uint32_t zoom() const
Get zoom value.
uint32_t zoom() const
Get zoom value.
void set_zoom(const uint32_t new_zoom)
Set zoom value.
SetZoomMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_mirror(const bool new_mirror)
Set mirror value.
bool is_effect_supported() const
Get effect_supported value.
virtual Message * clone() const
Clone this message.
Effect
Enumeration defining the possible effects.
Effect effect() const
Get effect value.
Effect effect() const
Get effect value.
size_t maxlenof_effect_supported() const
Get maximum length of effect_supported value.
SetMirrorMessage Fawkes BlackBoard Interface Message.
const char * tostring_Effect(Effect value) const
Convert Effect constant to string.
size_t maxlenof_zoom_min() const
Get maximum length of zoom_min value.
size_t maxlenof_effect() const
Get maximum length of effect value.
size_t maxlenof_zoom_supported() const
Get maximum length of zoom_supported value.
virtual Message * create_message(const char *type) const
Create message based on type name.
size_t maxlenof_zoom_max() const
Get maximum length of zoom_max value.
~SetEffectMessage()
Destructor.
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.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
SetZoomMessage()
Constructor.
size_t maxlenof_mirror() const
Get maximum length of mirror value.
Negative/Positive Reversal.
SetEffectMessage()
Constructor.
SetMirrorMessage()
Constructor.
const char * type() const
Get message type.
bool is_mirror() const
Get mirror value.
32 bit unsigned integer field
field with interface specific enum type