Changeset 10587 in ntrip for trunk/BNC/src
- Timestamp:
- Dec 10, 2024, 3:57:21 PM (3 days ago)
- Location:
- trunk/BNC/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r10579 r10587 1064 1064 } 1065 1065 GETBITS(i, 4) 1066 eph._ura = accuracyFromIndex(i, eph. type());1066 eph._ura = accuracyFromIndex(i, eph.system()); 1067 1067 GETBITS(eph._L2Codes, 2) 1068 1068 GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13)) … … 1132 1132 GETBITS(eph._L2PFlag, 1) 1133 1133 GETBITS(fitIntervalFalg, 1) 1134 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph. type());1134 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.system()); 1135 1135 eph._TOT = 0.9999e9; 1136 eph._ ephType = t_eph::LNAV;1136 eph._type = t_eph::LNAV; 1137 1137 1138 1138 emit newGPSEph(eph); … … 1159 1159 eph._receptStaID = _staID; 1160 1160 1161 eph._flags_unknown = true;1162 1163 1161 GETBITS(sv, 6) 1164 1162 if (sv < 1 || sv > 63) { … … 1184 1182 return false; 1185 1183 } 1186 eph._fr equency_number= i - 7;1184 eph._frq_num = i - 7; 1187 1185 GETBITS(eph._almanac_health, 1) /* almanac healthy */ 1188 1186 GETBITS(eph._almanac_health_availablility_indicator, 1) /* almanac health ok */ … … 1245 1243 eph._TOC.setTk(i * 60 * 1000); /* tb */ 1246 1244 1247 GETFLOATSIGNM(eph._x_vel ocity,24, 1.0 / (double )(1 << 20))1248 GETFLOATSIGNM(eph._x_pos, 1249 GETFLOATSIGNM(eph._x_acc eleration,5, 1.0 / (double )(1 << 30))1250 GETFLOATSIGNM(eph._y_vel ocity,24, 1.0 / (double )(1 << 20))1251 GETFLOATSIGNM(eph._y_pos, 1252 GETFLOATSIGNM(eph._y_acc eleration,5, 1.0 / (double )(1 << 30))1253 GETFLOATSIGNM(eph._z_vel ocity,24, 1.0 / (double )(1 << 20))1254 GETFLOATSIGNM(eph._z_pos, 1255 GETFLOATSIGNM(eph._z_acc eleration,5, 1.0 / (double )(1 << 30))1245 GETFLOATSIGNM(eph._x_vel, 24, 1.0 / (double )(1 << 20)) 1246 GETFLOATSIGNM(eph._x_pos, 27, 1.0 / (double )(1 << 11)) 1247 GETFLOATSIGNM(eph._x_acc, 5, 1.0 / (double )(1 << 30)) 1248 GETFLOATSIGNM(eph._y_vel, 24, 1.0 / (double )(1 << 20)) 1249 GETFLOATSIGNM(eph._y_pos, 27, 1.0 / (double )(1 << 11)) 1250 GETFLOATSIGNM(eph._y_acc, 5, 1.0 / (double )(1 << 30)) 1251 GETFLOATSIGNM(eph._z_vel, 24, 1.0 / (double )(1 << 20)) 1252 GETFLOATSIGNM(eph._z_pos, 27, 1.0 / (double )(1 << 11)) 1253 GETFLOATSIGNM(eph._z_acc, 5, 1.0 / (double )(1 << 30)) 1256 1254 GETBITS(eph._P3, 1) /* P3 */ 1257 1255 GETFLOATSIGNM(eph._gamma, 11, 1.0 / (double )(1 << 30) / (double )(1 << 10)) … … 1281 1279 return false; 1282 1280 } 1283 GETBITS(eph._ NA, 11) /* GLONASS-M Na */1281 GETBITS(eph._M_NA, 11) /* GLONASS-M Na */ 1284 1282 GETFLOATSIGNM(eph._tauC, 32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */ 1285 1283 GETBITS(eph._M_N4, 5) /* GLONASS-M N4 */ … … 1302 1300 return false; 1303 1301 } 1304 eph._xv(4) = eph._x_vel ocity* 1.e3;1305 eph._xv(5) = eph._y_vel ocity* 1.e3;1306 eph._xv(6) = eph._z_vel ocity* 1.e3;1302 eph._xv(4) = eph._x_vel * 1.e3; 1303 eph._xv(5) = eph._y_vel * 1.e3; 1304 eph._xv(6) = eph._z_vel * 1.e3; 1307 1305 if (eph._xv.Rows(4,6).NormFrobenius() < 1.0) { 1308 1306 #ifdef BNC_DEBUG_BCE … … 1312 1310 return false; 1313 1311 } 1314 GLOFreq[sv - 1] = 100 + eph._frequency_number ; /* store frequency for other users (MSM) */ 1315 _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0); 1316 1317 eph._ephType = t_eph::FDMA; 1312 GLOFreq[sv - 1] = 100 + eph._frq_num ; /* store frequency for other users (MSM) */ 1313 _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frq_num, 2, 'f', 0); 1314 1315 eph._type = t_eph::FDMA; 1316 eph._healthflags_unknown = false; 1317 eph._statusflags_unknown = false; 1318 1318 1319 1319 emit newGlonassEph(eph); … … 1429 1429 1430 1430 GETBITS(i, 4) 1431 eph._ura = accuracyFromIndex(i, eph. type());1431 eph._ura = accuracyFromIndex(i, eph.system()); 1432 1432 GETBITS(eph._health, 6) 1433 1433 GETFLOATSIGN(eph._TGD, 8, 1.0 / (double )(1 << 30) / (double )(1 << 1)) 1434 1434 GETBITS(eph._IODC, 10) 1435 1435 GETBITS(fitIntervalFalg, 1) 1436 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph. type());1436 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.system()); 1437 1437 eph._TOT = 0.9999e9; 1438 eph._ ephType = t_eph::LNAV;1438 eph._type = t_eph::LNAV; 1439 1439 1440 1440 emit newGPSEph(eph); … … 1487 1487 GETFLOATSIGN(eph._clock_driftrate, 8, 1.0 / (double )(1 << 30) / (double )(1 << 25)) 1488 1488 GETBITS(i, 4) 1489 eph._ura = accuracyFromIndex(i, eph. type());1489 eph._ura = accuracyFromIndex(i, eph.system()); 1490 1490 GETBITS(i, 16) 1491 1491 i <<= 4; … … 1567 1567 SKIPBITS(2) 1568 1568 eph._TOT = 0.9999e9; 1569 eph._ ephType = t_eph::LNAV;1569 eph._type = t_eph::LNAV; 1570 1570 1571 1571 emit newGPSEph(eph); … … 1618 1618 eph._TOC.setTOD(i * 1000); 1619 1619 GETBITS(i, 4) 1620 eph._ura = accuracyFromIndex(i, eph. type());1620 eph._ura = accuracyFromIndex(i, eph.system()); 1621 1621 GETFLOATSIGN(eph._x_pos, 30, 0.08) 1622 1622 GETFLOATSIGN(eph._y_pos, 30, 0.08) … … 1631 1631 return false; 1632 1632 } 1633 GETFLOATSIGN(eph._x_vel ocity, 17, 0.000625)1634 GETFLOATSIGN(eph._y_vel ocity, 17, 0.000625)1635 GETFLOATSIGN(eph._z_vel ocity, 18, 0.004)1636 GETFLOATSIGN(eph._x_acc eleration, 10, 0.0000125)1637 GETFLOATSIGN(eph._y_acc eleration, 10, 0.0000125)1638 GETFLOATSIGN(eph._z_acc eleration, 10, 0.0000625)1633 GETFLOATSIGN(eph._x_vel, 17, 0.000625) 1634 GETFLOATSIGN(eph._y_vel, 17, 0.000625) 1635 GETFLOATSIGN(eph._z_vel, 18, 0.004) 1636 GETFLOATSIGN(eph._x_acc, 10, 0.0000125) 1637 GETFLOATSIGN(eph._y_acc, 10, 0.0000125) 1638 GETFLOATSIGN(eph._z_acc, 10, 0.0000625) 1639 1639 GETFLOATSIGN(eph._agf0, 12, 1.0 / (1 << 30) / (1 << 1)) 1640 1640 GETFLOATSIGN(eph._agf1, 8, 1.0 / (1 << 30) / (1 << 10)) … … 1642 1642 eph._TOT = 0.9999E9; 1643 1643 eph._health = 0; 1644 eph._ ephType = t_eph::SBASL1;1644 eph._type = t_eph::SBASL1; 1645 1645 1646 1646 emit newSBASEph(eph); … … 1695 1695 GETBITS(eph._IODnav, 10) 1696 1696 GETBITS(i, 8) 1697 eph._SISA = accuracyFromIndex(i, eph. type());1697 eph._SISA = accuracyFromIndex(i, eph.system()); 1698 1698 GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13)) 1699 1699 GETBITSFACTOR(i, 14, 60) … … 1731 1731 } 1732 1732 /* FIXME: overwrite value, copied from old code */ 1733 eph._TOEsec = eph._TOC.gpssec();1733 //eph._TOEsec = eph._TOC.gpssec(); 1734 1734 GETFLOATSIGN(eph._Cic, 16, 1.0 / (double )(1 << 29)) 1735 1735 GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1)) … … 1742 1742 if (eph._inav) { 1743 1743 /* set unused F/NAV values */ 1744 eph._E5a HS = 0.0;1745 eph._ e5aDataInvalid = false;1744 eph._E5a_HS = 0.0; 1745 eph._E5a_DataInvalid = false; 1746 1746 1747 1747 GETFLOATSIGN(eph._BGD_1_5B, 10, 1.0 / (double )(1 << 30) / (double )(1 << 2)) 1748 GETBITS(eph._E5b HS, 2)1749 GETBITS(eph._ e5bDataInvalid, 1)1750 GETBITS(eph._E1 _bHS, 2)1751 GETBITS(eph._ e1DataInvalid, 1)1752 if (eph._E5b HS != eph._E1_bHS) {1748 GETBITS(eph._E5b_HS, 2) 1749 GETBITS(eph._E5b_DataInvalid, 1) 1750 GETBITS(eph._E1B_HS, 2) 1751 GETBITS(eph._E1B_DataInvalid, 1) 1752 if (eph._E5b_HS != eph._E1B_HS) { 1753 1753 #ifdef BNC_DEBUG_BCE 1754 1754 emit(newMessage(QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!") 1755 1755 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1756 .arg(eph._E5b HS).arg(eph._E1_bHS).toLatin1(), true));1756 .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1(), true)); 1757 1757 #endif 1758 1758 return false; … … 1761 1761 (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e-9)) { 1762 1762 #ifdef BNC_DEBUG_BCE 1763 emit(newMessage(QString("%1: Block %2 (%3) BGD_1 5a = %4 BGD_15b = %5: inconsistent BGD!")1763 emit(newMessage(QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!") 1764 1764 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1765 1765 .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1(), true)); … … 1767 1767 return false; 1768 1768 } 1769 eph._ ephType = t_eph::INAF;1769 eph._type = t_eph::INAV; 1770 1770 } 1771 1771 else { 1772 1772 /* set unused I/NAV values */ 1773 1773 eph._BGD_1_5B = 0.0; 1774 eph._E5b HS = 0.0;1775 eph._E1 _bHS = 0.0;1776 eph._ e1DataInvalid = false;1777 eph._ e5bDataInvalid = false;1778 1779 GETBITS(eph._E5a HS, 2)1780 GETBITS(eph._ e5aDataInvalid, 1)1781 eph._ ephType = t_eph::FNAV;1774 eph._E5b_HS = 0.0; 1775 eph._E1B_HS = 0.0; 1776 eph._E1B_DataInvalid = false; 1777 eph._E5b_DataInvalid = false; 1778 1779 GETBITS(eph._E5a_HS, 2) 1780 GETBITS(eph._E5a_DataInvalid, 1) 1781 eph._type = t_eph::FNAV; 1782 1782 } 1783 1783 eph._TOT = 0.9999e9; … … 1841 1841 eph._BDTweek = week; 1842 1842 GETBITS(i, 4) 1843 eph._ URA = accuracyFromIndex(i, eph.type());1843 eph._ura = accuracyFromIndex(i, eph.system()); 1844 1844 GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13)) 1845 1845 GETBITS(eph._AODE, 5) … … 1903 1903 eph._TOT = 0.9999E9; 1904 1904 if (eph._i0 > iMaxGEO) { 1905 eph._ ephType = t_eph::D1;1905 eph._type = t_eph::D1; 1906 1906 } 1907 1907 else { 1908 eph._ ephType = t_eph::D2;1908 eph._type = t_eph::D2; 1909 1909 } 1910 1910 -
trunk/BNC/src/RTCM3/ephEncoder.cpp
r10579 r10587 14 14 int numbits = 0; 15 15 unsigned long long bitbuffer = 0; 16 int ura = indexFromAccuracy(eph._ura, eph. type());16 int ura = indexFromAccuracy(eph._ura, eph.system()); 17 17 int L5Flag = 0; 18 18 int SFlag = 0; 19 19 int fitIntervalFlag = 0; 20 20 21 if (eph. type() == t_eph::QZSS) {21 if (eph.system() == t_eph::QZSS) { 22 22 GPSADDBITS(12, 1044) 23 23 GPSADDBITS(4, eph._prn.number()) … … 52 52 GPSADDBITS(1, fitIntervalFlag) 53 53 GPSADDBITS(3, 0) /* padding */ 54 } else if (eph. type() == t_eph::IRNSS) {54 } else if (eph.system() == t_eph::IRNSS) { 55 55 GPSADDBITS(12, 1041) 56 56 GPSADDBITS(6, eph._prn.number()) … … 156 156 GLONASSADDBITS(12, 1020) 157 157 GLONASSADDBITS(6, eph._prn.number()) 158 GLONASSADDBITS(5, 7+eph._fr equency_number)158 GLONASSADDBITS(5, 7+eph._frq_num) 159 159 GLONASSADDBITS(1, eph._almanac_health) 160 160 GLONASSADDBITS(1, eph._almanac_health_availablility_indicator) … … 169 169 unsigned long long timeofday = (static_cast<int>(eph._tt.gpssec()+3*60*60-eph._gps_utc)%86400); 170 170 GLONASSADDBITS(7, timeofday/60/15) 171 GLONASSADDBITSFLOATM(24, eph._x_vel ocity*1000, 1000.0/static_cast<double>(1<<20))171 GLONASSADDBITSFLOATM(24, eph._x_vel*1000, 1000.0/static_cast<double>(1<<20)) 172 172 GLONASSADDBITSFLOATM(27, eph._x_pos*1000, 1000.0/static_cast<double>(1<<11)) 173 GLONASSADDBITSFLOATM(5, eph._x_acc eleration*1000, 1000.0/static_cast<double>(1<<30))174 GLONASSADDBITSFLOATM(24, eph._y_vel ocity*1000, 1000.0/static_cast<double>(1<<20))173 GLONASSADDBITSFLOATM(5, eph._x_acc*1000, 1000.0/static_cast<double>(1<<30)) 174 GLONASSADDBITSFLOATM(24, eph._y_vel*1000, 1000.0/static_cast<double>(1<<20)) 175 175 GLONASSADDBITSFLOATM(27, eph._y_pos*1000, 1000.0/static_cast<double>(1<<11)) 176 GLONASSADDBITSFLOATM(5, eph._y_acc eleration*1000, 1000.0/static_cast<double>(1<<30))177 GLONASSADDBITSFLOATM(24, eph._z_vel ocity*1000, 1000.0/static_cast<double>(1<<20))176 GLONASSADDBITSFLOATM(5, eph._y_acc*1000, 1000.0/static_cast<double>(1<<30)) 177 GLONASSADDBITSFLOATM(24, eph._z_vel*1000, 1000.0/static_cast<double>(1<<20)) 178 178 GLONASSADDBITSFLOATM(27,eph._z_pos*1000, 1000.0/static_cast<double>(1<<11)) 179 GLONASSADDBITSFLOATM(5, eph._z_acc eleration*1000, 1000.0/static_cast<double>(1<<30))179 GLONASSADDBITSFLOATM(5, eph._z_acc*1000, 1000.0/static_cast<double>(1<<30)) 180 180 GLONASSADDBITS(1, eph._P3) 181 181 GLONASSADDBITSFLOATM(11, eph._gamma, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10)) … … 190 190 GLONASSADDBITS(2, eph._M_M) /* GLONASS-M active? */ 191 191 GLONASSADDBITS(1, eph._additional_data_availability) /* GLONASS additional data */ 192 GLONASSADDBITS(11, eph._ NA) /* GLONASS NA */192 GLONASSADDBITS(11, eph._M_NA) /* GLONASS NA */ 193 193 GLONASSADDBITSFLOATM(32, eph._tauC, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1)) /* GLONASS tau C */ 194 194 GLONASSADDBITS(5, eph._M_N4) /* GLONASS-M N4 */ … … 217 217 buffer= buffer+3; 218 218 219 int SISA = indexFromAccuracy(eph._SISA, eph. type());219 int SISA = indexFromAccuracy(eph._SISA, eph.system()); 220 220 221 221 GALILEOADDBITS(12, eph._inav ? 1046 : 1045) … … 247 247 if(eph._inav) { 248 248 GALILEOADDBITSFLOAT(10, eph._BGD_1_5B, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<2)) 249 GALILEOADDBITS(2, static_cast<int>(eph._E5b HS))250 GALILEOADDBITS(1, eph._ e5bDataInvalid ? 1 : 0)251 GALILEOADDBITS(2, static_cast<int>(eph._E1 _bHS))252 GALILEOADDBITS(1, eph._ e1DataInvalid ? 1 : 0)249 GALILEOADDBITS(2, static_cast<int>(eph._E5b_HS)) 250 GALILEOADDBITS(1, eph._E5b_DataInvalid ? 1 : 0) 251 GALILEOADDBITS(2, static_cast<int>(eph._E1B_HS)) 252 GALILEOADDBITS(1, eph._E1B_DataInvalid ? 1 : 0) 253 253 } else { 254 GALILEOADDBITS(2, static_cast<int>(eph._E5a HS))255 GALILEOADDBITS(1, eph._ e5aDataInvalid ? 1 : 0)254 GALILEOADDBITS(2, static_cast<int>(eph._E5a_HS)) 255 GALILEOADDBITS(1, eph._E5a_DataInvalid ? 1 : 0) 256 256 } 257 257 … … 278 278 buffer= buffer+3; 279 279 280 int ura = indexFromAccuracy(eph._ura, eph. type());280 int ura = indexFromAccuracy(eph._ura, eph.system()); 281 281 SBASADDBITS(12, 1043) 282 282 SBASADDBITS(6, eph._prn.number()-20) … … 287 287 SBASADDBITSFLOAT(30, eph._y_pos, 0.08) 288 288 SBASADDBITSFLOAT(25, eph._z_pos, 0.4) 289 SBASADDBITSFLOAT(17, eph._x_vel ocity, 0.000625)290 SBASADDBITSFLOAT(17, eph._y_vel ocity, 0.000625)291 SBASADDBITSFLOAT(18, eph._z_vel ocity, 0.004)292 SBASADDBITSFLOAT(10, eph._x_acc eleration, 0.0000125)293 SBASADDBITSFLOAT(10, eph._y_acc eleration, 0.0000125)294 SBASADDBITSFLOAT(10, eph._z_acc eleration, 0.0000625)289 SBASADDBITSFLOAT(17, eph._x_vel, 0.000625) 290 SBASADDBITSFLOAT(17, eph._y_vel, 0.000625) 291 SBASADDBITSFLOAT(18, eph._z_vel, 0.004) 292 SBASADDBITSFLOAT(10, eph._x_acc, 0.0000125) 293 SBASADDBITSFLOAT(10, eph._y_acc, 0.0000125) 294 SBASADDBITSFLOAT(10, eph._z_acc, 0.0000625) 295 295 SBASADDBITSFLOAT(12, eph._agf0, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 296 296 SBASADDBITSFLOAT(8, eph._agf1, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10)) … … 317 317 buffer= buffer+3; 318 318 319 int URA = indexFromAccuracy(eph._URA, eph.type());319 int URAI = indexFromAccuracy(eph._ura, eph.system()); 320 320 BDSADDBITS(12, 1042) 321 321 BDSADDBITS(6, eph._prn.number()) 322 322 BDSADDBITS(13, eph._TOC.bdsw()) 323 BDSADDBITS(4, URA );323 BDSADDBITS(4, URAI); 324 324 BDSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13)) 325 325 BDSADDBITS(5, eph._AODE) -
trunk/BNC/src/bnccore.cpp
r10577 r10587 209 209 messagePrivate(QString("%1: UNHEALTHY %2:%3") 210 210 .arg(eph->receptStaID()) 211 .arg(eph-> ephTypeStr(eph->ephType(), eph->prn(), 99.0))211 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) 212 212 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 213 213 } … … 215 215 messagePrivate(QString("%1: WRONG %2:%3") 216 216 .arg(eph->receptStaID()) 217 .arg(eph-> ephTypeStr(eph->ephType(), eph->prn(), 99.0))217 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) 218 218 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 219 219 } … … 221 221 messagePrivate(QString("%1: OUTDATED %2:%3") 222 222 .arg(eph->receptStaID()) 223 .arg(eph-> ephTypeStr(eph->ephType(), eph->prn(), 99.0))223 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) 224 224 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 225 225 } … … 491 491 QString strV4 = eph.toString(defaultRnxNavVersion4); 492 492 493 if (_rinexVers == 2 && eph.type() == t_eph::GLONASS) {493 if (_rinexVers == 2 && eph.system() == t_eph::GLONASS) { 494 494 printOutputEph(printFile, _ephStreamGlonass, strV2, strV3, strV4); 495 495 } 496 else if (_rinexVers == 2 && eph.type() == t_eph::GPS){496 else if (_rinexVers == 2 && eph.system() == t_eph::GPS) { 497 497 printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4); 498 498 } -
trunk/BNC/src/bncephuser.cpp
r10330 r10587 276 276 277 277 // update interval: 2h 278 if (eph-> type() == t_eph::GPS && dt > 7200.0) {278 if (eph->system() == t_eph::GPS && dt > 7200.0) { 279 279 ephL->setCheckState(t_eph::outdated); 280 280 return; 281 281 } 282 282 // update interval: 3h 283 else if (eph-> type() == t_eph::Galileo && dt > 10800.0) {283 else if (eph->system() == t_eph::Galileo && dt > 10800.0) { 284 284 ephL->setCheckState(t_eph::outdated); 285 285 return; 286 286 } 287 287 // updated every 30 minutes + 5 min 288 else if (eph-> type() == t_eph::GLONASS && dt > 2100.0) {288 else if (eph->system() == t_eph::GLONASS && dt > 2100.0) { 289 289 ephL->setCheckState(t_eph::outdated); 290 290 return; 291 291 } 292 292 // updated every ? 293 else if (eph-> type() == t_eph::QZSS && dt > 3600.0) {293 else if (eph->system() == t_eph::QZSS && dt > 3600.0) { 294 294 ephL->setCheckState(t_eph::outdated); 295 295 return; 296 296 } 297 297 // maximum update interval: 300 sec 298 else if (eph-> type() == t_eph::SBAS && dt > 600.0) {298 else if (eph->system() == t_eph::SBAS && dt > 600.0) { 299 299 ephL->setCheckState(t_eph::outdated); 300 300 return; 301 301 } 302 302 // updates 1h + 5 min 303 else if (eph-> type() == t_eph::BDS && dt > 3900.0) {303 else if (eph->system() == t_eph::BDS && dt > 3900.0) { 304 304 ephL->setCheckState(t_eph::outdated); 305 305 return; 306 306 } 307 307 // update interval: up to 24 hours 308 else if (eph-> type() == t_eph::IRNSS && dt > 86400.0) {309 ephL->setCheckState(t_eph::outdated); 310 return; 311 } 312 } 313 } 314 308 else if (eph->system() == t_eph::IRNSS && dt > 86400.0) { 309 ephL->setCheckState(t_eph::outdated); 310 return; 311 } 312 } 313 } 314 -
trunk/BNC/src/bncutils.cpp
r10577 r10587 266 266 267 267 // update interval: 2h, data sets are valid for 4 hours 268 if (eph-> type() == t_eph::GPS && (dt > 14400.0 || dt < -7200.0)) {268 if (eph->system() == t_eph::GPS && (dt > 14400.0 || dt < -7200.0)) { 269 269 return true; 270 270 } 271 271 // update interval: 3h, data sets are valid for 4 hours 272 else if (eph-> type() == t_eph::Galileo && (dt > 14400.0 || dt < 0.0)) {272 else if (eph->system() == t_eph::Galileo && (dt > 14400.0 || dt < 0.0)) { 273 273 return true; 274 274 } 275 275 // updated every 30 minutes + 5 min 276 else if (eph-> type() == t_eph::GLONASS && (dt > 2100.0 || dt < -2100.0)) {276 else if (eph->system() == t_eph::GLONASS && (dt > 2100.0 || dt < -2100.0)) { 277 277 return true; 278 278 } 279 279 // orbit parameters are valid for 7200 seconds (minimum) 280 else if (eph-> type() == t_eph::QZSS && (dt > 7200.0 || dt < -3600.0)) {280 else if (eph->system() == t_eph::QZSS && (dt > 7200.0 || dt < -3600.0)) { 281 281 return true; 282 282 } 283 283 // maximum update interval: 300 sec 284 else if (eph-> type() == t_eph::SBAS && (dt > 600.0 || dt < -600.0)) {284 else if (eph->system() == t_eph::SBAS && (dt > 600.0 || dt < -600.0)) { 285 285 return true; 286 286 } 287 287 // updates 1h + 5 min 288 else if (eph-> type() == t_eph::BDS && (dt > 3900.0 || dt < 0.0) ) {288 else if (eph->system() == t_eph::BDS && (dt > 3900.0 || dt < 0.0) ) { 289 289 return true; 290 290 } 291 291 // update interval: up to 24 hours 292 else if (eph-> type() == t_eph::IRNSS && (fabs(dt > 86400.0))) {292 else if (eph->system() == t_eph::IRNSS && (fabs(dt > 86400.0))) { 293 293 return true; 294 294 } … … 845 845 // 846 846 //////////////////////////////////////////////////////////////////////////// 847 double accuracyFromIndex(int index, t_eph::e_ type type) {847 double accuracyFromIndex(int index, t_eph::e_system system) { 848 848 double accuracy = -1.0; 849 849 850 if ( type== t_eph::GPS ||851 type== t_eph::BDS ||852 type== t_eph::SBAS||853 type== t_eph::QZSS||854 type== t_eph::IRNSS) {850 if (system == t_eph::GPS || 851 system == t_eph::BDS || 852 system == t_eph::SBAS|| 853 system == t_eph::QZSS|| 854 system == t_eph::IRNSS) { 855 855 if ((index >= 0) && (index <= 6)) { 856 856 if (index == 3) { … … 869 869 } 870 870 } 871 else if ( type== t_eph::Galileo) {871 else if (system == t_eph::Galileo) { 872 872 if ((index >= 0) && (index <= 49)) { 873 873 accuracy = (double(index) / 100.0); … … 891 891 // 892 892 //////////////////////////////////////////////////////////////////////////// 893 int indexFromAccuracy(double accuracy, t_eph::e_ type type) {894 895 if ( type== t_eph::GPS ||896 type== t_eph::BDS ||897 type== t_eph::SBAS ||898 type== t_eph::QZSS ||899 type== t_eph::IRNSS) {893 int indexFromAccuracy(double accuracy, t_eph::e_system system) { 894 895 if (system == t_eph::GPS || 896 system == t_eph::BDS || 897 system == t_eph::SBAS || 898 system == t_eph::QZSS || 899 system == t_eph::IRNSS) { 900 900 901 901 if (accuracy <= 2.40) { … … 949 949 } 950 950 951 if ( type== t_eph::Galileo) {951 if (system == t_eph::Galileo) { 952 952 if (accuracy <= 0.49) { 953 953 return int(ceil(accuracy * 100.0)); … … 967 967 } 968 968 969 return ( type== t_eph::Galileo) ? 255 : 15;969 return (system == t_eph::Galileo) ? 255 : 15; 970 970 } 971 971 972 972 // Returns fit interval in hours from flag 973 973 //////////////////////////////////////////////////////////////////////////// 974 double fitIntervalFromFlag(int flag, double iodc, t_eph::e_ type type) {974 double fitIntervalFromFlag(int flag, double iodc, t_eph::e_system system) { 975 975 double fitInterval = 0.0; 976 976 977 977 switch (flag) { 978 978 case 0: 979 if ( type== t_eph::GPS) {979 if (system == t_eph::GPS) { 980 980 fitInterval = 4.0; 981 981 } 982 else if ( type== t_eph::QZSS) {982 else if (system == t_eph::QZSS) { 983 983 fitInterval = 2.0; 984 984 } 985 985 break; 986 986 case 1: 987 if ( type== t_eph::GPS) {987 if (system == t_eph::GPS) { 988 988 if (iodc >= 240 && iodc <= 247) { 989 989 fitInterval = 8.0; -
trunk/BNC/src/bncutils.h
r10533 r10587 147 147 void stripWhiteSpace(std::string& str); 148 148 149 double accuracyFromIndex(int index, t_eph::e_ type type);149 double accuracyFromIndex(int index, t_eph::e_system system); 150 150 151 int indexFromAccuracy(double accuracy, t_eph::e_ type type);151 int indexFromAccuracy(double accuracy, t_eph::e_system system); 152 152 153 double fitIntervalFromFlag(int flag, double iodc, t_eph::e_ type type);153 double fitIntervalFromFlag(int flag, double iodc, t_eph::e_system system); 154 154 155 155 double associatedLegendreFunction(int n, int m, double t); -
trunk/BNC/src/ephemeris.cpp
r10580 r10587 22 22 t_eph::t_eph() { 23 23 _checkState = unchecked; 24 _ ephType = undefined;24 _type = undefined; 25 25 _orbCorr = 0; 26 26 _clkCorr = 0; … … 109 109 // 110 110 ////////////////////////////////////////////////////////////////////////////// 111 t_irc t_eph::setEphType(QString ephTypeStr) {112 113 if ( ephTypeStr == "LNAV") {114 _ ephType = t_eph::LNAV;115 } else if ( ephTypeStr == "FDMA") {116 _ ephType = t_eph::FDMA;117 } else if ( ephTypeStr == "FNAV") {118 _ ephType = t_eph::FNAV;119 } else if ( ephTypeStr == "INAV") {120 _ ephType = t_eph::INAF;121 } else if ( ephTypeStr == "D1") {122 _ ephType = t_eph::D1;123 } else if ( ephTypeStr == "D2") {124 _ ephType = t_eph::D2;125 } else if ( ephTypeStr == "SBAS") {126 _ ephType = t_eph::SBASL1;127 } else if ( ephTypeStr == "CNAV") {128 _ ephType = t_eph::CNAV;129 } else if ( ephTypeStr == "CNV1") {130 _ ephType = t_eph::CNV1;131 } else if ( ephTypeStr == "CNV2") {132 _ ephType = t_eph::CNV2;133 } else if ( ephTypeStr == "CNV3") {134 _ ephType = t_eph::CNV3;135 } else if ( ephTypeStr == "L1NV") {136 _ ephType = t_eph::L1NV;137 } else if ( ephTypeStr == "L1OC") {138 _ ephType = t_eph::L1OC;139 } else if ( ephTypeStr == "L3OC") {140 _ ephType = t_eph::L3OC;111 void t_eph::setType(QString typeStr) { 112 113 if (typeStr == "LNAV") { 114 _type = t_eph::LNAV; 115 } else if (typeStr == "FDMA") { 116 _type = t_eph::FDMA; 117 } else if (typeStr == "FNAV") { 118 _type = t_eph::FNAV; 119 } else if (typeStr == "INAV") { 120 _type = t_eph::INAV; 121 } else if (typeStr == "D1") { 122 _type = t_eph::D1; 123 } else if (typeStr == "D2") { 124 _type = t_eph::D2; 125 } else if (typeStr == "SBAS") { 126 _type = t_eph::SBASL1; 127 } else if (typeStr == "CNAV") { 128 _type = t_eph::CNAV; 129 } else if (typeStr == "CNV1") { 130 _type = t_eph::CNV1; 131 } else if (typeStr == "CNV2") { 132 _type = t_eph::CNV2; 133 } else if (typeStr == "CNV3") { 134 _type = t_eph::CNV3; 135 } else if (typeStr == "L1NV") { 136 _type = t_eph::L1NV; 137 } else if (typeStr == "L1OC") { 138 _type = t_eph::L1OC; 139 } else if (typeStr == "L3OC") { 140 _type = t_eph::L3OC; 141 141 } else { 142 _ephType = t_eph::undefined; 143 return failure; 144 } 145 146 return success; 142 _type = t_eph::undefined; 143 } 144 147 145 } 148 146 149 147 // 150 148 ////////////////////////////////////////////////////////////////////////////// 151 QString t_eph:: ephTypeStr(e_ephType ephType, const t_prn &prn, double version) {152 QString ephTypeStr = "";149 QString t_eph::typeStr(e_type type, const t_prn &prn, double version) { 150 QString typeStr = ""; 153 151 QString epochStart; 154 152 QString eolStr; 155 153 156 154 if (version < 4.0) { 157 return ephTypeStr;158 } 159 160 if (version == 99.0) { 155 return typeStr; 156 } 157 158 if (version == 99.0) { // log output for OUTDATED, WRONG or UNHEALTHY satellites 161 159 epochStart = ""; 162 160 eolStr = ""; … … 167 165 168 166 QString ephStr = QString("EPH %1 ").arg(prn.toString().c_str()); 169 switch ( ephType) {167 switch (type) { 170 168 case undefined: 171 ephTypeStr = epochStart + ephStr + "unknown" + eolStr;169 typeStr = epochStart + ephStr + "unknown" + eolStr; 172 170 break; 173 171 case LNAV: 174 ephTypeStr = epochStart + ephStr + "LNAV" + eolStr;172 typeStr = epochStart + ephStr + "LNAV" + eolStr; 175 173 break; 176 174 case FDMA: 177 ephTypeStr = epochStart + ephStr + "FDMA" + eolStr;175 typeStr = epochStart + ephStr + "FDMA" + eolStr; 178 176 break; 179 177 case FNAV: 180 ephTypeStr = epochStart + ephStr + "FNAV" + eolStr;178 typeStr = epochStart + ephStr + "FNAV" + eolStr; 181 179 break; 182 case INA F:183 ephTypeStr = epochStart + ephStr + "INAV" + eolStr;180 case INAV: 181 typeStr = epochStart + ephStr + "INAV" + eolStr; 184 182 break; 185 183 case D1: 186 ephTypeStr = epochStart + ephStr + "D1 " + eolStr;184 typeStr = epochStart + ephStr + "D1 " + eolStr; 187 185 break; 188 186 case D2: 189 ephTypeStr = epochStart + ephStr + "D2 " + eolStr;187 typeStr = epochStart + ephStr + "D2 " + eolStr; 190 188 break; 191 189 case SBASL1: 192 ephTypeStr = epochStart + ephStr + "SBAS" + eolStr;190 typeStr = epochStart + ephStr + "SBAS" + eolStr; 193 191 break; 194 192 case CNAV: 195 ephTypeStr = epochStart + ephStr + "CNAV" + eolStr;193 typeStr = epochStart + ephStr + "CNAV" + eolStr; 196 194 break; 197 195 case CNV1: 198 ephTypeStr = epochStart + ephStr + "CNV1" + eolStr;196 typeStr = epochStart + ephStr + "CNV1" + eolStr; 199 197 break; 200 198 case CNV2: 201 ephTypeStr = epochStart + ephStr + "CNV2" + eolStr;199 typeStr = epochStart + ephStr + "CNV2" + eolStr; 202 200 break; 203 201 case CNV3: 204 ephTypeStr = epochStart + ephStr + "CNV3" + eolStr;202 typeStr = epochStart + ephStr + "CNV3" + eolStr; 205 203 break; 206 204 case L1NV: 207 ephTypeStr = epochStart + ephStr + "L1NV" + eolStr;205 typeStr = epochStart + ephStr + "L1NV" + eolStr; 208 206 break; 209 207 case L1OC: 210 ephTypeStr = epochStart + ephStr + "L1OC" + eolStr;208 typeStr = epochStart + ephStr + "L1OC" + eolStr; 211 209 break; 212 210 case L3OC: 213 ephTypeStr = epochStart + ephStr + "L3OC" + eolStr;211 typeStr = epochStart + ephStr + "L3OC" + eolStr; 214 212 break; 215 213 } 216 return ephTypeStr;214 return typeStr; 217 215 } 218 216 … … 246 244 << QString(" %1 %2 %3 %4 %5%6").arg(year % 100, 2, 10, QChar('0')).arg( 247 245 month, 2).arg(day, 2).arg(hour, 2).arg(min, 2).arg(sec, 5, 'f', 1); 248 } else if (version == 99) { 246 } 247 else if (version == 99) { 249 248 out 250 249 << QString(" %1 %2 %3 %4 %5 %6").arg(year, 4).arg(month, 2, 10, 251 250 QChar('0')).arg(day, 2, 10, QChar('0')).arg(hour, 2, 10, QChar('0')).arg( 252 251 min, 2, 10, QChar('0')).arg(int(sec), 2, 10, QChar('0')); 253 } else { 252 } 253 else { 254 254 out << prnStr 255 255 << QString(" %1 %2 %3 %4 %5 %6").arg(year, 4).arg(month, 2, 10, … … 265 265 t_ephGPS::t_ephGPS(double rnxVersion, const QStringList &lines) { 266 266 267 int nLines = 8; // LNAV, 268 269 if (ephType() == t_eph::CNAV || 270 ephType() == t_eph::L1NV) { 267 int nLines = 8; // LNAV 268 269 // Source RINEX version < 4 270 if (type() == t_eph::undefined) { 271 _type = t_eph::LNAV; 272 } 273 274 if (type() == t_eph::CNAV || 275 type() == t_eph::L1NV) { 271 276 nLines += 1; 272 277 } 273 if ( ephType() == t_eph::CNV2) {278 if (type() == t_eph::CNV2) { 274 279 nLines += 2; 275 280 } … … 283 288 // ------------ 284 289 int fieldLen = 19; 290 double statusflags = 0.0; 285 291 286 292 int pos[4]; … … 290 296 pos[3] = pos[2] + fieldLen; 291 297 292 // Read eightlines293 // ---------------- 298 // Read nLines lines 299 // ------------------ 294 300 for (int iLine = 0; iLine < nLines; iLine++) { 295 301 QString line = lines[iLine]; … … 303 309 in >> prnStr; 304 310 305 if (prnStr.size() == 1 306 && (prnStr[0] == 'G' || prnStr[0] == 'J' || prnStr[0] == 'I')) { 311 if (prnStr.size() == 1 && 312 (prnStr[0] == 'G' || 313 prnStr[0] == 'J' || 314 prnStr[0] == 'I')) { 307 315 in >> n; 308 316 prnStr.append(n); … … 310 318 311 319 in >> year >> month >> day >> hour >> min >> sec; 312 if ( prnStr.at(0) == 'G') {320 if ( prnStr.at(0) == 'G') { 313 321 _prn.set('G', prnStr.mid(1).toInt()); 314 322 } else if (prnStr.at(0) == 'J') { … … 339 347 // ===================== 340 348 else if (iLine == 1) { 341 if ( ephType() == t_eph::CNAV ||342 ephType() == t_eph::CNV2 ||343 ephType() == t_eph::L1NV) {349 if (type() == t_eph::CNAV || 350 type() == t_eph::CNV2 || 351 type() == t_eph::L1NV) { 344 352 if ( readDbl(line, pos[0], fieldLen, _ADOT) 345 353 || readDbl(line, pos[1], fieldLen, _Crs) … … 349 357 return; 350 358 } 351 } else { // LNAV , undefined359 } else { // LNAV 352 360 if ( readDbl(line, pos[0], fieldLen, _IODE) 353 361 || readDbl(line, pos[1], fieldLen, _Crs) … … 375 383 // ===================== 376 384 else if (iLine == 3) { 377 if ( ephType() == t_eph::CNAV ||378 ephType() == t_eph::CNV2) {385 if (type() == t_eph::CNAV || 386 type() == t_eph::CNV2) { 379 387 if ( readDbl(line, pos[0], fieldLen, _top) 380 388 || readDbl(line, pos[1], fieldLen, _Cic) … … 384 392 return; 385 393 } 386 } else if ( ephType() == t_eph::L1NV) {394 } else if (type() == t_eph::L1NV) { 387 395 if ( readDbl(line, pos[0], fieldLen, _IODE) 388 396 || readDbl(line, pos[1], fieldLen, _Cic) … … 392 400 return; 393 401 } 394 } else { // LNAV , undefined402 } else { // LNAV 395 403 if ( readDbl(line, pos[0], fieldLen, _TOEsec) 396 404 || readDbl(line, pos[1], fieldLen, _Cic) … … 417 425 // BROADCAST ORBIT - 5 418 426 // ===================== 419 else if (iLine == 5 && type() != t_eph::IRNSS) {420 if ( ephType() == t_eph::CNAV ||421 ephType() == t_eph::CNV2) {427 else if (iLine == 5 && system() != t_eph::IRNSS) { 428 if (type() == t_eph::CNAV || 429 type() == t_eph::CNV2) { 422 430 if ( readDbl(line, pos[0], fieldLen, _IDOT) 423 431 || readDbl(line, pos[1], fieldLen, _Delta_n_dot) … … 428 436 } 429 437 } 430 else { // LNAV , undefined438 else { // LNAV 431 439 if ( readDbl(line, pos[0], fieldLen, _IDOT) 432 440 || readDbl(line, pos[1], fieldLen, _L2Codes) … … 437 445 } 438 446 } 439 } else if (iLine == 5 && type() == t_eph::IRNSS) { 440 if (ephType() == t_eph::LNAV || 441 ephType() == t_eph::undefined) { 447 } else if (iLine == 5 && system() == t_eph::IRNSS) { 448 if (type() == t_eph::LNAV) { 442 449 if ( readDbl(line, pos[0], fieldLen, _IDOT) 443 450 || readDbl(line, pos[2], fieldLen, _TOEweek)) { … … 446 453 } 447 454 } 448 else if ( ephType() == t_eph::L1NV) {455 else if (type() == t_eph::L1NV) { 449 456 if ( readDbl(line, pos[0], fieldLen, _IDOT) 450 457 || readDbl(line, pos[1], fieldLen, _Delta_n_dot) … … 458 465 // BROADCAST ORBIT - 6 459 466 // ===================== 460 else if (iLine == 6 && type() != t_eph::IRNSS) {461 if ( ephType() == t_eph::CNAV ||462 ephType() == t_eph::CNV2) {467 else if (iLine == 6 && system() != t_eph::IRNSS) { 468 if (type() == t_eph::CNAV || 469 type() == t_eph::CNV2) { 463 470 if ( readDbl(line, pos[0], fieldLen, _URAI_ED) 464 471 || readDbl(line, pos[1], fieldLen, _health) … … 468 475 return; 469 476 } 470 } else { // LNAV , undefined477 } else { // LNAV 471 478 if ( readDbl(line, pos[0], fieldLen, _ura) 472 479 || readDbl(line, pos[1], fieldLen, _health) … … 478 485 } 479 486 } 480 else if (iLine == 6 && type() == t_eph::IRNSS) { 481 if (ephType() == t_eph::LNAV || 482 ephType() == t_eph::undefined) { 487 else if (iLine == 6 && system() == t_eph::IRNSS) { 488 if (type() == t_eph::LNAV) { 483 489 if ( readDbl(line, pos[0], fieldLen, _ura) 484 490 || readDbl(line, pos[1], fieldLen, _health) … … 488 494 } 489 495 } 490 else if ( ephType() == t_eph::L1NV) {496 else if (type() == t_eph::L1NV) { 491 497 int i = 0; 492 498 (!_RSF) ? i = 2 : i = 3; … … 497 503 return; 498 504 } 499 _ura = accuracyFromIndex(int(_URAI), type());505 _ura = accuracyFromIndex(int(_URAI), system()); 500 506 } 501 507 } … … 504 510 // ===================== 505 511 else if (iLine == 7) { 506 if (ephType() == t_eph::LNAV || 507 ephType() == t_eph::undefined) { 512 if (type() == t_eph::LNAV) { 508 513 if (readDbl(line, pos[0], fieldLen, _TOT)) { 509 514 _checkState = bad; 510 515 return; 511 if (type() != t_eph::IRNSS) { 512 double fitIntervalRnx; 513 if (readDbl(line, pos[1], fieldLen, fitIntervalRnx)) { 514 _checkState = bad; 515 return; 516 } 517 if (type() == t_eph::GPS) { // in RINEX specified always as time period for GPS 516 } 517 if (system() != t_eph::IRNSS) { 518 double fitIntervalRnx; 519 if (readDbl(line, pos[1], fieldLen, fitIntervalRnx)) { 520 //fit interval BLK, do nothing 521 _flags_unknown = true; 522 } else { 523 _flags_unknown = false; 524 if (system() == t_eph::GPS) { // in RINEX specified always as time period for GPS 518 525 _fitInterval = fitIntervalRnx; 519 526 } 520 else if ( type() == t_eph::QZSS) { // specified as flag for QZSS527 else if (system() == t_eph::QZSS) { // specified as flag for QZSS 521 528 if (rnxVersion == 3.02) { 522 529 _fitInterval = fitIntervalRnx; // specified as time period … … 528 535 } 529 536 } 530 else if ( ephType() == t_eph::CNAV ||531 ephType() == t_eph::CNV2) {537 else if (type() == t_eph::CNAV || 538 type() == t_eph::CNV2) { 532 539 if ( readDbl(line, pos[0], fieldLen, _ISC_L1CA) 533 540 || readDbl(line, pos[1], fieldLen, _ISC_L2C) … … 538 545 } 539 546 } 540 else if ( ephType() == t_eph::L1NV) {547 else if (type() == t_eph::L1NV) { 541 548 if (!_RSF) { 542 549 if ( readDbl(line, pos[0], fieldLen, _ISC_S) … … 558 565 // ===================== 559 566 else if (iLine == 8) { 560 if (ephType() == t_eph::CNAV) { 561 double intFlags = -1.0; // optional; blank if not provided 567 if (type() == t_eph::CNAV) { 562 568 if ( readDbl(line, pos[0], fieldLen, _TOT) 563 || readDbl(line, pos[1], fieldLen, _wnop) 564 || readDbl(line, pos[2], fieldLen, intFlags)) { 565 _checkState = bad; 566 return; 567 } 568 if (intFlags > -1.0) { 569 || readDbl(line, pos[1], fieldLen, _wnop)) { 570 _checkState = bad; 571 return; 572 } 573 if (readDbl(line, pos[2], fieldLen, statusflags)) { 574 _flags_unknown = true; 575 } 576 else { 577 _flags_unknown = false; 569 578 // Bit 0: 570 _intSF = (int(intFlags) & (1 <<0));579 _intSF = double(bitExtracted(int(statusflags), 1, 0)); 571 580 // Bit 1: 572 _L2Cphasing = (int(intFlags) & (1 <<1));581 _L2Cphasing = double(bitExtracted(int(statusflags), 1, 1)); 573 582 // Bit 2: 574 _alert = (int(intFlags) & (1 <<2));575 } 576 } 577 else if ( ephType() == t_eph::CNV2) {583 _alert = double(bitExtracted(int(statusflags), 1, 2)); 584 } 585 } 586 else if (type() == t_eph::CNV2) { 578 587 if ( readDbl(line, pos[0], fieldLen, _ISC_L1Cd) 579 588 || readDbl(line, pos[1], fieldLen, _ISC_L1Cp)) { … … 582 591 } 583 592 } 584 else if ( ephType() == t_eph::L1NV) {593 else if (type() == t_eph::L1NV) { 585 594 if ( readDbl(line, pos[0], fieldLen, _TOT)) { 586 595 _checkState = bad; … … 593 602 // ===================== 594 603 else if (iLine == 9) { 595 if (ephType() == t_eph::CNV2) { 596 double intFlags = -1.0; 604 if (type() == t_eph::CNV2) { 597 605 if ( readDbl(line, pos[0], fieldLen, _TOT) 598 || readDbl(line, pos[1], fieldLen, _wnop) 599 || readDbl(line, pos[2], fieldLen, intFlags)) { 600 _checkState = bad; 601 return; 602 } 603 if (intFlags > -1.0) { 606 || readDbl(line, pos[1], fieldLen, _wnop)) { 607 _checkState = bad; 608 return; 609 } 610 if (readDbl(line, pos[2], fieldLen, statusflags)) { 611 _flags_unknown = true; 612 } 613 else { 614 _flags_unknown = false; 604 615 // Bit 0: 605 _intSF = (int(intFlags) & (1 <<0));606 if ( type() == t_eph::QZSS) {616 _intSF = double(bitExtracted(int(statusflags), 1, 0)); 617 if (system() == t_eph::QZSS) { 607 618 // Bit 1: 608 _ephSF = (int(intFlags) & (1 <<1));619 _ephSF = double(bitExtracted(int(statusflags), 1, 1)); 609 620 } 610 621 } … … 707 718 QString t_ephGPS::toString(double version) const { 708 719 709 QString ephStr = ephTypeStr(_ephType, _prn, version); 720 if (version < 4.0 && 721 (type() == t_eph::CNAV || 722 type() == t_eph::CNV2 || 723 type() == t_eph::L1NV )) { 724 return ""; 725 } 726 727 QString ephStr = typeStr(_type, _prn, version); 710 728 QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version); 711 729 … … 723 741 // BROADCAST ORBIT - 1 724 742 // ===================== 725 if ( ephType() == t_eph::CNAV ||726 ephType() == t_eph::CNV2 ||727 ephType() == t_eph::L1NV) {743 if (type() == t_eph::CNAV || 744 type() == t_eph::CNV2 || 745 type() == t_eph::L1NV) { 728 746 out 729 747 << QString(fmt) … … 752 770 // BROADCAST ORBIT - 3 753 771 // ===================== 754 if ( ephType() == t_eph::CNAV ||755 ephType() == t_eph::CNV2) {772 if (type() == t_eph::CNAV || 773 type() == t_eph::CNV2) { 756 774 out 757 775 << QString(fmt) … … 761 779 .arg(_Cis, 19, 'e', 12); 762 780 } 763 else if ( ephType() == t_eph::L1NV) {781 else if (type() == t_eph::L1NV) { 764 782 out 765 783 << QString(fmt) … … 789 807 // BROADCAST ORBIT - 5 790 808 // ===================== 791 if ( type() != t_eph::IRNSS) {792 if ( ephType() == t_eph::CNAV ||793 ephType() == t_eph::CNV2) {809 if (system() != t_eph::IRNSS) { 810 if (type() == t_eph::CNAV || 811 type() == t_eph::CNV2) { 794 812 out 795 813 << QString(fmt) … … 809 827 } 810 828 else { 811 if ( ephType() == t_eph::LNAV ||812 ephType() == t_eph::undefined) {829 if (type() == t_eph::LNAV || 830 type() == t_eph::undefined) { 813 831 out 814 832 << QString(fmt) … … 818 836 .arg("", 19, QChar(' ')); 819 837 } 820 else if ( ephType() == t_eph::L1NV) {838 else if (type() == t_eph::L1NV) { 821 839 out 822 840 << QString(fmt) … … 830 848 // BROADCAST ORBIT - 6 831 849 // ===================== 832 if ( type() != t_eph::IRNSS) {833 if ( ephType() == t_eph::CNAV ||834 ephType() == t_eph::CNV2) {850 if (system() != t_eph::IRNSS) { 851 if (type() == t_eph::CNAV || 852 type() == t_eph::CNV2) { 835 853 out 836 854 << QString(fmt) … … 850 868 } 851 869 else { 852 if ( ephType() == t_eph::LNAV ||853 ephType() == t_eph::undefined) {870 if (type() == t_eph::LNAV || 871 type() == t_eph::undefined) { 854 872 out 855 873 << QString(fmt) … … 858 876 .arg(_TGD, 19, 'e', 12); 859 877 } 860 else if ( ephType() == t_eph::L1NV) {878 else if (type() == t_eph::L1NV) { 861 879 int i = 0; (!_RSF) ? i = 2 : i = 3; 862 880 if (i == 2) { … … 881 899 // BROADCAST ORBIT - 7 882 900 // ===================== 883 /* 884 out 885 << QString(fmt) 886 .arg(, 19, 'e', 12) 887 .arg(, 19, 'e', 12) 888 .arg(, 19, 'e', 12) 889 .arg(, 19, 'e', 12); 890 891 */ 892 893 if (ephType() == t_eph::LNAV || 894 ephType() == t_eph::undefined) { 901 if (type() == t_eph::LNAV || 902 type() == t_eph::undefined) { 895 903 896 904 double tot = _TOT; … … 899 907 } 900 908 // fitInterval 901 if ( type() == t_eph::IRNSS) {909 if (system() == t_eph::IRNSS) { 902 910 out 903 911 << QString(fmt) … … 908 916 } 909 917 else { 910 // for GPS and QZSS in version 3.02 specified in hours 911 double fitIntervalRnx = _fitInterval; 912 // otherwise specified as flag 913 if (type() == t_eph::QZSS && version != 3.02) { 914 (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0; 915 } 916 out 917 << QString(fmt) 918 .arg(tot, 19, 'e', 12) 919 .arg(fitIntervalRnx, 19, 'e', 12) 920 .arg("", 19, QChar(' ')) 921 .arg("", 19, QChar(' ')); 922 } 923 } 924 else if (ephType() == t_eph::CNAV || 925 ephType() == t_eph::CNV2) { 918 if (_flags_unknown) { 919 out 920 << QString(fmt) 921 .arg(tot, 19, 'e', 12) 922 .arg("", 19, QChar(' ')) 923 .arg("", 19, QChar(' ')) 924 .arg("", 19, QChar(' ')); 925 } 926 else { 927 // for GPS and QZSS in version 3.02 specified in hours 928 double fitIntervalRnx = _fitInterval; 929 // otherwise specified as flag 930 if (system() == t_eph::QZSS && version != 3.02) { 931 (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0; 932 } 933 out 934 << QString(fmt) 935 .arg(tot, 19, 'e', 12) 936 .arg(fitIntervalRnx, 19, 'e', 12) 937 .arg("", 19, QChar(' ')) 938 .arg("", 19, QChar(' ')); 939 } 940 } 941 } 942 else if (type() == t_eph::CNAV || 943 type() == t_eph::CNV2) { 926 944 out 927 945 << QString(fmt) … … 931 949 .arg(_ISC_L5Q5, 19, 'e', 12); 932 950 } 933 else if ( ephType() == t_eph::L1NV) {951 else if (type() == t_eph::L1NV) { 934 952 if (_RSF) { 935 953 out … … 952 970 // BROADCAST ORBIT - 8 953 971 // ===================== 954 if (ephType() == t_eph::CNAV) { 955 int intFlags; 956 if (_intSF !=-1 ) { 957 intFlags |= (1 << 0); 958 intFlags |= (1 << 1); 959 intFlags |= (1 << 2); 972 if (type() == t_eph::CNAV) { 973 int intFlags = 0; 974 if (!_flags_unknown) { 975 // Bit 0: 976 if (_intSF) {intFlags |= (1 << 0);} 977 // Bit 1: 978 if (_L2Cphasing) {intFlags |= (1 << 1);} 979 // Bit 2: 980 if (_alert) {intFlags |= (1 << 2);} 960 981 out 961 982 << QString(fmt) 962 .arg(_TOT, 19, 'e', 12)963 .arg(_wnop, 19, 'e', 12)964 .arg( intFlags, 19, 'e', 12)965 .arg("", 19, QChar(' '));983 .arg(_TOT, 19, 'e', 12) 984 .arg(_wnop, 19, 'e', 12) 985 .arg(double(intFlags), 19, 'e', 12) 986 .arg("", 19, QChar(' ')); 966 987 } 967 988 else { … … 974 995 } 975 996 } 976 else if ( ephType() == t_eph::CNV2) {997 else if (type() == t_eph::CNV2) { 977 998 out 978 999 << QString(fmt) … … 982 1003 .arg("", 19, QChar(' ')); 983 1004 } 984 else if ( ephType() == t_eph::L1NV) {1005 else if (type() == t_eph::L1NV) { 985 1006 out 986 1007 << QString(fmt) … … 993 1014 // BROADCAST ORBIT - 9 994 1015 // ===================== 995 if (ephType() == t_eph::CNV2) { 996 int intFlags; 997 if (_intSF != -1 ) { 998 intFlags |= (1 << 0); 1016 if (type() == t_eph::CNV2) { 1017 int intFlags = 0; 1018 if (!_flags_unknown) { 1019 // Bit 0: 1020 if (_intSF) {intFlags |= (1 << 0);} 1021 if (system() == t_eph::QZSS) { 1022 // Bit 1: 1023 if (_ephSF) {intFlags |= (1 << 1);} 1024 } 999 1025 out 1000 1026 << QString(fmt) 1001 .arg(_TOT, 19, 'e', 12)1002 .arg(_wnop, 19, 'e', 12)1003 .arg( intFlags, 19, 'e', 12)1004 .arg("", 19, QChar(' '));1027 .arg(_TOT, 19, 'e', 12) 1028 .arg(_wnop, 19, 'e', 12) 1029 .arg(double(intFlags), 19, 'e', 12) 1030 .arg("", 19, QChar(' ')); 1005 1031 } 1006 1032 else { … … 1013 1039 } 1014 1040 } 1015 1016 1041 return rnxStr; 1017 1042 } … … 1022 1047 1023 1048 int nLines = 4; 1049 1050 // Source RINEX version < 4 1051 if (type() == t_eph::undefined) { 1052 _type = t_eph::FDMA; 1053 } 1054 1024 1055 if (rnxVersion >= 3.05) { 1025 1056 nLines += 1; 1026 1057 } else { 1027 1058 _M_delta_tau = 0.9999e9; // unknown 1028 _M_FT = 1.5e1;// unknown1059 _M_FT = 1.5e1; // unknown 1029 1060 } 1030 1061 … … 1039 1070 double statusflags = 0.0; 1040 1071 double healthflags = 0.0; 1072 double sourceflags = 0.0; 1073 _tauC = 0.0; 1074 _tau1 = 0.0; 1075 _tau2 = 0.0; 1076 _additional_data_availability = 0.0; 1041 1077 1042 1078 int pos[4]; … … 1081 1117 _TOC = _TOC + _gps_utc; 1082 1118 int nd = int((_TOC.gpssec())) / (24.0 * 60.0 * 60.0); 1083 if ( readDbl(line, pos[1], fieldLen, _tau)1119 if ( readDbl(line, pos[1], fieldLen, _tau) 1084 1120 || readDbl(line, pos[2], fieldLen, _gamma) 1085 1121 || readDbl(line, pos[3], fieldLen, _tki)) { … … 1094 1130 // ===================== 1095 1131 else if (iLine == 1) { 1096 if ( readDbl(line, pos[0], fieldLen, _x_pos)1097 || readDbl(line, pos[1], fieldLen, _x_vel ocity)1098 || readDbl(line, pos[2], fieldLen, _x_acc eleration)1132 if ( readDbl(line, pos[0], fieldLen, _x_pos) 1133 || readDbl(line, pos[1], fieldLen, _x_vel) 1134 || readDbl(line, pos[2], fieldLen, _x_acc) 1099 1135 || readDbl(line, pos[3], fieldLen, _health)) { 1100 1136 _checkState = bad; … … 1106 1142 // ===================== 1107 1143 else if (iLine == 2) { 1108 if (readDbl(line, pos[0], fieldLen, _y_pos) 1109 || readDbl(line, pos[1], fieldLen, _y_velocity) 1110 || readDbl(line, pos[2], fieldLen, _y_acceleration) 1111 || readDbl(line, pos[3], fieldLen, _frequency_number)) { 1112 _checkState = bad; 1113 return; 1144 if (type() == t_eph::FDMA || 1145 type() == t_eph::undefined) { 1146 if ( readDbl(line, pos[0], fieldLen, _y_pos) 1147 || readDbl(line, pos[1], fieldLen, _y_vel) 1148 || readDbl(line, pos[2], fieldLen, _y_acc) 1149 || readDbl(line, pos[3], fieldLen, _frq_num)) { 1150 _checkState = bad; 1151 return; 1152 } 1153 } 1154 else { //L1OC, L3OC 1155 if ( readDbl(line, pos[0], fieldLen, _y_pos) 1156 || readDbl(line, pos[1], fieldLen, _y_vel) 1157 || readDbl(line, pos[2], fieldLen, _y_acc) 1158 || readDbl(line, pos[3], fieldLen, statusflags)) { 1159 _checkState = bad; 1160 return; 1161 } 1162 _data_validity = int(statusflags); 1114 1163 } 1115 1164 } … … 1118 1167 // ===================== 1119 1168 else if (iLine == 3) { 1120 if (readDbl(line, pos[0], fieldLen, _z_pos) 1121 || readDbl(line, pos[1], fieldLen, _z_velocity) 1122 || readDbl(line, pos[2], fieldLen, _z_acceleration) 1123 || readDbl(line, pos[3], fieldLen, _E)) { 1124 _checkState = bad; 1125 return; 1169 if (type() == t_eph::FDMA || 1170 type() == t_eph::undefined) { 1171 if ( readDbl(line, pos[0], fieldLen, _z_pos) 1172 || readDbl(line, pos[1], fieldLen, _z_vel) 1173 || readDbl(line, pos[2], fieldLen, _z_acc) 1174 || readDbl(line, pos[3], fieldLen, _E)) { 1175 _checkState = bad; 1176 return; 1177 } 1178 } 1179 else if (type() == t_eph::L1OC) { 1180 if ( readDbl(line, pos[0], fieldLen, _z_pos) 1181 || readDbl(line, pos[1], fieldLen, _z_vel) 1182 || readDbl(line, pos[2], fieldLen, _z_acc) 1183 || readDbl(line, pos[3], fieldLen, _TGD_L2OCp)) { 1184 _checkState = bad; 1185 return; 1186 } 1187 } 1188 else if (type() == t_eph::L3OC) { 1189 if ( readDbl(line, pos[0], fieldLen, _z_pos) 1190 || readDbl(line, pos[1], fieldLen, _z_vel) 1191 || readDbl(line, pos[2], fieldLen, _z_acc) 1192 || readDbl(line, pos[3], fieldLen, _TGD_L3OCp)) { 1193 _checkState = bad; 1194 return; 1195 } 1126 1196 } 1127 1197 } … … 1130 1200 // ===================== 1131 1201 else if (iLine == 4) { 1132 if (readDbl(line, pos[0], fieldLen, statusflags)) { 1133 //statusflags BLK, do nothing 1134 _flags_unknown = true; 1135 } else { 1136 _flags_unknown = false; 1137 // status flags 1202 if (type() == t_eph::FDMA || 1203 type() == t_eph::undefined){ 1204 if (readDbl(line, pos[0], fieldLen, statusflags)) { 1205 //status flags BLK, do nothing 1206 _statusflags_unknown = true; 1207 } else { 1208 _statusflags_unknown = false; 1209 // status flags 1210 // ============ 1211 // bit 0-1 1212 _M_P = double(bitExtracted(int(statusflags), 2, 0)); 1213 // bit 2-3 1214 _P1 = double(bitExtracted(int(statusflags), 2, 2)); 1215 // bit 4 1216 _P2 = double(bitExtracted(int(statusflags), 1, 4)); 1217 // bit 5 1218 _P3 = double(bitExtracted(int(statusflags), 1, 5)); 1219 // bit 6 1220 _M_P4 = double(bitExtracted(int(statusflags), 1, 6)); 1221 // bit 7-8 1222 _M_M = double(bitExtracted(int(statusflags), 2, 7)); 1223 /// GLO M/K exclusive flags/values only valid if flag M is set to '01' 1224 if (!_M_M) { 1225 _M_P = 0.0; 1226 _M_l3 = 0.0; 1227 _M_P4 = 0.0; 1228 _M_FE = 0.0; 1229 _M_FT = 0.0; 1230 _M_NA = 0.0; 1231 _M_NT = 0.0; 1232 _M_N4 = 0.0; 1233 _M_l5 = 0.0; 1234 _M_tau_GPS = 0.0; 1235 _M_delta_tau = 0.0; 1236 } 1237 } 1238 if ( readDbl(line, pos[1], fieldLen, _M_delta_tau) 1239 || readDbl(line, pos[2], fieldLen, _M_FT)) { 1240 _checkState = bad; 1241 return; 1242 } 1243 if (readDbl(line, pos[3], fieldLen, healthflags)) { 1244 // health flags BLK 1245 _healthflags_unknown = true; 1246 } else { 1247 _healthflags_unknown = false; 1248 // health flags 1249 // ============ 1250 // bit 0 (is to be ignored, if bit 1 is zero) 1251 _almanac_health = double(bitExtracted(int(healthflags), 1, 0)); 1252 // bit 1 1253 _almanac_health_availablility_indicator = 1254 double(bitExtracted(int(healthflags), 1, 1)); 1255 // bit 2; GLO-M/K only, health bit of string 3 1256 _M_l3 = double(bitExtracted(int(healthflags), 1, 2)); 1257 } 1258 } 1259 else if (type() == t_eph::L1OC || 1260 type() == t_eph::L3OC) { 1261 if ( readDbl(line, pos[0], fieldLen, _sat_type) 1262 || readDbl(line, pos[1], fieldLen, sourceflags) 1263 || readDbl(line, pos[2], fieldLen, _EE) 1264 || readDbl(line, pos[3], fieldLen, _ET)) { 1265 _checkState = bad; 1266 return; 1267 } 1268 // sourceflags: 1138 1269 // ============ 1139 1270 // bit 0-1 1140 _M_P = double(bitExtracted(statusflags, 2, 0)); 1141 // bit 2-3 1142 _P1 = double(bitExtracted(statusflags, 2, 2)); 1143 // bit 4 1144 _P2 = double(bitExtracted(statusflags, 1, 4)); 1145 // bit 5 1146 _P3 = double(bitExtracted(statusflags, 1, 5)); 1147 // bit 6 1148 _M_P4 = double(bitExtracted(statusflags, 1, 6)); 1149 // bit 7-8 1150 _M_M = double(bitExtracted(statusflags, 2, 7)); 1151 /// GLO M/K exclusive flags/values only valid if flag M is set to '01' 1152 if (!_M_M) { 1153 _M_P4 = 0.0; 1154 _M_P = 0.0; 1155 } 1156 } 1157 if (readDbl(line, pos[1], fieldLen, _M_delta_tau) 1158 || readDbl(line, pos[2], fieldLen, _M_FT)) { 1159 _checkState = bad; 1160 return; 1161 } 1162 if (readDbl(line, pos[3], fieldLen, healthflags)) { 1163 // healthflags BLK 1164 _flags_unknown = true; 1165 } else { 1166 _flags_unknown = false; 1167 // health flags 1168 // ============ 1169 // bit 0 (is to be ignored, if bit 1 is zero) 1170 _almanac_health = double(bitExtracted(healthflags, 1, 0)); 1171 // bit 1 1172 _almanac_health_availablility_indicator = double( 1173 bitExtracted(healthflags, 1, 1)); 1174 // bit 2 1175 _M_l3 = double(bitExtracted(healthflags, 1, 2)); 1271 _RT = double(bitExtracted(int(sourceflags), 2, 0)); 1272 // bit 2-3: 1273 _RE = double(bitExtracted(int(sourceflags), 2, 2)); 1274 } 1275 } 1276 // ===================== 1277 // BROADCAST ORBIT - 5 1278 // ===================== 1279 else if (iLine == 5) { 1280 if (type() == t_eph::L1OC || 1281 type() == t_eph::L3OC) { 1282 if ( readDbl(line, pos[0], fieldLen, _attitude_P2) 1283 || readDbl(line, pos[1], fieldLen, _Tin) 1284 || readDbl(line, pos[2], fieldLen, _tau1) 1285 || readDbl(line, pos[3], fieldLen, _tau2)) { 1286 _checkState = bad; 1287 return; 1288 } 1289 } 1290 } 1291 // ===================== 1292 // BROADCAST ORBIT - 6 1293 // ===================== 1294 else if (iLine == 6) { 1295 if (type() == t_eph::L1OC || 1296 type() == t_eph::L3OC) { 1297 if ( readDbl(line, pos[0], fieldLen, _yaw) 1298 || readDbl(line, pos[1], fieldLen, _sn) 1299 || readDbl(line, pos[2], fieldLen, _angular_rate) 1300 || readDbl(line, pos[3], fieldLen, _angular_acc)) { 1301 _checkState = bad; 1302 return; 1303 } 1304 } 1305 } 1306 // ===================== 1307 // BROADCAST ORBIT - 7 1308 // ===================== 1309 else if (iLine == 7) { 1310 if (type() == t_eph::L1OC || 1311 type() == t_eph::L3OC) { 1312 if ( readDbl(line, pos[0], fieldLen, _angular_rate_max) 1313 || readDbl(line, pos[1], fieldLen, _X_PC) 1314 || readDbl(line, pos[2], fieldLen, _Y_PC) 1315 || readDbl(line, pos[3], fieldLen, _Z_PC)) { 1316 _checkState = bad; 1317 return; 1318 } 1319 } 1320 } 1321 // ===================== 1322 // BROADCAST ORBIT - 8 1323 // ===================== 1324 else if (iLine == 8) { 1325 if (type() == t_eph::L1OC || 1326 type() == t_eph::L3OC) { 1327 if ( readDbl(line, pos[0], fieldLen, _M_FE) 1328 || readDbl(line, pos[1], fieldLen, _M_FT) 1329 || readDbl(line, pos[3], fieldLen, _TOT)) { 1330 _checkState = bad; 1331 return; 1332 } 1176 1333 } 1177 1334 } … … 1186 1343 _xv(2) = _y_pos * 1.e3; 1187 1344 _xv(3) = _z_pos * 1.e3; 1188 _xv(4) = _x_vel ocity* 1.e3;1189 _xv(5) = _y_vel ocity* 1.e3;1190 _xv(6) = _z_vel ocity* 1.e3;1345 _xv(4) = _x_vel * 1.e3; 1346 _xv(5) = _y_vel * 1.e3; 1347 _xv(6) = _z_vel * 1.e3; 1191 1348 } 1192 1349 … … 1211 1368 1212 1369 double acc[3]; 1213 acc[0] = _x_acc eleration* 1.e3;1214 acc[1] = _y_acc eleration* 1.e3;1215 acc[2] = _z_acc eleration* 1.e3;1370 acc[0] = _x_acc * 1.e3; 1371 acc[1] = _y_acc * 1.e3; 1372 acc[2] = _z_acc * 1.e3; 1216 1373 1217 1374 for (int ii = 1; ii <= nSteps; ii++) { … … 1245 1402 QString t_ephGlo::toString(double version) const { 1246 1403 1247 QString ephStr = ephTypeStr(_ephType, _prn, version); 1404 if (version < 4.0 && 1405 (type() == t_eph::L1OC || 1406 type() == t_eph::L3OC )) { 1407 return ""; 1408 } 1409 1410 QString ephStr = typeStr(_type, _prn, version); 1248 1411 QString rnxStr = ephStr + rinexDateStr(_TOC - _gps_utc, _prn, version); 1249 1412 int nd = int((_TOC - _gps_utc).gpssec()) / (24.0 * 60.0 * 60.0); … … 1251 1414 1252 1415 out 1253 << QString("%1%2%3\n").arg(-_tau, 19, 'e', 12).arg(_gamma, 19, 'e', 12).arg( 1254 _tki + nd * 86400.0, 19, 'e', 12); 1416 << QString("%1%2%3\n") 1417 .arg(-_tau, 19, 'e', 12) 1418 .arg(_gamma, 19, 'e', 12) 1419 .arg(_tki + nd * 86400.0, 19, 'e', 12); 1255 1420 1256 1421 QString fmt = version < 3.0 ? " %1%2%3%4\n" : " %1%2%3%4\n"; … … 1259 1424 // ===================== 1260 1425 out 1261 << QString(fmt).arg(_x_pos, 19, 'e', 12).arg(_x_velocity, 19, 'e', 12).arg( 1262 _x_acceleration, 19, 'e', 12).arg(_health, 19, 'e', 12); 1426 << QString(fmt) 1427 .arg(_x_pos, 19, 'e', 12) 1428 .arg(_x_vel, 19, 'e', 12) 1429 .arg(_x_acc, 19, 'e', 12) 1430 .arg(_health, 19, 'e', 12); 1431 1263 1432 // ===================== 1264 1433 // BROADCAST ORBIT - 2 1265 1434 // ===================== 1266 out 1267 << QString(fmt).arg(_y_pos, 19, 'e', 12).arg(_y_velocity, 19, 'e', 12).arg( 1268 _y_acceleration, 19, 'e', 12).arg(_frequency_number, 19, 'e', 12); 1435 if (type() == t_eph::FDMA) { 1436 out 1437 << QString(fmt) 1438 .arg(_y_pos, 19, 'e', 12) 1439 .arg(_y_vel, 19, 'e', 12) 1440 .arg(_y_acc, 19, 'e', 12) 1441 .arg(_frq_num, 19, 'e', 12); 1442 } 1443 else { //L1OC, L3OC 1444 out 1445 << QString(fmt) 1446 .arg(_y_pos, 19, 'e', 12) 1447 .arg(_y_vel, 19, 'e', 12) 1448 .arg(_y_acc, 19, 'e', 12) 1449 .arg(double(_data_validity), 19, 'e', 12); 1450 } 1269 1451 // ===================== 1270 1452 // BROADCAST ORBIT - 3 1271 1453 // ===================== 1272 out 1273 << QString(fmt).arg(_z_pos, 19, 'e', 12).arg(_z_velocity, 19, 'e', 12).arg( 1274 _z_acceleration, 19, 'e', 12).arg(_E, 19, 'e', 12); 1275 // ===================== 1276 // BROADCAST ORBIT - 4 1277 // ===================== 1454 if (type() == t_eph::FDMA) { 1455 out 1456 << QString(fmt) 1457 .arg(_z_pos, 19, 'e', 12) 1458 .arg(_z_vel, 19, 'e', 12) 1459 .arg(_z_acc, 19, 'e', 12) 1460 .arg(_E, 19, 'e', 12); 1461 } 1462 else if (type() == t_eph::L1OC) { 1463 out 1464 << QString(fmt) 1465 .arg(_z_pos, 19, 'e', 12) 1466 .arg(_z_vel, 19, 'e', 12) 1467 .arg(_z_acc, 19, 'e', 12) 1468 .arg(_TGD_L2OCp, 19, 'e', 12); 1469 } 1470 else if (type() == t_eph::L3OC) { 1471 out 1472 << QString(fmt) 1473 .arg(_z_pos, 19, 'e', 12) 1474 .arg(_z_vel, 19, 'e', 12) 1475 .arg(_z_acc, 19, 'e', 12) 1476 .arg(_TGD_L3OCp, 19, 'e', 12); 1477 } 1278 1478 if (version >= 3.05) { 1279 // unknown (RINEX version < 3.05) 1280 if (_flags_unknown) { 1479 // ===================== 1480 // BROADCAST ORBIT - 4 1481 // ===================== 1482 if (type() == t_eph::FDMA){ 1483 int statusflags = 0; 1484 int healthflags = 0; 1485 if (!_statusflags_unknown ) { 1486 // bit 0-1 1487 if (_M_P == 1.0) {statusflags |= (1 << 0);} 1488 else if (_M_P == 2.0) {statusflags |= (1 << 1);} 1489 else if (_M_P == 3.0) {statusflags |= (1 << 0); statusflags |= (1 << 1);} 1490 // bit 2-3 1491 if (_P1 == 1.0) {statusflags |= (1 << 2);} 1492 else if (_P1 == 2.0) {statusflags |= (1 << 3);} 1493 else if (_P1 == 3.0) {statusflags |= (1 << 2); statusflags |= (1 << 3);} 1494 // bit 4 1495 if (_P2) {statusflags |= (1 << 4);} 1496 // bit 5 1497 if (_P3) {statusflags |= (1 << 5);} 1498 // bit 6 1499 if (_M_P4) {statusflags |= (1 << 6);} 1500 // bit 7-8 1501 if (_M_M == 1.0) {statusflags |= (1 << 7);} 1502 } 1503 if (!_healthflags_unknown) { 1504 // bit 0 (is to be ignored, if bit 1 is zero) 1505 if (_almanac_health) {healthflags |= (1 << 0);} 1506 // bit 1 1507 if (_almanac_health_availablility_indicator) {healthflags |= (1 << 1);} 1508 // bit 2 1509 if (_M_l3) {healthflags |= (1 << 2);} 1510 } 1511 1512 if (_statusflags_unknown && _healthflags_unknown) { 1513 out 1514 << QString(fmt) 1515 .arg("", 19, QChar(' ')) // status-flags BNK (unknown) 1516 .arg(_M_delta_tau, 19, 'e', 12) 1517 .arg(_M_FT, 19, 'e', 12) 1518 .arg("", 19, QChar(' '));// health-flags BNK (unknown) 1519 } 1520 else if (!_statusflags_unknown && _healthflags_unknown) { 1521 out 1522 << QString(fmt) 1523 .arg(double(statusflags), 19, 'e', 12) 1524 .arg(_M_delta_tau, 19, 'e', 12) 1525 .arg(_M_FT, 19, 'e', 12) 1526 .arg("", 19, QChar(' '));// health-flags BNK (unknown) 1527 } 1528 else if (_statusflags_unknown && !_healthflags_unknown) { 1529 out 1530 << QString(fmt) 1531 .arg("", 19, QChar(' ')) // status-flags BNK (unknown) 1532 .arg(_M_delta_tau, 19, 'e', 12) 1533 .arg(_M_FT, 19, 'e', 12) 1534 .arg(double(healthflags), 19, 'e', 12); 1535 } 1536 else if (!_statusflags_unknown && !_healthflags_unknown) { 1537 out 1538 << QString(fmt) 1539 .arg(double(statusflags), 19, 'e', 12) 1540 .arg(_M_delta_tau, 19, 'e', 12) 1541 .arg(_M_FT, 19, 'e', 12) 1542 .arg(double(healthflags), 19, 'e', 12); 1543 } 1544 } 1545 else if (type() == t_eph::L1OC || 1546 type() == t_eph::L3OC) { 1547 int sourceflags = 0; 1548 // bit 0-1 1549 if (_RT == 1.0) {sourceflags |= (1 << 0);} 1550 else if (_RT == 2.0) {sourceflags |= (1 << 1);} 1551 else if (_RT == 3.0) {sourceflags |= (1 << 0); sourceflags |= (1 << 1);} 1552 // bit 2-3 1553 if (_RE == 1.0) {sourceflags |= (1 << 2);} 1554 else if (_RE == 2.0) {sourceflags |= (1 << 3);} 1555 else if (_RE == 3.0) {sourceflags |= (1 << 2); sourceflags |= (1 << 3);} 1281 1556 out 1282 << QString(fmt).arg("", 19, QChar(' ')) // statusflags blank if unknown 1283 .arg(_M_delta_tau, 19, 'e', 12).arg(_M_FT, 19, 'e', 12).arg("", 19, 1284 QChar(' ')); // healthflags blank if unknown 1285 } else { 1286 int statusflags = 0; 1287 // bit 7-8 1288 if (_M_M == 2.0) { 1289 statusflags |= (1 << 7); 1290 } 1291 // bit 6 1292 if (_M_P4) { 1293 statusflags |= (1 << 6); 1294 } 1295 // bit 5 1296 if (_P3) { 1297 statusflags |= (1 << 5); 1298 } 1299 // bit 4 1300 if (_P2) { 1301 statusflags |= (1 << 4); 1302 } 1303 // bit 2-3 1304 if (_P1 == 2.0) { 1305 statusflags |= (1 << 2); 1306 } else if (_P1 == 1.0) { 1307 statusflags |= (1 << 3); 1308 } else if (_P1 == 3.0) { 1309 statusflags |= (1 << 2); 1310 statusflags |= (1 << 3); 1311 } 1312 // bit 0-1 1313 if (_M_P == 2.0) { 1314 statusflags |= (1 << 0); 1315 } else if (_M_P == 1.0) { 1316 statusflags |= (1 << 1); 1317 } else if (_M_P == 3.0) { 1318 statusflags |= (1 << 0); 1319 statusflags |= (1 << 1); 1320 } 1321 // health flags 1322 // ============ 1323 int healthflags = 0; 1324 // bit 0 (is to be ignored, if bit 1 is zero) 1325 if (_almanac_health) { 1326 healthflags |= (1 << 0); 1327 } 1328 // bit 1 1329 if (_almanac_health_availablility_indicator) { 1330 healthflags |= (1 << 1); 1331 } 1332 // bit 2 1333 if (_M_l3) { 1334 healthflags |= (1 << 2); 1335 } 1557 << QString(fmt) 1558 .arg(_sat_type , 19, 'e', 12) 1559 .arg(double(sourceflags), 19, 'e', 12) 1560 .arg(_ET, 19, 'e', 12) 1561 .arg(_EE, 19, 'e', 12); 1562 } 1563 // ===================== 1564 // BROADCAST ORBIT - 5 1565 // ===================== 1566 if (type() == t_eph::L1OC || 1567 type() == t_eph::L3OC) { 1336 1568 out 1337 << QString(fmt).arg(double(statusflags), 19, 'e', 12).arg( 1338 _M_delta_tau, 19, 'e', 12).arg(_M_FT, 19, 'e', 12).arg( 1339 double(healthflags), 19, 'e', 12); 1340 } 1341 } 1342 1569 << QString(fmt) 1570 .arg(_attitude_P2, 19, 'e', 12) 1571 .arg(_Tin, 19, 'e', 12) 1572 .arg(_tau1, 19, 'e', 12) 1573 .arg(_tau2, 19, 'e', 12); 1574 } 1575 // ===================== 1576 // BROADCAST ORBIT - 6 1577 // ===================== 1578 if (type() == t_eph::L1OC || 1579 type() == t_eph::L3OC) { 1580 out 1581 << QString(fmt) 1582 .arg(_yaw, 19, 'e', 12) 1583 .arg(_sn, 19, 'e', 12) 1584 .arg(_angular_rate, 19, 'e', 12) 1585 .arg(_angular_acc, 19, 'e', 12); 1586 } 1587 // ===================== 1588 // BROADCAST ORBIT - 7 1589 // ===================== 1590 if (type() == t_eph::L1OC || 1591 type() == t_eph::L3OC) { 1592 out 1593 << QString(fmt) 1594 .arg(_angular_rate_max, 19, 'e', 12) 1595 .arg(_X_PC, 19, 'e', 12) 1596 .arg(_Y_PC, 19, 'e', 12) 1597 .arg(_Z_PC, 19, 'e', 12); 1598 } 1599 // ===================== 1600 // BROADCAST ORBIT - 8 1601 // ===================== 1602 if (type() == t_eph::L1OC || 1603 type() == t_eph::L3OC) { 1604 out 1605 << QString(fmt) 1606 .arg(_M_FE, 19, 'e', 12) 1607 .arg(_M_FT, 19, 'e', 12) 1608 .arg("", 19, QChar(' ')) 1609 .arg(_TOT, 19, 'e', 12); 1610 } 1611 } 1343 1612 return rnxStr; 1344 1613 } … … 1455 1724 _TOC.set(year, month, day, hour, min, sec); 1456 1725 1457 if ( readDbl(line, pos[1], fieldLen, _clock_bias)1726 if ( readDbl(line, pos[1], fieldLen, _clock_bias) 1458 1727 || readDbl(line, pos[2], fieldLen, _clock_drift) 1459 1728 || readDbl(line, pos[3], fieldLen, _clock_driftrate)) { … … 1466 1735 // ===================== 1467 1736 else if (iLine == 1) { 1468 if ( readDbl(line, pos[0], fieldLen, _IODnav)1737 if ( readDbl(line, pos[0], fieldLen, _IODnav) 1469 1738 || readDbl(line, pos[1], fieldLen, _Crs) 1470 1739 || readDbl(line, pos[2], fieldLen, _Delta_n) … … 1478 1747 // ===================== 1479 1748 else if (iLine == 2) { 1480 if ( readDbl(line, pos[0], fieldLen, _Cuc)1749 if ( readDbl(line, pos[0], fieldLen, _Cuc) 1481 1750 || readDbl(line, pos[1], fieldLen, _e) 1482 1751 || readDbl(line, pos[2], fieldLen, _Cus) … … 1490 1759 // ===================== 1491 1760 else if (iLine == 3) { 1492 if ( readDbl(line, pos[0], fieldLen, _TOEsec)1761 if ( readDbl(line, pos[0], fieldLen, _TOEsec) 1493 1762 || readDbl(line, pos[1], fieldLen, _Cic) 1494 1763 || readDbl(line, pos[2], fieldLen, _OMEGA0) … … 1502 1771 // ===================== 1503 1772 else if (iLine == 4) { 1504 if ( readDbl(line, pos[0], fieldLen, _i0)1773 if ( readDbl(line, pos[0], fieldLen, _i0) 1505 1774 || readDbl(line, pos[1], fieldLen, _Crc) 1506 1775 || readDbl(line, pos[2], fieldLen, _omega) … … 1514 1783 // ===================== 1515 1784 else if (iLine == 5) { 1516 if ( readDbl(line, pos[0], fieldLen, _IDOT)1785 if ( readDbl(line, pos[0], fieldLen, _IDOT) 1517 1786 || readDbl(line, pos[1], fieldLen, datasource) 1518 1787 || readDbl(line, pos[2], fieldLen, _TOEweek)) { 1519 1788 _checkState = bad; 1520 1789 return; 1521 } else { 1522 if (int(datasource) & (1 << 8)) { 1790 } 1791 else { 1792 if (bitExtracted(int(datasource), 1, 8)) { 1523 1793 _fnav = true; 1524 1794 _inav = false; 1525 } else if (int(datasource) & (1 << 9)) { 1795 /* set unused I/NAV values */ 1796 _E5b_HS = 0.0; 1797 _E1B_HS = 0.0; 1798 _E1B_DataInvalid = false; 1799 _E5b_DataInvalid = false; 1800 // Source RINEX version < 4 1801 if (type() == t_eph::undefined) { 1802 _type = t_eph::FNAV; 1803 } 1804 } 1805 if (bitExtracted(int(datasource), 1, 9)) { 1526 1806 _fnav = false; 1527 1807 _inav = true; 1528 } 1808 /* set unused F/NAV values */ 1809 _E5a_HS = 0.0; 1810 _E5a_DataInvalid = false; 1811 // Source RINEX version < 4 1812 if (type() == t_eph::undefined) { 1813 _type = t_eph::INAV; 1814 } 1815 } 1816 // GAL week # in RINEX is aligned/identical to continuous GPS week # used in RINEX 1817 // but GST week # started at the first GPS roll-over (continuous GPS week 1024) 1529 1818 _TOEweek -= 1024.0; 1530 1819 } … … 1534 1823 // ===================== 1535 1824 else if (iLine == 6) { 1536 if ( readDbl(line, pos[0], fieldLen, _SISA)1825 if ( readDbl(line, pos[0], fieldLen, _SISA) 1537 1826 || readDbl(line, pos[1], fieldLen, SVhealth) 1538 1827 || readDbl(line, pos[2], fieldLen, _BGD_1_5A) … … 1542 1831 } else { 1543 1832 // Bit 0 1544 _ e1DataInvalid = (int(SVhealth) & (1 << 0));1833 _E1B_DataInvalid = bitExtracted(int(SVhealth), 1, 0); 1545 1834 // Bit 1-2 1546 _E1 _bHS = double((int(SVhealth) >> 1) & 0x3);1835 _E1B_HS = double(bitExtracted(int(SVhealth), 2, 1)); 1547 1836 // Bit 3 1548 _ e5aDataInvalid = (int(SVhealth) & (1 << 3));1837 _E5a_DataInvalid = bitExtracted(int(SVhealth), 1, 3); 1549 1838 // Bit 4-5 1550 _E5a HS = double((int(SVhealth) >> 4) & 0x3);1839 _E5a_HS = double(bitExtracted(int(SVhealth), 2, 4)); 1551 1840 // Bit 6 1552 _ e5bDataInvalid = (int(SVhealth) & (1 << 6));1841 _E5b_DataInvalid = bitExtracted(int(SVhealth), 1, 6); 1553 1842 // Bit 7-8 1554 _E5bHS = double((int(SVhealth) >> 7) & 0x3); 1555 1843 _E5b_HS = double(bitExtracted(int(SVhealth), 2, 7)); 1844 if (_fnav) { 1845 _BGD_1_5B = 0.0; 1846 } 1556 1847 if (prnStr.at(0) == 'E') { 1557 1848 _prn.set('E', prnStr.mid(1).toInt(), _inav ? 1 : 0); … … 1663 1954 //////////////////////////////////////////////////////////////////////////// 1664 1955 unsigned int t_ephGal::isUnhealthy() const { 1665 if (_E5aHS == 1 || _E5aHS == 3 || _E5bHS == 1 || _E5bHS == 3 || _E1_bHS == 1 1666 || _E1_bHS == 3) { 1956 // SHS; 1 = Out of Service, 3 = In Test, 0 = Signal Ok, 2 = Extended Operations Mode 1957 if (_E5a_HS == 1 || _E5a_HS == 3 || 1958 _E5b_HS == 1 || _E5b_HS == 3 || 1959 _E1B_HS == 1 || _E1B_HS == 3) { 1667 1960 return 1; 1668 1961 } 1669 if (_e5aDataInvalid || _e5bDataInvalid || _e1DataInvalid) { 1962 if (_E5a_DataInvalid || 1963 _E5b_DataInvalid || 1964 _E1B_DataInvalid) { 1670 1965 return 1; 1671 1966 } 1672 if (_SISA == 255.0) { 1967 if (_SISA == 255.0) { // NAPA: No Accuracy Prediction Available 1673 1968 return 1; 1674 1969 } … … 1677 1972 * It also means that the satellite signal may be used for PNT. 1678 1973 if (_E5aHS == 2 || 1679 _E5bHS == 2 ||1680 _E1_bHS == 2 ) {1681 return 1;1974 _E5bHS == 2 || 1975 _E1_bHS == 2 ) { 1976 return 1; 1682 1977 } 1683 1978 */ 1684 1979 return 0; 1980 1685 1981 } 1686 1982 … … 1689 1985 QString t_ephGal::toString(double version) const { 1690 1986 1691 QString ephStr = ephTypeStr(_ephType, _prn, version);1987 QString ephStr = typeStr(_type, _prn, version); 1692 1988 QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version); 1693 1989 … … 1703 1999 // ===================== 1704 2000 out 1705 << QString(fmt).arg(_IODnav, 19, 'e', 12).arg(_Crs, 19, 'e', 12).arg( 1706 _Delta_n, 19, 'e', 12).arg(_M0, 19, 'e', 12); 2001 << QString(fmt) 2002 .arg(_IODnav, 19, 'e', 12) 2003 .arg(_Crs, 19, 'e', 12) 2004 .arg(_Delta_n, 19, 'e', 12) 2005 .arg(_M0, 19, 'e', 12); 1707 2006 // ===================== 1708 2007 // BROADCAST ORBIT - 2 1709 2008 // ===================== 1710 2009 out 1711 << QString(fmt).arg(_Cuc, 19, 'e', 12).arg(_e, 19, 'e', 12).arg(_Cus, 19, 1712 'e', 12).arg(_sqrt_A, 19, 'e', 12); 2010 << QString(fmt) 2011 .arg(_Cuc, 19, 'e', 12). 2012 arg(_e, 19, 'e', 12) 2013 .arg(_Cus, 19, 'e', 12) 2014 .arg(_sqrt_A, 19, 'e', 12); 1713 2015 // ===================== 1714 2016 // BROADCAST ORBIT - 3 1715 2017 // ===================== 1716 2018 out 1717 << QString(fmt).arg(_TOEsec, 19, 'e', 12).arg(_Cic, 19, 'e', 12).arg( 1718 _OMEGA0, 19, 'e', 12).arg(_Cis, 19, 'e', 12); 2019 << QString(fmt). 2020 arg(_TOEsec, 19, 'e', 12) 2021 .arg(_Cic, 19, 'e', 12) 2022 .arg(_OMEGA0, 19, 'e', 12) 2023 .arg(_Cis, 19, 'e', 12); 1719 2024 // ===================== 1720 2025 // BROADCAST ORBIT - 4 1721 2026 // ===================== 1722 2027 out 1723 << QString(fmt).arg(_i0, 19, 'e', 12).arg(_Crc, 19, 'e', 12).arg(_omega, 1724 19, 'e', 12).arg(_OMEGADOT, 19, 'e', 12); 1725 // ===================== 1726 // BROADCAST ORBIT - 5 2028 << QString(fmt) 2029 .arg(_i0, 19, 'e', 12) 2030 .arg(_Crc, 19, 'e', 12) 2031 .arg(_omega, 19, 'e', 12) 2032 .arg(_OMEGADOT, 19, 'e', 12); 2033 // ===================== 2034 // BROADCAST ORBIT - 5/6 1727 2035 // ===================== 1728 2036 int dataSource = 0; … … 1736 2044 // SVhealth 1737 2045 // Bit 3 : E5a DVS 1738 if (_ e5aDataInvalid) {2046 if (_E5a_DataInvalid) { 1739 2047 SVhealth |= (1 << 3); 1740 2048 } 1741 2049 // Bit 4-5: E5a HS 1742 if (_E5aHS == 1.0) {2050 if (_E5a_HS == 1.0) { 1743 2051 SVhealth |= (1 << 4); 1744 } else if (_E5aHS == 2.0) { 2052 } 2053 else if (_E5a_HS == 2.0) { 1745 2054 SVhealth |= (1 << 5); 1746 } else if (_E5aHS == 3.0) { 2055 } 2056 else if (_E5a_HS == 3.0) { 1747 2057 SVhealth |= (1 << 4); 1748 2058 SVhealth |= (1 << 5); … … 1756 2066 // SVhealth 1757 2067 // Bit 0 : E1-B DVS 1758 if (_ e1DataInvalid) {2068 if (_E1B_DataInvalid) { 1759 2069 SVhealth |= (1 << 0); 1760 2070 } 1761 2071 // Bit 1-2: E1-B HS 1762 if (_E1_bHS == 1.0) {2072 if (_E1B_HS == 1.0) { 1763 2073 SVhealth |= (1 << 1); 1764 } else if (_E1_bHS == 2.0) { 2074 } 2075 else if (_E1B_HS == 2.0) { 1765 2076 SVhealth |= (1 << 2); 1766 } else if (_E1_bHS == 3.0) { 2077 } 2078 else if (_E1B_HS == 3.0) { 1767 2079 SVhealth |= (1 << 1); 1768 2080 SVhealth |= (1 << 2); 1769 2081 } 1770 // Bit 3 : E5a DVS1771 if (_e5aDataInvalid) {1772 SVhealth |= (1 << 3);1773 }1774 // Bit 4-5: E5a HS1775 if (_E5aHS == 1.0) {1776 SVhealth |= (1 << 4);1777 } else if (_E5aHS == 2.0) {1778 SVhealth |= (1 << 5);1779 } else if (_E5aHS == 3.0) {1780 SVhealth |= (1 << 4);1781 SVhealth |= (1 << 5);1782 }1783 2082 // Bit 6 : E5b DVS 1784 if (_ e5bDataInvalid) {2083 if (_E5b_DataInvalid) { 1785 2084 SVhealth |= (1 << 6); 1786 2085 } 1787 2086 // Bit 7-8: E5b HS 1788 if (_E5b HS == 1.0) {2087 if (_E5b_HS == 1.0) { 1789 2088 SVhealth |= (1 << 7); 1790 } else if (_E5bHS == 2.0) { 2089 } 2090 else if (_E5b_HS == 2.0) { 1791 2091 SVhealth |= (1 << 8); 1792 } else if (_E5bHS == 3.0) { 2092 } 2093 else if (_E5b_HS == 3.0) { 1793 2094 SVhealth |= (1 << 7); 1794 2095 SVhealth |= (1 << 8); 1795 2096 } 1796 2097 } 1797 2098 // ===================== 2099 // BROADCAST ORBIT - 5 2100 // ===================== 1798 2101 out 1799 << QString(fmt).arg(_IDOT, 19, 'e', 12).arg(double(dataSource), 19, 'e', 1800 12).arg(_TOEweek + 1024.0, 19, 'e', 12).arg(0.0, 19, 'e', 12); 2102 << QString(fmt) 2103 .arg(_IDOT, 19, 'e', 12) 2104 .arg(double(dataSource), 19, 'e', 12) 2105 .arg(_TOEweek + 1024.0, 19, 'e', 12) 2106 .arg(0.0, 19, 'e', 12); 1801 2107 // ===================== 1802 2108 // BROADCAST ORBIT - 6 1803 2109 // ===================== 1804 2110 out 1805 << QString(fmt).arg(_SISA, 19, 'e', 12).arg(double(SVhealth), 19, 'e', 12).arg( 1806 BGD_1_5A, 19, 'e', 12).arg(BGD_1_5B, 19, 'e', 12); 2111 << QString(fmt) 2112 .arg(_SISA, 19, 'e', 12) 2113 .arg(double(SVhealth), 19, 'e', 12) 2114 .arg(BGD_1_5A, 19, 'e', 12) 2115 .arg(BGD_1_5B, 19, 'e', 12); 1807 2116 // ===================== 1808 2117 // BROADCAST ORBIT - 7 … … 1813 2122 } 1814 2123 out 1815 << QString(fmt).arg(tot, 19, 'e', 12).arg("", 19, QChar(' ')).arg("", 19, 1816 QChar(' ')).arg("", 19, QChar(' ')); 2124 << QString(fmt) 2125 .arg(tot, 19, 'e', 12) 2126 .arg("", 19, QChar(' ')) 2127 .arg("", 19, QChar(' ')) 2128 .arg("", 19, QChar(' ')); 1817 2129 1818 2130 return rnxStr; … … 1824 2136 1825 2137 const int nLines = 4; 2138 2139 // Source RINEX version < 4 2140 if (type() == t_eph::undefined) { 2141 _type = t_eph::SBASL1; 2142 } 1826 2143 1827 2144 if (lines.size() != nLines) { … … 1872 2189 _TOC.set(year, month, day, hour, min, sec); 1873 2190 1874 if ( readDbl(line, pos[1], fieldLen, _agf0)2191 if ( readDbl(line, pos[1], fieldLen, _agf0) 1875 2192 || readDbl(line, pos[2], fieldLen, _agf1) 1876 2193 || readDbl(line, pos[3], fieldLen, _TOT)) { … … 1883 2200 // ===================== 1884 2201 else if (iLine == 1) { 1885 if ( readDbl(line, pos[0], fieldLen, _x_pos)1886 || readDbl(line, pos[1], fieldLen, _x_vel ocity)1887 || readDbl(line, pos[2], fieldLen, _x_acc eleration)2202 if ( readDbl(line, pos[0], fieldLen, _x_pos) 2203 || readDbl(line, pos[1], fieldLen, _x_vel) 2204 || readDbl(line, pos[2], fieldLen, _x_acc) 1888 2205 || readDbl(line, pos[3], fieldLen, _health)) { 1889 2206 _checkState = bad; … … 1895 2212 // ===================== 1896 2213 else if (iLine == 2) { 1897 if ( readDbl(line, pos[0], fieldLen, _y_pos)1898 || readDbl(line, pos[1], fieldLen, _y_vel ocity)1899 || readDbl(line, pos[2], fieldLen, _y_acc eleration)2214 if ( readDbl(line, pos[0], fieldLen, _y_pos) 2215 || readDbl(line, pos[1], fieldLen, _y_vel) 2216 || readDbl(line, pos[2], fieldLen, _y_acc) 1900 2217 || readDbl(line, pos[3], fieldLen, _ura)) { 1901 2218 _checkState = bad; … … 1908 2225 else if (iLine == 3) { 1909 2226 double iodn; 1910 if ( readDbl(line, pos[0], fieldLen, _z_pos)1911 || readDbl(line, pos[1], fieldLen, _z_vel ocity)1912 || readDbl(line, pos[2], fieldLen, _z_acc eleration)2227 if ( readDbl(line, pos[0], fieldLen, _z_pos) 2228 || readDbl(line, pos[1], fieldLen, _z_vel) 2229 || readDbl(line, pos[2], fieldLen, _z_acc) 1913 2230 || readDbl(line, pos[3], fieldLen, iodn)) { 1914 2231 _checkState = bad; … … 1919 2236 } 1920 2237 } 1921 1922 2238 _x_pos *= 1.e3; 1923 2239 _y_pos *= 1.e3; 1924 2240 _z_pos *= 1.e3; 1925 _x_vel ocity*= 1.e3;1926 _y_vel ocity*= 1.e3;1927 _z_vel ocity*= 1.e3;1928 _x_acc eleration*= 1.e3;1929 _y_acc eleration*= 1.e3;1930 _z_acc eleration*= 1.e3;2241 _x_vel *= 1.e3; 2242 _y_vel *= 1.e3; 2243 _z_vel *= 1.e3; 2244 _x_acc *= 1.e3; 2245 _y_acc *= 1.e3; 2246 _z_acc *= 1.e3; 1931 2247 } 1932 2248 … … 1944 2260 SBASADDBITSFLOAT(30, this->_y_pos, 0.08) 1945 2261 SBASADDBITSFLOAT(25, this->_z_pos, 0.4) 1946 SBASADDBITSFLOAT(17, this->_x_vel ocity, 0.000625)1947 SBASADDBITSFLOAT(17, this->_y_vel ocity, 0.000625)1948 SBASADDBITSFLOAT(18, this->_z_vel ocity, 0.004)1949 SBASADDBITSFLOAT(10, this->_x_acc eleration, 0.0000125)1950 SBASADDBITSFLOAT(10, this->_y_acc eleration, 0.0000125)1951 SBASADDBITSFLOAT(10, this->_z_acc eleration, 0.0000625)2262 SBASADDBITSFLOAT(17, this->_x_vel, 0.000625) 2263 SBASADDBITSFLOAT(17, this->_y_vel, 0.000625) 2264 SBASADDBITSFLOAT(18, this->_z_vel, 0.004) 2265 SBASADDBITSFLOAT(10, this->_x_acc, 0.0000125) 2266 SBASADDBITSFLOAT(10, this->_y_acc, 0.0000125) 2267 SBASADDBITSFLOAT(10, this->_z_acc, 0.0000625) 1952 2268 SBASADDBITSFLOAT(12, this->_agf0, 1953 2269 1.0 / static_cast<double>(1 << 30) / static_cast<double>(1 << 1)) … … 1967 2283 double dt = tt - _TOC; 1968 2284 1969 xc[0] = _x_pos + _x_vel ocity * dt + _x_acceleration* dt * dt / 2.0;1970 xc[1] = _y_pos + _y_vel ocity * dt + _y_acceleration* dt * dt / 2.0;1971 xc[2] = _z_pos + _z_vel ocity * dt + _z_acceleration* dt * dt / 2.0;1972 1973 vv[0] = _x_vel ocity + _x_acceleration* dt;1974 vv[1] = _y_vel ocity + _y_acceleration* dt;1975 vv[2] = _z_vel ocity + _z_acceleration* dt;2285 xc[0] = _x_pos + _x_vel * dt + _x_acc * dt * dt / 2.0; 2286 xc[1] = _y_pos + _y_vel * dt + _y_acc * dt * dt / 2.0; 2287 xc[2] = _z_pos + _z_vel * dt + _z_acc * dt * dt / 2.0; 2288 2289 vv[0] = _x_vel + _x_acc * dt; 2290 vv[1] = _y_vel + _y_acc * dt; 2291 vv[2] = _z_vel + _z_acc * dt; 1976 2292 1977 2293 xc[3] = _agf0 + _agf1 * dt; … … 2012 2328 QString t_ephSBAS::toString(double version) const { 2013 2329 2014 QString ephStr = ephTypeStr(_ephType, _prn, version);2330 QString ephStr = typeStr(_type, _prn, version); 2015 2331 QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version); 2016 2332 … … 2018 2334 2019 2335 out 2020 << QString("%1%2%3\n").arg(_agf0, 19, 'e', 12).arg(_agf1, 19, 'e', 12).arg( 2021 _TOT, 19, 'e', 12); 2336 << QString("%1%2%3\n") 2337 .arg(_agf0, 19, 'e', 12) 2338 .arg(_agf1, 19, 'e', 12) 2339 .arg(_TOT, 19, 'e', 12); 2022 2340 2023 2341 QString fmt = version < 3.0 ? " %1%2%3%4\n" : " %1%2%3%4\n"; … … 2026 2344 // ===================== 2027 2345 out 2028 << QString(fmt).arg(1.e-3 * _x_pos, 19, 'e', 12).arg(1.e-3 * _x_velocity, 2029 19, 'e', 12).arg(1.e-3 * _x_acceleration, 19, 'e', 12).arg(_health, 2030 19, 'e', 12); 2346 << QString(fmt) 2347 .arg(1.e-3 * _x_pos, 19, 'e', 12) 2348 .arg(1.e-3 * _x_vel, 19, 'e', 12) 2349 .arg(1.e-3 * _x_acc, 19, 'e', 12) 2350 .arg(_health, 19, 'e', 12); 2031 2351 // ===================== 2032 2352 // BROADCAST ORBIT - 2 2033 2353 // ===================== 2034 2354 out 2035 << QString(fmt).arg(1.e-3 * _y_pos, 19, 'e', 12).arg(1.e-3 * _y_velocity, 2036 19, 'e', 12).arg(1.e-3 * _y_acceleration, 19, 'e', 12).arg(_ura, 19, 2037 'e', 12); 2355 << QString(fmt) 2356 .arg(1.e-3 * _y_pos, 19, 'e', 12) 2357 .arg(1.e-3 * _y_vel, 19, 'e', 12) 2358 .arg(1.e-3 * _y_acc, 19, 'e', 12) 2359 .arg(_ura, 19, 'e', 12); 2038 2360 // ===================== 2039 2361 // BROADCAST ORBIT - 3 2040 2362 // ===================== 2041 2363 out 2042 << QString(fmt).arg(1.e-3 * _z_pos, 19, 'e', 12).arg(1.e-3 * _z_velocity, 2043 19, 'e', 12).arg(1.e-3 * _z_acceleration, 19, 'e', 12).arg( 2044 double(_IODN), 19, 'e', 12); 2364 << QString(fmt) 2365 .arg(1.e-3 * _z_pos, 19, 'e', 12) 2366 .arg(1.e-3 * _z_vel, 19, 'e', 12) 2367 .arg(1.e-3 * _z_acc, 19, 'e', 12) 2368 .arg(double(_IODN), 19, 'e', 12); 2045 2369 2046 2370 return rnxStr; … … 2053 2377 int nLines = 8; 2054 2378 2055 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) { 2379 if (type() == t_eph::CNV1 || 2380 type() == t_eph::CNV2) { 2056 2381 nLines += 2; 2057 2382 } 2058 if ( ephType() == t_eph::CNV3) {2383 if (type() == t_eph::CNV3) { 2059 2384 nLines += 1; 2060 2385 } … … 2107 2432 _TOC.setBDS(year, month, day, hour, min, sec); 2108 2433 2109 if ( readDbl(line, pos[1], fieldLen, _clock_bias)2434 if ( readDbl(line, pos[1], fieldLen, _clock_bias) 2110 2435 || readDbl(line, pos[2], fieldLen, _clock_drift) 2111 2436 || readDbl(line, pos[3], fieldLen, _clock_driftrate)) { … … 2118 2443 // ===================== 2119 2444 else if (iLine == 1) { 2120 double aode; 2121 if (readDbl(line, pos[0], fieldLen, aode) 2122 || readDbl(line, pos[1], fieldLen, _Crs) 2123 || readDbl(line, pos[2], fieldLen, _Delta_n) 2124 || readDbl(line, pos[3], fieldLen, _M0)) { 2125 _checkState = bad; 2126 return; 2127 } 2128 _AODE = int(aode); 2445 if (type() == t_eph::D1 || 2446 type() == t_eph::D2 || 2447 type() == t_eph::undefined) { 2448 double aode; 2449 if ( readDbl(line, pos[0], fieldLen, aode) 2450 || readDbl(line, pos[1], fieldLen, _Crs) 2451 || readDbl(line, pos[2], fieldLen, _Delta_n) 2452 || readDbl(line, pos[3], fieldLen, _M0)) { 2453 _checkState = bad; 2454 return; 2455 } 2456 _AODE = int(aode); 2457 } 2458 else { //CNV1, CNV2, CNV3 2459 if ( readDbl(line, pos[0], fieldLen, _ADOT) 2460 || readDbl(line, pos[1], fieldLen, _Crs) 2461 || readDbl(line, pos[2], fieldLen, _Delta_n) 2462 || readDbl(line, pos[3], fieldLen, _M0)) { 2463 _checkState = bad; 2464 return; 2465 } 2466 } 2129 2467 } 2130 2468 // ===================== … … 2132 2470 // ===================== 2133 2471 else if (iLine == 2) { 2134 if ( readDbl(line, pos[0], fieldLen, _Cuc)2472 if ( readDbl(line, pos[0], fieldLen, _Cuc) 2135 2473 || readDbl(line, pos[1], fieldLen, _e) 2136 2474 || readDbl(line, pos[2], fieldLen, _Cus) … … 2144 2482 // ===================== 2145 2483 else if (iLine == 3) { 2146 if ( readDbl(line, pos[0], fieldLen, _TOEsec)2484 if ( readDbl(line, pos[0], fieldLen, _TOEsec) 2147 2485 || readDbl(line, pos[1], fieldLen, _Cic) 2148 2486 || readDbl(line, pos[2], fieldLen, _OMEGA0) … … 2156 2494 // ===================== 2157 2495 else if (iLine == 4) { 2158 if ( readDbl(line, pos[0], fieldLen, _i0)2496 if ( readDbl(line, pos[0], fieldLen, _i0) 2159 2497 || readDbl(line, pos[1], fieldLen, _Crc) 2160 2498 || readDbl(line, pos[2], fieldLen, _omega) … … 2163 2501 return; 2164 2502 } 2503 else { 2504 // Source RINEX version < 4 2505 if (type() == t_eph::undefined) { 2506 const double iMaxGEO = 10.0 / 180.0 * M_PI; 2507 if (_i0 > iMaxGEO) { 2508 _type = t_eph::D1; 2509 } 2510 else { 2511 _type = t_eph::D2; 2512 } 2513 } 2514 } 2165 2515 } 2166 2516 // ===================== … … 2168 2518 // ===================== 2169 2519 else if (iLine == 5) { 2170 2171 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV22172 || ephType() == t_eph::CNV3) {2173 if ( readDbl(line, pos[0], fieldLen, _IDOT)2520 if (type() == t_eph::CNV1 || 2521 type() == t_eph::CNV2 || 2522 type() == t_eph::CNV3) { 2523 if ( readDbl(line, pos[0], fieldLen, _IDOT) 2174 2524 || readDbl(line, pos[1], fieldLen, _Delta_n_dot) 2175 2525 || readDbl(line, pos[2], fieldLen, _satType) … … 2178 2528 return; 2179 2529 } 2180 } else { // D1, D2, undefined 2181 if (readDbl(line, pos[0], fieldLen, _IDOT) 2530 } 2531 else { // D1, D2 2532 if ( readDbl(line, pos[0], fieldLen, _IDOT) 2182 2533 || readDbl(line, pos[2], fieldLen, _BDTweek)) { 2183 2534 _checkState = bad; … … 2190 2541 // ===================== 2191 2542 else if (iLine == 6) { 2192 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2 2193 || ephType() == t_eph::CNV3) { 2194 if (readDbl(line, pos[0], fieldLen, _SISAI_oe) 2543 if (type() == t_eph::CNV1 || 2544 type() == t_eph::CNV2 || 2545 type() == t_eph::CNV3) { 2546 if ( readDbl(line, pos[0], fieldLen, _SISAI_oe) 2195 2547 || readDbl(line, pos[1], fieldLen, _SISAI_ocb) 2196 2548 || readDbl(line, pos[2], fieldLen, _SISAI_oc1) … … 2199 2551 return; 2200 2552 } 2201 } else { // D1, D2, undefined 2553 } 2554 else { // D1, D2 2202 2555 double SatH1; 2203 if ( readDbl(line, pos[0], fieldLen, _URA)2556 if ( readDbl(line, pos[0], fieldLen, _ura) 2204 2557 || readDbl(line, pos[1], fieldLen, SatH1) 2205 2558 || readDbl(line, pos[2], fieldLen, _TGD1) … … 2215 2568 // ===================== 2216 2569 else if (iLine == 7) { 2217 if ( ephType() == t_eph::CNV1) {2218 if ( readDbl(line, pos[0], fieldLen, _ISC_B1Cd)2570 if (type() == t_eph::CNV1) { 2571 if ( readDbl(line, pos[0], fieldLen, _ISC_B1Cd) 2219 2572 || readDbl(line, pos[2], fieldLen, _TGD_B1Cp) 2220 2573 || readDbl(line, pos[3], fieldLen, _TGD_B2ap)) { … … 2222 2575 return; 2223 2576 } 2224 } else if (ephType() == t_eph::CNV2) { 2225 if (readDbl(line, pos[1], fieldLen, _ISC_B2ad) 2577 } 2578 else if (type() == t_eph::CNV2) { 2579 if ( readDbl(line, pos[1], fieldLen, _ISC_B2ad) 2226 2580 || readDbl(line, pos[2], fieldLen, _TGD_B1Cp) 2227 2581 || readDbl(line, pos[3], fieldLen, _TGD_B2ap)) { … … 2229 2583 return; 2230 2584 } 2231 } else if (ephType() == t_eph::CNV3) { 2585 } 2586 else if (type() == t_eph::CNV3) { 2232 2587 double health; 2233 if ( readDbl(line, pos[0], fieldLen, _SISMAI)2588 if ( readDbl(line, pos[0], fieldLen, _SISMAI) 2234 2589 || readDbl(line, pos[1], fieldLen, health) 2235 2590 || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b) … … 2239 2594 } 2240 2595 _health = int(health); 2241 } else { // D1, D2 or undefined 2596 } 2597 else { // D1, D2 2242 2598 double aodc; 2243 if ( readDbl(line, pos[0], fieldLen, _TOT)2599 if ( readDbl(line, pos[0], fieldLen, _TOT) 2244 2600 || readDbl(line, pos[1], fieldLen, aodc)) { 2245 2601 _checkState = bad; … … 2257 2613 else if (iLine == 8) { 2258 2614 double health; 2259 if ( ephType() == t_eph::CNV1) {2260 if ( readDbl(line, pos[0], fieldLen, _SISMAI)2615 if (type() == t_eph::CNV1) { 2616 if ( readDbl(line, pos[0], fieldLen, _SISMAI) 2261 2617 || readDbl(line, pos[1], fieldLen, health) 2262 2618 || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C) … … 2266 2622 } 2267 2623 _health = int(health); 2268 } else if (ephType() == t_eph::CNV2) { 2269 if (readDbl(line, pos[0], fieldLen, _SISMAI) 2624 } 2625 else if (type() == t_eph::CNV2) { 2626 if ( readDbl(line, pos[0], fieldLen, _SISMAI) 2270 2627 || readDbl(line, pos[1], fieldLen, health) 2271 2628 || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C) … … 2275 2632 } 2276 2633 _health = int(health); 2277 } else if (ephType() == t_eph::CNV3) { 2634 } 2635 else if (type() == t_eph::CNV3) { 2278 2636 if (readDbl(line, pos[0], fieldLen, _TOT)) { 2279 2637 _checkState = bad; … … 2281 2639 } 2282 2640 } 2283 2284 2641 } 2285 2642 // ===================== … … 2287 2644 // ===================== 2288 2645 else if (iLine == 9) { 2289 2290 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {2291 if ( readDbl(line, pos[0], fieldLen, _TOT)2646 if (type() == t_eph::CNV1 || 2647 type() == t_eph::CNV2) { 2648 if ( readDbl(line, pos[0], fieldLen, _TOT) 2292 2649 || readDbl(line, pos[3], fieldLen, _IODE)) { 2293 2650 _checkState = bad; … … 2295 2652 } 2296 2653 } 2297 2298 2654 } 2299 2655 } … … 2488 2844 unsigned int t_ephBDS::isUnhealthy() const { 2489 2845 2490 if ( ephType() == t_eph::CNV1 || ephType() == t_eph::CNV22491 || ephType() == t_eph::CNV3) {2846 if (type() == t_eph::CNV1 || type() == t_eph::CNV2 2847 || type() == t_eph::CNV3) { 2492 2848 return static_cast<unsigned int>(_health); 2493 2849 } … … 2501 2857 QString t_ephBDS::toString(double version) const { 2502 2858 2503 QString ephStr = ephTypeStr(_ephType, _prn, version); 2859 if (version < 4.0 && 2860 (type() == t_eph::CNV1 || 2861 type() == t_eph::CNV2 || 2862 type() == t_eph::CNV3 )) { 2863 return ""; 2864 } 2865 2866 QString ephStr = typeStr(_type, _prn, version); 2504 2867 QString rnxStr = ephStr + rinexDateStr(_TOC - 14.0, _prn, version); 2505 2868 … … 2507 2870 2508 2871 out 2509 << QString("%1%2%3\n").arg(_clock_bias, 19, 'e', 12).arg(_clock_drift, 19, 2510 'e', 12).arg(_clock_driftrate, 19, 'e', 12); 2872 << QString("%1%2%3\n") 2873 .arg(_clock_bias, 19, 'e', 12) 2874 .arg(_clock_drift, 19, 'e', 12) 2875 .arg(_clock_driftrate, 19, 'e', 12); 2511 2876 2512 2877 QString fmt = version < 3.0 ? " %1%2%3%4\n" : " %1%2%3%4\n"; … … 2514 2879 // BROADCAST ORBIT - 1 2515 2880 // ===================== 2881 if (type() == t_eph::D1 || 2882 type() == t_eph::D2 || 2883 type() == t_eph::undefined) { 2884 out 2885 << QString(fmt) 2886 .arg(double(_AODE), 19, 'e', 12) 2887 .arg(_Crs, 19, 'e', 12) 2888 .arg(_Delta_n, 19, 'e', 12) 2889 .arg(_M0, 19, 'e', 12); 2890 } 2891 else { //CNV1, CNV2, CNV3 2892 out 2893 << QString(fmt) 2894 .arg(_ADOT, 19, 'e', 12) 2895 .arg(_Crs, 19, 'e', 12) 2896 .arg(_Delta_n, 19, 'e', 12) 2897 .arg(_M0, 19, 'e', 12); 2898 } 2899 2900 // ===================== 2901 // BROADCAST ORBIT - 2 2902 // ===================== 2516 2903 out 2517 << QString(fmt).arg(double(_AODE), 19, 'e', 12).arg(_Crs, 19, 'e', 12).arg( 2518 _Delta_n, 19, 'e', 12).arg(_M0, 19, 'e', 12); 2519 // ===================== 2520 // BROADCAST ORBIT - 2 2904 << QString(fmt) 2905 .arg(_Cuc, 19, 'e', 12) 2906 .arg(_e, 19, 'e', 12) 2907 .arg(_Cus, 19, 'e', 12) 2908 .arg(_sqrt_A, 19, 'e', 12); 2909 2910 // ===================== 2911 // BROADCAST ORBIT - 3 2521 2912 // ===================== 2522 2913 out 2523 << QString(fmt).arg(_Cuc, 19, 'e', 12).arg(_e, 19, 'e', 12).arg(_Cus, 19, 2524 'e', 12).arg(_sqrt_A, 19, 'e', 12); 2525 // ===================== 2526 // BROADCAST ORBIT - 3 2914 << QString(fmt) 2915 .arg(_TOEsec, 19, 'e', 12) 2916 .arg(_Cic, 19, 'e', 12) 2917 .arg(_OMEGA0, 19, 'e', 12) 2918 .arg(_Cis, 19, 'e', 12); 2919 // ===================== 2920 // BROADCAST ORBIT - 4 2527 2921 // ===================== 2528 2922 out 2529 << QString(fmt).arg(_TOEsec, 19, 'e', 12).arg(_Cic, 19, 'e', 12).arg( 2530 _OMEGA0, 19, 'e', 12).arg(_Cis, 19, 'e', 12); 2531 // ===================== 2532 // BROADCAST ORBIT - 4 2533 // ===================== 2534 out 2535 << QString(fmt).arg(_i0, 19, 'e', 12).arg(_Crc, 19, 'e', 12).arg(_omega, 2536 19, 'e', 12).arg(_OMEGADOT, 19, 'e', 12); 2923 << QString(fmt) 2924 .arg(_i0, 19, 'e', 12) 2925 .arg(_Crc, 19, 'e', 12) 2926 .arg(_omega, 19, 'e', 12) 2927 .arg(_OMEGADOT, 19, 'e', 12); 2537 2928 // ===================== 2538 2929 // BROADCAST ORBIT - 5 2539 2930 // ===================== 2540 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2 2541 || ephType() == t_eph::CNV3) { 2931 if (type() == t_eph::CNV1 || 2932 type() == t_eph::CNV2 || 2933 type() == t_eph::CNV3) { 2542 2934 out 2543 << QString(fmt).arg(_IDOT, 19, 'e', 12).arg(_Delta_n_dot, 19, 'e', 12).arg( 2544 _satType, 19, 'e', 12).arg(_top, 19, 'e', 12); 2545 } else { // D1, D2, undefined 2935 << QString(fmt) 2936 .arg(_IDOT, 19, 'e', 12) 2937 .arg(_Delta_n_dot, 19, 'e', 12) 2938 .arg(_satType, 19, 'e', 12) 2939 .arg(_top, 19, 'e', 12); 2940 } 2941 else { // D1, D2, 2546 2942 out 2547 << QString(fmt).arg(_IDOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg( 2548 _BDTweek, 19, 'e', 12).arg("", 19, QChar(' ')); 2943 << QString(fmt) 2944 .arg(_IDOT, 19, 'e', 12) 2945 .arg("", 19, QChar(' ')) 2946 .arg(_BDTweek, 19, 'e', 12) 2947 .arg("", 19, QChar(' ')); 2549 2948 } 2550 2949 // ===================== 2551 2950 // BROADCAST ORBIT - 6 2552 2951 // ===================== 2553 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2 2554 || ephType() == t_eph::CNV3) { 2952 if (type() == t_eph::CNV1 || 2953 type() == t_eph::CNV2 || 2954 type() == t_eph::CNV3) { 2555 2955 out 2556 << QString(fmt).arg(_SISAI_oe, 19, 'e', 12).arg(_SISAI_ocb, 19, 'e', 12).arg( 2557 _SISAI_oc1, 19, 'e', 12).arg(_SISAI_oc2, 19, 'e', 12); 2558 } else { // D1, D2, undefined 2956 << QString(fmt) 2957 .arg(_SISAI_oe, 19, 'e', 12) 2958 .arg(_SISAI_ocb, 19, 'e', 12) 2959 .arg(_SISAI_oc1, 19, 'e', 12) 2960 .arg(_SISAI_oc2, 19, 'e', 12); 2961 } 2962 else { // D1, D2, undefined 2559 2963 out 2560 << QString(fmt).arg(_URA, 19, 'e', 12).arg(double(_SatH1), 19, 'e', 12).arg( 2561 _TGD1, 19, 'e', 12).arg(_TGD2, 19, 'e', 12); 2964 << QString(fmt) 2965 .arg(_ura, 19, 'e', 12) 2966 .arg(double(_SatH1), 19, 'e', 12) 2967 .arg(_TGD1, 19, 'e', 12) 2968 .arg(_TGD2, 19, 'e', 12); 2562 2969 } 2563 2970 // ===================== 2564 2971 // BROADCAST ORBIT - 7 2565 2972 // ===================== 2566 if ( ephType() == t_eph::CNV1) {2973 if (type() == t_eph::CNV1) { 2567 2974 out 2568 << QString(fmt).arg(_ISC_B1Cd, 19, 'e', 12).arg("", 19, QChar(' ')).arg( 2569 _TGD_B1Cp, 19, 'e', 12).arg(_TGD_B2ap, 19, 'e', 12); 2570 } else if (ephType() == t_eph::CNV2) { 2975 << QString(fmt) 2976 .arg(_ISC_B1Cd, 19, 'e', 12) 2977 .arg("", 19, QChar(' ')) 2978 .arg(_TGD_B1Cp, 19, 'e', 12) 2979 .arg(_TGD_B2ap, 19, 'e', 12); 2980 } 2981 else if (type() == t_eph::CNV2) { 2571 2982 out 2572 << QString(fmt).arg("", 19, QChar(' ')).arg(_ISC_B2ad, 19, 'e', 12).arg( 2573 _TGD_B1Cp, 19, 'e', 12).arg(_TGD_B2ap, 19, 'e', 12); 2574 } else if (ephType() == t_eph::CNV3) { 2983 << QString(fmt) 2984 .arg("", 19, QChar(' ')) 2985 .arg(_ISC_B2ad, 19, 'e', 12) 2986 .arg(_TGD_B1Cp, 19, 'e', 12) 2987 .arg(_TGD_B2ap, 19, 'e', 12); 2988 } 2989 else if (type() == t_eph::CNV3) { 2575 2990 out 2576 << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e', 2577 12).arg(_INTEGRITYF_B2b, 19, 'e', 12).arg(_TGD_B2bI, 19, 'e', 12); 2578 } else { // D1, D2, undefined 2991 << QString(fmt) 2992 .arg(_SISMAI, 19, 'e', 12) 2993 .arg(double(_health), 19, 'e', 12) 2994 .arg(_INTEGRITYF_B2b, 19, 'e', 12) 2995 .arg(_TGD_B2bI, 19, 'e', 12); 2996 } 2997 else { // D1, D2, undefined 2579 2998 double tots = 0.0; 2580 2999 if (_receptDateTime.isValid()) { // RTCM stream input … … 2584 3003 } 2585 3004 out 2586 << QString(fmt).arg(tots, 19, 'e', 12).arg(double(_AODC), 19, 'e', 12).arg( 2587 "", 19, QChar(' ')).arg("", 19, QChar(' ')); 3005 << QString(fmt) 3006 .arg(tots, 19, 'e', 12) 3007 .arg(double(_AODC), 19, 'e', 12) 3008 .arg("", 19, QChar(' ')) 3009 .arg("", 19, QChar(' ')); 2588 3010 } 2589 3011 … … 2591 3013 // BROADCAST ORBIT - 8 2592 3014 // ===================== 2593 if ( ephType() == t_eph::CNV1) {3015 if (type() == t_eph::CNV1) { 2594 3016 out 2595 << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e', 2596 12).arg(_INTEGRITYF_B1C, 19, 'e', 12).arg(_IODC, 19, 'e', 12); 2597 } else if (ephType() == t_eph::CNV2) { 3017 << QString(fmt) 3018 .arg(_SISMAI, 19, 'e', 12) 3019 .arg(double(_health), 19, 'e', 12) 3020 .arg(_INTEGRITYF_B1C, 19, 'e', 12) 3021 .arg(_IODC, 19, 'e', 12); 3022 } 3023 else if (type() == t_eph::CNV2) { 2598 3024 out 2599 << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e', 2600 12).arg(_INTEGRITYF_B2aB1C, 19, 'e', 12).arg(_IODC, 19, 'e', 12); 2601 } else if (ephType() == t_eph::CNV3) { 3025 << QString(fmt) 3026 .arg(_SISMAI, 19, 'e', 12) 3027 .arg(double(_health), 19, 'e', 12) 3028 .arg(_INTEGRITYF_B2aB1C, 19, 'e', 12) 3029 .arg(_IODC, 19, 'e', 12); 3030 } 3031 else if (type() == t_eph::CNV3) { 2602 3032 out 2603 << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("", 2604 19, QChar(' ')).arg("", 19, QChar(' ')); 3033 << QString(fmt) 3034 .arg(_TOT, 19, 'e', 12) 3035 .arg("", 19, QChar(' ')) 3036 .arg("", 19, QChar(' ')) 3037 .arg("", 19, QChar(' ')); 2605 3038 } 2606 3039 … … 2608 3041 // BROADCAST ORBIT - 9 2609 3042 // ===================== 2610 if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) { 3043 if (type() == t_eph::CNV1 || 3044 type() == t_eph::CNV2) { 2611 3045 out 2612 << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("", 2613 19, QChar(' ')).arg(_IODE, 19, 'e', 12); 3046 << QString(fmt) 3047 .arg(_TOT, 19, 'e', 12) 3048 .arg("", 19, QChar(' ')) 3049 .arg("", 19, QChar(' ')) 3050 .arg(_IODE, 19, 'e', 12); 2614 3051 } 2615 3052 -
trunk/BNC/src/ephemeris.h
r10580 r10587 13 13 class t_orbCorr; 14 14 class t_clkCorr; 15 enum e_navType {EPH, STO, EOP, ION};16 15 17 16 class t_eph { 18 17 public: 19 enum e_ type{unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS};18 enum e_system {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS}; 20 19 enum e_checkState {unchecked, ok, bad, outdated, unhealthy}; 21 enum e_ ephType {undefined, LNAV, FDMA, FNAV, INAF, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3, L1NV, L1OC, L3OC};20 enum e_type {undefined, LNAV, FDMA, FNAV, INAV, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3, L1NV, L1OC, L3OC}; 22 21 23 22 t_eph(); 24 23 virtual ~t_eph(); 25 24 26 virtual e_ type type() const = 0;25 virtual e_system system() const = 0; 27 26 virtual QString toString(double version) const = 0; 28 27 virtual unsigned int IOD() const = 0; … … 43 42 } 44 43 } 45 e_ ephType ephType() const {return _ephType;}46 t_irc setEphType(QString ephTypeStr);44 e_type type() const {return _type;} 45 void setType(QString typeStr); 47 46 48 47 t_prn prn() const {return _prn;} … … 54 53 static QString rinexDateStr(const bncTime& tt, const t_prn& prn, double version); 55 54 static QString rinexDateStr(const bncTime& tt, const QString& prnStr, double version); 56 static QString ephTypeStr(e_ephType ephType, const t_prn& prn, double version);55 static QString typeStr(e_type type, const t_prn& prn, double version); 57 56 static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {return eph1->_TOC < eph2->_TOC;} 58 57 static bool prnSort(const t_eph* eph1, const t_eph* eph2) {return eph1->prn() < eph2->prn();} … … 65 64 QString _receptStaID; 66 65 e_checkState _checkState; 67 e_ ephType _ephType; // defined in RINEX 466 e_type _type; // defined in RINEX 4 68 67 t_orbCorr* _orbCorr; 69 68 t_clkCorr* _clkCorr; … … 123 122 _ISC_L1P = 0.0; 124 123 _wnop = 0.0; 125 _intSF = -1; 126 _ephSF = -1; 127 _L2Cphasing = -1; 128 _alert = -1; 124 _flags_unknown = true; 125 _intSF = 0.0; 126 _ephSF = 0.0; 127 _L2Cphasing = 0.0; 128 _alert = 0.0; 129 129 _receptStaID = ""; 130 130 } … … 132 132 virtual ~t_ephGPS() {} 133 133 134 virtual e_ type type() const {134 virtual e_system system() const { 135 135 switch (_prn.system()) { 136 136 case 'J': … … 208 208 double _ISC_L1P; // [s] 209 209 210 int _intSF; // [-] integrity status flag 211 int _ephSF; // [-] ephemeris status flag (QZSS) 212 int _L2Cphasing; // [-] L2C phasing flag 213 int _alert; // [-] alert flag 210 bool _flags_unknown; // [-] status flags are unknown => BNK; fitInterval LNAV from QZSS or GPS 211 double _intSF; // [-] integrity status flag 212 double _ephSF; // [-] ephemeris status flag (QZSS) 213 double _L2Cphasing; // [-] L2C phasing flag 214 double _alert; // [-] alert flag 214 215 215 216 double _wnop; // GPS continuous week number with the ambiguity resolved (same as _TOEweek?) … … 221 222 public: 222 223 t_ephGlo() { 223 _xv.ReSize(6); _xv = 0.0; 224 _gps_utc = 0.0; 225 _tau = 0.0; 226 _gamma = 0.0; 227 _tki = 0.0; 228 _x_pos = 0.0; 229 _x_velocity = 0.0; 230 _x_acceleration = 0.0; 231 _health = 0.0; 232 _y_pos = 0.0; 233 _y_velocity = 0.0; 234 _y_acceleration = 0.0; 235 _frequency_number = 0.0; 236 _z_pos = 0.0; 237 _z_velocity = 0.0; 238 _z_acceleration = 0.0; 239 _E = 0.0; 240 _almanac_health = 0.0; 224 _xv.ReSize(6); 225 _xv = 0.0; 226 _gps_utc = 0.0; 227 _tau = 0.0; 228 _tau1 = 0.0; 229 _tau2 = 0.0; 230 _tauC = 0.0; 231 _Tin = 0.0; 232 _gamma = 0.0; 233 _tki = 0.0; 234 _x_pos = 0.0; 235 _x_vel = 0.0; 236 _x_acc = 0.0; 237 _health = 0.0; 238 _y_pos = 0.0; 239 _y_vel = 0.0; 240 _y_acc = 0.0; 241 _frq_num = 0.0; 242 _z_pos = 0.0; 243 _z_vel = 0.0; 244 _z_acc = 0.0; 245 _E = 0.0; 246 _EE = 0.0; 247 _ET = 0.0; 248 _RE = 0.0; 249 _RT = 0.0; 250 _P1 = 0.0; 251 _P2 = 0.0; 252 _P3 = 0.0; 253 _M_M = 0.0; 254 _M_FE = 0.0; 255 _M_FT = 0.0; 256 _M_l3 = 0.0; 257 _M_l5 = 0.0; 258 _M_NA = 0.0; 259 _M_NT = 0.0; 260 _M_N4 = 0.0; 261 _M_P = 0.0; 262 _M_P4 = 0.0; 263 _X_PC = 0.0; 264 _Y_PC = 0.0; 265 _Z_PC = 0.0; 266 _TOT = 0.0; 267 _yaw = 0.0; 268 _sn = 0.0; 269 _sat_type = 0.0; 270 _TGD_L2OCp = 0.0; 271 _TGD_L3OCp = 0.0; 272 _M_tau_GPS = 0.0; 273 _M_delta_tau = 0.0; 274 _attitude_P2 = 0.0; 275 _angular_rate = 0.0; 276 _angular_acc = 0.0; 277 _angular_rate_max = 0.0; 278 _data_validity = 0; 279 _healthflags_unknown = false; 280 _statusflags_unknown = false; 281 _almanac_health = 0.0; 241 282 _almanac_health_availablility_indicator = 0.0; 242 283 _additional_data_availability = 0.0; 243 _tauC = 0.0; 244 _P1 = 0.0; 245 _P2 = 0.0; 246 _P3 = 0.0; 247 _NA = 0.0; 248 _M_P = 0.0; 249 _M_l3 = 0.0; 250 _M_delta_tau = 0.0; 251 _M_P4 = 0.0; 252 _M_FT = 0.0; 253 _M_NT = 0.0; 254 _M_M = 0.0; 255 _M_N4 = 0.0; 256 _M_tau_GPS = 0.0; 257 _M_l5 = 0.0; 258 _receptStaID = ""; 259 _flags_unknown = true; 284 260 285 } 261 286 t_ephGlo(double rnxVersion, const QStringList& lines); 262 287 virtual ~t_ephGlo() {} 263 288 264 virtual e_ type type() const {return t_eph::GLONASS;}289 virtual e_system system() const {return t_eph::GLONASS;} 265 290 virtual QString toString(double version) const; 266 291 virtual unsigned int IOD() const; 267 292 virtual unsigned int isUnhealthy() const; 268 virtual int slotNum() const {return int(_fr equency_number);}293 virtual int slotNum() const {return int(_frq_num);} 269 294 270 295 private: … … 272 297 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, double* acc); 273 298 274 mutable bncTime _tt; // time 275 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt 276 277 double _gps_utc; 278 double _tau; // [s] 279 double _gamma; // [-] 280 mutable double _tki; // message frame time 281 282 double _x_pos; // [km] 283 double _x_velocity; // [km/s] 284 double _x_acceleration; // [km/s^2] 285 double _health; // 0 = O.K. MSB of Bn word 286 287 double _y_pos; // [km] 288 double _y_velocity; // [km/s] 289 double _y_acceleration; // [km/s^2] 290 double _frequency_number; // ICD-GLONASS data position 291 292 double _z_pos; // [km] 293 double _z_velocity; // [km/s] 294 double _z_acceleration; // [km/s^2] 295 double _E; // Age of Information [days] 296 297 double _almanac_health; // Cn word 298 double _almanac_health_availablility_indicator; 299 300 double _additional_data_availability; // 301 double _tauC; // GLONASS time scale correction to UTC(SU) time [sec] 302 double _P1; // flag of the immediate data updating [-] 303 double _P2; // flag of oddness or evenness of the value of tb for intervals 30 or 60 minutes [-] 304 double _P3; // flag indicating a number of satellites for which almanac is transmitted within given frame [-] 305 double _NA; // calendar day number within the 4-year period [days] 306 307 double _M_P; // control segment parameter that indicates the satellite operation mode with respect of time parameters 308 double _M_l3; // health flag 309 double _M_delta_tau; // [sec] 310 double _M_P4; // flag to show that ephemeris parameters are present [-] 311 double _M_FT; // Indicator for predicted satellite User Range Accuracy (URAI) [-] 312 double _M_NT; // current date, calendar number of day within 4-year interval [days] 313 double _M_M; // type of satellite transmitting navigation signal: 0 = GLONASS, 1 = GLONASS-M satellite [-] 314 double _M_N4; // 4-year interval number starting from 1996 315 double _M_tau_GPS; // correction to GPS time relative to GLONASS time [days] 316 double _M_l5; // health flag 317 bool _flags_unknown; // status and health flags are unknown (rnx version < 3.05) or known (rnx version >= 3.05) 299 mutable bncTime _tt; // time 300 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt 301 302 double _gps_utc; // [s] 303 double _tau; // [s] 304 double _tau1; // [s] 305 double _tau2; // [s] 306 double _tauC; // GLONASS time scale correction to UTC(SU) [sec] 307 double _Tin; // sec of day UTC(SU) [s] 308 309 double _gamma; // [-] 310 mutable double _tki; // message frame time 311 312 double _x_pos; // [km] 313 double _x_vel; // [km/s] 314 double _x_acc; // [km/s^2] 315 double _health; // 0 = OK. MSB of Bn word 316 317 double _y_pos; // [km] 318 double _y_vel; // [km/s] 319 double _y_acc; // [km/s^2] 320 double _frq_num; // ICD-GLONASS data position 321 322 double _z_pos; // [km] 323 double _z_vel; // [km/s] 324 double _z_acc; // [km/s^2] 325 326 double _E; // Age of current Information [days] 327 double _EE; // Age Of Data eph [days] 328 double _ET; // Age Of Data clk [days] 329 330 double _TGD_L2OCp; // [sec] 331 double _TGD_L3OCp; // [sec] 332 333 double _almanac_health ; // almanac health bit; 1 = healthy, 1 = not healthy 334 double _almanac_health_availablility_indicator; // 1 = reported in eph record, 0 = not reported 335 double _additional_data_availability; 336 337 double _sat_type; // 0 = GLO_SAT, 1 = GLO_SAT_M (M type), 2 = GLO_SAT_K (K type) 338 double _RE; // source flags; 01 = relay; 10 = prediction (propagation), 11 = use of inter-satellite measurements 339 double _RT; // source flags; 01 = relay, 10 = prediction (propagation), 11 = use of inter-satellite measurements 340 341 double _P1; // update and validity interval [-]; 00 = 0 min, 01 = 30 min, 10 ) 45 min, 11 = 60 min 342 double _P2; // flag of oddness or evenness of the value of tb for intervals 30 or 60 minutes [-] 343 double _P3; // flag indicating a number of satellites for which almanac is transmitted within given frame [-] 344 345 double _M_M; // type of satellite transmitting navigation signal: 0 = GLONASS, 1 = GLONASS-M/K satellite [-] 346 double _M_FE; // Indicator for predicted satellite User Range Accuracy (URAI_orb) [-] 347 double _M_FT; // Indicator for predicted satellite User Range Accuracy (URAI_clk) [-] 348 double _M_l3; // health bit on string 3 GLO-M/K only 349 double _M_l5; // health flag 350 double _M_NA; // calendar day number within the 4-year period [days] 351 double _M_NT; // current date, calendar number of day within 4-year interval [days] 352 double _M_N4; // 4-year interval number starting from 1996 353 double _M_P; // control segment parameter that indicates the satellite operation mode with respect of time parameters 354 double _M_P4; // flag to show that ephemeris parameters are present [-] GLO-M/K only 355 double _M_tau_GPS; // correction to GPS time relative to GLONASS time [days] 356 double _M_delta_tau; // [s] 357 358 bool _statusflags_unknown;// status flags are unknown => BNK in RNX NAV file if message type is FDMA 359 bool _healthflags_unknown;// health flags are unknown => BNK in RNX NAV file if message type is FDMA 360 int _data_validity; // data validity; 0 = valid, 1 = invalid 361 362 double _attitude_P2; // 0 = nominal yaw steering, 1 = rate-limited yaw maneuver 363 double _yaw; // [rad] 364 double _sn; // sign flag 365 double _angular_rate; // [rad/sec] 366 double _angular_rate_max; // [rad/sec] 367 double _angular_acc; // [rad/sec^2] 368 369 double _X_PC; // X PC coord [m] GLO manufacturer coordinate system 370 double _Y_PC; // Y PC coord [m] GLO manufacturer coordinate system 371 double _Z_PC; // Y PC coord [m] GLO manufacturer coordinate system 372 double _TOT; // Time of transmission 318 373 }; 319 374 … … 345 400 _TOEweek = 0.0; 346 401 _SISA = 0.0; 347 _E5a HS= 0.0;348 _E5b HS= 0.0;349 _E1 _bHS = 0.0;402 _E5a_HS = 0.0; 403 _E5b_HS = 0.0; 404 _E1B_HS = 0.0; 350 405 _BGD_1_5A = 0.0; 351 406 _BGD_1_5B = 0.0; … … 353 408 _inav = false; 354 409 _fnav = false; 355 _ e1DataInvalid= false;356 _ e5aDataInvalid= false;357 _ e5bDataInvalid= false;410 _E1B_DataInvalid = false; 411 _E5a_DataInvalid = false; 412 _E5b_DataInvalid = false; 358 413 _receptStaID = ""; 359 414 }; … … 362 417 363 418 virtual QString toString(double version) const; 364 virtual e_ type type() const {return t_eph::Galileo;}419 virtual e_system system() const {return t_eph::Galileo;} 365 420 virtual unsigned int IOD() const { return static_cast<unsigned long>(_IODnav); } 366 421 virtual unsigned int isUnhealthy() const; … … 394 449 395 450 double _IDOT; // [rad/s] 396 double _TOEweek; 451 double _TOEweek; // [-] 397 452 // spare 398 453 399 454 mutable double _SISA; // Signal In Space Accuracy 400 double _E5a HS;// [0..3] E5a Health Status401 double _E5b HS;// [0..3] E5b Health Status402 double _E1 _bHS; // [0..3] E1-bHealth Status455 double _E5a_HS; // [0..3] E5a Health Status 456 double _E5b_HS; // [0..3] E5b Health Status 457 double _E1B_HS; // [0..3] E1B Health Status 403 458 double _BGD_1_5A; // group delay [s] 404 459 double _BGD_1_5B; // group delay [s] … … 407 462 bool _inav; // Data comes from I/NAV when <code>true</code> 408 463 bool _fnav; // Data comes from F/NAV when <code>true</code> 409 bool _ e1DataInvalid; // E1Data is not valid410 bool _ e5aDataInvalid; // E5AData is not valid411 bool _ e5bDataInvalid; // E5BData is not valid464 bool _E1B_DataInvalid; // E1B Data is not valid 465 bool _E5a_DataInvalid; // E5a Data is not valid 466 bool _E5b_DataInvalid; // E5b Data is not valid 412 467 }; 413 468 … … 417 472 public: 418 473 t_ephSBAS() { 419 _IODN 420 _TOT 421 _agf0 422 _agf1 423 _x_pos 424 _x_vel ocity= 0.0;425 _x_acc eleration= 0.0;426 _y_pos 427 _y_vel ocity= 0.0;428 _y_acc eleration= 0.0;429 _z_pos 430 _z_vel ocity= 0.0;431 _z_acc eleration= 0.0;432 _ura 433 _health 434 _receptStaID 474 _IODN = 0; 475 _TOT = 0.0; 476 _agf0 = 0.0; 477 _agf1 = 0.0; 478 _x_pos = 0.0; 479 _x_vel = 0.0; 480 _x_acc = 0.0; 481 _y_pos = 0.0; 482 _y_vel = 0.0; 483 _y_acc = 0.0; 484 _z_pos = 0.0; 485 _z_vel = 0.0; 486 _z_acc = 0.0; 487 _ura = 0.0; 488 _health = 0.0; 489 _receptStaID = ""; 435 490 } 436 491 t_ephSBAS(double rnxVersion, const QStringList& lines); 437 492 virtual ~t_ephSBAS() {} 438 493 439 virtual e_ type type() const {return t_eph::SBAS;}494 virtual e_system system() const {return t_eph::SBAS;} 440 495 virtual unsigned int IOD() const; 441 496 virtual unsigned int isUnhealthy() const; … … 446 501 447 502 int _IODN; 448 double _TOT; 449 double _agf0; 450 double _agf1; 451 452 double _x_pos; 453 double _x_vel ocity;// [m/s]454 double _x_acc eleration; // [m/s^2]455 456 double _y_pos; 457 double _y_vel ocity;// [m/s]458 double _y_acc eleration; // [m/s^2]459 460 double _z_pos; 461 double _z_vel ocity;// [m/s]462 double _z_acc eleration; // [m/s^2]503 double _TOT; // not used (set to 0.9999e9) 504 double _agf0; // [s] clock correction 505 double _agf1; // [s/s] clock correction drift 506 507 double _x_pos; // [m] 508 double _x_vel; // [m/s] 509 double _x_acc; // [m/s^2] 510 511 double _y_pos; // [m] 512 double _y_vel; // [m/s] 513 double _y_acc; // [m/s^2] 514 515 double _z_pos; // [m] 516 double _z_vel; // [m/s] 517 double _z_acc; // [m/s^2] 463 518 464 519 mutable double _ura; … … 474 529 _AODE = 0; 475 530 _AODC = 0; 476 _URAI = 0; 477 _URA = 0.0; 531 _ura = 0.0; 478 532 _clock_bias = 0.0; 479 533 _clock_drift = 0.0; 480 534 _clock_driftrate = 0.0; 535 _ADOT = 0.0; 481 536 _Crs = 0.0; 482 537 _Delta_n = 0.0; … … 523 578 virtual ~t_ephBDS() {} 524 579 525 virtual e_ type type() const {return t_eph::BDS;}580 virtual e_system system() const {return t_eph::BDS;} 526 581 virtual unsigned int IOD() const; 527 582 virtual unsigned int isUnhealthy() const; … … 535 590 int _AODE; 536 591 int _AODC; 537 int _URAI; // [0..15] index from RTCM stream 538 mutable double _URA; // user range accuracy [m] 592 mutable double _ura; // user range accuracy [m] 539 593 double _clock_bias; // [s] 540 594 double _clock_drift; // [s/s] 541 595 double _clock_driftrate; // [s/s^2] 596 double _ADOT; // [m/s] 542 597 double _Crs; // [m] 543 598 double _Delta_n; // [rad/s] 544 599 double _M0; // [rad] 545 600 double _Cuc; // [rad] 546 double _e; // 601 double _e; // [-] 547 602 double _Cus; // [rad] 548 603 double _sqrt_A; // [m^0.5] … … 562 617 double _top; // [s] 563 618 564 double _SISAI_oe; // [ ]565 double _SISAI_ocb; // [ ]566 double _SISAI_oc1; // [ ]567 double _SISAI_oc2; // [ ]619 double _SISAI_oe; // [-] 620 double _SISAI_ocb; // [-] 621 double _SISAI_oc1; // [-] 622 double _SISAI_oc2; // [-] 568 623 569 624 double _ISC_B1Cd; // [s] … … 576 631 double _TGD_B2bI; // [s] 577 632 578 double _SISMAI; // [ ]579 580 int _SatH1; // 581 int _health; // 633 double _SISMAI; // [-] 634 635 int _SatH1; // [-] 636 int _health; // [-] 582 637 583 638 double _INTEGRITYF_B1C; // 3 bits word from sf 3 … … 585 640 double _INTEGRITYF_B2b; // 3 bits word from msg 10 586 641 587 double _IODC; // [ ]588 double _IODE; // [ ] IODE are the same as the 8 LSBs of IODC642 double _IODC; // [-] 643 double _IODE; // [-] IODE are the same as the 8 LSBs of IODC 589 644 590 645 }; -
trunk/BNC/src/rinex/reqcanalyze.cpp
r10577 r10587 1019 1019 *_log << " " 1020 1020 << navFi.fileName() << ' ' << QString(": WRONG %2:%3\n") 1021 .arg(eph-> ephTypeStr(eph->ephType(), eph->prn(), 99.0))1021 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) 1022 1022 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1(); 1023 1023 } -
trunk/BNC/src/rinex/reqcedit.cpp
r10577 r10587 586 586 bool haveGPS = false; 587 587 bool haveGlonass = false; 588 QMap<t_eph::e_ type, bool> haveGnss;588 QMap<t_eph::e_system, bool> haveGnss; 589 589 for (int ii = 0; ii < _ephs.size(); ii++) { 590 590 const t_eph* eph = _ephs[ii]; 591 switch (eph-> type()) {591 switch (eph->system()) { 592 592 case t_eph::GPS: 593 593 haveGPS = true; … … 680 680 bncTime begTime = _begTime; 681 681 bncTime endTime = _endTime; 682 if (eph-> type() == t_eph::BDS) {682 if (eph->system() == t_eph::BDS) { 683 683 begTime += 14; 684 684 endTime += 14; … … 695 695 696 696 if (outNavFile.version() < 3.0) { 697 if (outNavFile.glonass() && eph-> type() != t_eph::GLONASS) {697 if (outNavFile.glonass() && eph->system() != t_eph::GLONASS) { 698 698 continue; 699 699 } 700 if (!outNavFile.glonass() && eph-> type() != t_eph::GPS) {700 if (!outNavFile.glonass() && eph->system() != t_eph::GPS) { 701 701 continue; 702 702 } 703 703 } 704 705 if (outNavFile.version() < 4.0) {706 if (eph->ephType() == t_eph::CNAV ||707 eph->ephType() == t_eph::CNV1 ||708 eph->ephType() == t_eph::CNV2 ||709 eph->ephType() == t_eph::CNV3) {710 continue;711 }712 }713 714 if (outNavFile.version() >= 4.0 &&715 eph->ephType() == t_eph::undefined) { // input files < version 4.0716 continue;717 }718 719 704 outNavFile.writeEph(eph); 720 705 } … … 739 724 740 725 if (isNew) { 741 if (eph-> type() == t_eph::GPS) {726 if (eph->system() == t_eph::GPS) { 742 727 ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph))); 743 728 } 744 else if (eph-> type() == t_eph::GLONASS) {729 else if (eph->system() == t_eph::GLONASS) { 745 730 ephs.append(new t_ephGlo(*dynamic_cast<t_ephGlo*>(eph))); 746 731 } 747 else if (eph-> type() == t_eph::Galileo) {732 else if (eph->system() == t_eph::Galileo) { 748 733 ephs.append(new t_ephGal(*dynamic_cast<t_ephGal*>(eph))); 749 734 } 750 else if (eph-> type() == t_eph::QZSS) {735 else if (eph->system() == t_eph::QZSS) { 751 736 ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph))); 752 737 } 753 else if (eph-> type() == t_eph::SBAS) {738 else if (eph->system() == t_eph::SBAS) { 754 739 ephs.append(new t_ephSBAS(*dynamic_cast<t_ephSBAS*>(eph))); 755 740 } 756 else if (eph-> type() == t_eph::BDS) {741 else if (eph->system() == t_eph::BDS) { 757 742 ephs.append(new t_ephBDS(*dynamic_cast<t_ephBDS*>(eph))); 758 743 } 759 else if (eph-> type() == t_eph::IRNSS) {744 else if (eph->system() == t_eph::IRNSS) { 760 745 ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph))); 761 746 } -
trunk/BNC/src/rinex/rnxnavfile.cpp
r10577 r10587 149 149 //////////////////////////////////////////////////////////////////////////// 150 150 void t_rnxNavFile::read(QTextStream* stream) { 151 QString ephType;152 151 153 152 while (stream->status() == QTextStream::Ok && !stream->atEnd()) { … … 157 156 continue; 158 157 } 159 158 QString navType; 160 159 QStringList hlp = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts); 161 QString key, prn, navSubType;160 QString prn; 162 161 char sys; 163 164 162 QString firstStr = hlp.at(0); 165 if (version() >= 3.0 && firstStr != ">") { 163 164 // RINEX version 3 165 if (version() >= 3.0 && 166 version() < 4.0 && firstStr != ">") { 166 167 prn = firstStr; 167 168 sys = prn[0].toLatin1(); 168 } 169 navType = ""; 170 } 171 // RINEX version 4 169 172 else if (version() >= 4.0 && firstStr == ">") { 170 key = hlp.at(1);173 QString key = hlp.at(1); 171 174 prn = hlp.at(2); 172 175 sys = prn[0].toLatin1(); 173 ephType = hlp.at(3);176 navType = hlp.at(3); 174 177 175 178 // ALL Non-EPH messages are currently ignored … … 194 197 sys == 'J' || sys == 'I') { 195 198 lines2skip = 3; 196 if ((sys == 'I' && ephType == "L1NV") || // I: KLOB, NEQN197 (sys == 'J' && ephType == "CNVX")) { // J: WIDE, JAPN198 navSubType = hlp.at(4);199 if ((sys == 'I' && navType == "L1NV") || // I: KLOB, NEQN 200 (sys == 'J' && navType == "CNVX")) { // J: WIDE, JAPN 201 QString navSubType = hlp.at(4); 199 202 if (navSubType == "KLOB") { 200 203 lines2skip += 1; … … 213 216 continue; 214 217 } 218 // RINEX version 2 215 219 else { 216 220 if (glonass()) { … … 226 230 lines << line; 227 231 if (sys == 'G') { 228 for (int ii = 1; ii < 8; ii++) { 232 int nLines = 8; 233 if (navType == "CNAV") { 234 nLines += 1; 235 } 236 if (navType == "CNV2") { 237 nLines += 2; 238 } 239 for (int ii = 1; ii < nLines; ii++) { 229 240 lines << stream->readLine(); 230 241 } … … 232 243 } 233 244 else if (sys == 'R') { 234 int n um= 4;245 int nLines = 4; 235 246 if (version() >= 3.05) { 236 n um+= 1;237 } 238 for (int ii = 1; ii < n um; ii++) {247 nLines += 1; 248 } 249 for (int ii = 1; ii < nLines; ii++) { 239 250 lines << stream->readLine(); 240 251 } … … 248 259 } 249 260 else if (sys == 'J') { 250 for (int ii = 1; ii < 8; ii++) { 261 int nLines = 8; 262 if (navType == "CNAV") { 263 nLines += 1; 264 } 265 if (navType == "CNV2") { 266 nLines += 2; 267 } 268 for (int ii = 1; ii < nLines; ii++) { 251 269 lines << stream->readLine(); 252 270 } … … 260 278 } 261 279 else if (sys == 'C') { 262 for (int ii = 1; ii < 8; ii++) { 280 int nLines = 8; 281 if (navType == "CNV1" || 282 navType == "CNV2") { 283 nLines += 2; 284 } 285 if (navType == "CNV3") { 286 nLines += 1; 287 } 288 for (int ii = 1; ii < nLines; ii++) { 263 289 lines << stream->readLine(); 264 290 } … … 266 292 } 267 293 else if (sys == 'I') { 268 for (int ii = 1; ii < 8; ii++) { 294 int nLines = 8; 295 if (navType == "L1NV") { 296 nLines += 1; 297 } 298 for (int ii = 1; ii < nLines; ii++) { 269 299 lines << stream->readLine(); 270 300 } … … 272 302 } 273 303 274 if (version() >= 4.0 && key == "EPH") {275 if (eph->setEphType(ephType) != success) {276 delete eph;277 continue;278 }279 }280 281 304 if (eph) { 305 eph->setType(navType); 282 306 _ephs.push_back(eph); 283 307 } 308 284 309 } 285 310 } … … 363 388 else { 364 389 QString fmt; 365 t_eph::e_ typesys = satSystem();390 t_eph::e_system sys = satSystem(); 366 391 switch(sys) { 367 392 case t_eph::GPS: -
trunk/BNC/src/rinex/rnxnavfile.h
r10127 r10587 38 38 #define defaultRnxNavVersion2 2.11 39 39 #define defaultRnxNavVersion3 3.05 40 #define defaultRnxNavVersion4 4.0 140 #define defaultRnxNavVersion4 4.02 41 41 42 42 class t_rnxNavFile { … … 52 52 double _version; 53 53 bool _glonass; 54 t_eph::e_ type_satSys;55 QStringList _comments;56 QStringList _runByDate;54 t_eph::e_system _satSys; 55 QStringList _comments; 56 QStringList _runByDate; 57 57 }; 58 58 … … 67 67 QStringList comments() const {return _header._comments;} 68 68 QStringList runByDate() const {return _header._runByDate;} 69 t_eph::e_ typesatSystem() const {return _header._satSys;}69 t_eph::e_system satSystem() const {return _header._satSys;} 70 70 void setGlonass(bool glo) {_header._glonass = glo;} 71 void setGnssTypeV3(t_eph::e_ type sys) {_header._satSys = sys;}71 void setGnssTypeV3(t_eph::e_system system) {_header._satSys = system;} 72 72 void writeHeader(const QMap<QString, QString>* txtMap = 0, int numMergedFiles = 0, int leapSecs = 0); 73 73 void writeEph(const t_eph* eph); -
trunk/BNC/src/rinex/rnxobsfile.h
r10532 r10587 40 40 #define defaultRnxObsVersion2 2.11 41 41 #define defaultRnxObsVersion3 3.05 42 #define defaultRnxObsVersion4 4.0 142 #define defaultRnxObsVersion4 4.02 43 43 44 44 class t_rnxObsHeader { -
trunk/BNC/src/upload/bncephuploadcaster.cpp
r9436 r10587 91 91 int size = 0; 92 92 93 if (ephGPS && ephGPS-> type() == t_eph::GPS && (system == "ALL" || system.contains('G'))) {93 if (ephGPS && ephGPS->system() == t_eph::GPS && (system == "ALL" || system.contains('G'))) { 94 94 if (dt < 14400.0 || dt > -7200.0) { 95 95 size = t_ephEncoder::RTCM3(*ephGPS, Array); 96 96 } 97 97 } 98 else if (ephGPS && ephGPS-> type() == t_eph::QZSS && (system == "ALL" || system.contains('J'))) {98 else if (ephGPS && ephGPS->system() == t_eph::QZSS && (system == "ALL" || system.contains('J'))) { 99 99 if (dt < 7200.0 || dt > -3600.0) { 100 100 size = t_ephEncoder::RTCM3(*ephGPS, Array); … … 121 121 } 122 122 } 123 else if (ephGPS && ephGPS-> type() == t_eph::IRNSS && (system == "ALL" || system.contains('I'))) {123 else if (ephGPS && ephGPS->system() == t_eph::IRNSS && (system == "ALL" || system.contains('I'))) { 124 124 if (fabs(dt < 86400.0)) { 125 125 size = t_ephEncoder::RTCM3(*ephGPS, Array);
Note:
See TracChangeset
for help on using the changeset viewer.