Changeset 11123 in ntrip


Ignore:
Timestamp:
Oct 23, 2026, 4:52:02 PM (31 hours ago)
Author:
stuerze
Message:

A changed ANTEX file is read again while BNC is running and used from the GPS week given in it

Location:
trunk/BNC
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/CHANGELOG.md

    r11122 r11123  
    1919- ADDED: Detection and conversion of outdated or erroneous IGS-SSR epoch time encodings (GLONASS as UTC seconds of day or of week, BDS as BDT) with an hourly warning, and a plausibility check of the orbit/clock epochs of all systems of a stream
    2020- ADDED: ANTEX file name, number of entries and latest satellite entry are logged; satellites without a valid ANTEX entry are reported (and not combined)
     21- ADDED: Combination and PPP: a changed ANTEX file is read again while BNC is running and used from the GPS week given in it (SINEX code of the entries, e.g. IGS20_2437) on; the attitude model states are taken over
    2122- ADDED: Regression test suite ('tests'): example configurations and short raw captures replayed through BNC and compared with reference outputs
    2223- ADDED: macOS packaging script
  • trunk/BNC/src/PPP/pppClient.cpp

    r11095 r11123  
    561561    }
    562562
     563    // a changed ANTEX file is read and used from its GPS week on
     564    if (_antex) {
     565      QString msg = _antexReloader.update(_antex, _epoTimeRover);
     566      if (!msg.isEmpty()) {
     567        LOG << string(_epoTimeRover) << " " << msg.toStdString() << endl;
     568      }
     569    }
     570
    563571    for (int iter = 1; iter <= 2; iter++) {
    564572      ColumnVector xyzc(4); xyzc = 0.0;
  • trunk/BNC/src/PPP/pppClient.h

    r11095 r11123  
    1010#include "pppModel.h"
    1111
    12 class bncAntex;
     12#include "bncantex.h"
    1313
    1414namespace BNC_PPP {
    … …  
    7373  t_pppStation*             _staRover;
    7474  bncAntex*                 _antex;
     75  bncAntexReloader          _antexReloader; // re-reads a changed ANTEX file
    7576  e_ssrFormat               _ssrFormat;  // of the latest orbit corrections
    7677  t_pppFilter*              _filter;
  • trunk/BNC/src/bncantex.cpp

    r11110 r11123  
    11101110}
    11111111
     1112// GPS week of the file from the SINEX code of the satellite entries
     1113// (e.g. IGS20_2437): the week occurring most often
     1114////////////////////////////////////////////////////////////////////////////
     1115int bncAntex::gpsWeek() const {
     1116  static const QRegularExpression re("_(\\d{4})$");
     1117  QMap<int, int> count;
     1118  QMapIterator<QString, QVector<t_antMap*> > it(_satMaps);
     1119  while (it.hasNext()) {
     1120    it.next();
     1121    for (const t_antMap* map : it.value()) {
     1122      QRegularExpressionMatch mm = re.match(map->snxCode.trimmed());
     1123      if (mm.hasMatch()) {
     1124        count[mm.captured(1).toInt()] += 1;
     1125      }
     1126    }
     1127  }
     1128  int week = 0, num = 0;
     1129  QMapIterator<int, int> itC(count);
     1130  while (itC.hasNext()) {
     1131    itC.next();
     1132    if (itC.value() > num) {
     1133      week = itC.key();
     1134      num  = itC.value();
     1135    }
     1136  }
     1137  return week;
     1138}
     1139
     1140// Take over the attitude model states and warnings of another instance
     1141////////////////////////////////////////////////////////////////////////////
     1142void bncAntex::takeStates(const bncAntex& other) {
     1143  _glonassYaw       = other._glonassYaw;
     1144  _gpsYaw           = other._gpsYaw;
     1145  _onYaw            = other._onYaw;
     1146  _noSatEntryWarned = other._noSatEntryWarned;
     1147}
     1148
     1149// Re-read the ANTEX file while running
     1150////////////////////////////////////////////////////////////////////////////
     1151bncAntexReloader::bncAntexReloader() {
     1152  _fileSize    = 0;
     1153  _init        = false;
     1154  _pending     = 0;
     1155  _pendingWeek = 0;
     1156}
     1157
     1158bncAntexReloader::~bncAntexReloader() {
     1159  delete _pending;
     1160}
     1161
     1162QString bncAntexReloader::update(bncAntex*& antex, const bncTime& epoch) {
     1163  if (!antex || antex->fileName().isEmpty()) {
     1164    return QString();
     1165  }
     1166  QString msg;
     1167  QDateTime now = QDateTime::currentDateTimeUtc();
     1168  if (!_init) {
     1169    QFileInfo fi(antex->fileName());
     1170    _fileTime = fi.lastModified();
     1171    _fileSize = fi.size();
     1172    _lastCheck = now;
     1173    _init = true;
     1174  }
     1175
     1176  // file changed?
     1177  if (_lastCheck.secsTo(now) >= 60) {
     1178    _lastCheck = now;
     1179    QFileInfo fi(antex->fileName());
     1180    // read only once the file has not changed for 30 s (copy finished)
     1181    if (fi.exists() && (fi.lastModified() != _fileTime || fi.size() != _fileSize) &&
     1182        fi.lastModified().secsTo(now) >= 30) {
     1183      _fileTime = fi.lastModified();
     1184      _fileSize = fi.size();
     1185      bncAntex* newAntex = new bncAntex();
     1186      if (newAntex->readFile(antex->fileName()) != success || newAntex->numSatPrns() == 0) {
     1187        delete newAntex;
     1188        msg = "ANTEX file " + antex->fileName() + " changed but could not be read - previous file kept";
     1189      }
     1190      else {
     1191        int week = newAntex->gpsWeek();
     1192        delete _pending;
     1193        _pending     = newAntex;
     1194        _pendingWeek = week;
     1195        if (epoch.valid() && week > int(epoch.gpsw())) {
     1196          msg = QString("ANTEX file %1 changed (GPS week %2) - used from GPS week %2 on")
     1197                .arg(antex->fileName()).arg(week);
     1198        }
     1199      }
     1200    }
     1201  }
     1202
     1203  // pending file due?
     1204  if (_pending && (!epoch.valid() || _pendingWeek <= int(epoch.gpsw()))) {
     1205    _pending->takeStates(*antex);
     1206    delete antex;
     1207    antex    = _pending;
     1208    _pending = 0;
     1209    if (!msg.isEmpty()) msg += "; ";
     1210    msg += QString("ANTEX file re-read, used from now on (GPS week %1): ").arg(_pendingWeek) + antex->info();
     1211  }
     1212  return msg;
     1213}
     1214
    11121215// True if a missing satellite antenna entry has to be reported (at most once
    11131216// per hour and PRN)
  • trunk/BNC/src/bncantex.h

    r11110 r11123  
    5252  QString satBlockType(const QString& prn, const bncTime& epoch) const;
    5353  QString info() const;
     54  // GPS week from which the file is to be used: the week of the SINEX code of
     55  // the antenna entries (e.g. IGS20_2437), 0 if not available
     56  int     gpsWeek() const;
     57  const QString& fileName() const {return _fileName;}
     58  int     numSatPrns() const {return _satMaps.size();}
     59  // take over the attitude model states and warnings of another (older)
     60  // instance, so that a re-read file does not interrupt running turns
     61  void    takeStates(const bncAntex& other);
    5462  bool    hasSatEntry(const QString& prn, const bncTime& epoch) const {return satMap(prn, epoch) != 0;}
    5563  bool    warnNoSatEntry(const QString& prn, const bncTime& epoch) const;
    … …  
    228236};
    229237
     238// Re-reads an ANTEX file while BNC is running: a changed file (modification
     239// time or size, checked at most once a minute) is read, and used from the
     240// GPS week given in the file (SINEX code of its entries) on; a new file of a
     241// week not yet reached is kept pending until the processed epochs reach it.
     242////////////////////////////////////////////////////////////////////////////
     243class bncAntexReloader {
     244 public:
     245  bncAntexReloader();
     246  ~bncAntexReloader();
     247  // to be called per processed epoch; replaces antex if a new file is due
     248  // and returns a message for the logfile (empty if nothing happened)
     249  QString update(bncAntex*& antex, const bncTime& epoch);
     250 private:
     251  QDateTime _lastCheck;     // wall clock of the last file check
     252  QDateTime _fileTime;      // modification time of the file read last
     253  qint64    _fileSize;
     254  bool      _init;
     255  bncAntex* _pending;       // new file of a later GPS week
     256  int       _pendingWeek;
     257};
     258
    230259#endif
  • trunk/BNC/src/bnchelp.html

    r11119 r11123  
    63996399  </p>
    64006400  <p>
     6401    <b>Updated ANTEX file:</b> In real-time PPP, BNC checks once a minute whether the ANTEX file has changed (modification time or size)
     6402    and reads it again while running, once it has not changed for 30 seconds (copy finished). The new file is used from
     6403    the GPS week given in it on, i.e. the week of the SINEX code of its entries (e.g. 'IGS20_2437' for the file
     6404    igs20_2437.atx): if this week has already been reached by the processed epochs, the new file is used from the next
     6405    epoch on, otherwise it is kept and used from the first epoch of that week. The running attitude model states (e.g.
     6406    a noon turn) are taken over. A file that cannot be read is reported and the previous one kept. To provide a new
     6407    ANTEX file, overwrite the file given here (e.g. with a copy of the latest igs20_WWWW.atx), e.g.
     6408  </p>
     6409  <pre>
     6410ANTEX file /home/user/igs20.atx changed (GPS week 2440) - used from GPS week 2440 on
     6411ANTEX file re-read, used from now on (GPS week 2440): ANTEX file /home/user/igs20.atx: ...
     6412</pre>
     6413  <p>
    64016414    Whether the orbit corrections refer to the satellite's Antenna Phase Center (APC) or to its Center of Mass (CoM) is
    64026415    derived from the name of the correction stream or file: names beginning with 'SSRA' refer to the APC, the combined
    … …  
    96559668    logfile, at most once per hour and satellite.
    96569669  </p>
     9670  <p>
     9671    <b>Updated ANTEX file:</b> In the combination, BNC checks once a minute whether the ANTEX file has changed (modification time or size)
     9672    and reads it again while running, once it has not changed for 30 seconds (copy finished). The new file is used from
     9673    the GPS week given in it on, i.e. the week of the SINEX code of its entries (e.g. 'IGS20_2437' for the file
     9674    igs20_2437.atx): if this week has already been reached by the processed epochs, the new file is used from the next
     9675    epoch on, otherwise it is kept and used from the first epoch of that week. The running attitude model states (e.g.
     9676    a noon turn) are taken over. A file that cannot be read is reported and the previous one kept. To provide a new
     9677    ANTEX file, overwrite the file given here (e.g. with a copy of the latest igs20_WWWW.atx), e.g.
     9678  </p>
     9679  <pre>
     9680bncComb: ANTEX file /home/user/igs20.atx changed (GPS week 2440) - used from GPS week 2440 on
     9681bncComb: ANTEX file re-read, used from now on (GPS week 2440): ANTEX file /home/user/igs20.atx: ...
     9682</pre>
    96579683  <p>
    96589684    The following screenshot shows the encoding and uploading of several Broadcast Ephemeris correction streams combined
  • trunk/BNC/src/combination/bnccomb.cpp

    r11113 r11123  
    792792  QDateTime now = currentDateAndTimeGPS();
    793793  bncTime   currentTime(now.toString(Qt::ISODate).toStdString());
     794
     795  // a changed ANTEX file is read and used from its GPS week on
     796  if (_antex) {
     797    QString msg = _antexReloader.update(_antex, epoTime);
     798    if (!msg.isEmpty()) {
     799      emit newMessage(("bncComb: " + msg).toLatin1(), true);
     800    }
     801  }
    794802  for (unsigned ii = 0; ii < clkCorrVec.size(); ii++) {
    795803    const t_clkCorr& clkCorr = clkCorrVec[ii];
  • trunk/BNC/src/combination/bnccomb.h

    r11113 r11123  
    2121
    2222class bncRtnetDecoder;
    23 class bncAntex;
     23#include "bncantex.h"
    2424class bncBiasSnx;
    2525
    … …  
    283283  QByteArray                                 _log;
    284284  bncAntex*                                  _antex;
     285  bncAntexReloader                           _antexReloader; // re-reads a changed ANTEX file
    285286  bncBiasSnx*                                _bsx;
    286287  bncoutf*                                   _logFile;
Note: See TracChangeset for help on using the changeset viewer.