Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JRuncontrol
JDAQDriver.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <fstream>
4
#include <iomanip>
5
6
#include "
Jeep/JParser.hh
"
7
#include "
Jeep/JMessage.hh
"
8
#include "
JLogger/JStreamLogger.hh
"
9
#include "
JLogger/JControlHostLogger.hh
"
10
11
#include "
JRuncontrol/JDAQClient.hh
"
12
#include "
JRuncontrol/JDAQDriver.hh
"
13
14
15
/**
16
* \file
17
* Run control driver program.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
* argv[])
21
{
22
using namespace
std;
23
24
string
file_name;
25
string
server;
26
string
logger;
27
bool
use_cout;
28
int
timeout_s;
29
int
debug
;
30
31
try
{
32
33
JParser<>
zap(
"Run control driver program."
);
34
35
zap[
'f'
] =
make_field
(file_name);
36
zap[
'H'
] =
make_field
(server) =
"localhost"
;
37
zap[
'M'
] =
make_field
(logger) =
"localhost"
;
38
zap[
'c'
] =
make_field
(use_cout);
39
zap[
't'
] =
make_field
(timeout_s) = 10;
// [s]
40
zap[
'd'
] =
make_field
(
debug
) = 0;
41
42
zap(argc, argv);
43
}
44
catch
(
const
exception &error) {
45
FATAL
(error.what() << endl);
46
}
47
48
49
using namespace
KM3NETDAQ;
50
51
if
(server ==
"localhost"
) server =
JSYSTEM::getHostname
();
52
if
(logger ==
"localhost"
) logger =
JSYSTEM::getHostname
();
53
54
JClient::SERVER
= server;
55
JClient::LOGGER
= logger;
56
57
JLogger* out = NULL;
58
59
if
(use_cout)
60
out =
new
JStreamLogger(cout);
61
else
62
out =
new
JControlHostLogger(logger);
63
64
JDAQDriver
driver(argv[0], server, out,
debug
, timeout_s);
65
66
ifstream
in
(file_name.c_str());
67
68
driver.
run
(
in
);
69
70
in
.close();
71
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JStreamLogger.hh
JDAQDriver.hh
LOGGER
then usage $script[host[local file]] fi case set_variable LOGGER
Definition:
JStopDAQ.sh:28
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
JDAQClient.hh
KM3NETDAQ::JDAQDriver
Simple driver for run control clients.
Definition:
JDAQDriver.hh:35
KM3NETDAQ::JDAQDriver::run
void run()
Run driver with user input.
Definition:
JDAQDriver.hh:306
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JControlHostLogger.hh
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
JSYSTEM::getHostname
std::string getHostname()
Get host name.
Definition:
JNetwork.hh:77
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
SERVER
then usage $script fi SERVER
Definition:
software/JDataFilter/JDataFilter.sh:30
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5