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;
74 for (
int j=0; j < board_number; j++) {
75 inputfile.getline(buf, BufferSize);
76 std::istringstream infileStr2(buf);
78 infileStr2 >>
id >> port;
80 m_HPBToSL.setSLPortToHPB(itype,
id, port);
86 if (inputfile.getline(buf, BufferSize)) {
87 std::istringstream infileStr(buf);
88 std::string boardName;
89 infileStr >> boardName;
91 for (
int itype=0; itype <
m_SBToHPB.getNumberOfType(); itype++) {
93 if (itype ==
WISB || itype ==
SISB)
continue;
95 infileStr >> board_number;
97 for (
int j=0; j < board_number; j++) {
98 inputfile.getline(buf, BufferSize);
99 std::istringstream infileStr2(buf);
101 infileStr2 >>
id >> idHPB >> port;
102 if (
id < 0 || idHPB < 0 || port < 0)
continue;
104 m_SBToHPB.setHPBIdToSB(itype,
id, idHPB);
105 m_SBToHPB.setHPBPortToSB(itype,
id, port);
111 if (inputfile.getline(buf, BufferSize)) {
112 std::istringstream infileStr(buf);
113 std::string boardName;
114 infileStr >> boardName;
116 for (
int itype=0; itype <
m_PPToSB.getNumberOfType(); itype++) {
118 infileStr >> board_number;
119 m_PPToSB.setNumber(itype, board_number);
120 for(
int j=0; j<board_number; j++) {
121 inputfile.getline(buf, BufferSize);
122 std::istringstream infileStr2(buf);
126 infileStr2 >>
id >> idSB1 >> idSB2;
128 m_PPToSB.setSBIdToPP(itype, 0, j, idSB1);
129 m_PPToSB.setSBIdToPP(itype, 1, j, idSB2);