* allowing for missing value-id (and consequently external_id, as well) in local_column (refer to issue #12) => resulting in empty channel in output
* simplify get_channel_overview(...) by removing full group info * add build-timestamp to version/help message of CLI binary * simplify/unify group/channel/submatrix/localcolumn overview of CLI binary
This commit is contained in:
@@ -445,6 +445,11 @@ void tdm_termite::process_localcolumns(bool showlog, pugi::xml_document& xml_doc
|
||||
{
|
||||
locc.values_ = vl.at(0);
|
||||
}
|
||||
else if ( vl.size() == 0 )
|
||||
{
|
||||
//std::cerr<<"localcolumn ("<<locc.id_<<","<<locc.name_<<") misses any value-ids"<<"\n";
|
||||
locc.values_ = "none";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::logic_error("localcolumn with out/multiple values id(s)");
|
||||
@@ -460,7 +465,7 @@ void tdm_termite::process_localcolumns(bool showlog, pugi::xml_document& xml_doc
|
||||
{
|
||||
throw std::runtime_error(std::string("measurement_quantity: ")
|
||||
+ locc.measurement_quantity_
|
||||
+ std::string(" is ambiguous") );
|
||||
+ std::string(" is missing/ambiguous") );
|
||||
}
|
||||
std::string dt = tdmchannels_.at(locc.measurement_quantity_).datatype_;
|
||||
std::string sequence_type;
|
||||
@@ -482,8 +487,10 @@ void tdm_termite::process_localcolumns(bool showlog, pugi::xml_document& xml_doc
|
||||
|
||||
if ( locc.external_id_.empty() )
|
||||
{
|
||||
throw std::logic_error( std::string("no external id found for ")
|
||||
+ sequence_type + std::string(" with ") + locc.values_ );
|
||||
//throw std::logic_error( std::string("no external id found for ")
|
||||
// + sequence_type + std::string(" with ") + locc.values_ );
|
||||
//std::cerr<<"no external id found for "<<sequence_type<<" with "<<locc.values_<<"\n";
|
||||
locc.external_id_ = "none";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,8 +515,8 @@ std::string tdm_termite::get_channel_overview(format chformatter)
|
||||
|
||||
// compose header
|
||||
chformatter.set_header(true);
|
||||
tdm_channelgroup grp;
|
||||
channels_summary += grp.get_info(chformatter);
|
||||
//tdm_channelgroup grp;
|
||||
//channels_summary += grp.get_info(chformatter);
|
||||
tdm_channel chn;
|
||||
channels_summary += chn.get_info(chformatter);
|
||||
std::string rule; // = std::string("#");
|
||||
@@ -526,8 +533,9 @@ std::string tdm_termite::get_channel_overview(format chformatter)
|
||||
it!=tdmchannels_.end(); ++it)
|
||||
{
|
||||
// get corresponding group
|
||||
tdm_channelgroup grp = tdmchannelgroups_.at(it->second.group_);
|
||||
channels_summary += grp.get_info(chformatter);
|
||||
// tdm_channelgroup grp = tdmchannelgroups_.at(it->second.group_);
|
||||
// channels_summary += grp.get_info(chformatter);
|
||||
|
||||
// ...and actual channel
|
||||
channels_summary += it->second.get_info(chformatter);
|
||||
channels_summary += std::string("\n");
|
||||
@@ -619,7 +627,7 @@ std::vector<tdmdatatype> tdm_termite::get_channel(std::string& id)
|
||||
// retrieve full channel info
|
||||
tdm_channel chn = tdmchannels_.at(id);
|
||||
|
||||
// extract (first) "localcolumn" for channel
|
||||
// extract (first) "localcolumn" for channel TODO there should only be a single!! local_column!!
|
||||
if ( chn.local_columns_.size() != 1 )
|
||||
{
|
||||
throw std::runtime_error(std::string("invalid local_columns_ of channel: ") + id);
|
||||
@@ -636,6 +644,12 @@ std::vector<tdmdatatype> tdm_termite::get_channel(std::string& id)
|
||||
}
|
||||
|
||||
// use "values" id to map to external block
|
||||
if ( loccol.external_id_ == "none" )
|
||||
{
|
||||
//throw std::runtime_error(std::string("missing external_id in local_column ")+loccol.id_);
|
||||
//std::cerr<<"missing external_id in local_column "<<loccol.id_<<"\n";
|
||||
return std::vector<tdmdatatype>(0);
|
||||
}
|
||||
block blk = tdx_blocks_.at(loccol.external_id_);
|
||||
|
||||
// declare vector of appropriate length
|
||||
|
Reference in New Issue
Block a user