Index: /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10544)
+++ /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10545)
@@ -2116,7 +2116,6 @@
   GETBITS(helmertPar._sysIdentNum, 8)
   GETBITS(helmertPar._utilTrafoMessageIndicator, 10)
-  int mjd;
-  GETBITS(mjd, 16)
-  helmertPar._t0 = mjd + 44244;
+  GETBITS(helmertPar._mjd, 16)
+  helmertPar._mjd += 44244;
 
   // delete old parameter entries if available
@@ -2129,18 +2128,23 @@
   _helmertPar.push_back(helmertPar);
 
-  GETFLOATSIGN(_helmertPar.back()._dx, 23, 0.001)
-  GETFLOATSIGN(_helmertPar.back()._dy, 23, 0.001)
-  GETFLOATSIGN(_helmertPar.back()._dz, 23, 0.001)
-  GETFLOATSIGN(_helmertPar.back()._ox, 32, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._oy, 32, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._oz, 32, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._sc, 25, 0.00001)
-  GETFLOATSIGN(_helmertPar.back()._dxr, 17, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._dyr, 17, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._dzr, 17, 0.00002)
-  GETFLOATSIGN(_helmertPar.back()._oxr, 17, 0.0000004)
-  GETFLOATSIGN(_helmertPar.back()._oyr, 17, 0.0000004)
-  GETFLOATSIGN(_helmertPar.back()._ozr, 17, 0.0000004)
-  GETFLOATSIGN(_helmertPar.back()._scr, 14, 0.0000002)
+  GETFLOATSIGN(_helmertPar.back()._dx, 23, 1/1000.0)
+  GETFLOATSIGN(_helmertPar.back()._dy, 23, 1/1000.0)
+  GETFLOATSIGN(_helmertPar.back()._dz, 23, 1/1000.0)
+
+  GETFLOATSIGN(_helmertPar.back()._ox, 32, 1/50000.0)
+  GETFLOATSIGN(_helmertPar.back()._oy, 32, 1/50000.0)
+  GETFLOATSIGN(_helmertPar.back()._oz, 32, 1/50000.0)
+
+  GETFLOATSIGN(_helmertPar.back()._sc, 25, 1/100000.0)
+
+  GETFLOATSIGN(_helmertPar.back()._dxr, 17, 1/50000.0)
+  GETFLOATSIGN(_helmertPar.back()._dyr, 17, 1/50000.0)
+  GETFLOATSIGN(_helmertPar.back()._dzr, 17, 1/50000.0)
+
+  GETFLOATSIGN(_helmertPar.back()._oxr, 17, 1/2500000.0)
+  GETFLOATSIGN(_helmertPar.back()._oyr, 17, 1/2500000.0)
+  GETFLOATSIGN(_helmertPar.back()._ozr, 17, 1/2500000.0)
+
+  GETFLOATSIGN(_helmertPar.back()._scr, 14, 1/5000000.0)
 
   //_helmertPar.back().print();
Index: /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit.h
===================================================================
--- /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit.h	(revision 10544)
+++ /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit.h	(revision 10545)
@@ -407,45 +407,4 @@
   virtual CodeType    rnxTypeToCodeType(char system, std::string type) = 0;
 
-#define STOREBITS \
-  while(numbits >= 8) { \
-    if(!size) return 0; \
-    *(buffer++) = bitbuffer>>(numbits-8); \
-    numbits -= 8; \
-    ++ressize; \
-    --size; \
-  }
-
-#define ADDBITS(a, b) { \
-    bitbuffer = (bitbuffer<<(a))|((b)&((1<<a)-1)); \
-    numbits += (a); \
-    STOREBITS \
-  }
-
-#define STARTDATA \
-  size_t ressize=0; \
-  char *blockstart=0; \
-  int numbits=0; \
-  uint64_t bitbuffer=0;
-
-#define INITBLOCK \
-  numbits = 0; \
-  blockstart = buffer; \
-  ADDBITS(8, 0xD3) \
-  ADDBITS(6, 0) \
-  ADDBITS(10, 0)
-
-#define ENDBLOCK \
-  if(numbits) { ADDBITS((8-numbits), 0) } { \
-    int len = buffer-blockstart-3; \
-    blockstart[1] |= len>>8; \
-    blockstart[2] = len; \
-    if(len > 1023) \
-      return 0; \
-    len = CRC24(len+3, (const unsigned char *) blockstart); \
-    ADDBITS(24, len) \
-  }
-
-#define SCALEADDBITS(a, b, c) ADDBITS(a, (int64_t)(c > 0 ? b*c+0.5 : b*c-0.5))
-
 #define MPI         3.141592653589793
 
Index: /trunk/BNC/src/RTCM3/crs.h
===================================================================
--- /trunk/BNC/src/RTCM3/crs.h	(revision 10544)
+++ /trunk/BNC/src/RTCM3/crs.h	(revision 10545)
@@ -82,5 +82,5 @@
        _sysIdentNum = 0;
        _utilTrafoMessageIndicator = 0;
-       _t0  = 0;
+       _mjd = 0;
        _dx  = 0.0;
        _dy  = 0.0;
@@ -140,5 +140,5 @@
             strncmp(_targetName,  helmertPar1._targetName, strlen(_targetName)) == 0 &&
             _sysIdentNum == helmertPar1._sysIdentNum &&
-            _t0 == helmertPar1._t0) {
+            _mjd == helmertPar1._mjd) {
           return true;
         }
@@ -153,6 +153,6 @@
        cout << "_sysIdentNum:               " << _sysIdentNum << endl;
        cout << "_utilTrafoMessageIndicator: " << IndtoString().toStdString().c_str() << endl;
-       bncTime t; t.setmjd(0, _t0);
-       cout << "_t0   :                     " << "MJD " << _t0  << " (" << t.datestr() << ")" << endl;
+       bncTime t; t.setmjd(0, _mjd);
+       cout << "_t0   :                     " << "MJD " << _mjd  << " (" << t.datestr() << ")" << endl;
        cout <<setw(10) << setprecision(5) << "_dx   :                     " <<  _dx  << endl;
        cout <<setw(10) << setprecision(5) << "_dy   :                     " <<  _dy  << endl;
@@ -164,7 +164,7 @@
        cout <<setw(10) << setprecision(5) << "_oy   :                     " <<  _oy  << endl;
        cout <<setw(10) << setprecision(5) << "_oz   :                     " <<  _oz  << endl;
-       cout <<setw(10) << setprecision(7) << "_oxr  :                     " <<  _oxr << endl;
-       cout <<setw(10) << setprecision(7) << "_oyr  :                     " <<  _oyr << endl;
-       cout <<setw(10) << setprecision(7) << "_ozr  :                     " <<  _ozr << endl;
+       cout <<setw(15) << setprecision(7) << "_oxr  :                     " <<  _oxr << endl;
+       cout <<setw(15) << setprecision(7) << "_oyr  :                     " <<  _oyr << endl;
+       cout <<setw(15) << setprecision(7) << "_ozr  :                     " <<  _ozr << endl;
        cout <<setw(10) << setprecision(5) << "_sc   :                     " <<  _sc  << endl;
        cout <<setw(10) << setprecision(7) << "_scr  :                     " <<  _scr << endl;
@@ -175,5 +175,5 @@
      int            _sysIdentNum;
      int            _utilTrafoMessageIndicator;
-     int            _t0;  // reference epoch
+     int            _mjd; // reference epoch
      double         _dx;  // translation in x
      double         _dy;  // translation in y
Index: /trunk/BNC/src/RTCM3/crsEncoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/crsEncoder.cpp	(revision 10544)
+++ /trunk/BNC/src/RTCM3/crsEncoder.cpp	(revision 10545)
@@ -65,4 +65,39 @@
 
   ADDBITS(12, 1301)
+  int N = sizeof(helmertPar._sourceName) / sizeof(helmertPar._sourceName[0]);
+  if (N > 31) {N = 31;}
+  ADDBITS(5, N)
+  for(int i = 0; i < N; i++) {
+    ADDBITS(8, helmertPar._sourceName[i])
+  }
+  N = sizeof(helmertPar._targetName) / sizeof(helmertPar._targetName[0]);
+  if (N > 31) {N = 31;}
+  ADDBITS(5, N)
+  for(int i = 0; i < N; i++) {
+    ADDBITS(8, helmertPar._targetName[i])
+  }
+  ADDBITS(8 , helmertPar._sysIdentNum)
+  ADDBITS(10, helmertPar._utilTrafoMessageIndicator)
+  ADDBITS(16, (helmertPar._mjd - 44244))
+
+  SCALEADDBITS(23, 1000.0, helmertPar._dx)
+  SCALEADDBITS(23, 1000.0, helmertPar._dy)
+  SCALEADDBITS(23, 1000.0, helmertPar._dz)
+
+  SCALEADDBITS(32, 50000.0, helmertPar._ox)
+  SCALEADDBITS(32, 50000.0, helmertPar._oy)
+  SCALEADDBITS(32, 50000.0, helmertPar._oz)
+
+  SCALEADDBITS(25, 100000.0, helmertPar._sc)
+
+  SCALEADDBITS(17, 50000.0, helmertPar._dxr)
+  SCALEADDBITS(17, 50000.0, helmertPar._dyr)
+  SCALEADDBITS(17, 50000.0, helmertPar._dzr)
+
+  SCALEADDBITS(17, 2500000.0, helmertPar._oxr)
+  SCALEADDBITS(17, 2500000.0, helmertPar._oyr)
+  SCALEADDBITS(17, 2500000.0, helmertPar._ozr)
+
+  SCALEADDBITS(14, 5000000.0, helmertPar._scr)
 
   ENDBLOCK
Index: /trunk/BNC/src/bncgetthread.cpp
===================================================================
--- /trunk/BNC/src/bncgetthread.cpp	(revision 10544)
+++ /trunk/BNC/src/bncgetthread.cpp	(revision 10545)
@@ -971,10 +971,10 @@
       for (int ii = 0; ii < decoder()->_helmertPar.size(); ii++) {
         t_helmertPar& helmertPar = decoder()->_helmertPar[ii];
-        bncTime t; t.setmjd(0, helmertPar._t0); QString dateStr = QString::fromStdString(t.datestr());
+        bncTime t; t.setmjd(0, helmertPar._mjd); QString dateStr = QString::fromStdString(t.datestr());
         QString sourcename  = QString(": MT1301 Source Name: %1 ").arg(helmertPar._sourceName);
         QString targetname  = QString(": MT1301 Target Name: %1 ").arg(helmertPar._targetName);
         QString sysidentnum = QString(": MT1301 Sys Ident Num: %1 ").arg(helmertPar._sysIdentNum);
         QString trafomessageind = QString(": MT1301 Trafo Ident Num: %1 ").arg(helmertPar.IndtoString());
-        QString epoch = QString(": MT1301 t0: MJD %1 (%2) ").arg(helmertPar._t0).arg(dateStr);
+        QString epoch = QString(": MT1301 t0: MJD %1 (%2) ").arg(helmertPar._mjd).arg(dateStr);
         QString partrans = QString(": MT1301 Helmert Par Trans: dx = %1, dy = %2, dz = %3, dxr = %4, dyr = %5, dzr = %6")
             .arg(helmertPar._dx).arg(helmertPar._dy).arg(helmertPar._dz)
