source: ntrip/trunk/BNC/src/PPP/pppEphPool.cpp@ 8312

Last change on this file since 8312 was 8215, checked in by stuerze, 7 years ago

unhealthy satellites are reported within log file but are remainig in stream and file output

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 3.6 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: t_pppEphPool
6 *
7 * Purpose: Buffer with satellite ephemerides
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Jul-2014
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <iostream>
18#include "pppEphPool.h"
19#include "pppInclude.h"
20#include "pppClient.h"
21
22using namespace BNC_PPP;
23using namespace std;
24
25//
26/////////////////////////////////////////////////////////////////////////////
27void t_pppEphPool::putEphemeris(t_eph* eph) {
28 if (eph && (eph->checkState() != t_eph::bad ||
29 eph->checkState() != t_eph::unhealthy)) {
30 _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
31 }
32 else {
33 delete eph;
34 }
35}
36
37//
38/////////////////////////////////////////////////////////////////////////////
39void t_pppEphPool::putOrbCorrection(t_orbCorr* corr) {
40 if (corr) {
41 _satEphPool[corr->_prn.toInt()].putOrbCorrection(corr);
42 }
43}
44
45//
46/////////////////////////////////////////////////////////////////////////////
47void t_pppEphPool::putClkCorrection(t_clkCorr* corr) {
48 if (corr) {
49 _satEphPool[corr->_prn.toInt()].putClkCorrection(corr);
50 }
51}
52
53//
54/////////////////////////////////////////////////////////////////////////////
55t_irc t_pppEphPool::getCrd(const t_prn& prn, const bncTime& tt,
56 ColumnVector& xc, ColumnVector& vv) const {
57 return _satEphPool[prn.toInt()].getCrd(tt, xc, vv);
58}
59
60//
61/////////////////////////////////////////////////////////////////////////////
62int t_pppEphPool::getChannel(const t_prn& prn) const {
63 return _satEphPool[prn.toInt()].getChannel();
64}
65
66//
67/////////////////////////////////////////////////////////////////////////////
68void t_pppEphPool::t_satEphPool::putEphemeris(unsigned maxQueueSize, t_eph* eph) {
69 if (_ephs.empty() || eph->isNewerThan(_ephs.front())) {
70 _ephs.push_front(eph);
71 if (maxQueueSize > 0 && _ephs.size() > maxQueueSize) {
72 delete _ephs.back();
73 _ephs.pop_back();
74 }
75 }
76 else {
77 delete eph;
78 }
79}
80
81//
82/////////////////////////////////////////////////////////////////////////////
83void t_pppEphPool::t_satEphPool::putOrbCorrection(t_orbCorr* corr) {
84 for (unsigned ii = 0; ii < _ephs.size(); ii++) {
85 t_eph* eph = _ephs[ii];
86 if (eph->IOD() == corr->_iod) {
87 eph->setOrbCorr(corr);
88 }
89 }
90 delete corr;
91}
92
93//
94/////////////////////////////////////////////////////////////////////////////
95void t_pppEphPool::t_satEphPool::putClkCorrection(t_clkCorr* corr) {
96 for (unsigned ii = 0; ii < _ephs.size(); ii++) {
97 t_eph* eph = _ephs[ii];
98 if (eph->IOD() == corr->_iod) {
99 eph->setClkCorr(corr);
100 }
101 }
102 delete corr;
103}
104
105//
106/////////////////////////////////////////////////////////////////////////////
107t_irc t_pppEphPool::t_satEphPool::getCrd(const bncTime& tt, ColumnVector& xc,
108 ColumnVector& vv) const {
109 for (unsigned ii = 0; ii < _ephs.size(); ii++) {
110 t_eph* eph = _ephs[ii];
111 t_irc irc = eph->getCrd(tt, xc, vv, OPT->useOrbClkCorr());
112 if (irc == success) {
113 if (eph->prn().system() == 'R') {
114 double age = tt - eph->TOC();
115 if (fabs(age) > 3600.0) {
116 continue;
117 }
118 }
119 return irc;
120 }
121 }
122 return failure;
123}
124
125//
126/////////////////////////////////////////////////////////////////////////////
127int t_pppEphPool::t_satEphPool::getChannel() const {
128 if (_ephs.size() > 0) {
129 return _ephs[0]->slotNum();
130 }
131 return 0;
132}
Note: See TracBrowser for help on using the repository browser.