Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 5749)
+++ 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'))
