Skip to content
Snippets Groups Projects
Commit 816cb880 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

Add option to disable GUI commands to NoFairMQ histo server binary

parent 39c00e70
No related branches found
No related tags found
1 merge request!1787Add option to disable GUI commands to NoFairMQ histo server binary
Pipeline #29130 passed
......@@ -69,18 +69,20 @@ Application::Application(ProgramOptions const& opt) : fOpt(opt)
fServer->Register("/", fUiCmdActor.get());
fServer->Hide("/UiCmdActor");
fServer->RegisterCommand("/Reset_Hist", "/UiCmdActor/->SetResetHistos()");
fServer->RegisterCommand("/Save_Hist", "/UiCmdActor/->SetSaveHistos()");
fServer->RegisterCommand("/Stop_Server", "/UiCmdActor/->SetServerStop()");
/*
fServer->RegisterCommand("/Reset_Hist", "this->ResetHistograms()");
fServer->RegisterCommand("/Save_Hist", "this->SaveHistograms()");
*/
fServer->Restrict("/Reset_Hist", "allow=admin");
fServer->Restrict("/Save_Hist", "allow=admin");
fServer->Restrict("/Stop_Server", "allow=admin");
if (!fOpt.HideGuiCommands()) {
fServer->RegisterCommand("/Reset_Hist", "/UiCmdActor/->SetResetHistos()");
fServer->RegisterCommand("/Save_Hist", "/UiCmdActor/->SetSaveHistos()");
fServer->RegisterCommand("/Stop_Server", "/UiCmdActor/->SetServerStop()");
/*
fServer->RegisterCommand("/Reset_Hist", "this->ResetHistograms()");
fServer->RegisterCommand("/Save_Hist", "this->SaveHistograms()");
*/
fServer->Restrict("/Reset_Hist", "allow=admin");
fServer->Restrict("/Save_Hist", "allow=admin");
fServer->Restrict("/Stop_Server", "allow=admin");
}
// Provide signal handling for external interruptions
// NOTE: SZh 02.04.2024:
......
......@@ -44,6 +44,8 @@ namespace cbm::services::histserv
"name of the output ROOT file with histograms backup");
config_add("overwrite,w", po::bool_switch(&fOverwrite)->default_value(false),
"allow to overwite an existing output file");
config_add("hideguicmds", po::bool_switch(&fHideGuiCommands)->default_value(false),
"allow to hides (disable) the GUI commands for Reset/Save/Close");
// --- Allowed options
po::options_description cmdline_options("Allowed options");
......
......@@ -45,6 +45,9 @@ namespace cbm::services::histserv
/** @brief Get overwrite option **/
[[nodiscard]] bool Overwrite() const { return fOverwrite; }
/** @brief Get overwrite option **/
[[nodiscard]] bool HideGuiCommands() const { return fHideGuiCommands; }
// /** @brief Get configuration file name (YAML format) **/
// [[nodiscard]] const std::string& ConfigFile() const { return fConfig; }
......@@ -59,6 +62,7 @@ namespace cbm::services::histserv
uint32_t fuHttpServerPort = 8080; ///< HTTP port of the ROOT web server
std::string fsHistoFileName = "histos_dump.root"; ///< Output file name (ROOT format)
bool fOverwrite = false; ///< Enable overwriting of existing output file
bool fHideGuiCommands = false; ///< Hides (disables) the GUI commands for Reset/Save/Close
//std::string fConfig = ""; ///< Configuration file name (YAML format)
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment