27 static const int WILDCARD = -1;
29 static const std::string
set_t =
"set";
30 static const std::string
add_t =
"add";
31 static const std::string
sub_t =
"sub";
32 static const std::string
setx_t =
"setx";
33 static const std::string
sety_t =
"sety";
34 static const std::string
setz_t =
"setz";
35 static const std::string
addx_t =
"addx";
36 static const std::string
addy_t =
"addy";
37 static const std::string
addz_t =
"addz";
38 static const std::string
subx_t =
"subx";
39 static const std::string
suby_t =
"suby";
40 static const std::string
subz_t =
"subz";
42 static const std::string
rand_t =
"rand";
65 return (action !=
"" && !
data.empty());
74 bool apply(
JTripod& tripod)
const
76 switch (
data.size()) {
79 return apply(tripod, action, data[0]);
82 return apply(tripod, action,
JUTMPosition(data[0], data[1], data[2]));
98 static bool apply(
JTripod& tripod,
const std::string& action,
const double value)
102 else if (action ==
addx_t)
104 else if (action ==
subx_t)
106 else if (action ==
sety_t)
108 else if (action ==
addy_t)
110 else if (action ==
suby_t)
112 else if (action ==
setz_t)
114 else if (action ==
addz_t)
116 else if (action ==
subz_t)
141 else if (action ==
add_t)
143 else if (action ==
sub_t)
171 for (
double x; in >>
x; ) {
175 in.clear(std::ios_base::eofbit);
250 JParser<> zap(
"Auxiliary program to modify tripod configuration.");
263 catch(
const exception &error) {
270 if (!
rm.empty() && !
keep.empty()) {
271 FATAL(
"Use either option -K or -D." <<
endl);
276 if (inputFile !=
"") {
278 data.load(inputFile.c_str());
280 catch(
const exception& error) {
286 data.comment.clear();
297 for (container_type::iterator
target = data.begin();
target != data.end(); ++
target) {
299 if (
target->getID() == i->id || i->id == WILDCARD) {
301 DEBUG(
"Modifier" <<
' '
303 << i->action <<
' ' <<
JEEPZ() << i->data <<
endl);
306 ERROR(
"No valid action: " << *i <<
endl);
313 for (container_type::iterator
target = data.begin();
target != data.end(); ) {
322 for (container_type::iterator
target = data.begin();
target != data.end(); ) {
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Data structure for tripod.
Data structure for tripod.
Template definition of a multi-dimensional oscillation probability interpolation table.
Data structure for UTM position.
double getUTMNorth() const
Get UTM north.
double getUTMEast() const
Get UTM east.
double getUTMZ() const
Get UTM Z.
JUTMPosition & add(const JUTMPosition &pos)
Add UTM position.
JUTMPosition & sub(const JUTMPosition &pos)
Subtract UTM position.
void setUTMPosition(const JUTMPosition &position)
Set UTM position.
std::ostream & operator<<(std::ostream &out, const morphology_type &object)
Write morphology to output stream.
std::istream & operator>>(std::istream &in, morphology_type &object)
Read morphology from input stream.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool is_valid(const json &js)
Check validity of JSon data.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for streaming of STL containers.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...