Changeset 6072 in ntrip for trunk/BNC/src/PPP_free
- Timestamp:
- Sep 7, 2014, 11:05:26 AM (10 years ago)
- Location:
- trunk/BNC/src/PPP_free
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP_free/bncpppclient.cpp
r6068 r6072 84 84 // 85 85 //////////////////////////////////////////////////////////////////////////// 86 void bncPPPclient::putNewObs( const t_obs& obs, t_output* output) {86 void bncPPPclient::putNewObs(t_satData* satData, t_output* output) { 87 87 QMutexLocker locker(&_mutex); 88 89 if (obs.satSys == 'R') {90 if (!_opt->useSystem('R')) return;91 }92 else if (obs.satSys == 'E') {93 if (!_opt->useSystem('E')) return;94 }95 else if (obs.satSys != 'G') {96 return;97 }98 99 t_satData* satData = new t_satData();100 satData->tt = bncTime(obs.GPSWeek, obs.GPSWeeks);101 102 // Satellite Number103 // ----------------104 satData->prn = QString("%1%2").arg(obs.satSys).arg(obs.satNum,2,10,QChar('0'));105 106 // Check Slips107 // -----------108 slipInfo& sInfo = _slips[satData->prn];109 if ( sInfo.slipCntL1 == obs.slip_cnt_L1 &&110 sInfo.slipCntL2 == obs.slip_cnt_L2 &&111 sInfo.slipCntL5 == obs.slip_cnt_L5 ) {112 satData->slipFlag = false;113 }114 else {115 satData->slipFlag = true;116 }117 sInfo.slipCntL1 = obs.slip_cnt_L1;118 sInfo.slipCntL2 = obs.slip_cnt_L2;119 120 // Handle Code Biases121 // ------------------122 t_bias* bb = 0;123 if (_bias.contains(satData->prn)) {124 bb = _bias.value(satData->prn);125 }126 88 127 89 // Add new epoch, process the older ones … … 139 101 // Set Observations GPS and Glonass 140 102 // -------------------------------- 141 if (obs.satSys == 'G' || obs.satSys == 'R') { 142 const QByteArray preferredTypes("WPC"); 143 for (int ii = preferredTypes.length()-1; ii >= 0; ii--) { 144 for (int iPhase = 0; iPhase <= 1; iPhase++) { 145 for (int iFreq = 1; iFreq <= 2; iFreq++) { 146 147 char rnxStr[4]; rnxStr[3] = '\0'; 148 double* p_value = 0; 149 if (iPhase == 0 && iFreq == 1) { 150 rnxStr[0] = 'C'; 151 rnxStr[1] = '1'; 152 p_value = &satData->P1; 153 } 154 else if (iPhase == 0 && iFreq == 2) { 155 rnxStr[0] = 'C'; 156 rnxStr[1] = '2'; 157 p_value = &satData->P2; 158 } 159 else if (iPhase == 1 && iFreq == 1) { 160 rnxStr[0] = 'L'; 161 rnxStr[1] = '1'; 162 p_value = &satData->L1; 163 } 164 else if (iPhase == 1 && iFreq == 2) { 165 rnxStr[0] = 'L'; 166 rnxStr[1] = '2'; 167 p_value = &satData->L2; 168 } 169 170 rnxStr[2] = preferredTypes[ii]; 171 172 double measdata = obs.measdata(rnxStr, 3.0); 173 if (measdata != 0.0) { 174 *p_value = measdata; 175 if (rnxStr[0] == 'C' && bb) { 176 char biasStr[3]; 177 biasStr[0] = rnxStr[1]; 178 biasStr[1] = rnxStr[2]; 179 biasStr[2] = '\0'; 180 *p_value += bb->value(biasStr); 181 } 182 } 183 } 184 } 185 } 186 103 if (satData->system() == 'G' || satData->system() == 'R') { 187 104 if (satData->P1 != 0.0 && satData->P2 != 0.0 && 188 105 satData->L1 != 0.0 && satData->L2 != 0.0 ) { 189 t_frequency::type fType1 = t_lc::toFreq(obs.satSys,t_lc::l1); 190 t_frequency::type fType2 = t_lc::toFreq(obs.satSys,t_lc::l2); 191 double f1 = t_CST::freq(fType1, obs.slotNum); 192 double f2 = t_CST::freq(fType2, obs.slotNum); 106 107 int channel = 0; 108 if (satData->system() == 'R') { 109 cerr << "not yet implemented" << endl; 110 exit(0); 111 } 112 113 t_frequency::type fType1 = t_lc::toFreq(satData->system(), t_lc::l1); 114 t_frequency::type fType2 = t_lc::toFreq(satData->system(), t_lc::l2); 115 double f1 = t_CST::freq(fType1, channel); 116 double f2 = t_CST::freq(fType2, channel); 193 117 double a1 = f1 * f1 / (f1 * f1 - f2 * f2); 194 118 double a2 = - f2 * f2 / (f1 * f1 - f2 * f2); 195 satData->L1 = satData->L1 * t_CST::c / f1;196 satData->L2 = satData->L2 * t_CST::c / f2;197 119 satData->P3 = a1 * satData->P1 + a2 * satData->P2; 198 120 satData->L3 = a1 * satData->L1 + a2 * satData->L2; … … 207 129 // Set Observations Galileo 208 130 // ------------------------ 209 else if (obs.satSys == 'E') { 210 satData->P1 = obs.measdata("C1", 3.0); 211 satData->L1 = obs.measdata("L1", 3.0); 212 satData->P5 = obs.measdata("C5", 3.0); 213 satData->L5 = obs.measdata("L5", 3.0); 131 else if (satData->system() == 'E') { 214 132 if (satData->P1 != 0.0 && satData->P5 != 0.0 && 215 133 satData->L1 != 0.0 && satData->L5 != 0.0 ) { … … 218 136 double a1 = f1 * f1 / (f1 * f1 - f5 * f5); 219 137 double a5 = - f5 * f5 / (f1 * f1 - f5 * f5); 220 satData->L1 = satData->L1 * t_CST::c / f1;221 satData->L5 = satData->L5 * t_CST::c / f5;222 138 satData->P3 = a1 * satData->P1 + a5 * satData->P5; 223 139 satData->L3 = a1 * satData->L1 + a5 * satData->L5; -
trunk/BNC/src/PPP_free/bncpppclient.h
r6068 r6072 43 43 bncPPPclient(QByteArray staID, const t_pppOptions* opt); 44 44 ~bncPPPclient(); 45 void putNewObs( const t_obs& pp, t_output* output);45 void putNewObs(t_satData* satData, t_output* output); 46 46 void putNewCorrections(QList<QString> corrList); 47 47 QByteArray staID() const {return _staID;} … … 75 75 std::queue<t_epoData*> _epoData; 76 76 bncModel* _model; 77 QMap<QString, slipInfo> _slips;78 77 }; 79 78 -
trunk/BNC/src/PPP_free/pppClient.cpp
r6071 r6072 128 128 t_satData* satData = new t_satData(); 129 129 satData->tt = obs->_time; 130 satData->prn = obs->_prn;130 satData->prn = QString(obs->_prn.toString().c_str()); 131 131 satData->slipFlag = false; 132 132 satData->P1 = 0.0;
Note:
See TracChangeset
for help on using the changeset viewer.