Changeset 61 in ntrip


Ignore:
Timestamp:
Aug 24, 2006, 2:41:37 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

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

    r58 r61  
    1313}
    1414
     15#ifdef CGPS_TRANSFORM_MAIN
    1516int main() {
    1617
     
    9596  return 0;
    9697}
     98#endif
    9799
    98100// Constructor
  • trunk/BNC/RTIGS/rtigs.cpp

    r59 r61  
    3434void rtigs::Decode(char* buffer, int bufLen) {
    3535
    36   RTIGSS_T       rtigs_sta;
    37   RTIGSO_T       rtigs_obs;
    38   RTIGSM_T       rtigs_met;
    39   RTIGSE_T       rtigs_eph;
    40   short          PRN;
    41   short          retval;
    42   unsigned short statID;
    43   unsigned short messType;
     36  unsigned char* lBuffer = (unsigned char*) buffer;
    4437
    4538  // Find the beginning of the message
     
    4841  bool   found = false;
    4942  size_t ii;
    50   for (ii = 0; ii < nr - sz; ii += sz) {
     43  for (ii = 0; ii < bufLen - sz; ii += sz) {
    5144    unsigned short xx;
    52     memcpy( (void*) &xx, &buffer[ii], sz);
     45    memcpy( (void*) &xx, &lBuffer[ii], sz);
    5346    SwitchBytes( (char*) &xx, sz);
    5447    if (xx == 200) {
     
    6558  }
    6659
    67   messType = _GPSTrans.GetRTIGSHdrRecType(&buffer[ii]);
    68   numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&buffer[ii]);
    69   statID   = _GPSTrans.GetRTIGSHdrStaID(&buffer[ii]);
     60  unsigned short messType = _GPSTrans.GetRTIGSHdrRecType(&lBuffer[ii]);
     61  unsigned short numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&lBuffer[ii]);
     62  unsigned short statID   = _GPSTrans.GetRTIGSHdrStaID(&lBuffer[ii]);
    7063
    71   cout << "messType " << messType << endl;
    72   cout << "numbytes " << numbytes << endl;
    73   cout << "statID "   << statID   << endl;
    74 
    75   switch (messType) {
    76   case 100:
    77     _GPSTrans.Decode_RTIGS_Sta(&buffer[ii], numbytes , rtigs_sta);
    78     break;
    79   case 200:
    80     retval = _GPSTrans.Decode_RTIGS_Obs(&buffer[ii], numbytes , rtigs_obs);
     64  if (messType == 200) {
     65    RTIGSO_T       rtigs_obs;
     66    short retval = _GPSTrans.Decode_RTIGS_Obs(&lBuffer[ii], numbytes ,
     67                                              rtigs_obs);
    8168    if (retval >= 1) {
    8269      _GPSTrans.print_CMEAS();
    8370    }
    84     break;
    85   case 300:
    86     retval = _GPSTrans.Decode_RTIGS_Eph(&buffer[ii], numbytes , rtigs_eph, PRN);
    87     break;
    88   case 400:
    89     retval = _GPSTrans.Decode_RTIGS_Met(&buffer[ii], numbytes , &rtigs_met);
    90     break;
    9171  }
    9272}
  • trunk/BNC/bnc.pro

    r35 r61  
    22HEADERS =             bncgetthread.h    bncwindow.h   bnctabledlg.h   \
    33          bnccaster.h \
    4           RTCM/format.h RTCM/GPSDecoder.h RTCM/m_data.h RTCM/RTCM.h
     4          RTCM/format.h RTCM/GPSDecoder.h RTCM/m_data.h RTCM/RTCM.h   \
     5          RTIGS/rtigs.h  RTIGS/cgps_transform.h  RTIGS/rtacp.h        \
     6          RTIGS/rtigs_records.h  RTIGS/rtstruct.h
     7
    58
    69SOURCES = bncmain.cpp bncgetthread.cpp  bncwindow.cpp bnctabledlg.cpp \
    710          bnccaster.cpp \
    8           RTCM/m_date.cpp RTCM/RTCM.cpp
     11          RTCM/m_date.cpp RTCM/RTCM.cpp \
     12          RTIGS/rtigs.cpp RTIGS/cgps_transform.cpp
    913
    1014QT += network
  • trunk/BNC/bncgetthread.cpp

    r60 r61  
    2222#include "bncgetthread.h"
    2323#include "RTCM/RTCM.h"
     24#include "RTIGS/rtigs.h"
    2425
    2526using namespace std;
     
    134135  // Instantiate the filter
    135136  // ----------------------
    136   GPSDecoder* rtcmFilter;
     137  GPSDecoder* decoder;
    137138
    138139  if      (_format.indexOf("RTCM_2") != -1) {
    139140    qWarning("Get Data: " + _mountPoint + " in RTCM 2.x format");
    140     rtcmFilter = new RTCM('A',true);
     141    decoder = new RTCM('A',true);
    141142  }
    142143  else if (_format.indexOf("RTCM_3") != -1) {
     
    147148  else if (_format.indexOf("RTIGS") != -1) {
    148149    qWarning("Get Data: " + _mountPoint + " in RTIGS format");
    149     qWarning("Not yet implemented");
     150    decoder = new rtigs();
    150151    return exit(1);
    151152  }
    152153  else {
    153     qWarning("Unknown data format");
     154    qWarning(_mountPoint + " Unknown data format " + _format);
    154155    return exit(1);
    155156  }
     
    163164      char* data = new char[nBytes];
    164165      _socket->read(data, nBytes);
    165       rtcmFilter->Decode(data, nBytes);
     166      decoder->Decode(data, nBytes);
    166167      delete data;
    167       for (list<Observation*>::iterator it = rtcmFilter->m_lObsList.begin();
    168            it != rtcmFilter->m_lObsList.end(); it++) {
     168      for (list<Observation*>::iterator it = decoder->m_lObsList.begin();
     169           it != decoder->m_lObsList.end(); it++) {
    169170        emit newObs(_mountPoint, *it);
    170171      }
    171       rtcmFilter->m_lObsList.clear();
     172      decoder->m_lObsList.clear();
    172173    }
    173174    else {
     
    176177    }
    177178  }
    178   delete rtcmFilter;
     179  delete decoder;
    179180}
    180181
Note: See TracChangeset for help on using the changeset viewer.