Changeset 661 in ntrip for trunk/BNC/RTIGS/RTIGSDecoder.cpp


Ignore:
Timestamp:
Jan 29, 2008, 3:53:43 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTIGS/RTIGSDecoder.cpp

    r652 r661  
    4141#include "RTIGSDecoder.h"
    4242#include "bncconst.h"
     43#include "bncapp.h"
    4344
    4445using namespace std;
     
    4647#undef L1
    4748#undef L2
     49
     50//
     51////////////////////////////////////////////////////////////////////////////
     52ephSenderRTIGS::ephSenderRTIGS() {
     53  connect(this, SIGNAL(newGPSEph(gpsephemeris*)),
     54          (bncApp*) qApp, SLOT(slotNewGPSEph(gpsephemeris*)));
     55  //connect(this, SIGNAL(newGlonassEph(glonassephemeris*)),
     56  //        (bncApp*) qApp, SLOT(slotNewGlonassEph(glonassephemeris*)));
     57}
    4858
    4959// Constructor
     
    7484      SwitchBytes( (char*) &xx, sizeof(xx) );
    7585    }
    76     if (xx == 200) {
     86    if (xx == 200 || xx == 300 ) { // 2/1/2008 SPG
    7787      _buffer = _buffer.substr(ii);
    7888      found = true;
     
    97107  }
    98108
     109  // 2/1/2008 SPG Start
    99110  // Decode the epoch
    100111  // ----------------
    101112  if (messType == 200) {
     113  // Decode Obs
    102114    RTIGSO_T  rtigs_obs;
    103115    short numObs = _GPSTrans.Decode_RTIGS_Obs(p_buf, numbytes, rtigs_obs);
     
    121133    }
    122134  }
     135  if(messType==300){
     136  // Decode Ephemeris
     137    RTIGSE_T rtigs_eph;
     138    BEPH_T new_eph;
     139    short PRN;
     140    // To TNAV_T
     141    // ---------
     142    short retval = _GPSTrans.Decode_RTIGS_Eph(p_buf, numbytes , rtigs_eph, PRN);
     143    // Ensure it was decoded ok.
     144    // ------------------------
     145    if(retval==1){     
     146    // TNAV To BEPH (decodes subframes)
     147    // --------------------------------
     148      _GPSTrans.TNAV_To_BEPH(&_GPSTrans.TNAV_Eph.Eph[PRN-1],&new_eph);
     149      gpsephemeris* ep = new gpsephemeris();
     150      // Match datatypes
     151      // ---------------
     152      ep->flags            = (int)new_eph.l2pflag;
     153      ep->satellite        = (int)new_eph.satellite;
     154      ep->IODE             = (int)new_eph.issue_of_eph;
     155      ep->URAindex         = (int)new_eph.user_range_acc;
     156      ep->SVhealth         = (int)new_eph.sat_health;
     157      ep->GPSweek          = (int)new_eph.gps_week;
     158      ep->IODC             = (int)new_eph.issue_of_clock;
     159      ep->TOW              = (int)new_eph.transmit_time;
     160      ep->TOC              = (int)new_eph.clock_ref_time;
     161      ep->TOE              = (int)new_eph.eph_ref_time;
     162      ep->clock_bias       = new_eph.a0;
     163      ep->clock_drift      = new_eph.a1;
     164      ep->clock_driftrate  = new_eph.a2;
     165      ep->Crs              = new_eph.orbit_sin_corr;
     166      ep->Delta_n          = new_eph.mean_mot_diff ;
     167      ep->M0               = new_eph.ref_mean_anmly;
     168      ep->Cuc              = new_eph.lat_cos_corr;
     169      ep->e                = new_eph.orbit_ecc;
     170      ep->Cus              = new_eph.lat_sin_corr;
     171      ep->sqrt_A           = new_eph.orbit_semimaj;
     172      ep->Cic              = new_eph.incl_cos_corr;
     173      ep->OMEGA0           = new_eph.right_asc;
     174      ep->Cis              = new_eph.incl_sin_corr;
     175      ep->i0               = new_eph.orbit_incl;
     176      ep->Crc              = new_eph.orbit_cos_corr;
     177      ep->omega            = new_eph.arg_of_perigee;
     178      ep->OMEGADOT         = new_eph.right_asc_rate;
     179      ep->IDOT             = new_eph.incl_rate;
     180      ep->TGD              = new_eph.group_delay;
     181
     182      // Pass back to parent class
     183      // --------------------
     184      emit _ephSender.newGPSEph(ep);
     185    }   
     186  }
     187
     188  // 2/1/2008 SPG End
    123189
    124190  // Unprocessed bytes remain in buffer
    125191  // ----------------------------------
    126192  _buffer = _buffer.substr(numbytes);
    127 
    128193  return success;
    129194}
Note: See TracChangeset for help on using the changeset viewer.