Index: branches/BNC_2.11.0/src/RTCM3/ephemeris.h
===================================================================
--- branches/BNC_2.11.0/src/RTCM3/ephemeris.h	(revision 5908)
+++ branches/BNC_2.11.0/src/RTCM3/ephemeris.h	(revision 6214)
@@ -7,4 +7,5 @@
 #include <string>
 #include "bnctime.h"
+#include "bncconst.h"
 extern "C" {
 #include "rtcm3torinex.h"
@@ -25,5 +26,5 @@
   virtual e_type type() const = 0;
   virtual QString toString(double version) const = 0;
-  virtual void position(int GPSweek, double GPSweeks, 
+  virtual t_irc position(int GPSweek, double GPSweeks,
                         double* xc, double* vv) const = 0;
   virtual int  IOD() const = 0;
@@ -38,14 +39,17 @@
   const QDateTime& receptDateTime() const {return _receptDateTime;}
 
-  void position(int GPSweek, double GPSweeks, 
+  t_irc position(int GPSweek, double GPSweeks,
                 double& xx, double& yy, double& zz, double& cc) const {
     double tmp_xx[4];
     double tmp_vv[4];
-    position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
-
+    if (position(GPSweek, GPSweeks, tmp_xx, tmp_vv) != success) {
+    	return failure;
+    }
     xx = tmp_xx[0];
     yy = tmp_xx[1];
     zz = tmp_xx[2];
     cc = tmp_xx[3];
+
+    return success;
   }
 
@@ -53,5 +57,5 @@
                               double version);
 
- protected:  
+ protected:
   QString   _prn;
   bncTime   _TOC;
@@ -73,5 +77,5 @@
   void set(const gpsephemeris* ee);
 
-  virtual void position(int GPSweek, double GPSweeks, 
+  virtual t_irc position(int GPSweek, double GPSweeks,
                         double* xc,
                         double* vv) const;
@@ -84,30 +88,30 @@
 
  private:
-  double  _clock_bias;      // [s]    
-  double  _clock_drift;     // [s/s]  
+  double  _clock_bias;      // [s]
+  double  _clock_drift;     // [s/s]
   double  _clock_driftrate; // [s/s^2]
 
-  double  _IODE;            
-  double  _Crs;             // [m]    
+  double  _IODE;
+  double  _Crs;             // [m]
   double  _Delta_n;         // [rad/s]
-  double  _M0;              // [rad]  
-
-  double  _Cuc;             // [rad]  
-  double  _e;               //        
-  double  _Cus;             // [rad]  
+  double  _M0;              // [rad]
+
+  double  _Cuc;             // [rad]
+  double  _e;               //
+  double  _Cus;             // [rad]
   double  _sqrt_A;          // [m^0.5]
 
-  double  _TOEsec;          // [s]    
-  double  _Cic;             // [rad]  
-  double  _OMEGA0;          // [rad]  
-  double  _Cis;             // [rad]  
-
-  double  _i0;              // [rad]  
-  double  _Crc;             // [m]    
-  double  _omega;           // [rad]  
+  double  _TOEsec;          // [s]
+  double  _Cic;             // [rad]
+  double  _OMEGA0;          // [rad]
+  double  _Cis;             // [rad]
+
+  double  _i0;              // [rad]
+  double  _Crc;             // [m]
+  double  _omega;           // [rad]
   double  _OMEGADOT;        // [rad/s]
 
   double  _IDOT;            // [rad/s]
-  double  _L2Codes;         // Codes on L2 channel 
+  double  _L2Codes;         // Codes on L2 channel
   double  _TOEweek;
   double  _L2PFlag;         // L2 P data flag
@@ -115,8 +119,8 @@
   double  _ura;             // SV accuracy
   double  _health;          // SV health
-  double  _TGD;             // [s]    
-  double  _IODC;            
-
-  double  _TOT;             // Transmisstion time 
+  double  _TGD;             // [s]
+  double  _IODC;
+
+  double  _TOT;             // Transmisstion time
   double  _fitInterval;     // Fit interval
 };
@@ -133,5 +137,5 @@
   virtual QString toString(double version) const;
 
-  virtual void position(int GPSweek, double GPSweeks, 
+  virtual t_irc position(int GPSweek, double GPSweeks,
                         double* xc,
                         double* vv) const;
@@ -149,26 +153,26 @@
                                 double* acc);
 
-  mutable bncTime      _tt;  // time 
+  mutable bncTime      _tt;  // time
   mutable ColumnVector _xv;  // status vector (position, velocity) at time _tt
 
   double  _gps_utc;
-  double  _tau;              // [s]      
-  double  _gamma;            //          
+  double  _tau;              // [s]
+  double  _gamma;            //
   double  _tki;              // message frame time
 
-  double  _x_pos;            // [km]     
-  double  _x_velocity;       // [km/s]   
-  double  _x_acceleration;   // [km/s^2] 
-  double  _health;           // 0 = O.K. 
-
-  double  _y_pos;            // [km]     
-  double  _y_velocity;       // [km/s]   
-  double  _y_acceleration;   // [km/s^2] 
-  double  _frequency_number; // ICD-GLONASS data position 
-
-  double  _z_pos;            // [km]     
-  double  _z_velocity;       // [km/s]   
-  double  _z_acceleration;   // [km/s^2] 
-  double  _E;                // Age of Information [days]   
+  double  _x_pos;            // [km]
+  double  _x_velocity;       // [km/s]
+  double  _x_acceleration;   // [km/s^2]
+  double  _health;           // 0 = O.K.
+
+  double  _y_pos;            // [km]
+  double  _y_velocity;       // [km/s]
+  double  _y_acceleration;   // [km/s^2]
+  double  _frequency_number; // ICD-GLONASS data position
+
+  double  _z_pos;            // [km]
+  double  _z_velocity;       // [km/s]
+  double  _z_acceleration;   // [km/s^2]
+  double  _E;                // Age of Information [days]
 };
 
@@ -185,5 +189,5 @@
   void set(const galileoephemeris* ee);
 
-  virtual void position(int GPSweek, double GPSweeks, 
+  virtual t_irc position(int GPSweek, double GPSweeks,
                         double* xc,
                         double* vv) const;
@@ -194,26 +198,26 @@
 
  private:
-  double  _clock_bias;       //  [s]    
-  double  _clock_drift;      //  [s/s]  
+  double  _clock_bias;       //  [s]
+  double  _clock_drift;      //  [s/s]
   double  _clock_driftrate;  //  [s/s^2]
 
-  double  _IODnav;             
-  double  _Crs;              //  [m]    
+  double  _IODnav;
+  double  _Crs;              //  [m]
   double  _Delta_n;          //  [rad/s]
-  double  _M0;               //  [rad]  
-
-  double  _Cuc;              //  [rad]  
-  double  _e;                //         
-  double  _Cus;              //  [rad]  
+  double  _M0;               //  [rad]
+
+  double  _Cuc;              //  [rad]
+  double  _e;                //
+  double  _Cus;              //  [rad]
   double  _sqrt_A;           //  [m^0.5]
 
-  double  _TOEsec;           //  [s]    
-  double  _Cic;              //  [rad]  
-  double  _OMEGA0;           //  [rad]  
-  double  _Cis;              //  [rad]  
-
-  double  _i0;               //  [rad]  
-  double  _Crc;              //  [m]    
-  double  _omega;            //  [rad]  
+  double  _TOEsec;           //  [s]
+  double  _Cic;              //  [rad]
+  double  _OMEGA0;           //  [rad]
+  double  _Cis;              //  [rad]
+
+  double  _i0;               //  [rad]
+  double  _Crc;              //  [m]
+  double  _omega;            //  [rad]
   double  _OMEGADOT;         //  [rad/s]
 
@@ -226,6 +230,6 @@
   double  _E5aHS;            //  E5a Health Status
   double  _E5bHS;            //  E5a Health Status
-  double  _BGD_1_5A;         //  group delay [s] 
-  double  _BGD_1_5B;         //  group delay [s] 
+  double  _BGD_1_5A;         //  group delay [s]
+  double  _BGD_1_5B;         //  group delay [s]
 
   double _TOT;               // [s]
