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;
84 m_HPBToSL.setSLPortToHPB(itype,
id, port);
90 if (inputfile.getline(buf, BufferSize)) {
91 std::istringstream infileStr(buf);
92 std::string boardName;
93 infileStr >> boardName;
95 for (
int itype=0; itype <
m_SBToHPB.getNumberOfType(); itype++) {
97 if (itype ==
WISB || itype ==
SISB)
continue;
99 infileStr >> board_number;
101 m_SBToHPB.setNumber(itype, board_number);
102 for (
int j=0; j < board_number; j++) {
103 inputfile.getline(buf, BufferSize);
104 std::istringstream infileStr2(buf);
106 infileStr2 >>
id >> idHPB >> port;
107 if (
id < 0 || idHPB < 0 || port < 0)
continue;
110 m_SBToHPB.setHPBIdToSB(itype,
id, idHPB);
111 m_SBToHPB.setHPBPortToSB(itype,
id, port);
117 if (inputfile.getline(buf, BufferSize)) {
118 std::istringstream infileStr(buf);
119 std::string boardName;
120 infileStr >> boardName;
122 for (
int itype=0; itype <
m_PPToSB.getNumberOfType(); itype++) {
124 infileStr >> board_number;
126 m_PPToSB.setNumber(itype, board_number);
127 for(
int j=0; j<board_number; j++) {
128 inputfile.getline(buf, BufferSize);
129 std::istringstream infileStr2(buf);
133 infileStr2 >>
id >> idSB1 >> idSB2;
135 m_PPToSB.setSBIdToPP(itype, 0, j, idSB1);
136 m_PPToSB.setSBIdToPP(itype, 1, j, idSB2);