Changeset 2694 in ntrip for trunk/BNC/bnccaster.cpp


Ignore:
Timestamp:
Nov 14, 2010, 12:43:07 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r2690 r2694  
    4949#include "RTCM/GPSDecoder.h"
    5050
     51#define OLD_OBS_FORMAT 1
     52
     53class t_oldObsInternal {
     54 public:
     55
     56  t_oldObsInternal(const t_obsInternal obs) {
     57    strcpy(StatID, obs.StatID);
     58    flags         = 0;
     59    satSys        = obs.satSys;
     60    satNum        = obs.satNum;
     61    slot          = obs.slotNum;
     62    GPSWeek       = obs.GPSWeek;
     63    GPSWeeks      = obs.GPSWeeks;
     64    C1            = obs.C1;
     65    C2            = obs.C2;
     66    P1            = obs.P1;
     67    P2            = obs.P2;
     68    L1            = obs.L1;
     69    L2            = obs.L2;
     70    slip_cnt_L1   = obs.slip_cnt_L1;
     71    slip_cnt_L2   = obs.slip_cnt_L2;
     72    lock_timei_L1 = -1;
     73    lock_timei_L2 = -1;
     74    S1            = obs.S1;
     75    S2            = obs.S2;
     76    SNR1          = 0;
     77    SNR2          = 0;
     78  }
     79  int    flags;
     80  char   StatID[20+1];  // Station ID
     81  char   satSys;        // Satellite System ('G' or 'R')
     82  int    satNum;        // Satellite Number (PRN for GPS NAVSTAR)
     83  int    slot;          // Slot Number (for Glonass)
     84  int    GPSWeek;       // Week of GPS-Time
     85  double GPSWeeks;      // Second of Week (GPS-Time)
     86  double C1;            // CA-code pseudorange (meters)
     87  double C2;            // CA-code pseudorange (meters)
     88  double P1;            // P1-code pseudorange (meters)
     89  double P2;            // P2-code pseudorange (meters)
     90  double L1;            // L1 carrier phase (cycles)
     91  double L2;            // L2 carrier phase (cycles)
     92  int    slip_cnt_L1;   // L1 cumulative loss of continuity indicator (negative$
     93  int    slip_cnt_L2;   // L2 cumulative loss of continuity indicator (negative$
     94  int    lock_timei_L1; // L1 last lock time indicator                (negative$
     95  int    lock_timei_L2; // L2 last lock time indicator                (negative$
     96  double S1;            // L1 signal-to noise ratio
     97  double S2;            // L2 signal-to noise ratio
     98  int    SNR1;          // L1 signal-to noise ratio (mapped to integer)
     99  int    SNR2;          // L2 signal-to noise ratio (mapped to integer)
     100};
     101
    51102// Constructor
    52103////////////////////////////////////////////////////////////////////////////
     
    184235          ok = false;
    185236        }
    186         int numBytes = sizeof(obs->_o);
    187         if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) {
    188           ok = false;
     237        if (OLD_OBS_FORMAT) {
     238          t_oldObsInternal oldObs(obs->_o);
     239          int numBytes = sizeof(oldObs);
     240          if (myWrite(sock, (const char*)(&oldObs), numBytes) != numBytes) {
     241            ok = false;
     242          }
     243        }
     244        else {
     245          int numBytes = sizeof(obs->_o);
     246          if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) {
     247            ok = false;
     248          }
    189249        }
    190250        if (!ok) {
     
    388448                }
    389449              }
    390               int numBytes = sizeof(obs->_o);
    391               if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) {
    392                 ok = false;
     450              if (OLD_OBS_FORMAT) {
     451                t_oldObsInternal oldObs(obs->_o);
     452                int numBytes = sizeof(oldObs);
     453                if (myWrite(sock, (const char*)(&oldObs), numBytes) != numBytes) {
     454                  ok = false;
     455                }
     456              }
     457              else {
     458                int numBytes = sizeof(obs->_o);
     459                if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) {
     460                  ok = false;
     461                }
    393462              }
    394463              if (!it.hasNext()) {
Note: See TracChangeset for help on using the changeset viewer.