Index: /trunk/BNC/RTIGS/cgps_transform.cpp
===================================================================
--- /trunk/BNC/RTIGS/cgps_transform.cpp	(revision 60)
+++ /trunk/BNC/RTIGS/cgps_transform.cpp	(revision 61)
@@ -13,4 +13,5 @@
 }
 
+#ifdef CGPS_TRANSFORM_MAIN
 int main() {
 
@@ -95,4 +96,5 @@
   return 0;
 }
+#endif
 
 // Constructor
Index: /trunk/BNC/RTIGS/rtigs.cpp
===================================================================
--- /trunk/BNC/RTIGS/rtigs.cpp	(revision 60)
+++ /trunk/BNC/RTIGS/rtigs.cpp	(revision 61)
@@ -34,12 +34,5 @@
 void rtigs::Decode(char* buffer, int bufLen) {
 
-  RTIGSS_T       rtigs_sta;
-  RTIGSO_T       rtigs_obs;
-  RTIGSM_T       rtigs_met;
-  RTIGSE_T       rtigs_eph;
-  short          PRN;
-  short          retval;
-  unsigned short statID;
-  unsigned short messType;
+  unsigned char* lBuffer = (unsigned char*) buffer;
 
   // Find the beginning of the message
@@ -48,7 +41,7 @@
   bool   found = false;
   size_t ii;
-  for (ii = 0; ii < nr - sz; ii += sz) {
+  for (ii = 0; ii < bufLen - sz; ii += sz) {
     unsigned short xx;
-    memcpy( (void*) &xx, &buffer[ii], sz);
+    memcpy( (void*) &xx, &lBuffer[ii], sz);
     SwitchBytes( (char*) &xx, sz);
     if (xx == 200) {
@@ -65,28 +58,15 @@
   }
 
-  messType = _GPSTrans.GetRTIGSHdrRecType(&buffer[ii]);
-  numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&buffer[ii]);
-  statID   = _GPSTrans.GetRTIGSHdrStaID(&buffer[ii]);
+  unsigned short messType = _GPSTrans.GetRTIGSHdrRecType(&lBuffer[ii]);
+  unsigned short numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&lBuffer[ii]);
+  unsigned short statID   = _GPSTrans.GetRTIGSHdrStaID(&lBuffer[ii]);
 
-  cout << "messType " << messType << endl;
-  cout << "numbytes " << numbytes << endl;
-  cout << "statID "   << statID   << endl;
-
-  switch (messType) {
-  case 100:
-    _GPSTrans.Decode_RTIGS_Sta(&buffer[ii], numbytes , rtigs_sta);
-    break;
-  case 200:
-    retval = _GPSTrans.Decode_RTIGS_Obs(&buffer[ii], numbytes , rtigs_obs);
+  if (messType == 200) {
+    RTIGSO_T       rtigs_obs;
+    short retval = _GPSTrans.Decode_RTIGS_Obs(&lBuffer[ii], numbytes , 
+                                              rtigs_obs);
     if (retval >= 1) {
       _GPSTrans.print_CMEAS();
     }
-    break;
-  case 300:
-    retval = _GPSTrans.Decode_RTIGS_Eph(&buffer[ii], numbytes , rtigs_eph, PRN);
-    break;
-  case 400:
-    retval = _GPSTrans.Decode_RTIGS_Met(&buffer[ii], numbytes , &rtigs_met); 
-    break;
   }
 }
Index: /trunk/BNC/bnc.pro
===================================================================
--- /trunk/BNC/bnc.pro	(revision 60)
+++ /trunk/BNC/bnc.pro	(revision 61)
@@ -2,9 +2,13 @@
 HEADERS =             bncgetthread.h    bncwindow.h   bnctabledlg.h   \
           bnccaster.h \
-          RTCM/format.h RTCM/GPSDecoder.h RTCM/m_data.h RTCM/RTCM.h
+          RTCM/format.h RTCM/GPSDecoder.h RTCM/m_data.h RTCM/RTCM.h   \
+          RTIGS/rtigs.h  RTIGS/cgps_transform.h  RTIGS/rtacp.h        \
+          RTIGS/rtigs_records.h  RTIGS/rtstruct.h
+
 
 SOURCES = bncmain.cpp bncgetthread.cpp  bncwindow.cpp bnctabledlg.cpp \
           bnccaster.cpp \
-          RTCM/m_date.cpp RTCM/RTCM.cpp
+          RTCM/m_date.cpp RTCM/RTCM.cpp \
+          RTIGS/rtigs.cpp RTIGS/cgps_transform.cpp
 
 QT += network
Index: /trunk/BNC/bncgetthread.cpp
===================================================================
--- /trunk/BNC/bncgetthread.cpp	(revision 60)
+++ /trunk/BNC/bncgetthread.cpp	(revision 61)
@@ -22,4 +22,5 @@
 #include "bncgetthread.h"
 #include "RTCM/RTCM.h"
+#include "RTIGS/rtigs.h"
 
 using namespace std;
@@ -134,9 +135,9 @@
   // Instantiate the filter
   // ----------------------
-  GPSDecoder* rtcmFilter;
+  GPSDecoder* decoder;
 
   if      (_format.indexOf("RTCM_2") != -1) {
     qWarning("Get Data: " + _mountPoint + " in RTCM 2.x format");
-    rtcmFilter = new RTCM('A',true);
+    decoder = new RTCM('A',true);
   }
   else if (_format.indexOf("RTCM_3") != -1) {
@@ -147,9 +148,9 @@
   else if (_format.indexOf("RTIGS") != -1) {
     qWarning("Get Data: " + _mountPoint + " in RTIGS format");
-    qWarning("Not yet implemented");
+    decoder = new rtigs();
     return exit(1);
   }
   else {
-    qWarning("Unknown data format");
+    qWarning(_mountPoint + " Unknown data format " + _format);
     return exit(1);
   }
@@ -163,11 +164,11 @@
       char* data = new char[nBytes];
       _socket->read(data, nBytes);
-      rtcmFilter->Decode(data, nBytes);
+      decoder->Decode(data, nBytes);
       delete data;
-      for (list<Observation*>::iterator it = rtcmFilter->m_lObsList.begin(); 
-           it != rtcmFilter->m_lObsList.end(); it++) {
+      for (list<Observation*>::iterator it = decoder->m_lObsList.begin(); 
+           it != decoder->m_lObsList.end(); it++) {
         emit newObs(_mountPoint, *it);
       }
-      rtcmFilter->m_lObsList.clear();
+      decoder->m_lObsList.clear();
     }
     else {
@@ -176,5 +177,5 @@
     }
   }
-  delete rtcmFilter;
+  delete decoder;
 }
 
