- refactored
git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@500 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -33,40 +33,8 @@ namespace gr {
|
||||
pmt::pmt_t m_msg_port_in;
|
||||
pmt::pmt_t m_msg_port_out;
|
||||
|
||||
void set_msg(pmt::pmt_t msg)
|
||||
{
|
||||
if (pmt::is_dict(msg))
|
||||
{
|
||||
pmt::pmt_t items = pmt::dict_items(msg);
|
||||
for (int i=0; i < pmt::length(items); i++)
|
||||
{
|
||||
pmt::pmt_t pair = pmt::nth(i, items);
|
||||
|
||||
pmt::pmt_t key = pmt::car(pair);
|
||||
pmt::pmt_t val = pmt::cdr(pair);
|
||||
if (pmt::is_integer(val))
|
||||
{
|
||||
fprintf(stderr, "[%s=%d]", pmt::symbol_to_string(key).c_str(), (int)pmt::to_long(val));
|
||||
}
|
||||
else if (pmt::is_real(val))
|
||||
{
|
||||
fprintf(stderr, "[%s=%f]", pmt::symbol_to_string(key).c_str(), pmt::to_float(val));
|
||||
}
|
||||
else if (pmt::is_bool(val))
|
||||
{
|
||||
fprintf(stderr, "[%s=%d]", pmt::symbol_to_string(key).c_str(), pmt::to_bool(val));
|
||||
}
|
||||
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s\n", pmt::symbol_to_string(msg).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void print_pair(pmt::pmt_t pair);
|
||||
|
||||
public:
|
||||
message_debug_impl();
|
||||
~message_debug_impl();
|
||||
@@ -78,6 +46,8 @@ namespace gr {
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
void set_msg(pmt::pmt_t msg);
|
||||
};
|
||||
|
||||
} // namespace jay
|
||||
|
||||
Reference in New Issue
Block a user