Changeset 6792 in ntrip
- Timestamp:
- Apr 22, 2015, 2:51:30 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/ephemeris.cpp
r6756 r6792 446 446 447 447 _TOEsec = _TOC.gpssec(); 448 //// _TOEsec = ee->TOE; //// TODO: 448 449 449 _Cic = ee->Cic; 450 450 _OMEGA0 = ee->OMEGA0; … … 462 462 _E5aHS = ee->E5aHS; 463 463 _E5bHS = ee->E5bHS; 464 _E1_bHS = ee->E1_HS; 464 465 _BGD_1_5A = ee->BGD_1_5A; 465 466 _BGD_1_5B = ee->BGD_1_5B; … … 808 809 // ------------ 809 810 int fieldLen = 19; 810 811 double SVhealth = 0.0; 812 double datasource = 0.0; 811 813 int pos[4]; 812 814 pos[0] = (rnxVersion <= 2.12) ? 3 : 4; … … 893 895 894 896 else if ( iLine == 5 ) { 895 if ( readDbl(line, pos[0], fieldLen, _IDOT ) || 896 readDbl(line, pos[2], fieldLen, _TOEweek) ) { 897 _checkState = bad; 898 return; 897 if ( readDbl(line, pos[0], fieldLen, _IDOT ) || 898 readDbl(line, pos[1], fieldLen, datasource) || 899 readDbl(line, pos[2], fieldLen, _TOEweek ) ) { 900 _checkState = bad; 901 return; 902 } else { 903 if (int(datasource) & (1<<8)) { 904 _flags |= GALEPHF_FNAV; 905 } else if (int(datasource) & (1<<9)) { 906 _flags |= GALEPHF_INAV; 907 } 899 908 } 900 909 } … … 902 911 else if ( iLine == 6 ) { 903 912 if ( readDbl(line, pos[0], fieldLen, _SISA ) || 904 readDbl(line, pos[1], fieldLen, _E5aHS) ||913 readDbl(line, pos[1], fieldLen, SVhealth) || 905 914 readDbl(line, pos[2], fieldLen, _BGD_1_5A) || 906 915 readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) { 907 916 _checkState = bad; 908 917 return; 918 } else { 919 // Bit 0 920 if (int(SVhealth) & (1<<0)) { 921 _flags |= GALEPHF_E1DINVALID; 922 } 923 // Bit 1-2 924 _E1_bHS = double((int(SVhealth) >> 1) & 0x3); 925 // Bit 3 926 if (int(SVhealth) & (1<<3)) { 927 _flags |= GALEPHF_E5ADINVALID; 928 } 929 // Bit 4-5 930 _E5aHS = double((int(SVhealth) >> 4) & 0x3); 931 // Bit 6 932 if (int(SVhealth) & (1<<6)) { 933 _flags |= GALEPHF_E5BDINVALID; 934 } 935 // Bit 7-8 936 _E5bHS = double((int(SVhealth) >> 7) & 0x3); 909 937 } 910 938 } … … 1097 1125 .arg(_OMEGADOT, 19, 'e', 12); 1098 1126 1099 int dataSource = 0; 1100 double HS = 0.0; 1101 if ( (_flags & GALEPHF_INAV) == GALEPHF_INAV ) { 1102 dataSource |= (1<<0); 1103 dataSource |= (1<<9); 1104 HS = _E5bHS; 1105 } 1106 else if ( (_flags & GALEPHF_FNAV) == GALEPHF_FNAV ) { 1127 int dataSource = 0; 1128 int SVhealth = 0; 1129 double BGD_1_5A = _BGD_1_5A; 1130 double BGD_1_5B = _BGD_1_5B; 1131 if ((_flags & GALEPHF_FNAV) == GALEPHF_FNAV) { 1107 1132 dataSource |= (1<<1); 1108 1133 dataSource |= (1<<8); 1109 HS = _E5aHS; 1110 } 1134 BGD_1_5B = 0.0; 1135 // SVhealth 1136 // Bit 3 : E5a DVS 1137 if ((_flags & GALEPHF_E5ADINVALID) == GALEPHF_E5ADINVALID) { 1138 SVhealth |= (1<<3); 1139 } 1140 // Bit 4-5: E5a HS 1141 if (_E5aHS == 1.0) { 1142 SVhealth |= (1<<4); 1143 } 1144 else if (_E5aHS == 2.0) { 1145 SVhealth |= (1<<5); 1146 } 1147 else if (_E5aHS == 3.0) { 1148 SVhealth |= (1<<4); 1149 SVhealth |= (1<<5); 1150 } 1151 } 1152 else if ((_flags & GALEPHF_INAV) == GALEPHF_INAV) { 1153 dataSource |= (1<<0); 1154 dataSource |= (1<<2); 1155 dataSource |= (1<<9); 1156 // SVhealth 1157 // Bit 0 : E1-B DVS 1158 if ((_flags & GALEPHF_E1DINVALID) == GALEPHF_E1DINVALID) { 1159 SVhealth |= (1<<0); 1160 } 1161 // Bit 1-2: E1-B HS 1162 if (_E1_bHS == 1.0) { 1163 SVhealth |= (1<<1); 1164 } 1165 else if (_E1_bHS == 2.0) { 1166 SVhealth |= (1<<2); 1167 } 1168 else if (_E1_bHS == 3.0) { 1169 SVhealth |= (1<<1); 1170 SVhealth |= (1<<2); 1171 } 1172 // Bit 6 : E5b DVS 1173 if ((_flags & GALEPHF_E1DINVALID) == GALEPHF_E1DINVALID) { 1174 SVhealth |= (1<<6); 1175 } 1176 // Bit 7-8: E5b HS 1177 if (_E5bHS == 1.0) { 1178 SVhealth |= (1<<7); 1179 } 1180 else if (_E5bHS == 2.0) { 1181 SVhealth |= (1<<8); 1182 } 1183 else if (_E5bHS == 3.0) { 1184 SVhealth |= (1<<7); 1185 SVhealth |= (1<<8); 1186 } 1187 } 1188 1111 1189 out << QString(fmt) 1112 1190 .arg(_IDOT, 19, 'e', 12) … … 1115 1193 .arg(0.0, 19, 'e', 12); 1116 1194 1117 out << QString(fmt) 1118 .arg(_SISA, 19, 'e', 12) 1119 .arg(HS, 19, 'e', 12) 1120 .arg(_BGD_1_5A, 19, 'e', 12) 1121 .arg(_BGD_1_5B, 19, 'e', 12); 1195 double SISA = -1.0; 1196 if ((_SISA >= 0) && (_SISA <= 49)) { 1197 SISA = _SISA / 100.0; 1198 } 1199 if((_SISA >= 50) && (_SISA <= 74)) { 1200 SISA = (50 + (_SISA - 50.0) * 2.0) / 100.0; 1201 } 1202 if((_SISA >= 75) && (_SISA <= 99)) { 1203 SISA = 1.0 + (_SISA - 75.0) * 0.04; 1204 } 1205 if((_SISA >= 100) && (_SISA <= 125)) { 1206 SISA = 2.0 + (_SISA - 100.0) * 0.16; 1207 } 1208 out << QString(fmt) 1209 .arg(SISA, 19, 'e', 12) 1210 .arg(double(SVhealth), 19, 'e', 12) 1211 .arg(BGD_1_5A, 19, 'e', 12) 1212 .arg(BGD_1_5B, 19, 'e', 12); 1122 1213 1123 1214 out << QString(fmt) … … 1704 1795 .arg(0.0, 19, 'e', 12); 1705 1796 1706 double ura = _URA; // RINEX file input 1797 // RINEX file input 1798 double ura = _URA; 1799 // RTCM stream input 1707 1800 if ((_URAI < 6) && (_URAI >= 0)) { 1708 1801 ura = ceil(10.0 * pow(2.0, ((double)_URAI/2.0) + 1.0)) / 10.0; … … 1722 1815 } 1723 1816 out << QString(fmt) 1724 .arg(tots, 19, 'e', 12)1817 .arg(tots, 19, 'e', 12) 1725 1818 .arg(double(_AODC), 19, 'e', 12) 1726 1819 .arg("", 19, QChar(' ')) -
trunk/BNC/src/ephemeris.h
r6756 r6792 188 188 189 189 double _IDOT; // [rad/s] 190 //191 190 double _TOEweek; 192 191 // spare 193 192 194 double _SISA; // Signal In Space Accuracy 193 int _SISAI; // Signal In Space Accuracy Index from RTCM stream 194 double _SISA; // Signal In Space Accuracy [m] from RINEX file 195 195 double _E5aHS; // E5a Health Status 196 196 double _E5bHS; // E5b Health Status 197 double _E1_bHS; // E1-b Health Status 197 198 double _BGD_1_5A; // group delay [s] 198 199 double _BGD_1_5B; // group delay [s] 199 200 200 201 double _TOT; // [s] 201 202 202 int _flags; 203 203 };
Note:
See TracChangeset
for help on using the changeset viewer.