CbmRoot
Loading...
Searching...
No Matches
PadConfig.cxx
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#include "PadConfig.h"
11
13
14#include <sstream>
15
17
18// ---------------------------------------------------------------------------------------------------------------------
19//
20void PadConfig::SetGrid(bool gridX, bool gridY)
21{
22 fbGridX = gridX;
23 fbGridY = gridY;
24}
25
26// ---------------------------------------------------------------------------------------------------------------------
27//
28void PadConfig::SetLog(bool logX, bool logY, bool logZ)
29{
30 fbLogX = logX;
31 fbLogY = logY;
32 fbLogZ = logZ;
33}
34
35// ---------------------------------------------------------------------------------------------------------------------
36//
37std::string PadConfig::ToString() const
38{
39 std::stringstream cfg;
40 cfg << fbGridX << ',' << fbGridY << ',' << fbLogX << ',' << fbLogY << ',' << fbLogZ;
41 if (fvObjectList.empty()) {
42 L_(warning) << "PadConfig::ToString(): creating a config message for an empty pad";
43 cfg << ",(nullptr,nullptr)";
44 }
45 else {
46 for (const auto& [name, opt] : fvObjectList) {
47 cfg << ",(" << name << ',' << opt << ')';
48 }
49 }
50 return cfg.str();
51}
#define L_(level)
A class representing a pad config in the message for the Histogram server.
A pad configuration for the histogram server.
Definition PadConfig.h:26
std::string ToString() const
Returns message config.
Definition PadConfig.cxx:37
std::vector< std::pair< std::string, std::string > > fvObjectList
List of objects on the pad.
Definition PadConfig.h:113
bool fbLogY
Log flag for y-axis.
Definition PadConfig.h:110
bool fbLogZ
Log flag for z-axis.
Definition PadConfig.h:111
void SetGrid(bool gridX, bool gridY=false)
Set grid flags.
Definition PadConfig.cxx:20
bool fbGridY
Grid flag for y-axis.
Definition PadConfig.h:108
bool fbGridX
Grid flag for x-axis.
Definition PadConfig.h:107
void SetLog(bool logX, bool logY=false, bool logZ=false)
Sets logarithm axis.
Definition PadConfig.cxx:28
bool fbLogX
Log flag for x-axis.
Definition PadConfig.h:109