- Timestamp:
- Dec 28, 2009, 12:27:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2131 r2132 561 561 // ----------- 562 562 if (_nmeaStream) { 563 double xyz[3]; 564 xyz[0] = x(); 565 xyz[1] = y(); 566 xyz[2] = z(); 567 double ell[3]; 568 xyz2ell(xyz, ell); 569 double phiDeg = ell[0] * 180 / M_PI; 570 double lamDeg = ell[1] * 180 / M_PI; 571 572 char phiCh = 'N'; 573 if (phiDeg < 0) { 574 phiDeg = -phiDeg; 575 phiCh = 'S'; 576 } 577 char lamCh = 'E'; 578 if (lamDeg < 0) { 579 lamDeg = -lamDeg; 580 lamCh = 'W'; 581 } 582 563 583 ostringstream str3; 564 584 str3.setf(ios::fixed); 565 str3 << "GPGGA," << epoData->tt.timestr(0,0); 585 str3 << "GPGGA," 586 << epoData->tt.timestr(0,0) << ',' 587 << setw(2) << setfill('0') << int(phiDeg) 588 << setw(10) << setprecision(7) << setfill('0') 589 << fmod(60*phiDeg,60) << ',' << phiCh << ',' 590 << setw(2) << setfill('0') << int(lamDeg) 591 << setw(10) << setprecision(7) << setfill('0') 592 << fmod(60*lamDeg,60) << ',' << lamCh << ','; 566 593 567 594 writeNMEAstr(QString(str3.str().c_str()));
Note:
See TracChangeset
for help on using the changeset viewer.