1 #ifndef __TDE_CMAP_UTILS__ 2 #define __TDE_CMAP_UTILS__ 10 namespace dune {
namespace tde {
33 std::cout<<
"KEL "<<
_id<<
" : view "<<
_view 55 _view_kels.resize( views );
59 size_t views()
const {
return _view_kels.size(); }
64 if( iview >= (
int)_view_kels.size())
66 auto nkel = _view_kels[iview];
72 _kels.insert(
kel_connector(
id, view, reverse, first_view_ch ) );
90 const std::vector<int> &kel_ids )
92 auto nconn = kel_ids.size();
94 std::cout<<
"number of connectors is not even\n";
98 if( fslot < (
int)_crp_conn.size() && !_crp_conn.empty() ){
99 std::cout<<
"cannot overwrite the existing connection\n";
104 for(
size_t i=0;i<kel_ids.size();i+=2 ){
105 int kel_1 = kel_ids[i];
106 int kel_2 = kel_ids[i+1];
108 if( islot >= _cards ){
109 std::cout<<
"slot "<<islot<<
" does not exist\n";
112 _crp_conn.emplace_back(islot, icrp, kel_1, kel_2 );
120 std::vector< std::tuple< int, int, int, int> >
_crp_conn;
void add_connector(int id, int view, bool reverse, int first_view_ch)
size_t nch_view(int iview) const
void add_crp_connection(int icrp, int fslot, const std::vector< int > &kel_ids)
std::vector< std::tuple< int, int, int, int > > _crp_conn
std::vector< int > _view_kels
struct dune::tde::crp_connectors crp_connectors
std::set< kel_connector > connectors
struct dune::tde::crate crate
crp_connectors(int crp, int views)
static unsigned int reverse(QString &chars, unsigned char *level, unsigned int a, unsigned int b)
kel_connector(int id, int view, bool reverse, int first_view_ch)
bool operator<(const kel_connector &other) const
QTextStream & endl(QTextStream &s)