Skip to content
Snippets Groups Projects
Commit 78d67d45 authored by Joerg Stelzer's avatar Joerg Stelzer
Browse files

Address issue with undefined function L1Board::type

parent 79a7872a
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,9 @@ namespace TrigConf {
/** Accessor to the number of connectors */
std::size_t size() const;
BoardType type() const;
std::string type() const;
BoardType boardType() const;
/** Accessor to the connector type */
bool legacy() const;
......@@ -58,7 +60,7 @@ namespace TrigConf {
/** Update the internal members */
virtual void update();
BoardType m_type;
BoardType m_boardType;
bool m_legacy;
std::vector<std::string> m_connectorNames;
};
......
......@@ -38,11 +38,11 @@ TrigConf::L1Board::update()
std::string boardType(getAttribute("type"));
if( boardType == "MUCTPI" ) {
m_type = BoardType::MUCTPI;
m_boardType = BoardType::MUCTPI;
} else if( boardType == "CTPIN" ) {
m_type = BoardType::CTPIN;
m_boardType = BoardType::CTPIN;
} else if( boardType == "TOPO" ) {
m_type = BoardType::TOPO;
m_boardType = BoardType::TOPO;
} else {
throw std::runtime_error("Unknown board type " + boardType);
}
......@@ -60,6 +60,25 @@ TrigConf::L1Board::size() const
return m_connectorNames.size();
}
TrigConf::L1Board::BoardType
TrigConf::L1Board::boardType() const
{
return m_boardType;
}
std::string
TrigConf::L1Board::type() const
{
switch( boardType() ) {
case BoardType::CTPIN:
return "CTPIN";
case BoardType::MUCTPI:
return "MUCTPI";
case BoardType::TOPO:
return "TOPO";
}
return "";
}
bool
TrigConf::L1Board::legacy() const
......
......@@ -95,7 +95,7 @@ testL1Menu_Boards(const TrigConf::L1Menu & l1menu) {
cout << "L1 menu has " << l1menu.boardNames().size() << " boards configured" << endl;
string boardName("Topo1");
auto & board = l1menu.board(boardName);
cout << "Board " << boardName << " has " << board.size() << " connectors configured: ";
cout << "Board " << boardName << " of type " << board.type() << " has " << board.size() << " connectors configured: ";
for( auto & connName : board.connectorNames() ) { cout << connName << " "; }
cout << endl;
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment