17 #include "boost/program_options.hpp"
19 #include "FairMQLogger.h"
20 #include "FairMQParser.h"
21 #include "FairMQProgOptions.h"
25 #include "FairMQTransportFactoryNN.h"
27 #include "FairMQTransportFactoryZMQ.h"
32 int main(
int argc,
char** argv)
35 sampler.CatchSignals();
37 FairMQProgOptions config;
45 options_description samplerOptions(
"Sampler options");
46 samplerOptions.add_options()
47 (
"FileName", value<std::string>(&text)->default_value(
"/Users/Stockmanns/PandaSoftware/pandaRoot/pandaRoot_ActualTrunk/macro/mvd/TestBeam/2014-10-27-00-06-02--101-data--1.txt"),
48 "FileName of data to send out")
49 (
"FE", value<int>(&fe)->default_value(1),
"Front-End Number")
50 (
"TimeCorrection", value<double>(&timecorr)->default_value(0.0),
"Time offset between FE chips");
53 config.AddToCmdLineOptions(samplerOptions);
55 config.ParseAll(argc, argv);
57 std::string
filename = config.GetValue<std::string>(
"config-json-file");
58 std::string
id = config.GetValue<std::string>(
"id");
60 config.UserParser<FairMQParser::JSON>(
filename, id);
62 sampler.fChannels = config.GetFairMQMap();
64 LOG(INFO) <<
"PID: " << getpid();
67 FairMQTransportFactory* transportFactory =
new FairMQTransportFactoryNN();
69 FairMQTransportFactory* transportFactory =
new FairMQTransportFactoryZMQ();
72 sampler.SetTransport(transportFactory);
77 sampler.ChangeState(
"INIT_DEVICE");
78 sampler.WaitForEndOfState(
"INIT_DEVICE");
80 sampler.ChangeState(
"INIT_TASK");
81 sampler.WaitForEndOfState(
"INIT_TASK");
83 sampler.ChangeState(
"RUN");
84 sampler.InteractiveStateLoop();
86 catch (std::exception& e)
88 LOG(ERROR) << e.what();
89 LOG(INFO) <<
"Command line options are the following: ";
virtual void SetProperty(const int key, const std::string &value)
int main(int argc, char **argv)