Index: trunk/BNC/src/bncantex.cpp
===================================================================
--- trunk/BNC/src/bncantex.cpp	(revision 7520)
+++ trunk/BNC/src/bncantex.cpp	(revision 7521)
@@ -35,5 +35,5 @@
  * Created:    26-Jan-2011
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -68,5 +68,5 @@
 }
 
-// Print 
+// Print
 ////////////////////////////////////////////////////////////////////////////
 void bncAntex::print() const {
@@ -90,4 +90,30 @@
 }
 
+// Print
+////////////////////////////////////////////////////////////////////////////
+QString bncAntex::pcoSinexString(const std::string& antName, t_frequency::type frqType) {
+
+  if (antName.find("NULLANTENNA") != string::npos) {
+    QString();
+  }
+
+  QString antNameQ = antName.c_str();
+
+  if (_maps.find(antNameQ) == _maps.end()) {
+    QString();
+  }
+
+  t_antMap* map = _maps[antNameQ];
+  if (map->frqMap.find(frqType) == map->frqMap.end()) {
+    return QString();
+  }
+
+  t_frqMap* frqMap = map->frqMap[frqType];
+
+  return QString("%1 %2 %3").arg(frqMap->neu[2], 6, 'f', 4)
+                            .arg(frqMap->neu[0], 6, 'f', 4)
+                            .arg(frqMap->neu[1], 6, 'f', 4);
+}
+
 // Read ANTEX File
 ////////////////////////////////////////////////////////////////////////////
@@ -104,5 +130,5 @@
   while ( !in.atEnd() ) {
     QString line = in.readLine();
-  
+
     // Start of Antenna
     // ----------------
@@ -116,5 +142,5 @@
         newAntMap = new t_antMap();
       }
-    } 
+    }
 
     // End of Antenna
@@ -152,5 +178,5 @@
       else if (line.indexOf("ZEN1 / ZEN2 / DZEN") == 60) {
         QTextStream inLine(&line, QIODevice::ReadOnly);
-        inLine >> newAntMap->zen1 >> newAntMap->zen2 >> newAntMap->dZen;  
+        inLine >> newAntMap->zen1 >> newAntMap->zen2 >> newAntMap->dZen;
       }
 
@@ -271,5 +297,5 @@
 // Satellite Antenna Offset
 ////////////////////////////////////////////////////////////////////////////
-t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd, 
+t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd,
                                  const ColumnVector& xSat, ColumnVector& dx) {
 
@@ -297,8 +323,8 @@
       ColumnVector xSun = BNC_PPP::t_astro::Sun(Mjd);
       xSun /= sqrt(DotProduct(xSun,xSun));
-  
+
       ColumnVector sy = crossproduct(sz, xSun);
       sy /= sqrt(DotProduct(sy,sy));
-  
+
       ColumnVector sx = crossproduct(sy, sz);
 
@@ -314,5 +340,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double bncAntex::rcvCorr(const string& antName, t_frequency::type frqType,
Index: trunk/BNC/src/bncantex.h
===================================================================
--- trunk/BNC/src/bncantex.h	(revision 7520)
+++ trunk/BNC/src/bncantex.h	(revision 7521)
@@ -37,10 +37,11 @@
   bncAntex();
   ~bncAntex();
-  t_irc  readFile(const QString& fileName);  
-  void   print() const;
-  double rcvCorr(const std::string& antName, t_frequency::type frqType,
-                 double eleSat, double azSat, bool& found) const;
-  t_irc  satCoMcorrection(const QString& prn, double Mjd, 
-                          const ColumnVector& xSat, ColumnVector& dx);
+  t_irc   readFile(const QString& fileName);
+  void    print() const;
+  QString pcoSinexString(const std::string& antName, t_frequency::type frqType);
+  double  rcvCorr(const std::string& antName, t_frequency::type frqType,
+                  double eleSat, double azSat, bool& found) const;
+  t_irc   satCoMcorrection(const QString& prn, double Mjd,
+                           const ColumnVector& xSat, ColumnVector& dx);
 
  private:
Index: trunk/BNC/src/bncsinextro.cpp
===================================================================
--- trunk/BNC/src/bncsinextro.cpp	(revision 7520)
+++ trunk/BNC/src/bncsinextro.cpp	(revision 7521)
@@ -30,6 +30,14 @@
                          int sampl)
   : bncoutf(sklFileName, intr, sampl) {
+
   _opt       = opt;
   (!sampl) ? _sampl = 1 : _sampl =  sampl;
+
+  if (!_opt->_antexFileName.empty()) {
+    _antex = new bncAntex(_opt->_antexFileName.c_str());
+  }
+  else {
+    _antex = 0;
+  }
 }
 
@@ -38,4 +46,6 @@
 bncSinexTro::~bncSinexTro() {
   closeFile();
+  if (_antex)
+    delete _antex;
 }
 
@@ -45,4 +55,5 @@
   int    GPSWeek;
   double GPSWeeks;
+  bncSettings settings;
   GPSweekFromDateAndTime(datTim, GPSWeek, GPSWeeks);
   int daysec    = int(fmod(GPSWeeks, 86400.0));
@@ -58,8 +69,24 @@
                                        .arg(84600    , 5, 10);
 
-
-  _out << "%=TRO 0.01 BNC " << creationTime.toStdString() << " BNC "
+  QString intStr = settings.value("PPP/snxtroIntr").toString();
+  int intr, indHlp = 0;
+  if      ((indHlp = intStr.indexOf("min")) != -1) {
+    intr = intStr.left(indHlp-1).toInt();
+    intr *= 60;
+  }
+  else if ((indHlp = intStr.indexOf("hour")) != -1) {
+    intr = intStr.left(indHlp-1).toInt();
+    intr *= 3600;
+  }
+  else if ((indHlp = intStr.indexOf("day")) != -1) {
+    intr = intStr.left(indHlp-1).toInt();
+    intr *= 86400;
+  }
+
+
+  QString numberOfEpochs = QString("%1").arg(intr/_sampl, 5, 10, QLatin1Char('0'));
+  _out << "%=TRO 2.00 BNC " << creationTime.toStdString() << " BNC "
        << startTime.toStdString() << " " << endTime.toStdString() << " P "
-       << _opt->_roverName.substr(0,4)   << endl;
+       << numberOfEpochs.toStdString() << " 0 " << " T "  << endl;
 
 
@@ -68,7 +95,91 @@
   _out << " OUTPUT             " << "Total Troposphere Zenith Path Delay Product" << endl;
   _out << " SOFTWARE           " << BNCPGMNAME <<  endl;
-  _out << " HARDWARE           " << BNC_OS << endl;
   _out << " INPUT              " << "Orbit and Clock information used from BRDC and RTCM-SSR streams" << endl;
   _out << "-FILE/REFERENCE" << endl << endl;
+
+
+  _out << "+SITE/ID" << endl;
+  _out << "-SITE/ID" << endl << endl;
+
+
+  _out << "+SITE/RECEIVER" << endl;
+  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ DESCRIPTION_________ S/N__ FIRMWARE___" << endl;
+  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
+       << startTime.toStdString() << " " << endTime.toStdString() << " " << _opt->_recNameRover << endl;
+  _out << "-SITE/RECEIVER" << endl << endl;
+
+
+  _out << "+SITE/ANTENNA" << endl;
+  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ DESCRIPTION_________ S/N__" << endl;
+  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
+       << startTime.toStdString() << " " << endTime.toStdString() << " " << _opt->_antNameRover << endl;
+  _out << "-SITE/ANTENNA" << endl << endl;
+
+  if (_antex) {
+    if (_opt->_LCsGPS.size()) {
+      _out << "+SITE/GPS_PHASE_CENTER" << endl;
+      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
+      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
+      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
+           <<  "      "
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::G1).toStdString()
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::G2).toStdString()
+        << endl;
+      _out << "-SITE/GPS_PHASE_CENTER" << endl << endl;
+    }
+    if (_opt->_LCsGLONASS.size()) {
+      _out << "+SITE/GLONASS_PHASE_CENTER" << endl;
+      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
+      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
+      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
+           <<  "      "
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::R1).toStdString()
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::R2).toStdString()
+        << endl;
+      _out << "-SITE/GLONASS_PHASE_CENTER" << endl << endl;
+    }
+    if (_opt->_LCsGalileo.size()) {
+      _out << "+SITE/GALILEO_PHASE_CENTER" << endl;
+      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
+      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
+      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
+           <<  "      "
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::E1).toStdString()
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::E5).toStdString()
+        << endl;
+      _out << "-SITE/GALILEO_PHASE_CENTER" << endl << endl;
+    }
+    if (_opt->_LCsBDS.size()) {
+      _out << "+SITE/BEIDOU_PHASE_CENTER" << endl;
+      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
+      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
+      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
+           <<  "      "
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::C2).toStdString()
+           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::C7).toStdString()
+        << endl;
+      _out << "-SITE/BEIDOU_PHASE_CENTER" << endl << endl;
+    }
+  }
+
+  _out << "+SITE/ECCENTRICITY" << endl;
+  _out << "*                                             UP______ NORTH___ EAST____" << endl;
+  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ AXE ARP->BENCHMARK(M)_________" << endl;
+  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
+       << startTime.toStdString() << " " << endTime.toStdString() << " " << " UNE"
+       << QString("%1").arg(_opt->_neuEccRover(3), 9, 'f', 4, QLatin1Char(' ')).toStdString()
+       << QString("%1").arg(_opt->_neuEccRover(1), 9, 'f', 4, QLatin1Char(' ')).toStdString()
+       << QString("%1").arg(_opt->_neuEccRover(2), 9, 'f', 4, QLatin1Char(' ')).toStdString() << endl;
+  _out << "-SITE/ANTENNA" << endl << endl;
+
+
+  _out << "+TROP/COORDINATES" << endl;
+  _out << "*SITE PT SOLN T __STA_X_____ __STA_Y_____ __STA_Z_____ SYSTEM REMRK" << endl;
+  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P"
+       << QString("%1").arg(_opt->_xyzAprRover(1), 13, 'f', 3, QLatin1Char(' ')).toStdString()
+       << QString("%1").arg(_opt->_xyzAprRover(2), 13, 'f', 3, QLatin1Char(' ')).toStdString()
+       << QString("%1").arg(_opt->_xyzAprRover(3), 13, 'f', 3, QLatin1Char(' ')).toStdString()
+       << " ITRF08"<< endl;
+  _out << "-TROP/COORDINATES"<< endl << endl;
 
 
@@ -86,13 +197,4 @@
 
 
-  _out << "+TROP/STA_COORDINATES" << endl;
-  _out << "*SITE PT SOLN T STA_X_______ STA_Y_______ STA_Z_______ SYSTEM REMARK" << endl;
-  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
-       << setw(12) << setprecision(3) << _opt->_xyzAprRover(1) << " "
-       << setw(12) << setprecision(3) << _opt->_xyzAprRover(2) << " "
-       << setw(12) << setprecision(3) << _opt->_xyzAprRover(3) << " ITRF08" << endl;
-  _out << "-TROP/STA_COORDINATES"  << endl << endl;
-
-
   _out << "+TROP/SOLUTION" << endl;
   _out << "*SITE EPOCH_______ TROTOT STDEV" << endl;
Index: trunk/BNC/src/bncsinextro.h
===================================================================
--- trunk/BNC/src/bncsinextro.h	(revision 7520)
+++ trunk/BNC/src/bncsinextro.h	(revision 7521)
@@ -10,4 +10,6 @@
 #include "bncversion.h"
 #include "pppOptions.h"
+#include "bncsettings.h"
+#include "bncantex.h"
 
 using namespace BNC_PPP;
@@ -26,6 +28,8 @@
   virtual void closeFile();
   QString _roverName;
-  int     _sampl;
+  int _sampl;
   const t_pppOptions*  _opt;
+  bncAntex* _antex;
+  double _antPCO[t_frequency::max];
 };
 
Index: trunk/BNC/src/pppOptions.h
===================================================================
--- trunk/BNC/src/pppOptions.h	(revision 7520)
+++ trunk/BNC/src/pppOptions.h	(revision 7521)
@@ -32,9 +32,10 @@
   std::string             _corrFile;
   double                  _corrWaitTime;
-  std::string             _roverName;     
+  std::string             _roverName;
   ColumnVector            _xyzAprRover;
   ColumnVector            _neuEccRover;
-  std::string             _antNameRover;  
-  std::string             _antexFileName; 
+  std::string             _recNameRover;
+  std::string             _antNameRover;
+  std::string             _antexFileName;
   double                  _sigmaC1;
   double                  _sigmaL1;
