Ignore:
Timestamp:
Oct 17, 2026, 11:20:29 PM (4 days ago)
Author:
stuerze
Message:

orbit-switching logic enhanced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/combination/bnccomb.cpp

    r11087 r11098  
    10501050      }
    10511051    }
     1052    if (AC->numObs[sys] > 0) {
     1053      if (!AC->presentSince[sys].valid()) {
     1054        AC->presentSince[sys] = epoTime;
     1055      }
     1056    }
     1057    else {
     1058      AC->presentSince[sys].reset();
     1059    }
    10521060    out << epoTime.datestr().c_str()    << " "
    10531061        << epoTime.timestr().c_str()    << " "
    … …  
    10861094        }
    10871095      }
     1096    }
     1097  }
     1098
     1099  // Switch back to an AC higher in the table (the preferred one) once it
     1100  // delivers again without interruption for SWITCH_BACK_SEC, so that a single
     1101  // missing epoch of the preferred AC does not move the orbits permanently
     1102  // to another AC, and the orbits do not change back and forth
     1103  // ------------------------------------------------------------------------
     1104  const double SWITCH_BACK_SEC = 60.0;
     1105  QListIterator<cmbAC*> icPref(_ACs);
     1106  while (icPref.hasNext()) {
     1107    cmbAC* AC = icPref.next();
     1108    if (AC->name == _masterOrbitAC[sys]) {
     1109      break;
     1110    }
     1111    if (AC->numObs[sys] > 0 && AC->presentSince[sys].valid() &&
     1112        epoTime - AC->presentSince[sys] >= SWITCH_BACK_SEC) {
     1113      out <<  epoTime.datestr().c_str()    << " "
     1114          << epoTime.timestr().c_str()     << " "
     1115          << "Switching Master " << sys << " "
     1116          << _masterOrbitAC[sys].toLatin1().data() << " --> "
     1117          << AC->name.toLatin1().data()   << " (preferred AC delivers again)\n";
     1118      _masterOrbitAC[sys] = AC->name;
     1119      _masterIsAPC[sys]   = _cmbCoM ? false : AC->isAPC;
     1120      break;
    10881121    }
    10891122  }
Note: See TracChangeset for help on using the changeset viewer.