//---------------------------------------------------------------------------// #ifndef IMCCHANNEL #define IMCCHANNEL #include #include "imc_datatype.hpp" //---------------------------------------------------------------------------// namespace imc { // collect uuid's of blocks required for full channel reconstruction struct channel_env { // define unique identifer for channel_env std::string uuid_; // collect affiliate blocks for a single channel std::string CBuuid_, CGuuid_, CCuuid_, CNuuid_; std::string CDuuid_, CTuuid_, Cbuuid_, CPuuid_, CRuuid_, CSuuid_; std::string NTuuid_, NOuuid_; // reset all members void reset() { uuid_.clear(); CBuuid_.clear(); CGuuid_.clear(); CCuuid_.clear(); CNuuid_.clear(); CDuuid_.clear(); CTuuid_.clear(); Cbuuid_.clear(); CPuuid_.clear(); CRuuid_.clear(); CSuuid_.clear(); NTuuid_.clear(); NOuuid_.clear(); } // get info std::string get_info(int width = 20) { std::stringstream ss; ss< std::string joinvec(std::vector
myvec, unsigned long int limit = 10) { std::stringstream ss; ss<<"["; if ( myvec.size() <= limit ) { for ( dt el: myvec ) ss< 1 ) sumstr.pop_back(); sumstr += std::string("]"); return sumstr; } // channel struct channel { // associated environment of blocks and map of blocks channel_env chnenv_; const std::map* blocks_; // collect meta-data of channels according to env, // just everything valueable in here std::string uuid_; std::string name_; std::string yname_, yunit_; imc::datatype dattyp_; std::string xname_, xunit_; std::vector ydata_; std::vector xdata_; // group reference the channel belongs to std::string group_uuid_, group_name_; // constructor takes channel's block environment channel(channel_env chnenv, std::map* blocks): chnenv_(chnenv), blocks_(blocks) { std::vector prms = blocks->at(chnenv_.CNuuid_).get_parameters(); name_ = blocks->at(chnenv_.CNuuid_).get_parameter(prms[6]); } // get info string std::string get_info(int width = 20) { std::stringstream ss; ss<<"uuid:"<(ydata_) <<"\",\"xdata\":\""<(xdata_) <<"\",\"aff. blocks\":\""<