24 #include <interfaces/LaserBoxFilterInterface.h>
26 #include <core/exceptions/software.h>
46 LaserBoxFilterInterface::LaserBoxFilterInterface() : Interface()
48 data_size =
sizeof(LaserBoxFilterInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (LaserBoxFilterInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 add_fieldinfo(IFT_UINT32,
"num_boxes", 1, &data->num_boxes);
54 add_messageinfo(
"CreateNewBoxFilterMessage");
55 unsigned char tmp_hash[] = {0xd5, 0xd3, 0x35, 0xa5, 0xf5, 0xeb, 0xfe, 0xe0, 0x2e, 0x9e, 0xda, 0xa8, 0x77, 0x6f, 0x3, 0x74};
60 LaserBoxFilterInterface::~LaserBoxFilterInterface()
70 LaserBoxFilterInterface::num_boxes()
const
72 return data->num_boxes;
80 LaserBoxFilterInterface::maxlenof_num_boxes()
const
90 LaserBoxFilterInterface::set_num_boxes(
const uint32_t new_num_boxes)
92 data_changed |=
change_field(data->num_boxes, new_num_boxes);
97 LaserBoxFilterInterface::create_message(
const char *type)
const
99 if ( strncmp(
"CreateNewBoxFilterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
103 "message type for this interface type.", type);
112 LaserBoxFilterInterface::copy_values(
const Interface *other)
117 type(), other->
type());
119 memcpy(data, oi->data,
sizeof(LaserBoxFilterInterface_data_t));
123 LaserBoxFilterInterface::enum_tostring(
const char *enumtype,
int val)
const
142 LaserBoxFilterInterface::CreateNewBoxFilterMessage::CreateNewBoxFilterMessage(
const double * ini_p1,
const double * ini_p2,
const double * ini_p3,
const double * ini_p4) :
Message(
"CreateNewBoxFilterMessage")
144 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
147 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
149 memcpy(data->p1, ini_p1,
sizeof(
double) * 2);
150 memcpy(data->p2, ini_p2,
sizeof(
double) * 2);
151 memcpy(data->p3, ini_p3,
sizeof(
double) * 2);
152 memcpy(data->p4, ini_p4,
sizeof(
double) * 2);
161 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
164 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
186 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
211 throw Exception(
"Index value %u out of bounds (0..1)", index);
213 return data->p1[index];
266 throw Exception(
"Index value %u out of bounds (0..1)", index);
268 return data->p2[index];
321 throw Exception(
"Index value %u out of bounds (0..1)", index);
323 return data->p3[index];
376 throw Exception(
"Index value %u out of bounds (0..1)", index);
378 return data->p4[index];