Index: trunk/BNC/src/PPP/ephpool.cpp
===================================================================
--- trunk/BNC/src/PPP/ephpool.cpp	(revision 5775)
+++ trunk/BNC/src/PPP/ephpool.cpp	(revision 5776)
@@ -134,5 +134,5 @@
     t_irc irc = eph->getCrd(tt, xc, vv);
     if (irc == success) {
-      if (eph->system() == 'R') {
+      if (eph->prn().system() == 'R') {
         double age = tt - eph->TOC();
         if (fabs(age) > 3600.0) {
Index: trunk/BNC/src/bncephuser.cpp
===================================================================
--- trunk/BNC/src/bncephuser.cpp	(revision 5775)
+++ trunk/BNC/src/bncephuser.cpp	(revision 5776)
@@ -79,5 +79,5 @@
   t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph);
 
-  const QString& prn = eNew->prn();
+  QString prn(eNew->prn().toString().c_str());
 
   if (_eph.contains(prn)) {
@@ -106,5 +106,5 @@
   t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);
 
-  const QString& prn = eNew->prn();
+  QString prn(eNew->prn().toString().c_str());
 
   if (_eph.contains(prn)) {
@@ -161,5 +161,5 @@
   }
 
-  QString prn = newEph->prn();
+  QString prn(newEph->prn().toString().c_str());
 
   t_irc irc = failure;
Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 5775)
+++ trunk/BNC/src/ephemeris.cpp	(revision 5776)
@@ -75,5 +75,5 @@
   _receptDateTime = currentDateAndTimeGPS();
 
-  _prn = QString("G%1").arg(ee->satellite, 2, 10, QChar('0'));
+  _prn.set('G', ee->satellite);
 
   _TOC.set(ee->GPSweek, ee->TOC);
@@ -276,5 +276,5 @@
 
   GPSADDBITS(12, 1019)
-  GPSADDBITS(6,_prn.right((_prn.length()-1)).toInt())
+  GPSADDBITS(6,_prn.number())
   GPSADDBITS(10, _TOC.gpsw())
   GPSADDBITS(4, _ura)
@@ -416,5 +416,5 @@
   _receptDateTime = currentDateAndTimeGPS();
 
-  _prn = QString("R%1").arg(ee->almanac_number, 2, 10, QChar('0'));
+  _prn.set('R', ee->almanac_number);
 
   int ww  = ee->GPSWeek;
@@ -541,5 +541,5 @@
 
   GLONASSADDBITS(12, 1020)
-  GLONASSADDBITS(6, _prn.right((_prn.length()-1)).toInt())
+  GLONASSADDBITS(6, _prn.number())
   GLONASSADDBITS(5, 7+_frequency_number)
   GLONASSADDBITS(1, 0)
@@ -600,5 +600,5 @@
   _receptDateTime = currentDateAndTimeGPS();
 
-  _prn = QString("E%1").arg(ee->satellite, 2, 10, QChar('0'));
+  _prn.set('E', ee->satellite);
 
   _TOC.set(ee->Week, ee->TOC);
@@ -749,5 +749,5 @@
 
   GALILEOADDBITS(12, inav ? 1046 : 1045)
-  GALILEOADDBITS(6, _prn.right((_prn.length()-1)).toInt())
+  GALILEOADDBITS(6, _prn.number())
   GALILEOADDBITS(12, _TOC.gpsw())
   GALILEOADDBITS(10, _IODnav)
@@ -844,10 +844,13 @@
       double sec;
       
-      in >> _prn >> year >> month >> day >> hour >> min >> sec;
-
-      if (_prn.at(0) != 'G') {
-        _prn = QString("G%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0'));
-      }
-   
+      QString prnStr;
+      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
+      if (prnStr.at(0) == 'G') {
+        _prn.set('G', prnStr.mid(1).toInt());
+      }
+      else {
+        _prn.set('G', prnStr.toInt());
+      }
+
       if      (year <  80) {
         year += 2000;
@@ -964,10 +967,13 @@
       double sec;
       
-      in >> _prn >> year >> month >> day >> hour >> min >> sec;
-
-      if (_prn.at(0) != 'R') {
-        _prn = QString("R%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0'));
-      }
-   
+      QString prnStr;
+      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
+      if (prnStr.at(0) == 'R') {
+        _prn.set('R', prnStr.mid(1).toInt());
+      }
+      else {
+        _prn.set('R', prnStr.toInt());
+      }
+
       if      (year <  80) {
         year += 2000;
@@ -1066,10 +1072,13 @@
       double sec;
       
-      in >> _prn >> year >> month >> day >> hour >> min >> sec;
-
-      if (_prn.at(0) != 'E') {
-        _prn = QString("E%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0'));
-      }
-   
+      QString prnStr;
+      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
+      if (prnStr.at(0) == 'E') {
+        _prn.set('E', prnStr.mid(1).toInt());
+      }
+      else {
+        _prn.set('E', prnStr.toInt());
+      }
+
       if      (year <  80) {
         year += 2000;
@@ -1152,6 +1161,12 @@
 // 
 //////////////////////////////////////////////////////////////////////////////
-QString t_eph::rinexDateStr(const bncTime& tt, const QString& prn,
-                            double version) {
+QString t_eph::rinexDateStr(const bncTime& tt, const t_prn& prn, double version) {
+  QString prnStr(prn.toString().c_str());
+  return rinexDateStr(tt, prnStr, version);
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+QString t_eph::rinexDateStr(const bncTime& tt, const QString& prnStr, double version) {
 
   QString datStr;
@@ -1165,5 +1180,5 @@
 
   if (version < 3.0) {
-    QString prnHlp = prn.mid(1,2); if (prnHlp[0] == '0') prnHlp[0] = ' ';
+    QString prnHlp = prnStr.mid(1,2); if (prnHlp[0] == '0') prnHlp[0] = ' ';
     out << prnHlp << QString(" %1 %2 %3 %4 %5%6")
       .arg(year % 100, 2, 10, QChar('0'))
@@ -1175,5 +1190,5 @@
   }
   else {
-    out << prn << QString(" %1 %2 %3 %4 %5 %6")
+    out << prnStr << QString(" %1 %2 %3 %4 %5 %6")
       .arg(year,     4)
       .arg(month,    2, 10, QChar('0'))
Index: trunk/BNC/src/ephemeris.h
===================================================================
--- trunk/BNC/src/ephemeris.h	(revision 5775)
+++ trunk/BNC/src/ephemeris.h	(revision 5776)
@@ -8,4 +8,5 @@
 #include "bnctime.h"
 #include "bncconst.h"
+#include "t_prn.h"
 extern "C" {
 #include "rtcm3torinex.h"
@@ -41,6 +42,5 @@
     return earlierTime(eph, this);
   }
-  QString prn() const {return _prn;}
-  char system() const {return _prn[0].toAscii();}
+  t_prn prn() const {return _prn;}
   const QDateTime& receptDateTime() const {return _receptDateTime;}
 
@@ -63,9 +63,12 @@
   virtual int slotNum() const {return 0;}
 
-  static QString rinexDateStr(const bncTime& tt, const QString& prn,
+  static QString rinexDateStr(const bncTime& tt, const t_prn& prn,
                               double version);
 
+  static QString rinexDateStr(const bncTime& tt, const QString& prnStr,
+                              double version);
+
  protected:  
-  QString         _prn;
+  t_prn           _prn;
   bncTime         _TOC;
   QDateTime       _receptDateTime;
Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 5775)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 5776)
@@ -247,5 +247,5 @@
         if (obs.satSys == 'R') {
           for (int ie = 0; ie < _ephs.size(); ie++) {
-            if (_ephs[ie]->prn() == prn) {
+            if (QString(_ephs[ie]->prn().toString().c_str()) == prn) {
               ephGlo = dynamic_cast<t_ephGlo*>(_ephs[ie]);
               break;
@@ -536,5 +536,5 @@
           t_eph* eph = 0;
           for (int ie = 0; ie < _ephs.size(); ie++) {
-            if (_ephs[ie]->prn() == prn) {
+            if (QString(_ephs[ie]->prn().toString().c_str()) == prn) {
               eph = _ephs[ie];
               break;
@@ -746,5 +746,5 @@
     t_eph* eph = 0;
     for (int ie = 0; ie < _ephs.size(); ie++) {
-      if (_ephs[ie]->prn() == prn) {
+      if (QString(_ephs[ie]->prn().toString().c_str()) == prn) {
         eph = _ephs[ie];
         break;
Index: trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 5775)
+++ trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 5776)
@@ -208,5 +208,5 @@
         t_eph* eph = *it;
         double dt = eph->TOC() - tt;
-        if (dt < 8*3600.0 && eph->prn() == prn && eph->IOD() == iod) {
+        if (dt < 8*3600.0 && QString(eph->prn().toString().c_str()) == prn && eph->IOD() == iod) {
           it = _ephs.erase(it);
           return eph;
Index: trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 5775)
+++ trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 5776)
@@ -690,5 +690,5 @@
 
   outLine.sprintf("%d %.1f %s  %3d  %10.3f  %8.3f %8.3f %8.3f\n",
-                  GPSweek, GPSweeks, eph->prn().toAscii().data(),
+                  GPSweek, GPSweeks, eph->prn().toString().c_str(),
                   eph->IOD(), dClk, rsw(1), rsw(2), rsw(3));
 
