Index: /trunk/BNC/RTCM/GPSDecoder.h
===================================================================
--- /trunk/BNC/RTCM/GPSDecoder.h	(revision 1267)
+++ /trunk/BNC/RTCM/GPSDecoder.h	(revision 1268)
@@ -136,10 +136,28 @@
   }
 
-  QList<p_obs> _obsList;
-  QList<int> _typeList; // RTCMv3 message types
-  QList<int> _epochList; // Broadcast corrections
-  QStringList _antType; // RTCMv3 antenna descriptor
-  QList<double> _antList5; // RTCMv3 antenna XYZ
-  QList<double> _antList6; // RTCMv3 antenna XYZ & H
+  struct t_antInfo {
+    enum t_type { ARP, APC };
+
+    t_antInfo() {
+      xx = yy = zz = height = 0.0;
+      type = ARP;
+      height_f = false;
+      message  = 0;
+    };
+
+    double xx;
+    double yy;
+    double zz;
+    t_type type;
+    double height;
+    bool   height_f;
+    int    message;
+  };
+
+  QList<p_obs>     _obsList;
+  QList<int>       _typeList;  // RTCM   message types
+  QList<int>       _epochList; // Broadcast corrections
+  QStringList      _antType;   // RTCMv3 antenna descriptor
+  QList<t_antInfo> _antList;   // RTCM   antenna XYZ
 };
 
Index: /trunk/BNC/RTCM/RTCM2Decoder.cpp
===================================================================
--- /trunk/BNC/RTCM/RTCM2Decoder.cpp	(revision 1267)
+++ /trunk/BNC/RTCM/RTCM2Decoder.cpp	(revision 1268)
@@ -124,4 +124,7 @@
       }
     }
+    
+    // Store message number
+    _typeList.push_back(_PP.ID());
 
     if ( _PP.ID()==18 || _PP.ID()==19 ) {   
@@ -178,4 +181,14 @@
     else if ( _PP.ID() == 22 ) {
       _msg22.extract(_PP);
+    }
+
+    // Output for RTCM scan
+    if ( _PP.ID() == 3 ) {
+      _antList.push_back(t_antInfo());
+
+      this->getStaCrd(_antList.back().xx, _antList.back().yy, _antList.back().zz);
+
+      _antList.back().type     = t_antInfo::APC;
+      _antList.back().message  = _PP.ID();
     }
   }
Index: /trunk/BNC/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 1267)
+++ /trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 1268)
@@ -236,7 +236,10 @@
           else if(rr == 1005)
           {
-            _antList5.push_back(_Parser.antX);
-            _antList5.push_back(_Parser.antY);
-            _antList5.push_back(_Parser.antZ);
+	    _antList.push_back(t_antInfo());
+	    _antList.back().type     = t_antInfo::ARP;
+	    _antList.back().xx       = _Parser.antX * 1e-4;
+	    _antList.back().yy       = _Parser.antY * 1e-4;
+	    _antList.back().zz       = _Parser.antZ * 1e-4;
+	    _antList.back().message  = rr;
           }
 
@@ -245,8 +248,12 @@
           else if(rr == 1006)
           {
-            _antList6.push_back(_Parser.antX);
-            _antList6.push_back(_Parser.antY);
-            _antList6.push_back(_Parser.antZ);
-            _antList6.push_back(_Parser.antH);
+	    _antList.push_back(t_antInfo());
+	    _antList.back().type     = t_antInfo::ARP;
+	    _antList.back().xx       = _Parser.antX * 1e-4;
+	    _antList.back().yy       = _Parser.antY * 1e-4;
+	    _antList.back().zz       = _Parser.antZ * 1e-4;
+	    _antList.back().height   = _Parser.antH * 1e-4;
+	    _antList.back().height_f = true;
+	    _antList.back().message  = rr;
           }
 
Index: /trunk/BNC/bncgetthread.cpp
===================================================================
--- /trunk/BNC/bncgetthread.cpp	(revision 1267)
+++ /trunk/BNC/bncgetthread.cpp	(revision 1268)
@@ -755,38 +755,38 @@
 	    bool dump = true;
 
-            // RTCMv2 XYZ
-            // ----------
-            RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(_decoder);
-            if ( decoder2 && !_rnx_set_position ) {
-	      double stax, stay, staz;
-	      double dL1[3], dL2[3];
-	      if ( decoder2->getStaCrd(stax, stay, staz,
-                                       dL1[0], dL1[1], dL1[2], 
-                                       dL2[0], dL2[1], dL2[2]) == success ) {
-
-                if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
-                  QString ant1;
-                  ant1 =  QString("%1 ").arg(stax,0,'f',4);
-                  emit(newMessage(_staID + ": ARP X " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(stay,0,'f',4);
-                  emit(newMessage(_staID + ": ARP Y " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(staz,0,'f',4);
-                  emit(newMessage(_staID + ": ARP Z " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL1[0],0,'f',4);
-                  emit(newMessage(_staID + ": L1 APC DX " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL1[1],0,'f',4);
-                  emit(newMessage(_staID + ": L1 APC DY " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL1[2],0,'f',4);
-                  emit(newMessage(_staID + ": L1 APC DZ " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL2[0],0,'f',4);
-                  emit(newMessage(_staID + ": L2 APC DX " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL2[1],0,'f',4);
-                  emit(newMessage(_staID + ": L2 APC DY " + ant1.toAscii() + "m" ));
-                  ant1 =  QString("%1 ").arg(dL2[2],0,'f',4);
-                  emit(newMessage(_staID + ": L2 APC DZ " + ant1.toAscii() + "m" ));
-                }
-	    	_rnx_set_position = true;
-              }
-            }  
+            //// // RTCMv2 XYZ
+            //// // ----------
+            //// RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(_decoder);
+            //// if ( decoder2 && !_rnx_set_position ) {
+	    ////   double stax, stay, staz;
+	    ////   double dL1[3], dL2[3];
+	    ////   if ( decoder2->getStaCrd(stax, stay, staz,
+            ////                            dL1[0], dL1[1], dL1[2], 
+            ////                            dL2[0], dL2[1], dL2[2]) == success ) {
+	    //// 
+            ////     if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
+            ////       QString ant1;
+            ////       ant1 =  QString("%1 ").arg(stax,0,'f',4);
+            ////       emit(newMessage(_staID + ": ARP X " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(stay,0,'f',4);
+            ////       emit(newMessage(_staID + ": ARP Y " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(staz,0,'f',4);
+            ////       emit(newMessage(_staID + ": ARP Z " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL1[0],0,'f',4);
+            ////       emit(newMessage(_staID + ": L1 APC DX " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL1[1],0,'f',4);
+            ////       emit(newMessage(_staID + ": L1 APC DY " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL1[2],0,'f',4);
+            ////       emit(newMessage(_staID + ": L1 APC DZ " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL2[0],0,'f',4);
+            ////       emit(newMessage(_staID + ": L2 APC DX " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL2[1],0,'f',4);
+            ////       emit(newMessage(_staID + ": L2 APC DY " + ant1.toAscii() + "m" ));
+            ////       ant1 =  QString("%1 ").arg(dL2[2],0,'f',4);
+            ////       emit(newMessage(_staID + ": L2 APC DZ " + ant1.toAscii() + "m" ));
+            ////     }
+	    //// 	_rnx_set_position = true;
+            ////   }
+            //// }  
 
 	    if ( dump ) {
@@ -830,31 +830,23 @@
           }
 
-          // RTCMv3 antenna XYZ
+          // antenna XYZ
           // ------------------
-          if (0<_decoder->_antList5.size()) {
-            QString ant1,ant2,ant3;
-            for (int ii=0;ii<_decoder->_antList5.size();ii+=3) {
-              ant1 =  QString("%1 ").arg(_decoder->_antList5[ii+0]*0.0001,0,'f',4);
-              ant2 =  QString("%1 ").arg(_decoder->_antList5[ii+1]*0.0001,0,'f',4);
-              ant3 =  QString("%1 ").arg(_decoder->_antList5[ii+2]*0.0001,0,'f',4);
-              emit(newMessage(_staID + ": ARP (ITRF) X " + ant1.toAscii() + "m" ));
-              emit(newMessage(_staID + ": ARP (ITRF) Y " + ant2.toAscii() + "m"));
-              emit(newMessage(_staID + ": ARP (ITRF) Z " + ant3.toAscii() + "m"));
-            }
-          }
-
-          // RTCMv3 antenna XYZ-H
-          // --------------------
-          if (0<_decoder->_antList6.size()) {
-            QString ant1,ant2,ant3,ant4;
-            for (int ii=0;ii<_decoder->_antList6.size();ii+=4) {
-              ant1 =  QString("%1 ").arg(_decoder->_antList6[ii+0]*0.0001,0,'f',4);
-              ant2 =  QString("%1 ").arg(_decoder->_antList6[ii+1]*0.0001,0,'f',4);
-              ant3 =  QString("%1 ").arg(_decoder->_antList6[ii+2]*0.0001,0,'f',4);
-              ant4 =  QString("%1 ").arg(_decoder->_antList6[ii+3]*0.0001,0,'f',4);
-              emit(newMessage(_staID + ": ARP (ITRF) X " + ant1.toAscii() + "m" ));
-              emit(newMessage(_staID + ": ARP (ITRF) Y " + ant2.toAscii() + "m"));
-              emit(newMessage(_staID + ": ARP (ITRF) Z " + ant3.toAscii() + "m"));
-              emit(newMessage(_staID + ": Antenna height above ARP "  + ant4.toAscii() + "m"));
+          if (0<_decoder->_antList.size()) {
+            for (int ii=0;ii<_decoder->_antList.size();++ii) {
+	      QByteArray ant1,ant2,ant3, antT;
+              ant1 = QString("%1 ").arg(_decoder->_antList[ii].xx,0,'f',4).toAscii();
+              ant2 = QString("%1 ").arg(_decoder->_antList[ii].yy,0,'f',4).toAscii();
+              ant3 = QString("%1 ").arg(_decoder->_antList[ii].zz,0,'f',4).toAscii();
+	      switch (_decoder->_antList[ii].type) {
+	      case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
+	      case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
+	      }
+              emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m"));
+              emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m"));
+              emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m"));
+	      if (_decoder->_antList[ii].height_f) {
+		QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
+		emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m"));
+	      }
             }
           }
@@ -862,6 +854,5 @@
         _decoder->_typeList.clear();
         _decoder->_antType.clear();
-        _decoder->_antList5.clear();
-        _decoder->_antList6.clear();
+        _decoder->_antList.clear();
       }
 
