Index: /trunk/BNC/CHANGELOG.md
===================================================================
--- /trunk/BNC/CHANGELOG.md	(revision 11215)
+++ /trunk/BNC/CHANGELOG.md	(revision 11216)
@@ -2,5 +2,5 @@
 ## 2.13.9 (unreleased)
 - CHANGED: **Ephemerides of satellites outside the range supported by BNC** (e.g. G39, test signal of NTS-3 since 30 Sep 2026, not IS-GPS compliant, seen 19 Nov 2026 by many stations in Australia and the Pacific) are no longer written to RINEX navigation files or the ephemeris port, uploaded, or used in PPP, combination and SSR QC; each data set is logged once with its complete RINEX navigation record. Before, they were passed on unchanged (e.g. into an uploaded Broadcast Ephemeris stream), only the warning 'outside the range supported by BNC' was logged. RINEX Edit/Concatenate keeps such records of input files. New test case eph_out_of_range, test tool bncraw.py ephsats
-- ADDED: **Upload Ephemeris: majority vote over the copies of a data set.** The first copy of a data set (same TOC and IOD) received from any stream is uploaded immediately as before; every further stream counts as a vote for its copy, and a copy with different content (the RTCM3 message without the GLONASS frame time tk and the system time offsets tau_c/tau_GPS, which receivers take from the string 5 of any satellite) replaces the uploaded one as soon as more streams deliver it than the current one, i.e. with at least three streams. Each replacement is logged with the streams per copy and the differing fields. Before, the fastest stream decided all fields of a data set, e.g. BCEP00BKG0 18 Nov 2026 R19/R20 with Bn = 1 (unhealthy) from RIO200ARG0/ENAO00PRT0 while all other streams sent Bn = 0, and ln3 = 1 from CUT000AUS0; replay of 89 input streams (2 h): GLONASS health different from the majority of the streams in 1 of 156 data sets (a 2:2 tie in Cn of the unhealthy R27) instead of 63. New test case upload_eph_vote
+- ADDED: **Upload Ephemeris: majority vote over the copies of a data set.** A new data set (TOC and IOD) is uploaded as soon as three streams deliver the same content, at the latest 40 s after its first copy (before: the first copy immediately; SSR providers use a new IOD after 60 s, the 20 s left cover the upload interval and latency); meanwhile the previous data set stays in the upload (checked with each ephemeris and every second). Receivers and applications, BNC too, keep the first copy of a data set, so only this delay protects them; immediately uploaded if the previous data set came from less than three streams or for the first data set of a satellite. Replay 18 Nov 2026 (89 streams, 20 min): three agreeing streams after 14 s in the median, 87 % of 94 data sets within 40 s. Every further stream counts as a vote for its copy, and a copy with different content (the RTCM3 message without the GLONASS frame time tk and the system time offsets tau_c/tau_GPS, which receivers take from the string 5 of any satellite) replaces the uploaded one as soon as more streams deliver it than the current one, i.e. with at least three streams. Each replacement is logged with the streams per copy and the differing fields. Before, the fastest stream decided all fields of a data set, e.g. BCEP00BKG0 18 Nov 2026 R19/R20 with Bn = 1 (unhealthy) from RIO200ARG0/ENAO00PRT0 while all other streams sent Bn = 0, and ln3 = 1 from CUT000AUS0; replay of 89 input streams (2 h): GLONASS health different from the majority of the streams in 1 of 156 data sets (a 2:2 tie in Cn of the unhealthy R27) instead of 63. New test case upload_eph_vote
 - ADDED: **SSR QC: code biases of APC and CoM streams.** For IGS-SSR and old RTCM-SSR (not new RTCM-SSR, which carries its own satellite antenna model), the code biases of an APC stream (SSRA...) are compared with those of the CoM stream of the same solution and format (SSRC...); following the IGS SSR convention (users reduce the satellite PCOs of all frequencies by the PCO of the reference frequency) they have to be equal. With 'QC ANTEX File' the differences are compared with the PCO differences z(f) - z(ref): 15 Oct 2026 SSRA00GMV0 GPS/Galileo/BDS biases shifted by z(f) - z(ref) (residuals 2/3/14 mm, up to 0.76 m, B_IF of GPS IIIA 0.78 m), GLONASS equal. New test case ssr_qc_apc_com
 - ADDED: **SSR QC: phase bias indicators and Melbourne-Wuebbena check.** Per stream and system the SSR format, the dispersive bias and MW consistency indicators, the integer and wide-lane integer indicators per signal and the satellites with discontinuity counter changes are reported. Every 300 s the MW combination of the phase and code biases of the reference signals (wide-lane cycles) is differenced with that of each other AC; the RMS of the fractional parts about the common offset shows whether the wide-lane biases are consistent (< 0.10 cycles) as required for a PPP-AR combination. 2 Oct 2026: MW consistency indicator 1 only for CNES and NRCan, CNES vs NRCan GPS 0.14 cycles (single satellites up to 0.3), all other pairs ~0.25 cycles (random). New test case ssr_qc_phase_bias
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 11215)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 11216)
@@ -144,4 +144,8 @@
   }
 
+  if (_voting && realTime) {
+    releaseHeld();
+  }
+
   // satellite outside the range supported by BNC (e.g. G39)
   if (eph->prn().toInt() == 0) {
@@ -196,4 +200,9 @@
       votes->_eph.append(clone(newEph));
       votes->_station[newEph->receptStaID()] = 0;
+      votes->_first = currentTime();
+      if (qq.size() > 1) {
+        const t_votes* prev = _votes.value(qq[qq.size()-2], 0);
+        votes->_released = !(prev && prev->_station.size() >= VOTE_AGREE);
+      }
       _votes[newEph] = votes;
     }
@@ -316,4 +325,97 @@
 }
 
+// Satellite in the vote messages, for Galileo with the navigation message
+// (I/NAV and F/NAV data sets are buffered and voted separately)
+////////////////////////////////////////////////////////////////////////////
+static QString voteSat(const t_eph* eph) {
+  QString sat(QString(eph->prn().toInternalString().c_str()).left(3));
+  if      (eph->type() == t_eph::INAV) sat += " INAV";
+  else if (eph->type() == t_eph::FNAV) sat += " FNAV";
+  return sat;
+}
+
+const double bncEphUser::VOTE_HOLD  = 40.0;  // SSR providers switch to a new IOD after 60 s
+const int    bncEphUser::VOTE_AGREE = 3;
+
+// Current GPS time (time of the input data when replaying a file)
+////////////////////////////////////////////////////////////////////////////
+bncTime bncEphUser::currentTime() {
+  return bncTime(currentDateAndTimeGPS().toString(Qt::ISODate).toStdString());
+}
+
+// Release the data sets held back longer than VOTE_HOLD seconds
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::releaseHeld() {
+  bncTime now = currentTime();
+  bool changed = false;
+  QStringList msgs;  // sorted: the QHash order differs between runs
+  QHashIterator<const t_eph*, t_votes*> it(_votes);
+  while (it.hasNext()) {
+    it.next();
+    t_votes* votes = it.value();
+    if (!votes->_released && now - votes->_first >= VOTE_HOLD) {
+      votes->_released = true;
+      changed = true;
+      const t_eph* eph = it.key();
+      QVector<int> count(votes->_content.size(), 0);
+      QMapIterator<QString, int> is(votes->_station);
+      while (is.hasNext()) {
+        is.next();
+        count[is.value()]++;
+      }
+      msgs << QString("ephemeris vote %1 %2 %3: copy of %4 uploaded after %5 s without %6 agreeing streams (%7 of %8 streams)")
+                        .arg(voteSat(eph))
+                        .arg(eph->TOC().datestr().c_str())
+                        .arg(eph->TOC().timestr(0).c_str())
+                        .arg(eph->receptStaID())
+                        .arg(int(VOTE_HOLD))
+                        .arg(VOTE_AGREE)
+                        .arg(count[votes->_current])
+                        .arg(votes->_station.size());
+    }
+  }
+  msgs.sort();
+  for (const QString& msg : msgs) {
+    BNC_CORE->message(msg.toLatin1(), false, "bce", t_logRecord::info);
+  }
+  if (changed) {
+    ephBufferChanged();
+  }
+}
+
+// Vote over the copies of a data set, check of the hold every second
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::enableVoting() {
+  _voting = true;
+  QTimer* timer = new QTimer(this);
+  connect(timer, SIGNAL(timeout()), this, SLOT(slotVoteTimer()));
+  timer->start(1000);
+}
+
+// Release of held data sets without new ephemerides; not when replaying a
+// file, where the time of the input data decides (reproducible results)
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::slotVoteTimer() {
+  if (BNC_CORE->dateAndTimeGPSSet()) {
+    return;
+  }
+  QMutexLocker locker(&_mutex);
+  releaseHeld();
+}
+
+// Data set to be uploaded
+////////////////////////////////////////////////////////////////////////////
+t_eph* bncEphUser::ephUpload(const QString& prn) {
+  if (!_eph.contains(prn)) {
+    return 0;
+  }
+  const deque<t_eph*>& qq = _eph[prn];
+  const t_votes* votes = _votes.value(qq.back(), 0);
+  if (votes && !votes->_released && qq.size() > 1) {
+    return qq[qq.size()-2];
+  }
+  return qq.back();
+}
+
 // Further copy of the buffered data set qq[index] received from a stream
 ////////////////////////////////////////////////////////////////////////////
@@ -345,5 +447,13 @@
     }
   }
+  bool released = false;
+  if (!votes->_released && count[iBest] >= VOTE_AGREE) {
+    votes->_released = true;
+    released = true;
+  }
   if (iBest == votes->_current) {
+    if (released) {
+      ephBufferChanged();
+    }
     return;
   }
@@ -353,4 +463,7 @@
   if (!radialDistanceOk(newEph)) {
     delete newEph;
+    if (released) {
+      ephBufferChanged();
+    }
     return;
   }
@@ -380,5 +493,5 @@
   }
   BNC_CORE->message(QString("ephemeris vote %1 %2 %3: copy of %4 replaced by that of %5 (%6 of %7 streams; %8; differing: %9)")
-                    .arg(prn.left(3))
+                    .arg(voteSat(oldEph))
                     .arg(oldEph->TOC().datestr().c_str())
                     .arg(oldEph->TOC().timestr(0).c_str())
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 11215)
+++ /trunk/BNC/src/bncephuser.h	(revision 11216)
@@ -45,4 +45,7 @@
   void slotNewBDSEph(t_ephBDS);
 
+ private slots:
+  void slotVoteTimer();
+
  public:
   bncEphUser(bool connectSlots, unsigned maxQueueSize = 6);
@@ -53,8 +56,18 @@
   // Majority vote over the copies of a data set received from different streams
   // (real-time input only, used for the ephemeris upload): the first copy is
-  // accepted immediately; a copy with different content (RTCM3 encoding without
+  // buffered immediately; a copy with different content (RTCM3 encoding without
   // the GLONASS frame time tk and the system time offsets tau_c, tau_GPS) replaces it as soon as more streams deliver it
   // than the current one, i.e. with at least three streams.
-  void enableVoting() {_voting = true;}
+  // A new data set is held back from the upload (ephUpload() returns the
+  // previous one) until three streams deliver the same content or VOTE_HOLD
+  // seconds (GPS time) have passed since its first copy; no hold if fewer than
+  // three streams delivered the previous data set or there is none. The hold
+  // is checked with each ephemeris received and in real time every second, so
+  // that a held data set is also uploaded when no further ephemeris arrives.
+  void enableVoting();
+
+  // data set to be uploaded: the latest one, or the previous one while the
+  // latest is held back by the vote
+  t_eph* ephUpload(const QString& prn);
 
   // Real-time input restricted to the ephemerides of the streams given in the
@@ -110,5 +123,11 @@
     QMap<QString, int>   _station;  // stream -> variant of its latest copy
     int                  _current = 0;  // variant in the buffer
+    bncTime              _first;        // first copy received (GPS time)
+    bool                 _released = true;  // may be uploaded
   };
+  static const double VOTE_HOLD;    // maximum hold of a new data set [s]
+  static const int    VOTE_AGREE;   // streams releasing a new data set
+  static bncTime currentTime();
+  void   releaseHeld();
   static t_eph*     clone(const t_eph* eph);
   static QByteArray votingContent(const t_eph* eph);
Index: /trunk/BNC/src/bnchelp.html
===================================================================
--- /trunk/BNC/src/bnchelp.html	(revision 11215)
+++ /trunk/BNC/src/bnchelp.html	(revision 11216)
@@ -10070,7 +10070,15 @@
   <p>
     If the same data set (same TOC and IOD) is received from several streams, BNC votes on its content: the
-    first copy received is uploaded immediately; every further stream counts as a vote for the copy it delivers, and
-    a copy with different content replaces the uploaded one as soon as more streams deliver it than the current one,
-    i.e. with at least three streams. The content compared is the RTCM Version 3 message as uploaded, for GLONASS
+    first copy received is buffered; every further stream counts as a vote for the copy it delivers, and
+    a copy with different content replaces the buffered one as soon as more streams deliver it than the current one,
+    i.e. with at least three streams. A new data set is uploaded as soon as three streams deliver the same content as
+    the buffered copy, at the latest 40 seconds after its first copy; until then the previous data set of the
+    satellite stays in the upload; the hold is checked with each ephemeris received and every second. Data sets of satellites whose previous data set came from less than three streams
+    (and the first data set of a satellite) are uploaded immediately, as the vote cannot decide there. Receivers and
+    applications usually keep the first copy of a data set they received, also BNC itself, so a later replacement
+    with the same TOC and IOD would not reach them. The maximum of 40 seconds leaves time for the upload interval and
+    the latency before SSR providers may use the new IOD, 60 seconds after its broadcast; three streams agreed in the
+    median after 14 seconds and in 87 percent of the data sets within 40 seconds with 89 input streams
+    (18 Nov 2026). A replacement after the upload is still possible. The content compared is the RTCM Version 3 message as uploaded, for GLONASS
     without the frame time tk and the system time offsets tau_c and tau_GPS, which differ legitimately between
     receivers. This protects the uploaded stream against single receivers sending e.g. wrong health flags. Each
@@ -10081,4 +10089,11 @@
 ephemeris vote R19 2026-11-18 17:45:18: copy of RIO200ARG0 replaced by that of BRAZ00BRA0 (2 of 3 streams;
   - RIO200ARG0, + BRAZ00BRA0 RGDG00ARG0; differing: Cn A Bn P3 NA N4)
+</pre>
+  <p>
+    A data set uploaded after 40 seconds without three agreeing streams is logged as well, e.g.
+  </p>
+  <pre>
+ephemeris vote G14 2026-11-18 20:00:00: copy of OWMG00NZL0 uploaded after 40 s without 3 agreeing streams
+  (2 of 4 streams)
 </pre>
   <p>
Index: /trunk/BNC/src/upload/bncephuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 11215)
+++ /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 11216)
@@ -26,5 +26,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bncEphUploadCaster::bncEphUploadCaster() : bncEphUser(true) {
-  enableVoting();
   bncSettings settings;
   int sampl = settings.value("uploadSamplRtcmEph").toInt();
@@ -49,4 +48,9 @@
       _casters.push_back(newCaster);
     }
+  }
+
+  // vote (and hold back new data sets) only for an actual upload
+  if (!_casters.isEmpty()) {
+    enableVoting();
   }
 }
@@ -78,5 +82,5 @@
       QListIterator<QString> it(prnList());
       while (it.hasNext()) {
-        const t_eph* eph = ephLast(it.next());
+        const t_eph* eph = ephUpload(it.next());
 
         bncTime toc = eph->TOC();
Index: /trunk/BNC/tests/cases/upload_eph_vote/case.json
===================================================================
--- /trunk/BNC/tests/cases/upload_eph_vote/case.json	(revision 11215)
+++ /trunk/BNC/tests/cases/upload_eph_vote/case.json	(revision 11216)
@@ -1,4 +1,4 @@
 {
-  "description": "19_UploadEph replay with the majority vote over the copies of a data set: GPS, GLONASS and BDS ephemerides of 89 uploader input streams (BCEP00BKG0 removed), 18 Nov 2026 17:43-18:03; the log lists each replaced copy, e.g. R06/R19/R20 of 18:15:18 GPS time with Bn=1 from RIO200ARG0 replaced as soon as two other streams agree. The uploaded content depends on the wall-clock timing and is not compared",
+  "description": "19_UploadEph replay with the majority vote over the copies of a data set: GPS, GLONASS and BDS ephemerides of 89 uploader input streams (BCEP00BKG0 removed), 18 Nov 2026 17:43-18:03; the log lists each replaced copy, e.g. R06/R19/R20 of 18:15:18 GPS time with Bn=1 from RIO200ARG0 replaced as soon as two other streams agree; new data sets are uploaded after three agreeing streams or at the latest after 40 s (timeouts logged). The uploaded content depends on the wall-clock timing and is not compared",
   "config": "Example_Configs/19_UploadEph.bnc",
   "raw": "data/eph_vote_261118_20min.raw",
