20 L_(info) <<
"Starting Server with port " <<
fS.port;
22 if (
fS.sensor)
L_(info) <<
"Filtering on sensor " << *
fS.sensor;
24 L_(info) <<
"Not filtering on sensor";
27 fServer =
new THttpServer(fmt::format(
"http:{}",
fS.port).c_str());
31 fServer->SetJSROOT(
"https://jsroot.gsi.de/7.1.0/");
42 fServer->SetItemField(
"/",
"_layout",
"grid3x3");
44 fServer->RegisterCommand(
"/NextTS",
"/server/->RequestNextTS()");
45 fServer->SetItemField(
"/NextTS",
"_title",
"Next Timeslice");
47 if (
fS.archive ==
nullptr)
throw std::runtime_error(
"Archive must not be null");
48 if (
fS.histograms ==
nullptr)
throw std::runtime_error(
"Histograms must not be null");
50 if (
fS.archive2 !=
nullptr ||
fS.histograms2 !=
nullptr) {
51 if (
fS.archive2 ==
nullptr)
throw std::runtime_error(
"Archive2 must not be null");
52 if (
fS.histograms2 ==
nullptr)
throw std::runtime_error(
"Histograms2 must not be null");
56 for (
auto& folder :
fS.histograms->GetFolders()) {
57 fServer->CreateItem(folder.path.c_str(), folder.name.c_str());
58 fServer->SetItemField(folder.path.c_str(),
"_kind",
"Folder");
62 for (
auto& [path, histo] :
fS.histograms->GetHistos()) {
63 fServer->Register(path.c_str(), histo);