20 static const std::string set_t =
"set";
35 mechanics = this->mechanics;
50 friend inline std::istream&
operator>>(std::istream&
in, JModifier& modifier)
52 return in >> modifier.id >> modifier.action >> modifier.mechanics;
63 friend inline std::ostream&
operator<<(std::ostream& out,
const JModifier& modifier)
67 out << modifier.action;
69 out << modifier.mechanics;
100 int main(
int argc,
char **argv)
117 JParser<> zap(
"Auxiliary program to add or modify mechanical model data of detector string.");
119 zap[
'f'] =
make_field(inputFile,
"mechanics input file");
124 zap[
'q'] =
make_field(squash,
"squash meta data");
129 catch(
const exception &error) {
130 FATAL(error.what() << endl);
136 data.load(inputFile.c_str());
138 catch(
const exception&) {}
141 data.comment.clear();
144 data.comment.add(
JMeta(argc,argv));
147 if (data.count(i->first) == 0
u)
148 data[i->first] = i->second;
150 ERROR(
"String " << i->first <<
" already exists." << endl);
155 DEBUG(
"Modifier" <<
' '
156 <<
"(" <<
FILL(2,
'0') << i->id <<
FILL() <<
")" <<
' '
157 <<
"action" <<
' ' << i->mechanics << endl);
161 container_type::iterator p = data.find(i->id);
163 if (p != data.end()) {
164 mechanics = p->second;
167 if (!i->apply(mechanics))
168 ERROR(
"No valid action: " << *i << endl);
170 data[i->id] = mechanics;
175 container_type::iterator p = data.find(*i);
177 if (p != data.end()) {
Mechanical modelling of string.
Utility class to parse command line options.
int main(int argc, char *argv[])
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
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 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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
#define DEBUG(A)
Message macros.
Auxiliary data structure for parameters of mechanical model.