44 if (fullpath.length() == 0)
46 std::ifstream inputfile(fullpath.c_str(), std::ios::in);
48 static constexpr int BufferSize = 512;
52 bool isMatched =
false;
53 while (inputfile && inputfile.getline(buf,BufferSize)) {
54 std::istringstream line(buf);
62 if (!isMatched)
return false;
65 if (inputfile.getline(buf, BufferSize)) {
66 std::istringstream infileStr(buf);
67 std::string boardName;
68 infileStr >> boardName;
70 for (
int itype=0; itype <
m_HPBToSL.getNumberOfType(); itype++) {
72 infileStr >> board_number;
75 for (
int j=0; j < board_number; j++) {
76 inputfile.getline(buf, BufferSize);
77 std::istringstream infileStr2(buf);
79 infileStr2 >>
id >> port;
82 m_HPBToSL.setSLPortToHPB(itype,
id, port);
88 if (inputfile.getline(buf, BufferSize)) {
89 std::istringstream infileStr(buf);
90 std::string boardName;
91 infileStr >> boardName;
93 for (
int itype=0; itype <
m_SBToHPB.getNumberOfType(); itype++) {
95 if (itype ==
WISB || itype ==
SISB)
continue;
97 infileStr >> board_number;
100 for (
int j=0; j < board_number; j++) {
101 inputfile.getline(buf, BufferSize);
102 std::istringstream infileStr2(buf);
104 infileStr2 >>
id >> idHPB >> port;
105 if (
id < 0 || idHPB < 0 || port < 0)
continue;
108 m_SBToHPB.setHPBIdToSB(itype,
id, idHPB);
109 m_SBToHPB.setHPBPortToSB(itype,
id, port);
115 if (inputfile.getline(buf, BufferSize)) {
116 std::istringstream infileStr(buf);
117 std::string boardName;
118 infileStr >> boardName;
120 for (
int itype=0; itype <
m_PPToSB.getNumberOfType(); itype++) {
122 infileStr >> board_number;
124 m_PPToSB.setNumber(itype, board_number);
125 for(
int j=0; j<board_number; j++) {
126 inputfile.getline(buf, BufferSize);
127 std::istringstream infileStr2(buf);
131 infileStr2 >>
id >> idSB1 >> idSB2;
133 m_PPToSB.setSBIdToPP(itype, 0, j, idSB1);
134 m_PPToSB.setSBIdToPP(itype, 1, j, idSB2);