1 | // Part of BNC, a utility for retrieving decoding and
|
---|
2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
3 | //
|
---|
4 | // Copyright (C) 2007
|
---|
5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
6 | // http://www.bkg.bund.de
|
---|
7 | // Czech Technical University Prague, Department of Geodesy
|
---|
8 | // http://www.fsv.cvut.cz
|
---|
9 | //
|
---|
10 | // Email: euref-ip@bkg.bund.de
|
---|
11 | //
|
---|
12 | // This program is free software; you can redistribute it and/or
|
---|
13 | // modify it under the terms of the GNU General Public License
|
---|
14 | // as published by the Free Software Foundation, version 2.
|
---|
15 | //
|
---|
16 | // This program is distributed in the hope that it will be useful,
|
---|
17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | // GNU General Public License for more details.
|
---|
20 | //
|
---|
21 | // You should have received a copy of the GNU General Public License
|
---|
22 | // along with this program; if not, write to the Free Software
|
---|
23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
24 |
|
---|
25 | /* -------------------------------------------------------------------------
|
---|
26 | * BKG NTRIP Client
|
---|
27 | * -------------------------------------------------------------------------
|
---|
28 | *
|
---|
29 | * Class: bncFigurePPP
|
---|
30 | *
|
---|
31 | * Purpose:
|
---|
32 | *
|
---|
33 | * Author: Perlt, Mervart
|
---|
34 | *
|
---|
35 | * Created: 11-Nov-2009
|
---|
36 | *
|
---|
37 | * Changes:
|
---|
38 | *
|
---|
39 | * -----------------------------------------------------------------------*/
|
---|
40 |
|
---|
41 | #include <iostream>
|
---|
42 |
|
---|
43 | #include "bncfigureppp.h"
|
---|
44 | #include "bncsettings.h"
|
---|
45 |
|
---|
46 | using namespace std;
|
---|
47 |
|
---|
48 | // Constructor
|
---|
49 | ////////////////////////////////////////////////////////////////////////////
|
---|
50 | bncFigurePPP::bncFigurePPP(QWidget *parent) : QWidget(parent) {
|
---|
51 | }
|
---|
52 |
|
---|
53 | // Destructor
|
---|
54 | ////////////////////////////////////////////////////////////////////////////
|
---|
55 | bncFigurePPP::~bncFigurePPP() {
|
---|
56 | for (int ii = 0; ii < _pos.size(); ++ii) {
|
---|
57 | delete _pos[ii];
|
---|
58 | }
|
---|
59 | }
|
---|
60 |
|
---|
61 | //
|
---|
62 | ////////////////////////////////////////////////////////////////////////////
|
---|
63 | void bncFigurePPP::slotNewPosition(const double* xyz) {
|
---|
64 |
|
---|
65 | const static int MAXNUMPOS = 1000;
|
---|
66 |
|
---|
67 | QMutexLocker locker(&_mutex);
|
---|
68 |
|
---|
69 | double* newPos = new double [3];
|
---|
70 |
|
---|
71 | newPos[0] = xyz[0];
|
---|
72 | newPos[1] = xyz[1];
|
---|
73 | newPos[2] = xyz[2];
|
---|
74 |
|
---|
75 | _pos.push_back(newPos);
|
---|
76 |
|
---|
77 | if (_pos.size() > MAXNUMPOS) {
|
---|
78 | delete _pos[0];
|
---|
79 | _pos.pop_front();
|
---|
80 | }
|
---|
81 |
|
---|
82 | update();
|
---|
83 | }
|
---|
84 |
|
---|
85 | //
|
---|
86 | ////////////////////////////////////////////////////////////////////////////
|
---|
87 | void bncFigurePPP::paintEvent(QPaintEvent *) {
|
---|
88 |
|
---|
89 | int xMin = 0;
|
---|
90 | int xMax = 640;
|
---|
91 | int yMin = 0;
|
---|
92 | int yMax = 140;
|
---|
93 | float xLine = .60;
|
---|
94 |
|
---|
95 | QPainter painter(this);
|
---|
96 |
|
---|
97 | QFont font;
|
---|
98 | font.setPointSize(int(font.QFont::pointSize()*0.8));
|
---|
99 | painter.setFont(font);
|
---|
100 |
|
---|
101 | // x-axis
|
---|
102 | // ------
|
---|
103 | painter.drawLine(xMin+60, int((yMax-yMin)*xLine), xMax*3,
|
---|
104 | int((yMax-yMin)*xLine));
|
---|
105 |
|
---|
106 | // y-axis
|
---|
107 | // ------
|
---|
108 | painter.drawLine(xMin+60, int((yMax-yMin)*xLine), xMin+60, yMin+10);
|
---|
109 |
|
---|
110 | }
|
---|
111 |
|
---|