source: ntrip/trunk/BNC/bnctableitem.cpp@ 356

Last change on this file since 356 was 280, checked in by mervart, 18 years ago

* empty log message *

File size: 2.2 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters,
3// written by Leos Mervart.
4//
5// Copyright (C) 2006
6// German Federal Agency for Cartography and Geodesy (BKG)
7// http://www.bkg.bund.de
8// Czech Technical University Prague, Department of Advanced Geodesy
9// http://www.fsv.cvut.cz
10//
11// Email: euref-ip@bkg.bund.de
12//
13// This program is free software; you can redistribute it and/or
14// modify it under the terms of the GNU General Public License
15// as published by the Free Software Foundation, version 2.
16//
17// This program is distributed in the hope that it will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU General Public License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with this program; if not, write to the Free Software
24// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26/* -------------------------------------------------------------------------
27 * BKG NTRIP Client
28 * -------------------------------------------------------------------------
29 *
30 * Class: bncTableItem
31 *
32 * Purpose: Re-Implements QTableWidgetItem
33 *
34 * Author: L. Mervart
35 *
36 * Created: 24-Sep-2006
37 *
38 * Changes:
39 *
40 * -----------------------------------------------------------------------*/
41
42#include "bnctableitem.h"
43#include "RTCM/GPSDecoder.h"
44
45// Constructor
46////////////////////////////////////////////////////////////////////////////
47bncTableItem::bncTableItem() : QTableWidgetItem() {
48 _bytesRead = 0.0;
49 setText(QString("%1 byte(s)").arg(0));
50}
51
52// Destructor
53////////////////////////////////////////////////////////////////////////////
54bncTableItem::~bncTableItem() {
55}
56
57//
58////////////////////////////////////////////////////////////////////////////
59void bncTableItem::slotNewObs(const QByteArray&, Observation* obs) {
60
61 _bytesRead += sizeof(*obs);
62
63 if (_bytesRead < 1e3) {
64 setText(QString("%1 byte(s)").arg((int)_bytesRead));
65 }
66 else if (_bytesRead < 1e6) {
67 setText(QString("%1 kb").arg(_bytesRead/1.e3, 5));
68 }
69 else {
70 setText(QString("%1 Mb").arg(_bytesRead/1.e6, 5));
71 }
72}
Note: See TracBrowser for help on using the repository browser.