Auxiliary program to print hydrophone configuration.
More...
#include <iostream>
#include <iomanip>
#include "JDetector/JHydrophone.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JContainer.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
Auxiliary program to print hydrophone configuration.
- Author
- mdejong
Definition in file JPrintHydrophone.cc.
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 20 of file JPrintHydrophone.cc.
21{
22 using namespace std;
24
25 typedef JContainer< vector<JHydrophone> > container_type;
26
27 string file_name;
28 int string;
29 int debug;
30
31 try {
32
33 JParser<> zap("Auxiliary program to print hydrophone configuration.");
34
35 zap['f'] = make_field(file_name, "hydrophone file");
36 zap['S'] = make_field(string) = -1;
37 zap['d'] = make_field(debug) = 1;
38
39 zap(argc, argv);
40 }
41 catch(const exception &error) {
42 FATAL(error.what() << endl);
43 }
44
45 container_type data;
46
47 data.load(file_name.c_str());
48
49 if (string != 0) {
50
51 for (const auto& hydrophone : data) {
52 if (hydrophone.getString() == string || string == -1) {
53 cout << hydrophone << endl;
54 }
55 }
56
57 } else {
58
59 cout << data << endl;
60 }
61}