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

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

* empty log message *

File size: 2.2 KB
RevLine 
[280]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.
[184]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() {
[185]48 _bytesRead = 0.0;
49 setText(QString("%1 byte(s)").arg(0));
[184]50}
51
52// Destructor
53////////////////////////////////////////////////////////////////////////////
54bncTableItem::~bncTableItem() {
55}
56
57//
58////////////////////////////////////////////////////////////////////////////
59void bncTableItem::slotNewObs(const QByteArray&, Observation* obs) {
60
[185]61 _bytesRead += sizeof(*obs);
[184]62
[185]63 if (_bytesRead < 1e3) {
64 setText(QString("%1 byte(s)").arg((int)_bytesRead));
65 }
66 else if (_bytesRead < 1e6) {
[188]67 setText(QString("%1 kb").arg(_bytesRead/1.e3, 5));
[185]68 }
69 else {
[188]70 setText(QString("%1 Mb").arg(_bytesRead/1.e6, 5));
[185]71 }
[184]72}
Note: See TracBrowser for help on using the repository browser.