Configuration and DDS example/tools updates

- Update DDS example command UI and extract it from example.
 - Unify address handling via DDS properties for dynamic deployment.
 - Update DDS docs with the new approach.
 - Allow `--config-key` to be used to access common config in JSON.
 - Allow common channel properties to be specified for all sockets.
 - Update MQ examples and Tuto3 with new config options.
 - Add start scripts to MQ examples for easier use.
This commit is contained in:
Alexey Rybalchenko
2016-03-31 14:41:05 +02:00
parent 9a6e7f7aaf
commit 86ae4c2da1
40 changed files with 211 additions and 605 deletions

View File

@@ -7,6 +7,7 @@
################################################################################
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/ex1-sampler-sink.json ${CMAKE_BINARY_DIR}/bin/config/ex1-sampler-sink.json)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/startMQEx1.sh.in ${CMAKE_BINARY_DIR}/bin/startMQEx1.sh)
Set(INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/fairmq

View File

@@ -5,4 +5,6 @@ A simple topology of two devices - **Sampler** and **Sink**. **Sampler** sends d
`runExample1Sampler.cxx` and `runExample1Sink.cxx` configure and run the devices in their main function.
The executables take two required command line parameters: `--id` and `--config-json-file`. The value of `--id` should be a unique identifier and the value for `--config-json-file` a path to a config file. The config file for this example is `ex1-sampler-sink.json` and it contains configuration for the communication channels of the devices. The mapping between a specific device and the configuration (which can contain multiple devices) is done based on the **id**.
The executables take two required command line parameters: `--id` and `--mq-config`. The value of `--id` should be a unique identifier and the value for `--mq-config` a path to a config file. The config file for this example is `ex1-sampler-sink.json` and it contains configuration for the communication channels of the devices. The mapping between a specific device and the configuration (which can contain multiple devices) is done based on the **id**.
For this and the following example, all the commands needed to start the device are contained in the startFairMQExN.sh script (that can also be used for starting the example).

View File

@@ -45,18 +45,7 @@ int main(int argc, char** argv)
return 0;
}
std::string filename = config.GetValue<std::string>("config-json-file");
std::string id = config.GetValue<std::string>("id");
config.UserParser<FairMQParser::JSON>(filename, id);
sampler.fChannels = config.GetFairMQMap();
LOG(INFO) << "PID: " << getpid();
sampler.SetTransport(config.GetValue<std::string>("transport"));
sampler.SetProperty(FairMQExample1Sampler::Id, id);
sampler.SetConfig(config);
sampler.SetProperty(FairMQExample1Sampler::Text, text);
sampler.ChangeState("INIT_DEVICE");

View File

@@ -33,18 +33,7 @@ int main(int argc, char** argv)
return 0;
}
std::string filename = config.GetValue<std::string>("config-json-file");
std::string id = config.GetValue<std::string>("id");
config.UserParser<FairMQParser::JSON>(filename, id);
sink.fChannels = config.GetFairMQMap();
LOG(INFO) << "PID: " << getpid();
sink.SetTransport(config.GetValue<std::string>("transport"));
sink.SetProperty(FairMQExample1Sink::Id, id);
sink.SetConfig(config);
sink.ChangeState("INIT_DEVICE");
sink.WaitForEndOfState("INIT_DEVICE");

View File

@@ -0,0 +1,12 @@
#!/bin/bash
ex1config="@CMAKE_BINARY_DIR@/bin/config/ex1-sampler-sink.json"
SAMPLER="ex1-sampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --mq-config $ex1config"
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
SINK="ex1-sink"
SINK+=" --id sink1"
SINK+=" --mq-config $ex1config"
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &