24 static const int WILDCARD = -1;
26 static const std::string set_t =
"set";
27 static const std::string add_t =
"add";
28 static const std::string sub_t =
"sub";
30 static const std::string rand_t =
"rand";
31 static const std::string randset_t = rand_t + set_t;
32 static const std::string randadd_t = rand_t + add_t;
33 static const std::string randsub_t = rand_t + sub_t;
45 bool apply(
JTripod& tripod)
const
47 const JUTMPosition randpos(gRandom->Gaus(0.0, pos.getUTMEast()),
48 gRandom->Gaus(0.0, pos.getUTMNorth()),
49 gRandom->Gaus(0.0, pos.getUTMZ()));
53 else if (action == add_t)
55 else if (action == sub_t)
57 else if (action == randset_t)
59 else if (action == randadd_t)
61 else if (action == randsub_t)
77 friend inline std::istream&
operator>>(std::istream&
in, JModifier& modifier)
79 return in >> modifier.id >> modifier.action >> modifier.pos;
90 friend inline std::ostream&
operator<<(std::ostream& out,
const JModifier& modifier)
94 out << modifier.action;
127 int main(
int argc,
char **argv)
143 JParser<> zap(
"Auxiliary program to modify tripod configuration.");
145 zap[
'f'] =
make_field(file_name,
"tripod file");
154 catch(
const exception &error) {
155 FATAL(error.what() << endl);
163 data.load(file_name.c_str());
165 catch(
const exception&) {}
168 data.comment.clear();
171 data.comment.add(
JMeta(argc, argv));
179 for (container_type::iterator
target = data.begin();
target != data.end(); ++
target) {
181 if (
target->getID() == i->id || i->id == WILDCARD) {
183 DEBUG(
"Modifier" <<
' '
185 <<
"action" <<
' ' << i->pos << endl);
188 ERROR(
"No valid action: " << *i << endl);
195 for (container_type::iterator
target = data.begin();
target != data.end(); ) {
196 if (
target->getID() == *i)
203 data.store(file_name.c_str());
Utility class to parse command line options.
int main(int argc, char *argv[])
JUTMPosition & sub(const JUTMPosition &pos)
Subtract UTM position.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
void setUTMPosition(const JUTMPosition &position)
Set UTM position.
Data structure for UTM position.
I/O formatting auxiliaries.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Auxiliary data structure for sequence of same character.
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
Utility class to parse command line options.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
Data structure for tripod.
JUTMPosition & add(const JUTMPosition &pos)
Add UTM position.
Data structure for tripod.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in