Changeset 18438
- Timestamp:
- 02/17/16 08:26:25 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/makeschedule.cc
r18437 r18438 18 18 po::options_description control("Makeschedule"); 19 19 control.add_options() 20 ("date", var<string>(), "SQL time (UTC), e.g. '2016-12-24' ")21 ("source-database", var<string>( ""), "Database link as in\n\tuser:password@server[:port]/database.")22 ("schedule-database", var<string>( ""), "Database link as in\n\tuser:password@server[:port]/database.")20 ("date", var<string>(), "SQL time (UTC), e.g. '2016-12-24' (equiv. '2016-12-24 12:00:00' to '2016-12-25 11:59:59')") 21 ("source-database", var<string>()->required(), "Database link as in\n\tuser:password@server[:port]/database.") 22 ("schedule-database", var<string>(), "Database link as in\n\tuser:password@server[:port]/database.") 23 23 ("max-current", var<double>(90), "Global maximum current limit in uA") 24 24 ("max-zd", var<double>(75), "Global zenith distance limit in degree") … … 460 460 map<string, uint32_t> types; 461 461 for (const auto &row: res1) 462 types. emplace(string(row[0]), uint32_t(row[1]));462 types.insert(make_pair(string(row[0]), uint32_t(row[1]))); 463 463 464 464 ostringstream str; 465 465 str << "INSERT INTO Schedule (fStart, fUser, fMeasurementID, fMeasurementTypeKEY, fSourceKEY) VALUES\n"; 466 466 467 str << "('" << Time(obs[0].begin-startup_offset).GetAsStr() << "', auto, 0, " << types["Startup"] << ", NULL), [Startup]\n";467 str << "('" << Time(obs[0].begin-startup_offset).GetAsStr() << "', auto, 0, " << types["Startup"] << ", NULL),\n"; // [Startup]\n"; 468 468 for (const auto& src: obs) 469 469 { … … 481 481 482 482 if (src.name!="SLEEP") 483 str << "('" << tm << "', auto, 0, " << types["Data"] << ", " << src.key << "), [Data: " << src.name << "]\n";483 str << "('" << tm << "', auto, 0, " << types["Data"] << ", " << src.key << "),\n"; // [Data: " << src.name << "]\n"; 484 484 else 485 str << "('" << tm << "', auto, 0, " << types["Sleep"] << ", NULL), [Sleep]\n";486 } 487 488 str << "('" << Time(obs.back().end).GetAsStr() << "', auto, 0, " << types["Shutdown"] << ", NULL) [Shutdown]";485 str << "('" << tm << "', auto, 0, " << types["Sleep"] << ", NULL),\n"; // [Sleep]\n"; 486 } 487 488 str << "('" << Time(obs.back().end).GetAsStr() << "', auto, 0, " << types["Shutdown"] << ", NULL)";// [Shutdown]"; 489 489 490 490 if (enter<0) … … 519 519 Time time; 520 520 if (conf.Has("date")) 521 time.SetFromStr(conf.Get<string>("date") );521 time.SetFromStr(conf.Get<string>("date")+" 12:00:00"); 522 522 523 523 if (enter && floor(time.JD())<ceil(Time().JD()))
Note:
See TracChangeset
for help on using the changeset viewer.