4#include <unordered_set>
13 if (!
signals.contains(satSigId)) {
return 0; }
15 const auto& recvObs =
signals.at(satSigId).recvObs;
16 return static_cast<size_t>(std::ranges::count_if(recvObs, [&obsType](
const auto& obs) {
17 return obs.second->obs.contains(obsType);
29 for (
const auto& [satSigId, sigObs] :
signals)
31 auto satId = satSigId.toSatId();
35 const auto& recvObs = sigObs.recvObs.begin();
36 for (
const auto& obs : recvObs->second->obs)
38 auto obsType =
static_cast<size_t>(obs.first);
40 nMeasUniqueSat.at(obsType).insert(satId);
49#if LOG_LEVEL <= LOG_LEVEL_DATA
52 std::string observables;
53 std::string observablesUnique;
62 observablesUnique +=
", ";
65 LOG_DATA(
"{}: nObservables: {}", nameId, observables);
66 LOG_DATA(
"{}: nObservablesUniqueSatellite: {}", nameId, observablesUnique);
72 bool somethingRemoved =
false;
75 LOG_DATA(
"{}: Erasing signal [{}]", nameId, satSigId);
77 somethingRemoved =
true;
80 return somethingRemoved;
85 bool somethingRemoved =
false;
88 LOG_DATA(
"{}: Erasing signal [{}][{}]", nameId, satSigId, obsType);
89 size_t emptyReceiver = 0;
90 for (
auto& recvObs :
signals.at(satSigId).recvObs)
92 if (recvObs.second->obs.contains(obsType))
94 recvObs.second->obs.erase(obsType);
96 if (recvObs.second->obs.empty()) { emptyReceiver++; }
98 if (emptyReceiver ==
signals.at(satSigId).recvObs.size())
102 somethingRemoved =
true;
105 return somethingRemoved;
110 std::vector<SatSigId> toRemove;
111 for (
const auto& signal :
signals)
113 if (signal.first.toSatId() == satId)
115 toRemove.push_back(signal.first);
118 for (
const auto& satSigId : toRemove)
120 LOG_DATA(
"{}: Erasing signal [{}]", nameId, satSigId);
124 return !toRemove.empty();
129 LOG_DATA(
"{}: Searching observations to remove on [{}][{}]", nameId, code, obsType);
130 bool somethingRemoved =
false;
131 for (
auto& [satSigId, sigObs] :
signals)
133 if (satSigId.code != code) {
continue; }
135 for (
size_t i = 0; i < sigObs.recvObs.size(); i++)
137 if (!sigObs.recvObs.contains(i)) {
continue; }
138 auto& recvObs = sigObs.recvObs.at(i);
139 if (recvObs->obs.contains(obsType))
141 recvObs->obs.erase(obsType);
142 LOG_DATA(
"{}: Erasing observation [{}][{}] of receiver '{}'", nameId, satSigId, obsType, i);
143 somethingRemoved =
true;
148 return somethingRemoved;
153 LOG_DATA(
"{}: Searching observations to remove on [{}]", nameId, obsType);
154 bool somethingRemoved =
false;
155 for (
auto& [satSigId, sigObs] :
signals)
157 for (
size_t i = 0; i < sigObs.recvObs.size(); i++)
159 if (!sigObs.recvObs.contains(i)) {
continue; }
160 auto& recvObs = sigObs.recvObs.at(i);
161 if (recvObs->obs.contains(obsType))
163 recvObs->obs.erase(obsType);
164 LOG_DATA(
"{}: Erasing observation [{}][{}] of receiver '{}'", nameId, satSigId, obsType, i);
165 somethingRemoved =
true;
170 return somethingRemoved;
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Observation data used for calculations.
Structs identifying a unique satellite.
Enumerate for GNSS Codes.
ObservationType
Observation types.
@ ObservationType_COUNT
Count.
size_t countObservations(const SatSigId &satSigId, const GnssObs::ObservationType &obsType) const
Counts how many observations for the specified signal ant type exist.
bool removeSignal(const SatSigId &satSigId, const std::string &nameId)
Remove the signal from the observations.
std::set< SatelliteSystem > systems
Satellite systems used.
bool removeMeasurementsFor(const Code &code, const GnssObs::ObservationType &obsType, const std::string &nameId)
Remove all measurements for the provided code and observation type.
std::array< size_t, GnssObs::ObservationType_COUNT > nObservables
Number of observables.
void recalcObservableCounts(const std::string &nameId)
Calculates/Recalculates the number of observables.
bool removeSatellite(const SatId &satId, const std::string &nameId)
Remove all signals of the satellite.
std::unordered_set< SatId > satellites
Satellites used.
std::array< size_t, GnssObs::ObservationType_COUNT > nObservablesUniqueSatellite
Number of observables (counted once for each satellite)
unordered_map< SatSigId, SignalObservation > signals
Observations and calculated data for each signal.
bool removeObsType(const GnssObs::ObservationType &obsType, const std::string &nameId)
Remove all measurements for the provided observation type.
Identifies a satellite (satellite system and number)
Identifies a satellite signal (satellite frequency and number)