Changeset 4788 in ntrip for trunk/BNC


Ignore:
Timestamp:
Oct 27, 2012, 1:40:07 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTRover/bncrtrover.cpp

    r4783 r4788  
    173173  int numOrbCorr = 0;
    174174  int numClkCorr = 0;
    175 
    176   rtrover_orbCorr orbCorr[corrList.size()];
    177   rtrover_clkCorr clkCorr[corrList.size()];
     175  int numBiases  = 0;
     176
     177  rtrover_orbCorr    orbCorr[corrList.size()];
     178  rtrover_clkCorr    clkCorr[corrList.size()];
     179  rtrover_codeBiases biases[corrList.size()];
    178180
    179181  QListIterator<QString> it(corrList);
     
    191193    }
    192194
     195    // Orbit and clock corrections
     196    // ---------------------------
    193197    t_corr corr;
    194198    if (corr.readLine(line) == success) {
     
    228232      }
    229233    }
    230   }
    231  
     234
     235    // Code Biases
     236    // -----------
     237    t_bias bias;
     238    if (bias.readLine(line) == success) {
     239      ++numBiases;
     240      rtrover_codeBiases& codeBiases = biases[numBiases-1];
     241      codeBiases._biases = new rtrover_bias[bias._value.size()];
     242      int iBias = -1;
     243      QMapIterator<QByteArray, double> it(bias._value);
     244      while (it.hasNext()) {
     245        it.next();
     246        ++iBias;
     247        rtrover_bias& singleBias = codeBiases._biases[iBias];
     248        singleBias._rnxType[0] = it.key()[0];
     249        singleBias._rnxType[1] = it.key()[1];
     250        singleBias._value      = it.value();
     251      }
     252    }
     253  }
     254
     255  // Pass Corrections and Biases to client library
     256  // ---------------------------------------------
    232257  if (numOrbCorr > 0) {
    233258    rtrover_putOrbCorrections(numOrbCorr, orbCorr);
     
    235260  if (numClkCorr > 0) {
    236261    rtrover_putClkCorrections(numClkCorr, clkCorr);
     262  }
     263  if (numBiases > 0) {
     264    rtrover_putBiases(numBiases, biases);
     265  }
     266
     267  // Clean the memory
     268  // ----------------
     269  for (int ii = 0; ii < numBiases; ii++) {
     270    delete [] biases[ii]._biases;
    237271  }
    238272}
Note: See TracChangeset for help on using the changeset viewer.