Changeset 11215 in ntrip for trunk/BNC/src/bncephuser.h


Ignore:
Timestamp:
Nov 19, 2026, 11:04:10 PM (less than one hour ago)
Author:
stuerze
Message:

Upload Ephemeris: majority vote included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncephuser.h

    r11194 r11215  
    5151  t_irc putNewEph(t_eph* newEph, bool check);
    5252
     53  // Majority vote over the copies of a data set received from different streams
     54  // (real-time input only, used for the ephemeris upload): the first copy is
     55  // accepted immediately; a copy with different content (RTCM3 encoding without
     56  // the GLONASS frame time tk and the system time offsets tau_c, tau_GPS) replaces it as soon as more streams deliver it
     57  // than the current one, i.e. with at least three streams.
     58  void enableVoting() {_voting = true;}
     59
    5360  // Real-time input restricted to the ephemerides of the streams given in the
    5461  // general option 'Ephemeris streams' (key ephMount; empty: all streams), used
    … …  
    97104
    98105 private:
    99   void checkEphemeris(t_eph* eph, bool realTime);
     106  struct t_votes {
     107    ~t_votes() {for (int ii = 0; ii < _eph.size(); ii++) delete _eph[ii];}
     108    QVector<QByteArray>  _content;  // per variant: encoded content
     109    QVector<t_eph*>      _eph;      // per variant: copy of the first one received
     110    QMap<QString, int>   _station;  // stream -> variant of its latest copy
     111    int                  _current = 0;  // variant in the buffer
     112  };
     113  static t_eph*     clone(const t_eph* eph);
     114  static QByteArray votingContent(const t_eph* eph);
     115  static QString    differingFields(const QByteArray& content1, const QByteArray& content2);
     116  void   vote(const QString& prn, unsigned index, const t_eph* eph);
     117  void   checkEphemeris(t_eph* eph, bool realTime);
    100118  bool fromEphMount(const t_eph& eph) const {
    101119    return _ephMounts.isEmpty() || _ephMounts.contains(eph.receptStaID());
    … …  
    105123  unsigned                           _maxQueueSize;  // data sets kept per satellite
    106124  QMap<QString, std::deque<t_eph*> > _eph;
     125  bool                               _voting;
     126  QHash<const t_eph*, t_votes*>      _votes;         // per buffered data set
    107127};
    108128
Note: See TracChangeset for help on using the changeset viewer.