Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 9788)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 9789)
@@ -2065,6 +2065,7 @@
       }
       else if (navType() == t_eph::CNV3) {
+        double health;
         if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
-             readDbl(line, pos[1], fieldLen, _health        ) ||
+             readDbl(line, pos[1], fieldLen,  health        ) ||
              readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b) ||
              readDbl(line, pos[3], fieldLen, _TGD_B2bI)     )  {
@@ -2072,4 +2073,5 @@
           return;
         }
+        _health = int(health);
       }
       else { // D1, D2 or undefined
@@ -2090,8 +2092,8 @@
     // =====================
     else if ( iLine == 8 ) {
-
+      double health;
       if      (navType() == t_eph::CNV1) {
         if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
-             readDbl(line, pos[1], fieldLen, _health        ) ||
+             readDbl(line, pos[1], fieldLen,  health        ) ||
              readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C) ||
              readDbl(line, pos[3], fieldLen, _IODC)     )  {
@@ -2099,8 +2101,9 @@
           return;
         }
+        _health = int(health);
       }
       else if (navType() == t_eph::CNV2) {
         if ( readDbl(line, pos[0], fieldLen, _SISMAI           ) ||
-             readDbl(line, pos[1], fieldLen, _health           ) ||
+             readDbl(line, pos[1], fieldLen,  health           ) ||
              readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C) ||
              readDbl(line, pos[3], fieldLen, _IODC)            )  {
@@ -2108,4 +2111,5 @@
           return;
         }
+        _health = int(health);
       }
       else if (navType() == t_eph::CNV3) {
@@ -2313,4 +2317,20 @@
 }
 
+
+// Health status of SBAS Ephemeris (virtual)
+////////////////////////////////////////////////////////////////////////////
+unsigned int t_ephBDS::isUnhealthy() const {
+
+  if (navType() == t_eph::CNV1 ||
+      navType() == t_eph::CNV2 ||
+      navType() == t_eph::CNV3) {
+    return static_cast<unsigned int>(_health);
+  }
+
+  return static_cast<unsigned int>(_SatH1);
+
+}
+
+
 // RINEX Format String
 //////////////////////////////////////////////////////////////////////////////
@@ -2418,5 +2438,5 @@
     out << QString(fmt)
       .arg(_SISMAI,         19, 'e', 12)
-      .arg(_health,         19, 'e', 12)
+      .arg(double(_health), 19, 'e', 12)
       .arg(_INTEGRITYF_B2b, 19, 'e', 12)
       .arg(_TGD_B2bI,       19, 'e', 12);
@@ -2443,5 +2463,5 @@
     out << QString(fmt)
       .arg(_SISMAI,         19, 'e', 12)
-      .arg(_health,         19, 'e', 12)
+      .arg(double(_health), 19, 'e', 12)
       .arg(_INTEGRITYF_B1C, 19, 'e', 12)
       .arg(_IODC,           19, 'e', 12);
@@ -2450,5 +2470,5 @@
     out << QString(fmt)
       .arg(_SISMAI,            19, 'e', 12)
-      .arg(_health,            19, 'e', 12)
+      .arg(double(_health),    19, 'e', 12)
       .arg(_INTEGRITYF_B2aB1C, 19, 'e', 12)
       .arg(_IODC,              19, 'e', 12);
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 9788)
+++ /trunk/BNC/src/ephemeris.h	(revision 9789)
@@ -75,47 +75,48 @@
  public:
   t_ephGPS() {
-    _clock_bias       = 0.0;
-    _clock_drift      = 0.0;
-    _clock_driftrate  = 0.0;
-    _IODE             = 0.0;
-    _Crs              = 0.0;
-    _Delta_n          = 0.0;
-    _M0               = 0.0;
-    _Cuc              = 0.0;
-    _e                = 0.0;
-    _Cus              = 0.0;
-    _sqrt_A           = 0.0;
-    _TOEsec           = 0.0;
-    _Cic              = 0.0;
-    _OMEGA0           = 0.0;
-    _Cis              = 0.0;
-    _i0               = 0.0;
-    _Crc              = 0.0;
-    _omega            = 0.0;
-    _OMEGADOT         = 0.0;
-    _IDOT             = 0.0;
-    _L2Codes          = 0.0;
-    _TOEweek          = 0.0;
-    _L2PFlag          = 0.0;
-    _ura              = 0.0;
-    _health           = 0.0;
-    _TGD              = 0.0;
-    _IODC             = 0.0;
-    _TOT              = 0.0;
-    _fitInterval      = 0.0;
-    _ADOT             = 0.0;
-    _top              = 0.0;
-    _Delta_n_dot      = 0.0;
-    _URAI_NED0        = 0.0;
-    _URAI_NED1        = 0.0;
-    _URAI_NED2        = 0.0;
-    _URAI_ED          = 0.0;
-    _ISC_L1CA         = 0.0;
-    _ISC_L2C          = 0.0;
-    _ISC_L5I5         = 0.0;
-    _ISC_L5Q5         = 0.0;
-    _ISC_L1Cd         = 0.0;
-    _ISC_L1Cp         = 0.0;
-    _receptStaID      = "";
+    _clock_bias      = 0.0;
+    _clock_drift     = 0.0;
+    _clock_driftrate = 0.0;
+    _IODE            = 0.0;
+    _Crs             = 0.0;
+    _Delta_n         = 0.0;
+    _M0              = 0.0;
+    _Cuc             = 0.0;
+    _e               = 0.0;
+    _Cus             = 0.0;
+    _sqrt_A          = 0.0;
+    _TOEsec          = 0.0;
+    _Cic             = 0.0;
+    _OMEGA0          = 0.0;
+    _Cis             = 0.0;
+    _i0              = 0.0;
+    _Crc             = 0.0;
+    _omega           = 0.0;
+    _OMEGADOT        = 0.0;
+    _IDOT            = 0.0;
+    _L2Codes         = 0.0;
+    _TOEweek         = 0.0;
+    _L2PFlag         = 0.0;
+    _ura             = 0.0;
+    _health          = 0.0;
+    _TGD             = 0.0;
+    _IODC            = 0.0;
+    _TOT             = 0.0;
+    _fitInterval     = 0.0;
+    _ADOT            = 0.0;
+    _top             = 0.0;
+    _Delta_n_dot     = 0.0;
+   _URAI_NED0        = 0.0;
+   _URAI_NED1        = 0.0;
+   _URAI_NED2        = 0.0;
+   _URAI_ED          = 0.0;
+   _ISC_L1CA         = 0.0;
+   _ISC_L2C          = 0.0;
+   _ISC_L5I5         = 0.0;
+   _ISC_L5Q5         = 0.0;
+   _ISC_L1Cd         = 0.0;
+   _ISC_L1Cp         = 0.0;
+   _wnop             = 0.0;
+    _receptStaID     = "";
   }
   t_ephGPS(double rnxVersion, const QStringList& lines);
@@ -450,33 +451,52 @@
  public:
  t_ephBDS() {
-   _TOT             = 0.0;
-   _AODE            = 0;
-   _AODC            = 0;
-   _URAI            = 0;
-   _URA             = 0.0;
-   _clock_bias      = 0.0;
-   _clock_drift     = 0.0;
-   _clock_driftrate = 0.0;
-   _Crs             = 0.0;
-   _Delta_n         = 0.0;
-   _M0              = 0.0;
-   _Cuc             = 0.0;
-   _e               = 0.0;
-   _Cus             = 0.0;
-   _sqrt_A          = 0.0;
-   _Cic             = 0.0;
-   _OMEGA0          = 0.0;
-   _Cis             = 0.0;
-   _i0              = 0.0;
-   _Crc             = 0.0;
-   _omega           = 0.0;
-   _OMEGADOT        = 0.0;
-   _IDOT            = 0.0;
-   _TGD1            = 0.0;
-   _TGD2            = 0.0;
-   _SatH1           = 0.0;
-   _TOEsec          = 0.0;
-   _BDTweek         = 0.0;
-   _receptStaID     = "";
+   _TOT               = 0.0;
+   _AODE              = 0;
+   _AODC              = 0;
+   _URAI              = 0;
+   _URA               = 0.0;
+   _clock_bias        = 0.0;
+   _clock_drift       = 0.0;
+   _clock_driftrate   = 0.0;
+   _Crs               = 0.0;
+   _Delta_n           = 0.0;
+   _M0                = 0.0;
+   _Cuc               = 0.0;
+   _e                 = 0.0;
+   _Cus               = 0.0;
+   _sqrt_A            = 0.0;
+   _Cic               = 0.0;
+   _OMEGA0            = 0.0;
+   _Cis               = 0.0;
+   _i0                = 0.0;
+   _Crc               = 0.0;
+   _omega             = 0.0;
+   _OMEGADOT          = 0.0;
+   _IDOT              = 0.0;
+   _TOEsec            = 0.0;
+   _BDTweek           = 0.0;
+   _Delta_n_dot       = 0.0;
+   _satType           = 0.0;
+   _top               = 0.0;
+   _SISAI_oe          = 0.0;
+   _SISAI_ocb         = 0.0;
+   _SISAI_oc1         = 0.0;
+   _SISAI_oc2         = 0.0;
+   _ISC_B1Cd          = 0.0;
+   _ISC_B2ad          = 0.0;
+   _TGD1              = 0.0;
+   _TGD2              = 0.0;
+   _TGD_B1Cp          = 0.0;
+   _TGD_B2ap          = 0.0;
+   _TGD_B2bI          = 0.0;
+   _SISMAI            = 0.0;
+   _SatH1             = 0;
+   _health            = 0;
+   _INTEGRITYF_B1C    = 0.0;
+   _INTEGRITYF_B2aB1C = 0.0;
+   _INTEGRITYF_B2b    = 0.0;
+   _IODC              = 0.0;
+   _IODE              = 0.0;
+   _receptStaID       = "";
  }
  t_ephBDS(double rnxVersion, const QStringList& lines);
@@ -485,5 +505,5 @@
   virtual e_type  type() const {return t_eph::BDS;}
   virtual unsigned int IOD() const;
-  virtual unsigned int  isUnhealthy() const {return static_cast<unsigned int>(_SatH1);}
+  virtual unsigned int isUnhealthy() const;
   virtual QString toString(double version) const;
 
@@ -539,5 +559,5 @@
 
   int     _SatH1;            //
-  double  _health;           //
+  int     _health;           //
 
   double  _INTEGRITYF_B1C;   // 3 bits word from sf 3
