source: ntrip/trunk/BNS/bnssp3.cpp@ 854

Last change on this file since 854 was 854, checked in by mervart, 14 years ago

* empty log message *

File size: 2.1 KB
Line 
1
2/* -------------------------------------------------------------------------
3 * BKG NTRIP Server
4 * -------------------------------------------------------------------------
5 *
6 * Class: bnsSP3
7 *
8 * Purpose: writes SP3 files
9 *
10 * Author: L. Mervart
11 *
12 * Created: 25-Apr-2008
13 *
14 * Changes:
15 *
16 * -----------------------------------------------------------------------*/
17
18#include <iomanip>
19#include <math.h>
20
21#include "bnssp3.h"
22#include "bnsutils.h"
23
24using namespace std;
25
26// Constructor
27////////////////////////////////////////////////////////////////////////////
28bnsSP3::bnsSP3(const QString& prep, const QString& ext, const QString& path,
29 const QString& intr, int sampl)
30 : bnsoutf(prep, ext, path, intr, sampl) {
31
32 _lastGPSweek = 0;
33 _lastGPSweeks = 0.0;
34}
35
36// Destructor
37////////////////////////////////////////////////////////////////////////////
38bnsSP3::~bnsSP3() {
39}
40
41// Write Header
42////////////////////////////////////////////////////////////////////////////
43void bnsSP3::writeHeader(const QDateTime& datTim) {
44 _out << "THIS IS A DUMMY SP3 HEADER" << endl;
45}
46
47// Write One Epoch
48////////////////////////////////////////////////////////////////////////////
49t_irc bnsSP3::write(int GPSweek, double GPSweeks, const QString& prn,
50 const ColumnVector& xx) {
51
52 if ( bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
53
54 if (_lastGPSweek != GPSweek || _lastGPSweeks != GPSweeks) {
55 _lastGPSweek = GPSweek;
56 _lastGPSweeks = GPSweeks;
57
58 QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
59 double sec = fmod(GPSweeks, 60.0);
60
61 _out << "* "
62 << datTim.toString("yyyy MM dd hh mm").toAscii().data()
63 << setw(12) << setprecision(8) << sec << endl;
64 }
65 _out << "P" << prn.toAscii().data()
66 << setw(14) << setprecision(6) << xx(1) / 1000.0
67 << setw(14) << setprecision(6) << xx(2) / 1000.0
68 << setw(14) << setprecision(6) << xx(3) / 1000.0
69 << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
70
71 return success;
72 }
73 else {
74 return failure;
75 }
76}
Note: See TracBrowser for help on using the repository browser.