#include #include #include "JDB/JDB.hh" #include "JDB/JDBToolkit.hh" #include "JDB/JSelector.hh" #include "JDB/JSelectorSupportkit.hh" #include "JDB/JAHRSCalibration_t.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to store AHRS calibration data on local disk. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; JServer server; string usr; string pwd; string cookie; int option; string detid; string outputFile; int debug; try { JParser<> zap("Auxiliary program to store AHRS calibration data on local disk."); zap['s'] = make_field(server) = getServernames(); zap['u'] = make_field(usr) = ""; zap['!'] = make_field(pwd) = ""; zap['C'] = make_field(cookie) = ""; zap['O'] = make_field(option) = 0; zap['D'] = make_field(detid); zap['o'] = make_field(outputFile) = "ahrs_calibration.txt"; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } try { JDB::reset(usr, pwd, cookie); STATUS("Reading AHRS calibration data... " << flush); const JAHRSCalibration_t calibration(getDetector(detid), option); STATUS("OK" << endl); if (outputFile != "") { STATUS("Storing AHRS calibration data to " << outputFile << "... " << flush); calibration.store(outputFile.c_str()); STATUS("OK" << endl); } else { cout << calibration << endl; } } catch(const exception& error) { FATAL(error.what() << endl); } }