You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/configurationParameters.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ The *receiverFMQ-\** section defines parameters for the test receiverFMQ.exe pro
11
11
12
12
Please see the provided example configuration files to see how they are usually arranged.
13
13
14
+
It is possible to define some default parameters to be used in all matching sections by creating a section which name ends with "-\*" and containing some key-value pairs. These pairs are applied to all sections with similar names. Existing key-value pairs are not overwritten, but are defined according to these defaults if they don't exist. It can be useful to create multiple equipments with similar settings.
15
+
14
16
## Parameter types
15
17
16
18
The following table describes the types used in the configuration, giving:
@@ -168,7 +170,6 @@ The parameters related to 3rd-party libraries are described here for convenience
168
170
| readout | fairmqConsoleSeverity | int | -1 | Select amount of FMQ messages with fair::Logger::SetConsoleSeverity(). Value as defined in Severity enum defined from FairLogger/Logger.h. Use -1 to leave current setting. |
169
171
| readout | flushConsumerTimeout | double | 1 | Time in seconds to wait before stopping the consumers (ie wait allocated pages released). 0 means stop immediately. |
170
172
| readout | flushEquipmentTimeout | double | 1 | Time in seconds to wait for data once the equipments are stopped. 0 means stop immediately. |
171
-
| readout | logbookApiToken | string || The token to be used for the logbook API. |
172
173
| readout | logbookEnabled | int | 0 | When set, the logbook is enabled and populated with readout stats at runtime. |
173
174
| readout | logbookUpdateInterval | int | 30 | Amount of time (in seconds) between logbook publish updates. |
174
175
| readout | logbookUrl | string || The address to be used for the logbook API. |
Copy file name to clipboardExpand all lines: doc/releaseNotes.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -520,3 +520,7 @@ This file describes the main feature changes for each readout.exe released versi
520
520
- added equipment-cruemulator-*.PayloadSizeStdev: generate payload with random size (gaussian distribution mean=PayloadSize sigma=PayloadSizeStdev).
521
521
- added equipment-cruemulator-*.linkThroughput: set incoming link data throughput (in Gbps).
522
522
- Minor logging updates.
523
+
524
+
## v2.17.0 - 01/03/2022
525
+
- Updated configuration syntax: section names ending with `-*` can be used to define default parameters. They are applied to all section with similar names. Existing key-value pairs are not overwritten, but are defined according to defaults if they don't exist. For example, it is possible to define the TFperiod for all equipments by adding a section named `[equipment-*]` with `TFperiod=32`.
// function returns true when end of string matches tag
681
+
auto isEndOfStringMatching = [&](const std::string &s, constchar* tag) {
682
+
if (s.length()<=strlen(tag)) returnfalse;
683
+
if (s.substr(s.length()-strlen(tag)) != tag) returnfalse;
684
+
returntrue;
685
+
};
686
+
for (boost::property_tree::ptree::iterator pos = cfg.get().begin(); pos != cfg.get().end();) {
687
+
const std::string section = pos->first;
688
+
if (!isEndOfStringMatching(section, defaultTag)) {
689
+
++pos;
690
+
continue;
691
+
}
692
+
auto smatch = section.substr(0,section.length()-strlen(defaultTag));
693
+
for (boost::property_tree::ptree::iterator pos2 = cfg.get().begin(); pos2 != cfg.get().end();++pos2) {
694
+
if (pos2 == pos) continue; // do not self-overwrite
695
+
const std::string section2 = pos2->first;
696
+
if (section2.compare(0,smatch.length(),smatch)) continue; // mismatch
697
+
if (isEndOfStringMatching(section2, defaultTag)) continue; // do not overwrite other defaults sections
698
+
theLog.log(LogInfoDevel_(3002), "Updating configuration section [%s] with defaults from [%s]", pos2->first.c_str(), pos->first.c_str());
699
+
appendConfig(pos2->second,pos->second);
700
+
}
701
+
// delete section with defaults, to avoid it is used further
702
+
pos = cfg.get().erase(pos);
703
+
}
704
+
663
705
// extract optional configuration parameters
664
706
// configuration parameter: | readout | customCommands | string | | List of key=value pairs defining some custom shell commands to be executed at before/after state change commands. |
665
707
if (customCommandsShellPid) {
@@ -805,11 +847,9 @@ int Readout::configure(const boost::property_tree::ptree& properties)
805
847
#else
806
848
// configuration parameter: | readout | logbookUrl | string | | The address to be used for the logbook API. |
@@ -957,7 +987,11 @@ int Readout::configure(const boost::property_tree::ptree& properties)
957
987
try {
958
988
// configuration parameter: | consumer-* | consumerType | string | | The type of consumer to be instanciated. One of:stats, FairMQDevice, DataSampling, FairMQChannel, fileRecorder, checker, processor, tcp. |
Copy file name to clipboardExpand all lines: src/readoutConfigEditor.tcl
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -146,7 +146,6 @@ set configurationParametersDescriptor {
146
146
| readout | fairmqConsoleSeverity | int | -1 | Select amount of FMQ messages with fair::Logger::SetConsoleSeverity(). Value as defined in Severity enum defined from FairLogger/Logger.h. Use -1 to leave current setting. |
147
147
| readout | flushConsumerTimeout | double | 1 | Time in seconds to wait before stopping the consumers (ie wait allocated pages released). 0 means stop immediately. |
148
148
| readout | flushEquipmentTimeout | double | 1 | Time in seconds to wait for data once the equipments are stopped. 0 means stop immediately. |
149
-
| readout | logbookApiToken | string | | The token to be used for the logbook API. |
150
149
| readout | logbookEnabled | int | 0 | When set, the logbook is enabled and populated with readout stats at runtime. |
151
150
| readout | logbookUpdateInterval | int | 30 | Amount of time (in seconds) between logbook publish updates. |
152
151
| readout | logbookUrl | string | | The address to be used for the logbook API. |
0 commit comments