Changeset 516 in ntrip for trunk/BNC


Ignore:
Timestamp:
Oct 18, 2007, 12:52:57 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r512 r516  
    5858
    5959  _bncVersion  = "BNC 1.4";
     60  // Lists of Ephemeris
     61  // ------------------
     62  _ephFile     = 0;
     63  _ephStream   = 0;
     64  for (int ii = PRN_GPS_START; ii <= PRN_GPS_END; ii++) {
     65    _gpsEph[ii-PRN_GPS_START] = 0;
     66  }
     67  for (int ii = PRN_GLONASS_START; ii <= PRN_GLONASS_END; ii++) {
     68    _glonassEph[ii-PRN_GLONASS_START] = 0;
     69  }
     70
     71  // Eph file
     72  // --------
     73  _ephFile   = 0;
     74  _ephStream = 0;
     75  QString ephFileName = "TEST.EPH";
     76  ////  QString ephFileName = settings.value("ephFile").toString();
     77  if ( !ephFileName.isEmpty() ) {
     78    expandEnvVar(ephFileName);
     79    _ephFile = new QFile(ephFileName);
     80    _ephFile->open(QIODevice::WriteOnly);
     81    _ephStream = new QTextStream();
     82    _ephStream->setDevice(_ephFile);
     83    printEphHeader();
     84  }
    6085}
    6186
     
    6590  delete _logStream;
    6691  delete _logFile;
     92  delete _ephStream;
     93  delete _ephFile;
     94  for (int ii = PRN_GPS_START; ii <= PRN_GPS_END; ii++) {
     95    delete _gpsEph[ii-PRN_GPS_START];
     96  }
     97  for (int ii = PRN_GLONASS_START; ii <= PRN_GLONASS_END; ii++) {
     98    delete _glonassEph[ii-PRN_GLONASS_START];
     99  }
    67100}
    68101
     
    104137////////////////////////////////////////////////////////////////////////////
    105138void bncApp::slotNewGPSEph(gpsephemeris* gpseph) {
    106   cout << "GPS: " << gpseph->satellite << endl;
    107   delete gpseph;
     139
     140  QMutexLocker locker(&_mutex);
     141
     142  gpsephemeris** ee = &_gpsEph[gpseph->satellite-PRN_GPS_START];
     143  if ( *ee == 0 || (*ee)->IODE != gpseph->IODE ) {
     144    cout << "new GPS: " << gpseph->satellite << endl;
     145    delete *ee;
     146    *ee = gpseph;
     147    printGPSEph(gpseph);
     148  }
     149  else {
     150    cout << "GPS: " << gpseph->satellite << endl;
     151    delete gpseph;
     152  }
    108153}
    109154   
     
    111156////////////////////////////////////////////////////////////////////////////
    112157void bncApp::slotNewGlonassEph(glonassephemeris* glonasseph) {
     158
     159  QMutexLocker locker(&_mutex);
     160
    113161  cout << "GLONASS: " << glonasseph->almanac_number << endl;
    114162  delete glonasseph;
    115163}
    116164
     165//
     166////////////////////////////////////////////////////////////////////////////
     167void bncApp::printEphHeader() {
     168
     169}
     170
     171//
     172////////////////////////////////////////////////////////////////////////////
     173void bncApp::printGPSEph(gpsephemeris* ep) {
     174
     175}
     176
     177//
     178////////////////////////////////////////////////////////////////////////////
     179void bncApp::printGlonassEph(glonassephemeris* ep) {
     180
     181}
  • trunk/BNC/bncapp.h

    r511 r516  
    4444    void slotNewGlonassEph(glonassephemeris* glonasseph);
    4545  private:
    46     QFile*       _logFile;
    47     QTextStream* _logStream;
    48     int          _logFileFlag;
    49     QString      _bncVersion;
    50     QMutex       _mutex;
     46    void printEphHeader();
     47    void printGPSEph(gpsephemeris* ep);
     48    void printGlonassEph(glonassephemeris* ep);
     49
     50    QFile*            _logFile;
     51    QTextStream*      _logStream;
     52    int               _logFileFlag;
     53    QString           _bncVersion;
     54    QMutex            _mutex;
     55    QFile*            _ephFile;
     56    QTextStream*      _ephStream;
     57    gpsephemeris*     _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
     58    glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
    5159};
    5260#endif
Note: See TracChangeset for help on using the changeset viewer.