本文整理汇总了C++中DayTime::printf方法的典型用法代码示例。如果您正苦于以下问题:C++ DayTime::printf方法的具体用法?C++ DayTime::printf怎么用?C++ DayTime::printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DayTime
的用法示例。
在下文中一共展示了DayTime::printf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
MPSim::~MPSim()
{
DayTime endTime;
logStream << "Execution end at: " << endTime.printf(epochFormat) << endl;
logStream << "Total execution time: " << endTime - startTime << " seconds"
<< endl;
}
示例2: updateFileName
// Update the file name, returns true if the file name changed
bool updateFileName(const DayTime& t=DayTime())
{
bool openedNewFile = false;
const std::string newFilename=t.printf(filespec);
if (currentFilename.size() == 0 && newFilename.size() > 0)
{
currentFilename = newFilename;
currentTime = t;
BaseStream::open(currentFilename.c_str(), omode);
if (debugLevel)
std::cout << "Opened " << currentFilename << std::endl;
openedNewFile=true;
}
else if (newFilename == currentFilename)
{
currentTime = t;
openedNewFile=false;
}
else
{
if (debugLevel)
std::cout << "Closing " << currentFilename << std::endl;
BaseStream::close();
currentFilename = newFilename;
currentTime = t;
BaseStream::open(currentFilename.c_str(), omode);
if (debugLevel)
std::cout << "Opened " << currentFilename << std::endl;
openedNewFile=true;
}
return openedNewFile;
};
示例3: dtorig
void xINCDayTime :: FinishUp (void)
{
gpstk::DayTime dtorig(2000,12,1,0,0,0.);
DayTime endTime;
cout << endl << setprecision(4);
cout << endTime.printf("Completed on %B %d, %Y %H:%02M:%02S") << endl;
cout << "Processing time " << endTime-startTime << " seconds." << endl;
cout << endl;
}
示例4: main
//------------------------------------------------------------------------------------
int main(int argc, char **argv)
{
try {
totaltime = clock();
int iret,nfile,reading,nread;
// Title and description
Title = PrgmName + ", part of the GPS ToolKit, Ver " + PrgmVers + ", Run ";
PrgmEpoch.setLocalTime();
Title += PrgmEpoch.printf("%04Y/%02m/%02d %02H:%02M:%02S");
Title += "\n";
cout << Title;
// get command line
iret=GetCommandLine(argc, argv);
if(iret) return iret;
PrevEpoch = DayTime::BEGINNING_OF_TIME;
// loop over input files - reading them twice
Ninterps = 0;
for(reading=1; reading <= 2; reading++) {
nread = 0;
for(nfile=0; nfile<PIC.InputObsName.size(); nfile++) {
iret = ReadFile(nfile,reading);
if(iret < 0) break;
nread++;
}
// quit if error
if(iret < 0) break;
if(nread>0) {
iret = AfterReadingFiles(reading);
if(iret < 0) break;
}
CurrEpoch = DayTime::BEGINNING_OF_TIME;
}
PIC.oflog << PrgmName << " did " << Ninterps << " interpolations" << endl;
totaltime = clock()-totaltime;
PIC.oflog << PrgmName << " timing: " << fixed << setprecision(3)
<< double(totaltime)/double(CLOCKS_PER_SEC) << " seconds.\n";
cout << PrgmName << " timing: " << fixed << setprecision(3)
<< double(totaltime)/double(CLOCKS_PER_SEC) << " seconds.\n";
PIC.oflog.close();
return iret;
}
catch(FFStreamError& e) { cout << "FFStream exception:\n" << e << endl; }
catch(Exception& e) { cout << "GPSTK exception:\n" << e << endl; }
catch (...) { cout << "Unknown exception in main." << endl; }
} // end main()
示例5: OutputClockData
//------------------------------------------------------------------------------------
int OutputClockData(void) throw(Exception)
{
try {
if(CI.Verbose) oflog << "BEGIN OutputClockData()" << endl;
if(CI.OutputClkFile.empty()) return 0;
int i;
DayTime tt;
map<string,Station>::const_iterator it;
format f166(16,6),f92(9,2,2),f96(9,6);
// open an output file for Clk data
ofstream clkofs;
clkofs.open(CI.OutputClkFile.c_str(),ios::out);
if(clkofs.is_open()) {
oflog << "Opened file " << CI.OutputClkFile << " for DD data output." << endl;
clkofs << "# " << Title << endl;
clkofs << "CLK site week sec_wk Rx_clk_bias(m) Sig(m) TT_off(s)\n";
}
else {
// TD error msg
return -1;
}
// loop over stations
for(it=Stations.begin(); it != Stations.end(); it++) {
// loop over epochs
for(i=0; i<it->second.ClockBuffer.size(); i++) {
tt = FirstEpoch + it->second.CountBuffer[i]*CI.DataInterval;
clkofs << "CLK " << it->first << " " << tt.printf("%4F %10.3g")
<< " " << f166 << it->second.ClockBuffer[i]
<< " " << f92 << it->second.ClkSigBuffer[i]
// TD add clock polynomial Evaluate(tt)
<< " " << f92 << it->second.RxTimeOffset[i]
<< endl;
} // loop over epochs
} // loop over stations
clkofs.close();
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }
catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
} // end OutputClockData()
示例6: main
/// returns 0 if all tests pass
int main()
{
using gpstk::DayTime;
try
{
cout << "BOT:" << DayTime(gpstk::DayTime::BEGINNING_OF_TIME) << endl;
cout << "EOT:" << DayTime(gpstk::DayTime::END_OF_TIME) << endl;
DayTime dt;
dt.setSystemTime();
cout << "Check that the output matches the current UTC time." << endl
<< "string printf()" << endl;
dtft(cout, dt, "mjd: %Q (%.0Q)");
dtft(cout, dt, "mjd: %5.3Q");
dtft(cout, dt, "mdy: %02m/%02d/%04Y");
dtft(cout, dt, "hms: %02H:%02M:%02S");
dtft(cout, dt, "hms: %02H:%02M:%06.3f");
dtft(cout, dt, "cal: %A, %B %d, %Y");
dtft(cout, dt, "week: %F(%G)");
dtft(cout, dt, "sow: %g");
dtft(cout, dt, "sow: %06.3g");
dtft(cout, dt, "doy: %j:%s");
dtft(cout, dt, "dow: %w");
dtft(cout, dt, "z: %Z (%z)");
dtft(cout, dt, "unix: %U.%06u");
cout << endl
<< "The following functions use DayTime::setToString()" << endl;
string format = "%02m/%02d/%04Y %02H:%02M:%02S";
string st = dt.printf(format);
DayTime q;
q.setToString(st, format);
dtft(cout, q, format);
cout << "Tests complete." << endl;
return 0;
}
catch(gpstk::Exception& e)
{
cout << e << endl;
}
catch(...)
{
cout << "Some other exception thrown..." << endl;
}
cout << "Exiting with exceptions." << endl;
return -1;
}
示例7: initialize
bool MPSim::initialize(int argc, char *argv[])
throw()
{
if(!BasicFramework::initialize(argc, argv))
return false;
if (logfileOption.getCount()>0)
{
logFileName = StringUtils::asString(logfileOption.getValue().front());
}
logStream.open( logFileName.c_str() );
logStream << "mpsim log file" << endl;
logStream << "Execution started at: " << startTime.printf(epochFormat) << endl;
return true;
}
示例8: DumpGrid
int DumpGrid(DayTime& time, string dumpfile)
{
try
{
ofstream ofs;
// open output file
ofs.open(dumpfile.c_str(),ios_base::out);
if (!ofs) return -6;
else lofs << "Opened output file " << dumpfile << endl;
if (Grid.size() == 0) return 0;
int i;
for (i=0; i<Grid.size(); i++)
{
ofs << " "
<< time.printf("%4F %8.1g")
<< fixed << setprecision(3)
<< " " << setw(7) << Grid[i].lon
<< " " << setw(6) << Grid[i].lat
<< " " << setw(7) << Grid[i].gdop
<< " " << setw(7) << Grid[i].pdop
<< " " << setw(7) << Grid[i].hdop
<< " " << setw(7) << Grid[i].vdop
<< " " << setw(7) << Grid[i].tdop
<< " " << setw(6) << Grid[i].nsvs
<< fixed << setprecision(7)
<< " " << setw(9) << Grid[i].bdop
<< " "
<< endl;
}
ofs.close();
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
}
示例9: OutputRawData
//------------------------------------------------------------------------------------
// called from DDBase.cpp
int OutputRawData(void) throw(Exception)
{
try {
if(CI.Verbose) oflog << "BEGIN OutputRawData()" << endl;
if(CI.OutputRawFile.empty()) return 0;
int i;
DayTime tt;
map<string,Station>::const_iterator it;
map<GSatID,RawData>::const_iterator jt;
format f133(13,3),f52(5,2);
// open an output file for RAW data
ofstream rawofs;
rawofs.open(CI.OutputRawFile.c_str(),ios::out);
if(rawofs.is_open()) {
oflog << "Opened file " << CI.OutputRawFile << " for raw data output.." << endl;
rawofs << "# " << Title << endl;
rawofs << "RAW site sat week sec_wk count L1_cyc L2_cyc"
<< " P1_m P2_m ER_m EL AZ\n";
}
else {
// TD error msg
return -1;
}
// loop over stations
for(it=Stations.begin(); it != Stations.end(); it++) {
// loop over satellites
for(jt=it->second.RawDataBuffers.begin();
jt != it->second.RawDataBuffers.end(); jt++) {
// loop over epochs
for(i=0; i<jt->second.count.size(); i++) {
tt = FirstEpoch + jt->second.count[i]*CI.DataInterval;
rawofs << "RAW " << it->first << " " << jt->first << " "
<< tt.printf("%4F %10.3g")
<< " " << setw(5) << jt->second.count[i]
<< " " << f133 << jt->second.L1[i]
<< " " << f133 << jt->second.L2[i]
<< " " << f133 << jt->second.P1[i]
<< " " << f133 << jt->second.P2[i]
<< " " << f133 << jt->second.ER[i]
<< " " << f52 << jt->second.elev[i]
<< " " << f52 << jt->second.az[i]
<< endl;
} // end loop over epochs
} // loop over satellites
} // loop over stations
// close output file
rawofs.close();
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }
catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
} // end OutputRawData()
示例10: OutputDDData
//------------------------------------------------------------------------------------
int OutputDDData(void) throw(Exception)
{
try {
if(CI.Verbose) oflog << "BEGIN OutputDDData()" << endl;
if(CI.OutputDDDFile.empty()) return 0;
int i;
double wlb;
DayTime tt;
map<DDid,DDData>::const_iterator it;
format f166(16,6);
// open an output file for DDD data
ofstream dddofs;
dddofs.open(CI.OutputDDDFile.c_str(),ios::out);
if(dddofs.is_open()) {
oflog << "Opened file " << CI.OutputDDDFile << " for DD data output." << endl;
dddofs << "# " << Title << endl;
dddofs << "DDD sit1 sit2 sat ref week sec_wk DDL1_m "
<< "DDL2_m DDER_m resL1_m resL2_m";
if(CI.Frequency == 3) dddofs << " WLbias_m";
dddofs << endl;
}
else {
// TD error msg
return -1;
}
// loop over DDids
for(it=DDDataMap.begin(); it != DDDataMap.end(); it++) {
// loop over epochs
for(i=0; i<it->second.count.size(); i++) {
tt = FirstEpoch + it->second.count[i]*CI.DataInterval;
if(CI.Frequency == 3)
wlb = wl1p * it->second.DDL1[i] // wide lane range minus phase
+ wl2p * it->second.DDL2[i] // = WL phase - NL range
- wl1r * it->second.DDP1[i]
- wl2r * it->second.DDP2[i];
dddofs << "DDD " << it->first << " " << tt.printf("%4F %10.3g")
<< " " << f166 << it->second.DDL1[i]
<< " " << f166 << it->second.DDL2[i]
<< " " << f166 << it->second.DDER[i]
<< " " << f166 << it->second.DDL1[i] - it->second.DDER[i]
<< " " << f166 << it->second.DDL2[i] - it->second.DDER[i];
if(CI.Frequency == 3) dddofs << " " << f166 << wlb;
dddofs << endl;
}
}
dddofs.close();
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }
catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
} // end OutputDDData()
示例11: OutputRawDData
//------------------------------------------------------------------------------------
// called from EditDDs.cpp
int OutputRawDData(const DDid& ddid, const DDData& dddata, const vector<int>& mark)
throw(Exception)
{
try {
bool TripleOut=true; // output triple differences as well
if(CI.OutputRawDDFile.empty()) return 0;
static ofstream rddofs;
// allow caller to close the file...
if(mark.size() == 0) {
if(rddofs.is_open()) rddofs.close();
return 0;
}
if(!rddofs.is_open()) { // first call : open the file
if(CI.Verbose) oflog << "BEGIN OutputRawDData()" << endl;
rddofs.open(CI.OutputRawDDFile.c_str(),ios::out);
if(rddofs.is_open()) {
oflog << "Opened file " << CI.OutputRawDDFile
<< " for raw DD data output." << endl;
rddofs << "# " << Title << endl;
rddofs << "RDD sit1 sit2 sat ref week sec_wk flag DDL1_m"
<< " "
<< "DDL2_m DDER_m resL1_m resL2_m";
if(CI.Frequency == 3) rddofs << " WLbias_m";
rddofs << endl;
if(TripleOut) rddofs
<< "RTD sit1 sit2 sat ref week sec_wk flag TDL1_m"
<< " TDL2_m TDER_m" << endl;
}
else {
// TD error msg
return -1;
}
}
int i;
double wlb;
DayTime tt;
format f166(16,6);
// loop over epochs
for(i=0; i<dddata.count.size(); i++) {
tt = FirstEpoch + dddata.count[i]*CI.DataInterval;
if(CI.Frequency == 3)
wlb = wl1p * dddata.DDL1[i] // wide lane range minus phase
+ wl2p * dddata.DDL2[i] // = WL phase - NL range
- wl1r * dddata.DDP1[i]
- wl2r * dddata.DDP2[i];
rddofs << "RDD " << ddid << " " << tt.printf("%4F %10.3g")
<< " " << setw(2) << mark[i]
<< " " << f166 << dddata.DDL1[i]
<< " " << f166 << dddata.DDL2[i]
<< " " << f166 << dddata.DDER[i]
<< " " << f166 << dddata.DDL1[i] - dddata.DDER[i]
<< " " << f166 << dddata.DDL2[i] - dddata.DDER[i];
if(CI.Frequency == 3) rddofs << " " << f166 << wlb;
rddofs << endl;
if(TripleOut && i>0) {
// wlb is a dummy here, = delta time for this triple diff
wlb = (dddata.count[i]-dddata.count[i-1])*CI.DataInterval;
rddofs << "RTD " << ddid << " " << tt.printf("%4F %10.3g")
<< " " << setw(2) << 10*mark[i]+mark[i-1]
<< " " << f166 << (dddata.DDL1[i]-dddata.DDL1[i-1])/wlb
<< " " << f166 << (dddata.DDL2[i]-dddata.DDL2[i-1])/wlb
<< " " << f166 << (dddata.DDER[i]-dddata.DDER[i-1])/wlb
<< endl;
}
}
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }
catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
} // end OutputRawDData()
示例12: getWxObservation
WxObservation WxObsData::getWxObservation(const DayTime& t,
unsigned iv,
bool interpolate) const
throw(ObjectNotFound)
{
if (obs.empty())
{
ObjectNotFound e("No WxObservation available near time " +
t.printf("%02H:%02M:%02S on day %03j of %4Y"));
GPSTK_THROW(e);
}
// get the first object after time t;
WxObsMap::const_iterator after = obs.upper_bound(t);
if (after == obs.begin())
{
const WxObservation& wxa = after->second;
if ((wxa.t >= (t - iv)) && (wxa.t <= (t + iv)))
{
// only after point fits
return wxa;
}
else
{
ObjectNotFound e("No WxObservation available near time " +
t.printf("%02H:%02M:%02S on day %03j of %4Y"));
GPSTK_THROW(e);
}
}
// get the first object at or before time t;
WxObsMap::const_iterator before = after;
before--;
if (after == obs.end())
{
const WxObservation& wxb = before->second;
if((wxb.t >= (t - iv)) && (wxb.t <= (t + iv)))
{
// only before point fits
return wxb;
}
else
{
ObjectNotFound e("No WeatherData available near time " +
t.printf("%02H:%02M:%02S on day %03j of %4Y"));
GPSTK_THROW(e);
}
}
else
{
const WxObservation& wxa = after->second;
const WxObservation& wxb = before->second;
if (interpolate)
{
if((wxb.t >= (t - iv)) && (wxb.t <= (t + iv)))
{
if ((wxa.t >= (t - iv)) && (wxa.t <= (t + iv)))
{
// both points fit, linearly interpolate and create
// a WeatherData object with those values
double dtw = wxa.t - wxb.t;
double dt = t - wxb.t;
double slope = (wxa.pressure - wxb.pressure) / dtw;
double pressure = slope * dt + wxb.pressure;
slope = (wxa.humidity - wxb.humidity) / dtw;
double humidity = slope * dt + wxb.humidity;
slope = (wxa.temperature - wxb.temperature) / dtw;
double temp = slope * dt + wxb.temperature;
WxObservation wx(t, temp, pressure, humidity);
return wx;
}
else
{
// only before point fits
return wxb;
}
}
else if ((wxa.t >= (t - iv)) && (wxa.t <= (t + iv)))
{
// only after point fits
return wxa;
}
else
{
ObjectNotFound e("No WeatherData available near time " +
t.printf("%02H:%02M:%02S on day %03j of %4Y"));
GPSTK_THROW(e);
}
}
else
{
if((wxb.t >= (t - iv)) && (wxb.t <= (t + iv)))
//.........这里部分代码省略.........
示例13: InterpolateAndOutput
//------------------------------------------------------------------------------------
int InterpolateAndOutput(void) throw(Exception)
{ // interpolate positions and output to rinex
try {
bool Lagrange;
int i,ipts;
double PDOP,GDOP,rms,err,dt,Dt,delt,xx,yy,zz,tt;
DayTime t0,ttag;
RinexObsData psdata;
vector<double> times,X,Y,Z,T;
map<DayTime,PosInfo>::iterator itb,ite,itB,itE,itr;
// if no previous epoch, nothing to do
if(PrevEpoch==DayTime::BEGINNING_OF_TIME)
return 0;
// find 4 positions on each side of CurrEpoch-1/2dt
ite = TimePositionMap.lower_bound(CurrEpoch);
if(ite == TimePositionMap.end())
return 0; // no position; get it next time
if(ite->first - LastInterpolated < 0)
return 0; // already done
itb = ite;
if(itb == TimePositionMap.begin()) {
//PIC.oflog << "Warning: cannot interpolate at " << CurrEpoch
//<< ": before beginning of data" << endl;
PIC.oflog << "Echo position at first epoch "
<< CurrEpoch.printf("%04Y/%02m/%02d %02H:%02M:%6.3f = %4F %.3g")
<< endl;
// create the aux header
// use data from the begin time
RinexPositionComments(psdata,CurrEpoch,
itb->second.N,
itb->second.X,
itb->second.Y,
itb->second.Z,
itb->second.T,
itb->second.PDOP,
itb->second.GDOP,
itb->second.rms);
// write it out
ofstr << psdata;
return 0;
}
itb--;
// itb and ite are now on either side of the times at which to interpolate
if(PIC.Debug) PIC.oflog << "Interpolate : "
<< itb->first.printf("%02H:%02M:%04.1f") << " to "
<< ite->first.printf("%02H:%02M:%04.1f")
<< " : (" << (ite->first - itb->first) << " sec)" << endl;
// now expand them out, up to 3 more epochs, watching for gaps TD: 3*DT input
itB = itb;
itE = ite;
for(i=0; i<3; i++) {
if(itB == TimePositionMap.begin() || (i==0 && itE->first-itB->first > 3*PIC.DT))
break;
// increase the end time
ttag = itE->first;
itE++;
if(itE == TimePositionMap.end() || itE->first-ttag > 3*PIC.DT) { itE--; break; }
// decrease the begin time
ttag = itB->first;
itB--;
if(ttag-itB->first > 3*PIC.DT) { itE--; itB++; break; }
}
// fill the arrays for interpolation
t0 = itB->first;
ipts = 1;
itr = itB;
if(PIC.Debug) PIC.oflog << "Data for interpolation:\n";
while(1) {
if(PIC.Debug) PIC.oflog << " " << ipts
<< " " << itr->first.printf("%02M:%04.1f")
<< fixed << setprecision(3)
<< " " << setw(6) << (itr->first-t0)
<< " " << setw(13) << itr->second.X
<< " " << setw(13) << itr->second.Y
<< " " << setw(13) << itr->second.Z
<< ((itr==itb || itr==ite) ? " *":"")
<< endl;
times.push_back(itr->first - t0); // sec
X.push_back(itr->second.X); // m
Y.push_back(itr->second.Y);
Z.push_back(itr->second.Z);
T.push_back(itr->second.T);
if(itr == itE) break;
itr++;
ipts++;
//.........这里部分代码省略.........
示例14: Timetable
//------------------------------------------------------------------------------------
int Timetable(void) throw(Exception)
{
try {
if(CI.Verbose) oflog << "BEGIN Timetable()"
<< " at total time " << fixed << setprecision(3)
<< double(clock()-totaltime)/double(CLOCKS_PER_SEC) << " seconds."
<< endl;
int ib,iret;
list<TTSegment>::iterator ttit;
if(CI.TimeTableFile.size() > 0) {
iret = ReadTimeTable();
}
else if(CI.RefSat.id != -1) { // user says use this sat only
// loop over baselines
for(ib=0; ib<Baselines.size(); ib++) {
TTSegment ts;
ts.site1 = word(Baselines[ib],0,'-');
ts.site2 = word(Baselines[ib],1,'-');
ts.sat = CI.RefSat;
ts.start = ts.first = 0;
ts.end = ts.last = maxCount;
ts.minelev = ts.maxelev = 0.0;
ts.length = ts.end - ts.start + 1;
TimeTable.push_back(ts);
iret = 0;
}
}
else {
// loop over baselines
for(ib=0; ib<Baselines.size(); ib++) {
iret = ComputeBaselineTimeTable(Baselines[ib]);
if(iret) break;
} // end loop over baselines
}
if(iret == 0) {
// write out timetable to log
// REF site site sat week use_first use_last data_start data_end
DayTime tt;
GSatID sat;
oflog << "Here is the time table (" << TimeTable.size() << ")" << endl;
if(CI.Screen)
cout << "Time table (" << TimeTable.size() << "):" << endl;
oflog << "# " << Title << endl;
oflog << "# REF site site sat week use_first use_last data_start data_end\n";
if(CI.Screen)
cout << "# REF site site sat week use_first use_last data_start data_end\n";
for(ttit=TimeTable.begin(); ttit != TimeTable.end(); ttit++) {
oflog << "REF " << ttit->site1 << " " << ttit->site2 << " " << ttit->sat;
if(CI.Screen)
cout << "REF " << ttit->site1 << " " << ttit->site2 << " " << ttit->sat;
tt = FirstEpoch + CI.DataInterval * ttit->first;
oflog << tt.printf(" %4F %10.3g"); // TD week rollover!
if(CI.Screen)
cout << tt.printf(" %4F %10.3g"); // TD week rollover!
tt = FirstEpoch + CI.DataInterval * ttit->last;
oflog << tt.printf(" %10.3g");
if(CI.Screen)
cout << tt.printf(" %10.3g");
tt = FirstEpoch + CI.DataInterval * ttit->start;
oflog << tt.printf(" %10.3g");
if(CI.Screen)
cout << tt.printf(" %10.3g");
tt = FirstEpoch + CI.DataInterval * ttit->end;
oflog << tt.printf(" %10.3g");
if(CI.Screen)
cout << tt.printf(" %10.3g");
// TD? ttit->minelev, ttit->maxelev, ttit->length, ttit->metric()
oflog << " " << fixed << setw(4) << setprecision(1) << ttit->minelev;
if(CI.Screen)
cout << " " << fixed << setw(4) << setprecision(1) << ttit->minelev;
oflog << " " << fixed << setw(4) << setprecision(1) << ttit->maxelev;
if(CI.Screen)
cout << " " << fixed << setw(4) << setprecision(1) << ttit->maxelev;
// write the number of counts for this ref
oflog << " " << setw(5) << ttit->length;
if(CI.Screen)
cout << " " << setw(5) << ttit->length;
oflog << endl;
if(CI.Screen)
cout << endl;
// for next time
sat = ttit->sat;
}
oflog << "End of time table." << endl;
if(CI.Screen)
cout << "End of time table." << endl;
}
return iret;
return 0;
}
catch(Exception& e) { GPSTK_RETHROW(e); }
catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }
catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
//.........这里部分代码省略.........
示例15: reallyPutRecord
void RinexNavHeader::reallyPutRecord(FFStream& ffs) const
throw(std::exception, FFStreamError, StringException)
{
RinexNavStream& strm = dynamic_cast<RinexNavStream&>(ffs);
strm.header = (*this);
unsigned long allValid;
if (version == 2.0) allValid = allValid20;
else if (version == 2.1) allValid = allValid21;
else if (version == 2.11) allValid = allValid211;
else
{
FFStreamError err("Unknown RINEX version: " + asString(version,3));
err.addText("Make sure to set the version correctly.");
GPSTK_THROW(err);
}
if ((valid & allValid) != allValid)
{
FFStreamError err("Incomplete or invalid header.");
err.addText("Make sure you set all header valid bits for all of the available data.");
GPSTK_THROW(err);
}
string line;
if (valid & versionValid)
{
line = rightJustify(asString(version,3), 10);
line += string(10, ' ');
line += string("NAVIGATION"); //leftJustify(fileType, 20);
line += string(30, ' ');
line += versionString;
strm << line << endl;
strm.lineNumber++;
}
if (valid & runByValid)
{
line = leftJustify(fileProgram,20);
line += leftJustify(fileAgency,20);
DayTime dt;
dt.setLocalTime();
string dat = dt.printf("%02m/%02d/%04Y %02H:%02M:%02S");
line += leftJustify(dat, 20);
line += runByString;
strm << line << endl;
strm.lineNumber++;
}
if (valid & commentValid)
{
vector<string>::const_iterator itr = commentList.begin();
while (itr != commentList.end())
{
line = leftJustify((*itr), 60);
line += commentString;
strm << line << endl;
strm.lineNumber++;
itr++;
}
}
if (valid & ionAlphaValid)
{
line = string(2, ' ');
for (int i = 0; i < 4; i++)
{
line += rightJustify(doub2for(ionAlpha[i], 12, 2),12); // should be 12.4
}
line += string(10, ' ');
line += ionAlphaString;
strm << line << endl;
strm.lineNumber++;
}
if (valid & ionBetaValid)
{
line = string(2, ' ');
for (int i = 0; i < 4; i++)
{
line += rightJustify(doub2for(ionBeta[i], 12, 2),12);
}
line += string(10, ' ');
line += ionBetaString;
strm << line << endl;
strm.lineNumber++;
}
if (valid & deltaUTCValid)
{
line = string(3, ' ');
//line += string(2, ' ');
line += doub2for(A0, 19, 2);
line += doub2for(A1, 19, 2);
line += rightJustify(asString(UTCRefTime),9);
line += rightJustify(asString(UTCRefWeek),9);
line += string(1, ' ');
line += deltaUTCString;
strm << line << endl;
strm.lineNumber++;
}
if (valid & leapSecondsValid)
{
//.........这里部分代码省略.........