本文整理汇总了C++中DayTime::day方法的典型用法代码示例。如果您正苦于以下问题:C++ DayTime::day方法的具体用法?C++ DayTime::day怎么用?C++ DayTime::day使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DayTime
的用法示例。
在下文中一共展示了DayTime::day方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
try
{
// if no options are given on command line, print syntax and quit
if (argc < 2 || string(argv[1]) == "-h" || string(argv[1]) == "--help")
{
cout << "Program CalcDOPs reads an FIC, FICA or a Rinex Nav file" << endl
<< "Usage: CalcDOPs -i <inputfile> input file for day to be calculated (required)" << endl
<< " -p <inputfile> input file for previous day (optional, ephemeris mode only)" << endl
<< " -o <outputfile> grid output file [DOPs.out]" << endl
<< " -sf <outputfile> stats output file [DOPs.stat]" << endl
<< " -tf <outputfile> time steps output file [DOPs.times]" << endl
<< " -l <outputfile> log output file [DOPs.log]" << endl
<< " -rs read from stats file" << endl
<< " -a work in almanac mode [ephemeris mode is default]" << endl
<< " -w <week> -s <sow> starting time tag" << endl
<< " -x <prn> exclude satellite PRN" << endl
<< " -t <dt> time spacing" << endl
<< " -na do North America only" << endl
<< " -d dump grid results at each time step (time-intensive)" << endl
<< " -h, --help output options info and exit" << endl
<< " -v print version info and exit" << endl
<< endl;
return 0;
}
int i, j, ii;
// parse command line
i = 1;
while (i < argc)
{
if (string(argv[i]) == "-i" ) inputfile = string(argv[++i]);
else if (string(argv[i]) == "-p" ) previnputfile = string(argv[++i]);
else if (string(argv[i]) == "-o" ) outputfile = string(argv[++i]);
else if (string(argv[i]) == "-l" ) logfile = string(argv[++i]);
else if (string(argv[i]) == "-tf") timesfile = string(argv[++i]);
else if (string(argv[i]) == "-a" ) ephmode = false;
else if (string(argv[i]) == "-w" ) week = atoi(argv[++i]);
else if (string(argv[i]) == "-s" ) sow = atof(argv[++i]);
else if (string(argv[i]) == "-x" ) ExPRN.push_back(atoi(argv[++i]));
else if (string(argv[i]) == "-t" ) dt = atof(argv[++i]);
else if (string(argv[i]) == "-sf") statsfile = string(argv[++i]);
else if (string(argv[i]) == "-rs") readStats = true;
else if (string(argv[i]) == "-na") NAonly = true;
else if (string(argv[i]) == "-d" ) dumpeach = true;
else if (string(argv[i]) == "-v" )
{
cout << "CalcDOPs version " << fixed << setprecision(1) << setw(3) << version << endl;
return 0;
}
else cout << "Unrecognized option: " << argv[i] << endl;
i++;
}
lofs.open(logfile.c_str(),ios_base::out);
if (!lofs) return -8;
tofs.open(timesfile.c_str(),ios_base::out);
if (!tofs) return -8;
// reassurance print
lofs << "Program visible with:" << endl << "current-day input file " << inputfile << endl;
if ( previnputfile != "" ) lofs << "and previous-day input file " << previnputfile << endl;
lofs << "and output file " << outputfile << endl;
if (week > 0) lofs << " Input time tag: " << week << " " << sow << endl;
if (ExPRN.size() > 0)
{
lofs << " Exclude satellite PRNs";
for(i=0; i<ExPRN.size(); i++) lofs << " " << ExPRN[i];
lofs << "." << endl;
}
// compute the number of time steps from the time spacing
nt = int(86400.0/dt); // 86400 = 60*60*24 = sec/day
// open and read the previous day's input data file first, if specified and in Eph mode
if ( previnputfile != "" && ephmode )
{
lofs << "Reading in previous-day input file..." << endl;
i = ReadDataFile(previnputfile);
if (i)
{
if (i == -1) lofs << "Previous-day input file does not exist. Abort." << endl;
if (i == -2) lofs << "Cannot identify previous-day file type. Abort." << endl;
return i;
}
}
// open and read the current day's input data file
lofs << "Reading in current-day input file..." << endl;
i = ReadDataFile(inputfile);
if (i)
{
if (i == -1) lofs << "Current-day input file does not exist. Abort." << endl;
if (i == -2) lofs << "Cannot identify current-day file type. Abort." << endl;
return i;
}
//.........这里部分代码省略.........