Index: trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8962)
+++ trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8967)
@@ -559,23 +559,24 @@
       else if (prn.system() == 'E') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
+           + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
         ++co.NumberOfSat[CLOCKORBIT_SATGALILEO];
       }
       else if (prn.system() == 'J') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + co.NumberOfSat[CLOCKORBIT_SATQZSS];
+           + CLOCKORBIT_NUMGALILEO
+		   + co.NumberOfSat[CLOCKORBIT_SATQZSS];
         ++co.NumberOfSat[CLOCKORBIT_SATQZSS];
+      }
+      else if (prn.system() == 'C') {
+        sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
+           + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+           + co.NumberOfSat[CLOCKORBIT_SATBDS];
+        ++co.NumberOfSat[CLOCKORBIT_SATBDS];
       }
       else if (prn.system() == 'S') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
-            + co.NumberOfSat[CLOCKORBIT_SATSBAS];
+           + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS  + CLOCKORBIT_NUMSBAS
+           + co.NumberOfSat[CLOCKORBIT_SATSBAS];
         ++co.NumberOfSat[CLOCKORBIT_SATSBAS];
-      }
-      else if (prn.system() == 'C') {
-        sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-            + co.NumberOfSat[CLOCKORBIT_SATBDS];
-        ++co.NumberOfSat[CLOCKORBIT_SATBDS];
       }
       if (sd) {
@@ -600,28 +601,29 @@
         else if (prn.system() == 'R') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS
-              + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
+                  + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
           ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
         }
         else if (prn.system() == 'E') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
+                   + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
           ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
         }
         else if (prn.system() == 'J') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
+                  + CLOCKORBIT_NUMGALILEO
+			      + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
           ++bias.NumberOfSat[CLOCKORBIT_SATQZSS];
+        }
+        else if (prn.system() == 'C') {
+          biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
+                   + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+                   + bias.NumberOfSat[CLOCKORBIT_SATBDS];
+          ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
         else if (prn.system() == 'S') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
-              + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
+                  + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMBDS
+                  + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
           ++bias.NumberOfSat[CLOCKORBIT_SATSBAS];
-        }
-        else if (prn.system() == 'C') {
-          biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-              + bias.NumberOfSat[CLOCKORBIT_SATBDS];
-          ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
       }
@@ -1371,27 +1373,25 @@
         }
         else if (prn.system() == 'E') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
               + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
         }
         else if (prn.system() == 'J') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO
+                       + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
         }
+        else if (prn.system() == 'C') {
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+                       + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
+          ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
+        }
         else if (prn.system() == 'S') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + CLOCKORBIT_NUMQZSS + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMBDS
+					   + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
-        }
-        else if (prn.system() == 'C') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-              + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
-          ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
       //}
@@ -2533,5 +2533,5 @@
       || bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
     char obuffer[CLOCKORBIT_BUFFERSIZE];
-    int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
+    int len = MakeCodeBias(&bias, CBTYPE_AUTO, 0, obuffer, sizeof(obuffer));
     if (len > 0) {
       hlpBufferBias = QByteArray(obuffer, len);
