Changeset 61 in ntrip
- Timestamp:
- Aug 24, 2006, 2:41:37 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTIGS/cgps_transform.cpp
r58 r61 13 13 } 14 14 15 #ifdef CGPS_TRANSFORM_MAIN 15 16 int main() { 16 17 … … 95 96 return 0; 96 97 } 98 #endif 97 99 98 100 // Constructor -
trunk/BNC/RTIGS/rtigs.cpp
r59 r61 34 34 void rtigs::Decode(char* buffer, int bufLen) { 35 35 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; 44 37 45 38 // Find the beginning of the message … … 48 41 bool found = false; 49 42 size_t ii; 50 for (ii = 0; ii < nr- sz; ii += sz) {43 for (ii = 0; ii < bufLen - sz; ii += sz) { 51 44 unsigned short xx; 52 memcpy( (void*) &xx, & buffer[ii], sz);45 memcpy( (void*) &xx, &lBuffer[ii], sz); 53 46 SwitchBytes( (char*) &xx, sz); 54 47 if (xx == 200) { … … 65 58 } 66 59 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]); 70 63 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); 81 68 if (retval >= 1) { 82 69 _GPSTrans.print_CMEAS(); 83 70 } 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;91 71 } 92 72 } -
trunk/BNC/bnc.pro
r35 r61 2 2 HEADERS = bncgetthread.h bncwindow.h bnctabledlg.h \ 3 3 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 5 8 6 9 SOURCES = bncmain.cpp bncgetthread.cpp bncwindow.cpp bnctabledlg.cpp \ 7 10 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 9 13 10 14 QT += network -
trunk/BNC/bncgetthread.cpp
r60 r61 22 22 #include "bncgetthread.h" 23 23 #include "RTCM/RTCM.h" 24 #include "RTIGS/rtigs.h" 24 25 25 26 using namespace std; … … 134 135 // Instantiate the filter 135 136 // ---------------------- 136 GPSDecoder* rtcmFilter;137 GPSDecoder* decoder; 137 138 138 139 if (_format.indexOf("RTCM_2") != -1) { 139 140 qWarning("Get Data: " + _mountPoint + " in RTCM 2.x format"); 140 rtcmFilter = new RTCM('A',true);141 decoder = new RTCM('A',true); 141 142 } 142 143 else if (_format.indexOf("RTCM_3") != -1) { … … 147 148 else if (_format.indexOf("RTIGS") != -1) { 148 149 qWarning("Get Data: " + _mountPoint + " in RTIGS format"); 149 qWarning("Not yet implemented");150 decoder = new rtigs(); 150 151 return exit(1); 151 152 } 152 153 else { 153 qWarning( "Unknown data format");154 qWarning(_mountPoint + " Unknown data format " + _format); 154 155 return exit(1); 155 156 } … … 163 164 char* data = new char[nBytes]; 164 165 _socket->read(data, nBytes); 165 rtcmFilter->Decode(data, nBytes);166 decoder->Decode(data, nBytes); 166 167 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++) { 169 170 emit newObs(_mountPoint, *it); 170 171 } 171 rtcmFilter->m_lObsList.clear();172 decoder->m_lObsList.clear(); 172 173 } 173 174 else { … … 176 177 } 177 178 } 178 delete rtcmFilter;179 delete decoder; 179 180 } 180 181
Note:
See TracChangeset
for help on using the changeset viewer.