本文整理汇总了C++中bulkio::StreamSRISequence_var类的典型用法代码示例。如果您正苦于以下问题:C++ StreamSRISequence_var类的具体用法?C++ StreamSRISequence_var怎么用?C++ StreamSRISequence_var使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StreamSRISequence_var类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setupIOMappings
void burst_tagger_cc_base::setupIOMappings( )
{
int ninput_streams = 0;
int noutput_streams = 0;
std::string sid("");
int inMode=RealMode;
if ( !validGRBlock() ) return;
ninput_streams = gr_sptr->get_max_input_streams();
gr_io_signature_sptr g_isig = gr_sptr->input_signature();
noutput_streams = gr_sptr->get_max_output_streams();
gr_io_signature_sptr g_osig = gr_sptr->output_signature();
LOG_DEBUG( burst_tagger_cc_base, "GNUHAWK IO MAPPINGS IN/OUT " << ninput_streams << "/" << noutput_streams );
//
// Someone reset the GR Block so we need to clean up old mappings if they exists
// we need to reset the io signatures and check the vlens
//
if ( _istreams.size() > 0 || _ostreams.size() > 0 ) {
LOG_DEBUG( burst_tagger_cc_base, "RESET INPUT SIGNATURE SIZE:" << _istreams.size() );
IStreamList::iterator istream;
for ( int idx=0 ; istream != _istreams.end(); idx++, istream++ ) {
// re-add existing stream definitons
LOG_DEBUG( burst_tagger_cc_base, "ADD READ INDEX TO GNU RADIO BLOCK");
if ( ninput_streams == -1 ) gr_sptr->add_read_index();
// setup io signature
(*istream)->associate( gr_sptr );
}
LOG_DEBUG( burst_tagger_cc_base, "RESET OUTPUT SIGNATURE SIZE:" << _ostreams.size() );
OStreamList::iterator ostream;
for ( int idx=0 ; ostream != _ostreams.end(); idx++, ostream++ ) {
// need to evaluate new settings...???
(*ostream)->associate( gr_sptr );
}
return;
}
int i = 0;
//
// Setup mapping of RH port to GNU RADIO Block input streams
// For version 1, we are ignoring the GNU Radio input stream -1 case that allows multiple data
// streams over a single connection. We are mapping a single RH Port to a single GNU Radio stream.
// Stream Identifiers will be pass along as they are received
//
LOG_TRACE( burst_tagger_cc_base, "setupIOMappings INPUT PORTS: " << inPorts.size() );
RH_ProvidesPortMap::iterator p_in;
i = 0;
// grab ports based on their order in the scd.xml file
p_in = inPorts.find("complex_in");
if ( p_in != inPorts.end() ) {
bulkio::InFloatPort *port = dynamic_cast< bulkio::InFloatPort * >(p_in->second);
int mode = inMode;
sid = "";
// need to add read index to GNU Radio Block for processing streams when max_input == -1
if ( ninput_streams == -1 ) gr_sptr->add_read_index();
// check if we received SRI during setup
BULKIO::StreamSRISequence_var sris = port->activeSRIs();
if ( sris->length() > 0 ) {
BULKIO::StreamSRI sri = sris[sris->length()-1];
mode = sri.mode;
}
std::vector<int> in;
io_mapping.push_back( in );
_istreams.push_back( new gr_istream< bulkio::InFloatPort > ( port, gr_sptr, i, mode, sid ));
LOG_DEBUG( burst_tagger_cc_base, "ADDING INPUT MAP IDX:" << i << " SID:" << sid );
// increment port counter
i++;
}
// grab ports based on their order in the scd.xml file
p_in = inPorts.find("trigger_in");
if ( p_in != inPorts.end() ) {
bulkio::InShortPort *port = dynamic_cast< bulkio::InShortPort * >(p_in->second);
int mode = inMode;
sid = "";
// need to add read index to GNU Radio Block for processing streams when max_input == -1
if ( ninput_streams == -1 ) gr_sptr->add_read_index();
// check if we received SRI during setup
BULKIO::StreamSRISequence_var sris = port->activeSRIs();
if ( sris->length() > 0 ) {
BULKIO::StreamSRI sri = sris[sris->length()-1];
mode = sri.mode;
}
std::vector<int> in;
io_mapping.push_back( in );
_istreams.push_back( new gr_istream< bulkio::InShortPort > ( port, gr_sptr, i, mode, sid ));
LOG_DEBUG( burst_tagger_cc_base, "ADDING INPUT MAP IDX:" << i << " SID:" << sid );
// increment port counter
i++;
}
//.........这里部分代码省略.........
开发者ID:54AndyN,项目名称:integration-gnuhawk,代码行数:101,代码来源:burst_tagger_cc_base.cpp
示例2: setupIOMappings
void file_descriptor_sink_f_base::setupIOMappings( )
{
int ninput_streams = 0;
int noutput_streams = 0;
std::vector<std::string>::iterator pname;
std::string sid("");
int inMode=RealMode;
if ( !validGRBlock() ) return;
ninput_streams = gr_sptr->get_max_input_streams();
gr_io_signature_sptr g_isig = gr_sptr->input_signature();
LOG_DEBUG( file_descriptor_sink_f_base, "GNUHAWK IO MAPPINGS IN/OUT " << ninput_streams << "/" << noutput_streams );
//
// Someone reset the GR Block so we need to clean up old mappings if they exists
// we need to reset the io signatures and check the vlens
//
if ( _istreams.size() > 0 ) {
LOG_DEBUG( file_descriptor_sink_f_base, "RESET INPUT SIGNATURE SIZE:" << _istreams.size() );
IStreamList::iterator istream;
for ( int idx=0 ; istream != _istreams.end(); idx++, istream++ ) {
// re-add existing stream definitons
LOG_DEBUG( file_descriptor_sink_f_base, "ADD READ INDEX TO GNU RADIO BLOCK");
if ( ninput_streams == -1 ) gr_sptr->add_read_index();
// setup io signature
istream->associate( gr_sptr );
}
return;
}
//
// Setup mapping of RH port to GNU RADIO Block input streams
// For version 1, we are ignoring the GNU Radio input stream -1 case that allows multiple data
// streams over a single connection. We are mapping a single RH Port to a single GNU Radio stream.
// Stream Identifiers will be pass along as they are received
//
LOG_TRACE( file_descriptor_sink_f_base, "setupIOMappings INPUT PORTS: " << inPorts.size() );
pname = inputPortOrder.begin();
for( int i=0; pname != inputPortOrder.end(); pname++ ) {
// grab ports based on their order in the scd.xml file
RH_ProvidesPortMap::iterator p_in = inPorts.find(*pname);
if ( p_in != inPorts.end() ) {
bulkio::InFloatPort *port = dynamic_cast< bulkio::InFloatPort * >(p_in->second);
int mode = inMode;
sid = "";
// need to add read index to GNU Radio Block for processing streams when max_input == -1
if ( ninput_streams == -1 ) gr_sptr->add_read_index();
// check if we received SRI during setup
BULKIO::StreamSRISequence_var sris = port->activeSRIs();
if ( sris->length() > 0 ) {
BULKIO::StreamSRI sri = sris[sris->length()-1];
mode = sri.mode;
}
std::vector<int> in;
io_mapping.push_back( in );
_istreams.push_back( gr_istream< bulkio::InFloatPort > ( port, gr_sptr, i, mode, sid ));
LOG_DEBUG( file_descriptor_sink_f_base, "ADDING INPUT MAP IDX:" << i << " SID:" << sid );
// increment port counter
i++;
}
}
}
开发者ID:54AndyN,项目名称:integration-gnuhawk,代码行数:72,代码来源:file_descriptor_sink_f_base.cpp
注:本文中的bulkio::StreamSRISequence_var类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论