本文整理汇总了C++中DayTime::year方法的典型用法代码示例。如果您正苦于以下问题:C++ DayTime::year方法的具体用法?C++ DayTime::year怎么用?C++ DayTime::year使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DayTime
的用法示例。
在下文中一共展示了DayTime::year方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setprecision
// Method to print solution values
void example9::printSolution( ofstream& outfile,
const SolverLMS& solver,
const DayTime& time,
const ComputeDOP& cDOP,
bool useNEU,
int numSats,
double dryTropo,
int precision )
{
// Prepare for printing
outfile << fixed << setprecision( precision );
// Print results
outfile << time.year() << " "; // Year - #1
outfile << time.DOY() << " "; // DayOfYear - #2
outfile << time.DOYsecond() << " "; // SecondsOfDay - #3
if( useNEU )
{
outfile << solver.getSolution(TypeID::dLat) << " "; // dLat - #4
outfile << solver.getSolution(TypeID::dLon) << " "; // dLon - #5
outfile << solver.getSolution(TypeID::dH) << " "; // dH - #6
// We add 0.1 meters to 'wetMap' because 'NeillTropModel' sets a
// nominal value of 0.1 m. Also to get the total we have to add the
// dry tropospheric delay value
// ztd - #7
outfile << solver.getSolution(TypeID::wetMap) + 0.1 + dryTropo << " ";
outfile << solver.getVariance(TypeID::dLat) << " "; // Cov dLat - #8
outfile << solver.getVariance(TypeID::dLon) << " "; // Cov dLon - #9
outfile << solver.getVariance(TypeID::dH) << " "; // Cov dH - #10
outfile << solver.getVariance(TypeID::wetMap) << " "; // Cov ztd - #11
}
else
{
outfile << solver.getSolution(TypeID::dx) << " "; // dx - #4
outfile << solver.getSolution(TypeID::dy) << " "; // dy - #5
outfile << solver.getSolution(TypeID::dz) << " "; // dz - #6
// We add 0.1 meters to 'wetMap' because 'NeillTropModel' sets a
// nominal value of 0.1 m. Also to get the total we have to add the
// dry tropospheric delay value
// ztd - #7
outfile << solver.getSolution(TypeID::wetMap) + 0.1 + dryTropo << " ";
outfile << solver.getVariance(TypeID::dx) << " "; // Cov dx - #8
outfile << solver.getVariance(TypeID::dy) << " "; // Cov dy - #9
outfile << solver.getVariance(TypeID::dz) << " "; // Cov dz - #10
outfile << solver.getVariance(TypeID::wetMap) << " "; // Cov ztd - #11
}
outfile << numSats << " "; // Number of satellites - #12
outfile << cDOP.getGDOP() << " "; // GDOP - #13
outfile << cDOP.getPDOP() << " "; // PDOP - #14
outfile << cDOP.getTDOP() << " "; // TDOP - #15
outfile << cDOP.getHDOP() << " "; // HDOP - #16
outfile << cDOP.getVDOP() << " "; // VDOP - #17
// Add end-of-line
outfile << endl;
return;
} // End of method 'example9::printSolution()'
示例2: main
//.........这里部分代码省略.........
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;
}
// build the spatial grid, and store it in vector<GridData> Grid;
BuildGrid();
// get a list of the available satellite PRNs and the initial timetag
bool ok;
DayTime tt, starttime;
bool initialTimeSet = false;
if ( ephmode ) // ephemeris mode
{
try
{
DayTime earliest = ges.getInitialTime();
DayTime latest = ges.getFinalTime();
// DayTime start = latest - gpstk::DayTime::SEC_DAY/2; /* make sure you're in the right day */
DayTime start = latest - 6*3600.0; /* go back 6 h: covers any 4 h ephemeris going into the next day */
tt = DayTime( start.year(), start.month(), start.day(), 0, 0, 0.0 );
starttime = tt;
lofs << " Initial time tag is " << tt.printf("%4F %8.1g") << endl;
initialTimeSet = true;
}
catch(InvalidRequest)
{
i = -100;
lofs << "Initial Time or Final Time missing. Abort." << endl;
return i;
}
for (i=1; i<33; i++)
{
for (ok=true,j=0; j<ExPRN.size(); j++)
{
if (ExPRN[j] == i) { ok=false; break; }
}
if (!ok) continue; // skip this satellite
Sats.push_back(i); // save this satellite
}
}
else // almanac mode (original version)
{
DayTime start(DayTime::BEGINNING_OF_TIME); // Declare and initialize to something guaranteed to be early.
for (i=1; i<33; i++) // # of SVs hard-wired to 32
{
if (aomap.find(i) == aomap.end()) continue; // satellite not found in almanac
for (ok=true,j=0; j<ExPRN.size(); j++)
{
if (ExPRN[j] == i) { ok=false; break; }
}
if (!ok) continue; // skip this satellite if not ok