Index: trunk/BNC/bnchelp.html
===================================================================
--- trunk/BNC/bnchelp.html	(revision 2472)
+++ trunk/BNC/bnchelp.html	(revision 2473)
@@ -174,8 +174,9 @@
 &nbsp; &nbsp; &nbsp; 3.11.2.3 <a href=#ppptropo>Estimate Tropo</a><br>
 &nbsp; &nbsp; &nbsp; 3.11.2.4 <a href=#pppglo>Use GLONASS</a><br>
-&nbsp; &nbsp; &nbsp; 3.11.3 <a href=#pppnmearef>Plot Origin</a><br>
-&nbsp; &nbsp; &nbsp; 3.11.4 <a href=#pppnmeaout>NMEA</a><br>
-&nbsp; &nbsp; &nbsp; 3.11.4.1 <a href=#pppnmeafile>File</a><br>
-&nbsp; &nbsp; &nbsp; 3.11.4.2 <a href=#pppnmeaport>Port</a><br><br>
+&nbsp; &nbsp; &nbsp; 3.11.3 <a href=#pppsigma>Sigma Code</a><br>
+&nbsp; &nbsp; &nbsp; 3.11.4 <a href=#pppnmearef>Plot Origin</a><br>
+&nbsp; &nbsp; &nbsp; 3.11.5 <a href=#pppnmeaout>NMEA</a><br>
+&nbsp; &nbsp; &nbsp; 3.11.5.1 <a href=#pppnmeafile>File</a><br>
+&nbsp; &nbsp; &nbsp; 3.11.5.2 <a href=#pppnmeaport>Port</a><br><br>
 3.12. <a href=#streams>Streams</a><br>
 &nbsp; &nbsp; &nbsp; 3.12.1 <a href=#streamedit>Edit Streams</a><br>
@@ -1111,5 +1112,18 @@
 </p>
 
-<p><a name="pppnmearef"><h4>3.11.3 Plot Origin - optional</h4></p>
+<p><a name="pppsigma"><h4>3.11.3 Sigma Code - mandatory if 'Use Phase Obs' is set</h4></p>
+<p>
+When 'Use phase obs' is set in BNC the PPP solution will be carried out using both code and phase observations. A sigma of 5.0 m for code observations and a sigma of 0.02 m for phase observations (defauls) is used to combine both types of observations. 
+As the convergence characteristic of a PPP solution can be influenced by the relation between the sigmas for code and phase observations, you may like to introduce you own sigma for code observations which differs from the default of 5.0 m.
+<ul>
+<li>Introducing a smaller sigma (higher accuracy) for code observations leads to better results shortly after the program start. However, it may take more time till you finally get the best possible coordinates.</li>
+<li>Introducing a higher sigma (lower accuracy) for code observations may lead to a prolonged convergence time but more rapidly provide the final accurate coordinates.</li>
+</ul>
+</p>
+<p>
+Note that only values between 0.3 m and 50.0 m are accepted as code sigma.
+</p>
+
+<p><a name="pppnmearef"><h4>3.11.4 Plot Origin - optional</h4></p>
 <p>
 Select an origin for North/East/Up time series plots of derived coordinates in the 'PPP Plot' tab. Note that this makes only sense for a stationary receiver. Available options are
@@ -1133,5 +1147,5 @@
 </p>
 
-<p><a name="pppnmeaout"><h4>3.11.4 NMEA</h4></p>
+<p><a name="pppnmeaout"><h4>3.11.5 NMEA</h4></p>
 <p>
 BNC allows to output results from Point Positioning in NMEA format. The NMEA messages generated are
@@ -1142,10 +1156,10 @@
 </p>
 
-<p><a name="pppnmeafile"><h4>3.11.4.1 File - optional</h4></p>
+<p><a name="pppnmeafile"><h4>3.11.5.1 File - optional</h4></p>
 <p>
 Specify the full path to a file where Point Positioning results are saved as NMEA messages. The generated NMEA file begins with a single GPRMC message which carries only date and time information. The default value for 'File (full path)' is an empty option field, meaning that BNC will not saved NMEA messages into a file.
 </p>
 
-<p><a name="pppnmeaport"><h4>3.11.4.2 Port - optional</h4></p>
+<p><a name="pppnmeaport"><h4>3.11.5.2 Port - optional</h4></p>
 <p>
 Specify the IP port number of a local port where Point Positioning results become available as NMEA messages. The default value for 'Port' is an empty option field, meaning that BNC does not provide NMEA messsages vi IP port. Note that the NMEA file output and the NMEA IP port output are the same. 
Index: trunk/BNC/bncmodel.cpp
===================================================================
--- trunk/BNC/bncmodel.cpp	(revision 2472)
+++ trunk/BNC/bncmodel.cpp	(revision 2473)
@@ -66,5 +66,5 @@
 const double   sig_amb_0_GPS    =  100.0;
 const double   sig_amb_0_GLO    = 1000.0;
-const double   sig_P3           =    5.0; // was 20.0, GW
+//const double   sig_P3           =    20.0;
 const double   sig_L3_GPS       =    0.02;
 const double   sig_L3_GLO       =    0.02;
@@ -79,4 +79,5 @@
   index_old = 0;
   xx        = 0.0;
+
 }
 
@@ -530,4 +531,14 @@
 t_irc bncModel::update(t_epoData* epoData) {
 
+  bncSettings settings;
+  double sig_P3;
+  sig_P3 = 5.0;
+  if ( Qt::CheckState(settings.value("pppUsePhase").toInt()) == Qt::Checked ) {
+    sig_P3 = settings.value("pppSigC").toDouble();
+    if (sig_P3 < 0.3 || sig_P3 > 50.0) {
+      sig_P3 = 5.0;
+    }
+  }
+
   _log.clear();  
 
@@ -730,5 +741,4 @@
   // NEU Output
   // ----------
-  bncSettings settings;
   if (settings.value("pppOrigin").toString() == "X Y Z") {
     double xyzRef[3];
Index: trunk/BNC/bncsettings.cpp
===================================================================
--- trunk/BNC/bncsettings.cpp	(revision 2472)
+++ trunk/BNC/bncsettings.cpp	(revision 2473)
@@ -79,4 +79,5 @@
     setValue("pppMount",         "");
     setValue("pppSPP",           "PPP");
+    setValue("pppSigC",          "5.0");
     setValue("pppStatic",        "");
     setValue("pppUsePhase",      "");
Index: trunk/BNC/bncwindow.cpp
===================================================================
--- trunk/BNC/bncwindow.cpp	(revision 2472)
+++ trunk/BNC/bncwindow.cpp	(revision 2473)
@@ -341,7 +341,9 @@
   _pppNMEALineEdit     = new QLineEdit(settings.value("nmeaFile").toString());
   _pppNMEAPortLineEdit = new QLineEdit(settings.value("nmeaPort").toString());
+  _pppSigCLineEdit  = new QLineEdit(settings.value("pppSigC").toString());
   _pppRefCrdXLineEdit  = new QLineEdit(settings.value("pppRefCrdX").toString());
   _pppRefCrdYLineEdit  = new QLineEdit(settings.value("pppRefCrdY").toString());
   _pppRefCrdZLineEdit  = new QLineEdit(settings.value("pppRefCrdZ").toString());
+
   _pppOriginComboBox = new QComboBox();
   _pppOriginComboBox->setEditable(false);
@@ -351,4 +353,5 @@
     _pppOriginComboBox->setCurrentIndex(ij);
   }
+
   _pppSPPComboBox = new QComboBox();
   _pppSPPComboBox->setEditable(false);
@@ -375,4 +378,7 @@
 
   connect(_pppOriginComboBox, SIGNAL(currentIndexChanged(const QString &)),
+          this, SLOT(slotBncTextChanged()));
+
+  connect(_pppUsePhaseCheckBox, SIGNAL(stateChanged(int)),
           this, SLOT(slotBncTextChanged()));
 
@@ -462,4 +468,5 @@
   _pppNMEAPortLineEdit->setWhatsThis(tr("<p>Specify an IP port number to output PPP results as NMEA messages through an IP port.</p>"));
   _pppOriginComboBox->setWhatsThis(tr("<p>Select an origin for North/East/Up time series plots in the 'PPP Plot' tab. This option makes only sense for a stationary receiver.</p>"));
+  _pppSigCLineEdit->setWhatsThis(tr("<p>Enter a sigma for your code observations in meters.</p><p>5.0 (default) is likely to be an appropriate choice.</p>"));
   _pppRefCrdXLineEdit->setWhatsThis(tr("<p>You may enter reference coordinates of the receiver position if known. The time series plots shown in the 'PPP Plot' tab will then be referred to these values.</p>"));
   _pppRefCrdYLineEdit->setWhatsThis(tr("<p>You may enter reference coordinates of the receiver position if known. The time series plots shown in the 'PPP Plot' tab will then be referred to these values.</p>"));
@@ -699,4 +706,5 @@
   // ----------
   QGridLayout* pppLayout = new QGridLayout;
+  _pppSigCLineEdit->setMaximumWidth(5*ww);
   _pppRefCrdXLineEdit->setMaximumWidth(14*ww);
   _pppRefCrdYLineEdit->setMaximumWidth(14*ww);
@@ -718,18 +726,20 @@
   pppLayout->addWidget(_pppGLONASSCheckBox,                  1, 7);
   pppLayout->addWidget(new QLabel("Use GLONASS"),            1, 8);
-  pppLayout->addWidget(new QLabel("Plot origin"),            2, 0);
-  pppLayout->addWidget(_pppOriginComboBox,                   2, 1, 1, 2);
-  pppLayout->addWidget(new QLabel("  "),                     2, 3);
-  pppLayout->addWidget(_pppRefCrdXLineEdit,                  2, 4);
-  pppLayout->addWidget(new QLabel("  "),                     2, 5);
-  pppLayout->addWidget(_pppRefCrdYLineEdit,                  2, 6); 
-  pppLayout->addWidget(new QLabel("  "),                     2, 7);
-  pppLayout->addWidget(_pppRefCrdZLineEdit,                  2, 8);
-  pppLayout->addWidget(new QLabel("NMEA File (full path)"),  3, 0); 
-  pppLayout->addWidget(_pppNMEALineEdit,                     3, 1, 1, 6);
-  pppLayout->addWidget(new QLabel("Port"),                   3, 7);
-  pppLayout->addWidget(_pppNMEAPortLineEdit,                 3, 8);
-  pppLayout->addWidget(new QLabel("Coordinates from Precise Point Positioning (PPP)."),4, 0,1,15);
-  pppLayout->addWidget(new QLabel("    "),                   5, 0);
+  pppLayout->addWidget(new QLabel("Sigma code"),             2, 0);
+  pppLayout->addWidget(_pppSigCLineEdit,                     2, 1);
+  pppLayout->addWidget(new QLabel("Plot origin"),            3, 0);
+  pppLayout->addWidget(_pppOriginComboBox,                   3, 1, 1, 2);
+  pppLayout->addWidget(new QLabel("  "),                     3, 3);
+  pppLayout->addWidget(_pppRefCrdXLineEdit,                  3, 4);
+  pppLayout->addWidget(new QLabel("  "),                     3, 5);
+  pppLayout->addWidget(_pppRefCrdYLineEdit,                  3, 6); 
+  pppLayout->addWidget(new QLabel("  "),                     3, 7);
+  pppLayout->addWidget(_pppRefCrdZLineEdit,                  3, 8);
+  pppLayout->addWidget(new QLabel("NMEA File (full path)"),  4, 0); 
+  pppLayout->addWidget(_pppNMEALineEdit,                     4, 1, 1, 6);
+  pppLayout->addWidget(new QLabel("Port"),                   4, 7);
+  pppLayout->addWidget(_pppNMEAPortLineEdit,                 4, 8);
+
+  pppLayout->addWidget(new QLabel("Coordinates from Precise Point Positioning (PPP)."),5, 0,1,15);
   pppgroup->setLayout(pppLayout);
 
@@ -1045,4 +1055,5 @@
   settings.setValue("nmeaFile",    _pppNMEALineEdit->text());
   settings.setValue("nmeaPort",    _pppNMEAPortLineEdit->text());
+  settings.setValue("pppSigC",     _pppSigCLineEdit->text());
   settings.setValue("pppRefCrdX",  _pppRefCrdXLineEdit->text());
   settings.setValue("pppRefCrdY",  _pppRefCrdYLineEdit->text());
@@ -1397,4 +1408,5 @@
   QPalette palette_white(QColor(255, 255, 255));
   QPalette palette_gray(QColor(230, 230, 230));
+  bncSettings settings;
 
   // Proxy
@@ -1586,5 +1598,5 @@
   // ----------
   if (sender() == 0 || sender() == _pppMountLineEdit 
-     || sender() == _pppOriginComboBox) {
+     || sender() == _pppOriginComboBox || sender() == _pppUsePhaseCheckBox ) {
     if (!_pppMountLineEdit->text().isEmpty()) {
       _pppSPPComboBox->setPalette(palette_white);
@@ -1626,4 +1638,13 @@
         _pppRefCrdZLineEdit->setEnabled(false);
       }
+      if (_pppUsePhaseCheckBox->isChecked() 
+         && !_pppMountLineEdit->text().isEmpty()) {
+        _pppSigCLineEdit->setPalette(palette_white);
+        _pppSigCLineEdit->setEnabled(true);
+      }
+      else {
+        _pppSigCLineEdit->setPalette(palette_gray);
+        _pppSigCLineEdit->setEnabled(false);
+      }
     } else {
       _pppSPPComboBox->setPalette(palette_gray);
@@ -1638,4 +1659,5 @@
       _pppGLONASSCheckBox->setPalette(palette_gray);
       _pppOriginComboBox->setPalette(palette_gray);
+      _pppSigCLineEdit->setPalette(palette_gray);
       _pppSPPComboBox->setEnabled(false);
       _pppNMEALineEdit->setEnabled(false);
@@ -1649,5 +1671,6 @@
       _pppGLONASSCheckBox->setEnabled(false);
       _pppOriginComboBox->setEnabled(false);
-    }
-  }
-}
+      _pppSigCLineEdit->setEnabled(false);
+    }
+  }
+}
Index: trunk/BNC/bncwindow.h
===================================================================
--- trunk/BNC/bncwindow.h	(revision 2472)
+++ trunk/BNC/bncwindow.h	(revision 2473)
@@ -116,4 +116,6 @@
     QLineEdit* _pppNMEALineEdit;
     QLineEdit* _pppNMEAPortLineEdit;
+    QLineEdit* _pppSigCLineEdit;
+    QLineEdit* _pppSigPLineEdit;
     QLineEdit* _pppRefCrdXLineEdit;
     QLineEdit* _pppRefCrdYLineEdit;
