Changeset 2566 in ntrip
- Timestamp:
- Aug 11, 2010, 3:11:24 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2563 r2566 772 772 } 773 773 774 string datestr = epoData->tt.datestr(0); // yyyymmdd 775 ostringstream strRMC; 776 strRMC.setf(ios::fixed); 777 strRMC << "GPRMC," 778 << epoData->tt.timestr(0,0) << ",A," 779 << setw(2) << setfill('0') << int(phiDeg) 780 << setw(6) << setprecision(3) << setfill('0') 781 << fmod(60*phiDeg,60) << ',' << phiCh << ',' 782 << setw(3) << setfill('0') << int(lamDeg) 783 << setw(6) << setprecision(3) << setfill('0') 784 << fmod(60*lamDeg,60) << ',' << lamCh << ",,," 785 << datestr[6] << datestr[7] 786 << datestr[4] << datestr[5] 787 << datestr[2] << datestr[3] << ",,,"; 788 789 writeNMEAstr(QString(strRMC.str().c_str())); 790 774 791 double dop = 2.0; // TODO 775 792 776 ostringstream str 3;777 str 3.setf(ios::fixed);778 str 3<< "GPGGA,"779 << epoData->tt.timestr(0,0) << ','780 << setw(2) << setfill('0') << int(phiDeg)781 << setw(10) << setprecision(7) << setfill('0')782 << fmod(60*phiDeg,60) << ',' << phiCh << ','783 << setw(2) << setfill('0') << int(lamDeg)784 << setw(10) << setprecision(7) << setfill('0')785 << fmod(60*lamDeg,60) << ',' << lamCh786 << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ','787 << setw(3) << setprecision(1) << dop << ','788 << setprecision(3) << ell[2] << ",M,0.0,M,,,";793 ostringstream strGGA; 794 strGGA.setf(ios::fixed); 795 strGGA << "GPGGA," 796 << epoData->tt.timestr(0,0) << ',' 797 << setw(2) << setfill('0') << int(phiDeg) 798 << setw(10) << setprecision(7) << setfill('0') 799 << fmod(60*phiDeg,60) << ',' << phiCh << ',' 800 << setw(3) << setfill('0') << int(lamDeg) 801 << setw(10) << setprecision(7) << setfill('0') 802 << fmod(60*lamDeg,60) << ',' << lamCh 803 << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ',' 804 << setw(3) << setprecision(1) << dop << ',' 805 << setprecision(3) << ell[2] << ",M,0.0,M,,,"; 789 806 790 writeNMEAstr(QString(str3.str().c_str())); 791 792 QDateTime dateTime = QDateTime::currentDateTime().toUTC(); 793 QString nmStr = "GPRMC," + dateTime.time().toString("hhmmss") 794 + ",A,0.00,S,0.00,E,0.00,0.00," 795 + dateTime.date().toString("ddMMyy") 796 + ",,"; 797 writeNMEAstr(nmStr); 807 writeNMEAstr(QString(strGGA.str().c_str())); 798 808 799 809 return success; -
trunk/BNC/bnctime.cpp
r2257 r2566 113 113 return this->_sec - time1._sec; 114 114 } 115 } 116 117 // 118 ////////////////////////////////////////////////////////////////////////////// 119 void bncTime::civil_date (unsigned int& year, unsigned int& month, 120 unsigned int& day) const { 121 double day_d; 122 long int yy, mm; 123 jmt(_mjd, yy, mm, day_d); 124 year = yy; 125 month = mm; 126 day = static_cast<unsigned int>(day_d); 115 127 } 116 128 … … 166 178 } 167 179 180 // 181 ////////////////////////////////////////////////////////////////////////////// 182 string bncTime::datestr(char sep) const { 183 unsigned int year, month, day; 184 civil_date(year,month,day); 185 ostringstream str; 186 str.setf(ios::fixed); 187 str << setfill('0'); 188 str << setw(4) << year; 189 if (sep) str << sep; 190 str << setw(2) << month; 191 if (sep) str << sep; 192 str << setw(2) << day; 193 return str.str(); 194 } 168 195 169 196 // -
trunk/BNC/bnctime.h
r2252 r2566 18 18 unsigned int gpsw() const; 19 19 double gpssec() const; 20 void civil_date (unsigned int& year, unsigned int& month, 21 unsigned int& day) const; 20 22 void civil_time (unsigned int& hour, unsigned int& min, 21 23 double& sec) const; … … 27 29 28 30 std::string timestr(unsigned numdec = 3, char sep = ':') const; 31 std::string datestr(char sep = '-') const; 29 32 30 33 private:
Note:
See TracChangeset
for help on using the changeset viewer.