24 #include <interfaces/SkillerDebugInterface.h> 26 #include <core/exceptions/software.h> 49 SkillerDebugInterface::SkillerDebugInterface() : Interface()
51 data_size =
sizeof(SkillerDebugInterface_data_t);
52 data_ptr = malloc(data_size);
53 data = (SkillerDebugInterface_data_t *)data_ptr;
54 data_ts = (interface_data_ts_t *)data_ptr;
55 memset(data_ptr, 0, data_size);
56 enum_map_GraphDirectionEnum[(int)GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
57 enum_map_GraphDirectionEnum[(int)GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
58 enum_map_GraphDirectionEnum[(int)GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
59 enum_map_GraphDirectionEnum[(int)GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
60 add_fieldinfo(IFT_STRING,
"graph_fsm", 32, data->graph_fsm);
61 add_fieldinfo(IFT_STRING,
"graph", 8192, data->graph);
62 add_fieldinfo(IFT_ENUM,
"graph_dir", 1, &data->graph_dir,
"GraphDirectionEnum", &enum_map_GraphDirectionEnum);
63 add_fieldinfo(IFT_BOOL,
"graph_colored", 1, &data->graph_colored);
64 add_messageinfo(
"SetGraphMessage");
65 add_messageinfo(
"SetGraphDirectionMessage");
66 add_messageinfo(
"SetGraphColoredMessage");
67 unsigned char tmp_hash[] = {0xcf, 0x3d, 0x2f, 0xf8, 0x80, 0x6e, 0x8f, 0xf4, 0x81, 0xa6, 0x7f, 0xd9, 0xb0, 0x29, 0xfc, 0x62};
72 SkillerDebugInterface::~SkillerDebugInterface()
84 case GD_TOP_BOTTOM:
return "GD_TOP_BOTTOM";
85 case GD_BOTTOM_TOP:
return "GD_BOTTOM_TOP";
86 case GD_LEFT_RIGHT:
return "GD_LEFT_RIGHT";
87 case GD_RIGHT_LEFT:
return "GD_RIGHT_LEFT";
88 default:
return "UNKNOWN";
99 SkillerDebugInterface::graph_fsm()
const 101 return data->graph_fsm;
109 SkillerDebugInterface::maxlenof_graph_fsm()
const 121 SkillerDebugInterface::set_graph_fsm(
const char * new_graph_fsm)
123 strncpy(data->graph_fsm, new_graph_fsm,
sizeof(data->graph_fsm));
134 SkillerDebugInterface::graph()
const 144 SkillerDebugInterface::maxlenof_graph()
const 156 SkillerDebugInterface::set_graph(
const char * new_graph)
158 strncpy(data->graph, new_graph,
sizeof(data->graph));
169 SkillerDebugInterface::graph_dir()
const 179 SkillerDebugInterface::maxlenof_graph_dir()
const 193 data->graph_dir = new_graph_dir;
204 SkillerDebugInterface::is_graph_colored()
const 206 return data->graph_colored;
214 SkillerDebugInterface::maxlenof_graph_colored()
const 226 SkillerDebugInterface::set_graph_colored(
const bool new_graph_colored)
228 data->graph_colored = new_graph_colored;
234 SkillerDebugInterface::create_message(
const char *type)
const 236 if ( strncmp(
"SetGraphMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
238 }
else if ( strncmp(
"SetGraphDirectionMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
240 }
else if ( strncmp(
"SetGraphColoredMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
244 "message type for this interface type.", type);
253 SkillerDebugInterface::copy_values(
const Interface *other)
258 type(), other->
type());
260 memcpy(data, oi->data,
sizeof(SkillerDebugInterface_data_t));
264 SkillerDebugInterface::enum_tostring(
const char *enumtype,
int val)
const 266 if (strcmp(enumtype,
"GraphDirectionEnum") == 0) {
283 SkillerDebugInterface::SetGraphMessage::SetGraphMessage(
const char * ini_graph_fsm) :
Message(
"SetGraphMessage")
285 data_size =
sizeof(SetGraphMessage_data_t);
288 data = (SetGraphMessage_data_t *)
data_ptr;
290 strncpy(data->graph_fsm, ini_graph_fsm, 32);
291 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
292 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
293 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
294 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
300 data_size =
sizeof(SetGraphMessage_data_t);
303 data = (SetGraphMessage_data_t *)
data_ptr;
305 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
306 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
307 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
308 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
326 data = (SetGraphMessage_data_t *)
data_ptr;
340 return data->graph_fsm;
362 strncpy(data->graph_fsm, new_graph_fsm,
sizeof(data->graph_fsm));
387 data_size =
sizeof(SetGraphDirectionMessage_data_t);
390 data = (SetGraphDirectionMessage_data_t *)
data_ptr;
392 data->graph_dir = ini_graph_dir;
393 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
394 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
395 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
396 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
397 add_fieldinfo(
IFT_ENUM,
"graph_dir", 1, &data->graph_dir,
"GraphDirectionEnum", &enum_map_GraphDirectionEnum);
402 data_size =
sizeof(SetGraphDirectionMessage_data_t);
405 data = (SetGraphDirectionMessage_data_t *)
data_ptr;
407 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
408 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
409 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
410 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
411 add_fieldinfo(
IFT_ENUM,
"graph_dir", 1, &data->graph_dir,
"GraphDirectionEnum", &enum_map_GraphDirectionEnum);
428 data = (SetGraphDirectionMessage_data_t *)
data_ptr;
464 data->graph_dir = new_graph_dir;
489 data_size =
sizeof(SetGraphColoredMessage_data_t);
492 data = (SetGraphColoredMessage_data_t *)
data_ptr;
494 data->graph_colored = ini_graph_colored;
495 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
496 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
497 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
498 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
504 data_size =
sizeof(SetGraphColoredMessage_data_t);
507 data = (SetGraphColoredMessage_data_t *)
data_ptr;
509 enum_map_GraphDirectionEnum[(int)
GD_TOP_BOTTOM] =
"GD_TOP_BOTTOM";
510 enum_map_GraphDirectionEnum[(int)
GD_BOTTOM_TOP] =
"GD_BOTTOM_TOP";
511 enum_map_GraphDirectionEnum[(int)
GD_LEFT_RIGHT] =
"GD_LEFT_RIGHT";
512 enum_map_GraphDirectionEnum[(int)
GD_RIGHT_LEFT] =
"GD_RIGHT_LEFT";
530 data = (SetGraphColoredMessage_data_t *)
data_ptr;
544 return data->graph_colored;
566 data->graph_colored = new_graph_colored;
SkillerDebugInterface Fawkes BlackBoard Interface.
size_t maxlenof_graph_fsm() const
Get maximum length of graph_fsm value.
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
size_t maxlenof_graph_dir() const
Get maximum length of graph_dir value.
Fawkes library namespace.
virtual Message * clone() const
Clone this message.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
GraphDirectionEnum graph_dir() const
Get graph_dir value.
~SetGraphDirectionMessage()
Destructor.
void set_graph_colored(const bool new_graph_colored)
Set graph_colored value.
SetGraphMessage Fawkes BlackBoard Interface Message.
Base class for all Fawkes BlackBoard interfaces.
void set_graph_fsm(const char *new_graph_fsm)
Set graph_fsm value.
size_t maxlenof_graph_colored() const
Get maximum length of graph_colored value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
const char * type() const
Get type of interface.
virtual Message * clone() const
Clone this message.
GraphDirectionEnum
Primary direction of the graph.
char * graph_fsm() const
Get graph_fsm value.
~SetGraphColoredMessage()
Destructor.
bool is_graph_colored() const
Get graph_colored value.
~SetGraphMessage()
Destructor.
SetGraphColoredMessage Fawkes BlackBoard Interface Message.
SetGraphDirectionMessage()
Constructor.
virtual Message * clone() const
Clone this message.
void set_graph_dir(const GraphDirectionEnum new_graph_dir)
Set graph_dir value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
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.
SetGraphMessage()
Constructor.
SetGraphDirectionMessage Fawkes BlackBoard Interface Message.
SetGraphColoredMessage()
Constructor.
field with interface specific enum type