Skip to content
Snippets Groups Projects
Commit b4ff6cda authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

obs is now copied in add observaitons

parent 3a475cac
No related branches found
No related tags found
2 merge requests!20new tag,!19new tag
......@@ -26,11 +26,26 @@ void Observations::addObservation(const obsd_t & obs)
assert(sat_2_idx_.size() == idx_2_sat_.size());
assert(sat_2_idx_.size() == obs_.size());
assert(!hasSatellite(obs.sat) && "adding an observation of a satellite already stored!");
this->obs_.push_back(obs);
idx_2_sat_.push_back(obs.sat);
sat_2_idx_[obs.sat] = obs_.size()-1;
// copy obsd_t object
obsd_t copy_obs;
std::copy(obs.D, obs.D + 3, copy_obs.D);
std::copy(obs.L, obs.L + 3, copy_obs.L);
std::copy(obs.LLI, obs.LLI + 3, copy_obs.LLI);
std::copy(obs.P, obs.P + 3, copy_obs.P);
std::copy(obs.SNR, obs.SNR + 3, copy_obs.SNR);
std::copy(obs.code, obs.code + 3, copy_obs.code);
std::copy(obs.qualL, obs.qualL + 3, copy_obs.qualL);
copy_obs.eventime = obs.eventime;
copy_obs.freq = obs.freq;
copy_obs.rcv = obs.rcv;
copy_obs.sat = obs.sat;
copy_obs.time = obs.time;
copy_obs.timevalid = obs.timevalid;
assert(!hasSatellite(copy_obs.sat) && "adding an observation of a satellite already stored!");
this->obs_.push_back(copy_obs);
idx_2_sat_.push_back(copy_obs.sat);
sat_2_idx_[copy_obs.sat] = obs_.size()-1;
//std::cout << "added observation of sat " << (int)obs.sat << " stored in idx " << sat_2_idx_[obs.sat] << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment