16 if(! isInitialized() ||
empty() ) {
20 for(
size_t slot = 7; slot<=9; ++slot) {
25 auto electrical =
inputs.get_child(
"electrical");
26 for(
size_t i=0;
i<3; ++
i) {
27 m_electrical[
i] = electrical.get_optional<std::string>(
"connector" +
std::to_string(
i)).get_value_or(
"");
29 if(
auto optical =
inputs.get_child_optional(
"optical")) {
30 for(
size_t i=0;
i<12; ++
i) {
31 m_optical[
i] = optical->get_optional<std::string>(
"connector" +
std::to_string(
i)).get_value_or(
"");
34 for(
auto &
mon :
data().get_child(
"monitoring.ctpmon") ) {
35 std::string monName =
mon.first;
36 size_t multiplicity =
mon.second.get_child(
"multiplicity").get_value<
size_t>();
37 std::string thr =
mon.second.get_child(
"thr").get_value<std::string>();
38 m_ctpmon.emplace( std::piecewise_construct,
39 std::forward_as_tuple(monName),
40 std::forward_as_tuple(multiplicity, thr)
43 auto ctpinMon =
data().get_child_optional(
"monitoring.ctpin");
45 for(
auto &
mon : *ctpinMon ) {
46 std::string monName =
mon.first;
47 size_t multiplicity =
mon.second.get_child(
"multiplicity").get_value<
size_t>();
48 std::string thr =
mon.second.get_child(
"thr").get_value<std::string>();
49 m_ctpinMon.emplace( std::piecewise_construct,
50 std::forward_as_tuple(monName),
51 std::forward_as_tuple(multiplicity, thr)
66 if(slot<7 or slot>9) {
67 throw std::runtime_error(
"CTPIN slot must be between 7 and 9, but " +
std::to_string(slot) +
"was specified");
70 throw std::runtime_error(
"CTPIN connector must be between 0 and 3, but " +
std::to_string(
conn) +
"was specified");
72 return m_ctpin[slot-7][
conn];
79 throw std::runtime_error(
"Electrical connector must be between 0 and 2, but " +
std::to_string(
conn) +
"was specified");
81 return m_electrical[
conn];
87 throw std::runtime_error(
"Optical connector must be between 0 and 11, but " +
std::to_string(
conn) +
"was specified");
89 return m_optical[
conn];