Index: /trunk/BNS/bns.cpp
===================================================================
--- /trunk/BNS/bns.cpp	(revision 1771)
+++ /trunk/BNS/bns.cpp	(revision 1772)
@@ -435,5 +435,5 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void t_bns::processSatellite(int oldEph, int iCaster, bool trafo, 
+void t_bns::processSatellite(int oldEph, int iCaster, const QString trafo, 
                              bool beClocks, t_eph* ep, int GPSweek, 
                              double GPSweeks, const QString& prn, 
@@ -448,6 +448,6 @@
 
   ColumnVector xyz = xx.Rows(1,3);
-  if (trafo) {
-    crdTrafo(GPSweek, xyz);
+  if (trafo != "IGS05") {
+    crdTrafo(GPSweek, xyz, trafo);
   }
 
@@ -498,23 +498,70 @@
 }
 
-// Transform Coordinates IGS -> ETRF
-////////////////////////////////////////////////////////////////////////////
-void t_bns::crdTrafo(int GPSWeek, ColumnVector& xyz) {
+// Transform Coordinates
+////////////////////////////////////////////////////////////////////////////
+void t_bns::crdTrafo(int GPSWeek, ColumnVector& xyz, const QString trafo) {
+
+  bnsSettings settings;
+
+  if (trafo == "ETRF2000") {
+  _dx  =  0.0541;
+  _dy  =  0.0502;
+  _dz  = -0.0538;
+  _dxr = -0.0002;
+  _dyr =  0.0001;
+  _dzr = -0.0018;
+  _ox  =  0.000891;
+  _oy  =  0.005390;
+  _oz  = -0.008712;
+  _oxr =  0.000081;
+  _oyr =  0.000490;
+  _ozr = -0.000792;
+  _sc  =  0.40;
+  _scr =  0.08;
+  _t0  =  2000.0;
+  }
+  else if (trafo == "Custom") {
+  _dx  = settings.value("trafo_dx").toInt();
+  _dy  = settings.value("trafo_dy").toInt();
+  _dz  = settings.value("trafo_dz").toInt();
+  _dxr = settings.value("trafo_dxr").toInt();
+  _dyr = settings.value("trafo_dyr").toInt();
+  _dzr = settings.value("trafo_dzr").toInt();
+  _ox  = settings.value("trafo_ox").toInt();
+  _oy  = settings.value("trafo_oy").toInt();
+  _oz  = settings.value("trafo_oz").toInt();
+  _oxr = settings.value("trafo_oxr").toInt();
+  _oyr = settings.value("trafo_oyr").toInt();
+  _ozr = settings.value("trafo_ozr").toInt();
+  _sc  = settings.value("trafo_sc").toInt();
+  _scr = settings.value("trafo_scr").toInt();
+  _t0  = settings.value("trafo_t0").toInt();
+  }
 
   // Current epoch minus 2000.0 in years
   // ------------------------------------
-  double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0;
+//double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0;
+  double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
 
   ColumnVector dx(3);
-  dx(1) =  0.0541 - dt * 0.0002;
-  dx(2) =  0.0502 + dt * 0.0001;
-  dx(3) = -0.0538 - dt * 0.0018;
+
+//dx(1) =  0.0541 - dt * 0.0002;
+//dx(2) =  0.0502 + dt * 0.0001;
+//dx(3) = -0.0538 - dt * 0.0018;
+  dx(1) = _dx + dt * _dxr;
+  dx(2) = _dy + dt * _dyr;
+  dx(3) = _dz + dt * _dzr;
 
   static const double arcSec = 180.0 * 3600.0 / M_PI;
-  double ox = ( 0.000891 + dt * 0.000081) / arcSec;
-  double oy = ( 0.005390 + dt * 0.000490) / arcSec;
-  double oz = (-0.008712 - dt * 0.000792) / arcSec;
-
-  double sc = 1.0 + 0.4e-9 + dt * 0.08e-9;
+
+//double ox = ( 0.000891 + dt * 0.000081) / arcSec;
+//double oy = ( 0.005390 + dt * 0.000490) / arcSec;
+//double oz = (-0.008712 - dt * 0.000792) / arcSec;
+  double ox = (_ox + dt * _oxr) / arcSec;
+  double oy = (_oy + dt * _oyr) / arcSec;
+  double oz = (_oz + dt * _ozr) / arcSec;
+
+//double sc = 1.0 + 0.4e-9 + dt * 0.08e-9;
+  double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
 
   Matrix rMat(3,3);
Index: /trunk/BNS/bns.h
===================================================================
--- /trunk/BNS/bns.h	(revision 1771)
+++ /trunk/BNS/bns.h	(revision 1772)
@@ -61,9 +61,9 @@
   void openCaster();
   void readEpoch();
-  void processSatellite(int oldEph, int iCaster, bool trafo, bool beClocks,
+  void processSatellite(int oldEph, int iCaster, const QString trafo, bool beClocks,
                         t_eph* ep, int GPSweek, double GPSweeks, 
                         const QString& prn, const ColumnVector& xx, 
                         struct ClockOrbit::SatData* sd, QString& outLine);
-  void crdTrafo(int GPSWeek, ColumnVector& xyz);
+  void crdTrafo(int GPSWeek, ColumnVector& xyz, const QString trafo);
 
   QTcpServer*               _clkServer;
@@ -80,4 +80,19 @@
   bnsSP3*                   _sp3;
   QByteArray                _clkLine;
+  double _dx;
+  double _dy;
+  double _dz;
+  double _dxr;
+  double _dyr;
+  double _dzr;
+  double _ox;
+  double _oy;
+  double _oz;
+  double _oxr;
+  double _oyr;
+  double _ozr;
+  double _sc;
+  double _scr;
+  double _t0;
 };
 #endif
Index: /trunk/BNS/bnscaster.cpp
===================================================================
--- /trunk/BNS/bnscaster.cpp	(revision 1771)
+++ /trunk/BNS/bnscaster.cpp	(revision 1772)
@@ -55,10 +55,5 @@
   // Reference frame
   // ---------------
-  if (settings.value(QString("refSys_%1").arg(_ic)).toString() == "ETRF2000") {
-    _crdTrafo = true;
-  }
-  else {
-    _crdTrafo = false;
-  }
+  _crdTrafo = settings.value(QString("refSys_%1").arg(_ic)).toString();
 
   if ( Qt::CheckState(settings.value(QString("beClocks%1").arg(_ic)).toInt()) 
Index: /trunk/BNS/bnscaster.h
===================================================================
--- /trunk/BNS/bnscaster.h	(revision 1771)
+++ /trunk/BNS/bnscaster.h	(revision 1772)
@@ -13,5 +13,5 @@
   void printAscii(const QString& line);
   bool usedSocket() const {return _outSocket;}
-  bool crdTrafo() const {return _crdTrafo;}
+  QString crdTrafo() const {return _crdTrafo;}
   bool beClocks() const {return _beClocks;}
   int  ic() const {return _ic;}
@@ -28,5 +28,5 @@
   QFile*       _outFile;
   QTextStream* _outStream;
-  bool         _crdTrafo;
+  QString      _crdTrafo;
   bool         _beClocks;
   int          _ic;
Index: /trunk/BNS/bnscustomtrafo.cpp
===================================================================
--- /trunk/BNS/bnscustomtrafo.cpp	(revision 1771)
+++ /trunk/BNS/bnscustomtrafo.cpp	(revision 1772)
@@ -32,19 +32,19 @@
  bnsSettings settings;
 
- _dxLineEdit = new QLineEdit(settings.value("dx").toString());
- _dyLineEdit = new QLineEdit(settings.value("dy").toString());
- _dzLineEdit = new QLineEdit(settings.value("dz").toString());
- _dxrLineEdit = new QLineEdit(settings.value("dxr").toString());
- _dyrLineEdit = new QLineEdit(settings.value("dyr").toString());
- _dzrLineEdit = new QLineEdit(settings.value("dzr").toString());
- _oxLineEdit = new QLineEdit(settings.value("ox").toString());
- _oyLineEdit = new QLineEdit(settings.value("oy").toString());
- _ozLineEdit = new QLineEdit(settings.value("oz").toString());
- _oxrLineEdit = new QLineEdit(settings.value("oxr").toString());
- _oyrLineEdit = new QLineEdit(settings.value("oyr").toString());
- _ozrLineEdit = new QLineEdit(settings.value("ozr").toString());
- _scLineEdit = new QLineEdit(settings.value("sc").toString());
- _scrLineEdit = new QLineEdit(settings.value("scr").toString());
- _t0LineEdit = new QLineEdit(settings.value("t0").toString());
+ _dxLineEdit = new QLineEdit(settings.value("trafo_dx").toString());
+ _dyLineEdit = new QLineEdit(settings.value("trafo_dy").toString());
+ _dzLineEdit = new QLineEdit(settings.value("trafo_dz").toString());
+ _dxrLineEdit = new QLineEdit(settings.value("trafo_dxr").toString());
+ _dyrLineEdit = new QLineEdit(settings.value("trafo_dyr").toString());
+ _dzrLineEdit = new QLineEdit(settings.value("trafo_dzr").toString());
+ _oxLineEdit = new QLineEdit(settings.value("trafo_ox").toString());
+ _oyLineEdit = new QLineEdit(settings.value("trafo_oy").toString());
+ _ozLineEdit = new QLineEdit(settings.value("trafo_oz").toString());
+ _oxrLineEdit = new QLineEdit(settings.value("trafo_oxr").toString());
+ _oyrLineEdit = new QLineEdit(settings.value("trafo_oyr").toString());
+ _ozrLineEdit = new QLineEdit(settings.value("trafo_ozr").toString());
+ _scLineEdit = new QLineEdit(settings.value("trafo_sc").toString());
+ _scrLineEdit = new QLineEdit(settings.value("trafo_scr").toString());
+ _t0LineEdit = new QLineEdit(settings.value("trafo_t0").toString());
 
   // WhatsThis
@@ -95,19 +95,19 @@
   editLayout->addWidget(new QLabel(tr("dZr [m/y]")),      1, 4, Qt::AlignRight);
   editLayout->addWidget(_dzrLineEdit,                     1, 5);
-  editLayout->addWidget(new QLabel(tr("   oX(t0) [mas]")),2, 0, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("   oX(t0) [as]")), 2, 0, Qt::AlignRight);
   editLayout->addWidget(_oxLineEdit,                      2, 1);
-  editLayout->addWidget(new QLabel(tr("   oY(t0) [mas]")),2, 2, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("   oY(t0) [as]")), 2, 2, Qt::AlignRight);
   editLayout->addWidget(_oyLineEdit,                      2, 3);
-  editLayout->addWidget(new QLabel(tr("   oZ(t0) [mas]")),2, 4, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("   oZ(t0) [as]")), 2, 4, Qt::AlignRight);
   editLayout->addWidget(_ozLineEdit,                      2, 5);
-  editLayout->addWidget(new QLabel(tr("oXr [mas/y]")),    3, 0, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("oXr [as/y]")),     3, 0, Qt::AlignRight);
   editLayout->addWidget(_oxrLineEdit,                     3, 1);
-  editLayout->addWidget(new QLabel(tr("oYr [mas/y]")),    3, 2, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("oYr [as/y]")),     3, 2, Qt::AlignRight);
   editLayout->addWidget(_oyrLineEdit,                     3, 3);
-  editLayout->addWidget(new QLabel(tr("oZr [mas/y]")),    3, 4, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("oZr [as/y]")),     3, 4, Qt::AlignRight);
   editLayout->addWidget(_ozrLineEdit,                     3, 5);
-  editLayout->addWidget(new QLabel(tr("S(t0) [10^-9]")),    4, 0, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("S(t0) [10^-9]")),  4, 0, Qt::AlignRight);
   editLayout->addWidget(_scLineEdit,                      4, 1);
-  editLayout->addWidget(new QLabel(tr("Sr [10^-9/y]")),     4, 2, Qt::AlignRight);
+  editLayout->addWidget(new QLabel(tr("Sr [10^-9/y]")),   4, 2, Qt::AlignRight);
   editLayout->addWidget(_scrLineEdit,                     4, 3);
   editLayout->addWidget(new QLabel(tr("t0 [y]")),         4, 4, Qt::AlignRight);
@@ -170,19 +170,19 @@
 
     bnsSettings settings;
-    settings.setValue("dx",   _dxLineEdit->text());
-    settings.setValue("dy",   _dyLineEdit->text());
-    settings.setValue("dz",   _dzLineEdit->text());
-    settings.setValue("dxr",  _dxrLineEdit->text());
-    settings.setValue("dyr",  _dyrLineEdit->text());
-    settings.setValue("dzr",  _dzrLineEdit->text());
-    settings.setValue("ox",   _oxLineEdit->text());
-    settings.setValue("oy",   _oyLineEdit->text());
-    settings.setValue("oz",   _ozLineEdit->text());
-    settings.setValue("oxr",  _oxrLineEdit->text());
-    settings.setValue("oyr",  _oyrLineEdit->text());
-    settings.setValue("ozr",  _ozrLineEdit->text());
-    settings.setValue("sc",   _scLineEdit->text());
-    settings.setValue("scr",  _scrLineEdit->text());
-    settings.setValue("t0",   _t0LineEdit->text());
+    settings.setValue("trafo_dx",   _dxLineEdit->text());
+    settings.setValue("trafo_dy",   _dyLineEdit->text());
+    settings.setValue("trafo_dz",   _dzLineEdit->text());
+    settings.setValue("trafo_dxr",  _dxrLineEdit->text());
+    settings.setValue("trafo_dyr",  _dyrLineEdit->text());
+    settings.setValue("trafo_dzr",  _dzrLineEdit->text());
+    settings.setValue("trafo_ox",   _oxLineEdit->text());
+    settings.setValue("trafo_oy",   _oyLineEdit->text());
+    settings.setValue("trafo_oz",   _ozLineEdit->text());
+    settings.setValue("trafo_oxr",  _oxrLineEdit->text());
+    settings.setValue("trafo_oyr",  _oyrLineEdit->text());
+    settings.setValue("trafo_ozr",  _ozrLineEdit->text());
+    settings.setValue("trafo_sc",   _scLineEdit->text());
+    settings.setValue("trafo_scr",  _scrLineEdit->text());
+    settings.setValue("trafo_t0",   _t0LineEdit->text());
 
   } else {
Index: /trunk/BNS/bnssettings.cpp
===================================================================
--- /trunk/BNS/bnssettings.cpp	(revision 1771)
+++ /trunk/BNS/bnssettings.cpp	(revision 1772)
@@ -62,19 +62,19 @@
     setValue("outFile_3",   "");
 
-    setValue("dx",    "0.0541");
-    setValue("dy",    "0.0502");
-    setValue("dz",   "-0.0538");
-    setValue("dxr",  "-0.0002");
-    setValue("dyr",   "0.0001");
-    setValue("dzr",  "-0.0018");
-    setValue("ox",     "0.891");
-    setValue("oy",     "5.390");
-    setValue("oz",    "-8.712");
-    setValue("oxr",    "0.081");
-    setValue("oyr",    "0.490");
-    setValue("ozr",   "-0.792");
-    setValue("sc",      "0.40");
-    setValue("scr",     "0.08");
-    setValue("t0",    "2000.0");
+    setValue("trafo_dx",    "0.0541");
+    setValue("trafo_dy",    "0.0502");
+    setValue("trafo_dz",   "-0.0538");
+    setValue("trafo_dxr",  "-0.0002");
+    setValue("trafo_dyr",   "0.0001");
+    setValue("trafo_dzr",  "-0.0018");
+    setValue("trafo_ox",  "0.000891");
+    setValue("trafo_oy",  "0.005390");
+    setValue("trafo_oz", "-0.008712");
+    setValue("trafo_oxr", "0.000081");
+    setValue("trafo_oyr", "0.000490");
+    setValue("trafo_ozr","-0.000792");
+    setValue("trafo_sc",      "0.40");
+    setValue("trafo_scr",     "0.08");
+    setValue("trafo_t0",    "2000.0");
 
     setValue("rnxPath",     "");
