- changed tags into on/off event tags
git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@479 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -290,6 +290,10 @@ namespace gr {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Output OFF-tags
|
||||||
|
pmt::pmt_t tag_key = pmt::string_to_symbol(std::string("peak"));
|
||||||
|
pmt::pmt_t tag_value = pmt::string_to_symbol(std::string("id=") + std::to_string(peak.id) + std::string(":pos=") + std::to_string(peak.pos) + std::string(":state=") + std::string("OFF"));
|
||||||
|
add_item_tag(DATA, nitems_written(DATA) + k, tag_key, tag_value, m_tag_id);
|
||||||
fprintf(stderr, "Lost Peak #%u at %d\n", (int)peak.id, (int)peak.pos);
|
fprintf(stderr, "Lost Peak #%u at %d\n", (int)peak.id, (int)peak.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,6 +316,11 @@ namespace gr {
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
temp.push_back(peak);
|
temp.push_back(peak);
|
||||||
|
|
||||||
|
// Output ON-tags
|
||||||
|
pmt::pmt_t tag_key = pmt::string_to_symbol(std::string("peak"));
|
||||||
|
pmt::pmt_t tag_value = pmt::string_to_symbol(std::string("id=") + std::to_string(peak.id) + std::string(":pos=") + std::to_string(peak.pos) + std::string(":state=") + std::string("ON"));
|
||||||
|
add_item_tag(DATA, nitems_written(DATA) + k, tag_key, tag_value, m_tag_id);
|
||||||
fprintf(stderr, "New Peak #%u at %d\n", (int)peak.id, (int)peak.pos);
|
fprintf(stderr, "New Peak #%u at %d\n", (int)peak.id, (int)peak.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -347,18 +356,6 @@ namespace gr {
|
|||||||
*(optr_pbox++) = m_pPeakBox_abs[i];
|
*(optr_pbox++) = m_pPeakBox_abs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
|
||||||
// Output tags
|
|
||||||
// -----------------------------------------------------------------
|
|
||||||
for (int i = 0; i < m_peakHistory.size(); i++)
|
|
||||||
{
|
|
||||||
// Create peak tags
|
|
||||||
Peak &peak = m_peakHistory[i];
|
|
||||||
pmt::pmt_t tag_key = pmt::string_to_symbol(std::string("pos_id_") + std::to_string(peak.id));
|
|
||||||
pmt::pmt_t tag_value = pmt::from_long(peak.pos);
|
|
||||||
add_item_tag(DATA, nitems_written(DATA) + k, tag_key, tag_value, m_tag_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_frameCount++;
|
m_frameCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -826,7 +826,7 @@
|
|||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>display</key>
|
<key>display</key>
|
||||||
<value>False</value>
|
<value>True</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_enabled</key>
|
<key>_enabled</key>
|
||||||
@@ -850,7 +850,7 @@
|
|||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>filter</key>
|
<key>filter</key>
|
||||||
<value>""</value>
|
<value>"peak"</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user