Index: trunk/BNC/bncmodel.cpp
===================================================================
--- trunk/BNC/bncmodel.cpp	(revision 2724)
+++ trunk/BNC/bncmodel.cpp	(revision 2726)
@@ -140,5 +140,5 @@
   _sigL3 = 0.02;
   if (!settings.value("pppSigmaPhase").toString().isEmpty()) {
-    _sigL3 = settings.value("pppSigmaPhase").toDouble();
+    _sigP3 = settings.value("pppSigmaPhase").toDouble();
   }
 
@@ -167,5 +167,7 @@
   // ----------------
   _quickStart = 0;
-  if (settings.value("pppOrigin").toString() == "PPP" &&
+  if (settings.value("pppRefCrdX").toString() != "" &&
+      settings.value("pppRefCrdY").toString() != "" &&
+      settings.value("pppRefCrdZ").toString() != "" &&
       !settings.value("pppQuickStart").toString().isEmpty()) {
     _quickStart = settings.value("pppQuickStart").toDouble() * 60.0;
@@ -414,5 +416,5 @@
   }
 
-  // Use different white noise for quick-start mode
+  // Use different white noise for Quick-Start mode
   // ----------------------------------------------
   double sigCrdP_used   = _sigCrdP;
@@ -431,5 +433,7 @@
     if      (pp->type == bncParam::CRD_X) {
       if (firstCrd) {
-        if (settings.value("pppOrigin").toString() == "PPP") {
+        if (settings.value("pppRefCrdX").toString() != "" &&
+            settings.value("pppRefCrdY").toString() != "" &&
+            settings.value("pppRefCrdZ").toString() != "") {
           pp->xx = settings.value("pppRefCrdX").toDouble();
         }
@@ -442,5 +446,7 @@
     else if (pp->type == bncParam::CRD_Y) {
       if (firstCrd) {
-        if (settings.value("pppOrigin").toString() == "PPP") {
+        if (settings.value("pppRefCrdX").toString() != "" &&
+            settings.value("pppRefCrdY").toString() != "" &&
+            settings.value("pppRefCrdZ").toString() != "") {
           pp->xx = settings.value("pppRefCrdY").toDouble();
         }
@@ -453,5 +459,7 @@
     else if (pp->type == bncParam::CRD_Z) {
       if (firstCrd) {
-        if (settings.value("pppOrigin").toString() == "PPP") {
+        if (settings.value("pppRefCrdX").toString() != "" &&
+            settings.value("pppRefCrdY").toString() != "" &&
+            settings.value("pppRefCrdZ").toString() != "") {
           pp->xx = settings.value("pppRefCrdZ").toDouble();
         }
@@ -586,4 +594,12 @@
 
   bncSettings settings;
+  double sig_P3;
+  sig_P3 = 5.0;
+  if ( Qt::CheckState(settings.value("pppUsePhase").toInt()) == Qt::Checked ) {
+    sig_P3 = settings.value("pppSigmaCode").toDouble();
+    if (sig_P3 < 0.3 || sig_P3 > 50.0) {
+      sig_P3 = 5.0;
+    }
+  }
 
   _log.clear();  
@@ -647,5 +663,5 @@
     
       ll(iObs)      = satData->P3 - cmpValue(satData, false);
-      PP(iObs,iObs) = 1.0 / (_sigP3 * _sigP3);
+      PP(iObs,iObs) = 1.0 / (sig_P3 * sig_P3);
       for (int iPar = 1; iPar <= _params.size(); iPar++) {
         AA(iObs, iPar) = _params[iPar-1]->partial(satData, false);
@@ -783,5 +799,7 @@
   // NEU Output
   // ----------
-  if (settings.value("pppOrigin").toString() != "None") {
+  if (settings.value("pppRefCrdX").toString() != "" &&
+      settings.value("pppRefCrdY").toString() != "" &&
+      settings.value("pppRefCrdZ").toString() != "") {
 
     double xyzRef[3];
@@ -885,11 +903,12 @@
       emit newMessage(QByteArray(strE.str().c_str()), true);
 
-      ostringstream strF; strF.setf(ios::fixed);
-      strF << _staID.data() << "  AVE-TRP " 
-           << epoData->tt.timestr(1) << " "
-           << setw(13) << setprecision(3) << mean[6]  << " +- "
-           << setw(6)  << setprecision(3) << std[6]   << endl;
-
-      emit newMessage(QByteArray(strF.str().c_str()), true);
+      if ( Qt::CheckState(settings.value("pppEstTropo").toInt()) == Qt::Checked) {
+        ostringstream strF; strF.setf(ios::fixed);
+        strF << _staID.data() << "  AVE-TRP " 
+             << epoData->tt.timestr(1) << " "
+             << setw(13) << setprecision(3) << mean[6]  << " +- "
+             << setw(6)  << setprecision(3) << std[6]   << endl;
+        emit newMessage(QByteArray(strF.str().c_str()), true);
+      }
     }
   }
