📄 gpsstatus.h
字号:
/*
qpegps is a program for displaying a map centered at the current longitude/
latitude as read from a gps receiver.
Copyright (C) 2002 Ralf Haselmeier <Ralf.Haselmeier@gmx.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GPSSTATUS_H
#define GPSSTATUS_H
#ifndef DESKTOP
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#include <qsocket.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qtextview.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtextstream.h>
#include <qtimer.h>
#include <qpixmap.h>
#include <qpainter.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <qarray.h>
#include <qwidget.h>
#include <qhbuttongroup.h>
#include <qradiobutton.h>
#include <qvgroupbox.h>
#include <qdatetime.h>
#include <qmultilineedit.h>
#include <qdialog.h>
#include <vector>
#include <math.h>
#include <sys/time.h>
#include <qpe/timeconversion.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/tzselect.h>
#include "qpegps.h"
#include "maps.h"
#include "gpsdata.h"
class SatSNR : public QFrame
{
// ----- METHODS -----
public:
SatSNR(GpsData * gps, QWidget * parent = 0, const char * name = 0,
WFlags f = 0) : QFrame(parent, name, f), gpsData(gps) {}
~SatSNR() {}
protected:
void drawContents(QPainter * painter); // QFrame virtual
// ----- MEMBERS -----
public:
GpsData * gpsData;
Satellite d_pSatInfo[12]; // cache
};
class SatStat : public QFrame
{
Q_OBJECT
// ----- METHODS -----
public:
SatStat(GpsData * gps, QWidget * parent = 0,
const char * name = 0, WFlags f = 0);
~SatStat();
void shiftSamples();
void drawSamples();
protected:
void drawContents (QPainter * painter); // QFrame virtual
private slots:
void updateSamples();
// ----- MEMBERS -----
public:
GpsData * gpsData;
double * d_pSpeedSamples;
double * d_pAltitudeSamples;
std::pair<int,int> * d_pSatelliteSamples;
static const int d_pixSatellites = 12;
double d_maxSpeed;
double d_minSpeed;
static const int d_pixSpeed = 12;
double d_maxAltitude;
double d_minAltitude;
static const int d_pixAltitude = 12;
static const int d_numSamples = 80;
QTimer * d_pTimer;
};
class ScriptDialog : public QDialog
{
Q_OBJECT
// ----- METHODS ------
public:
ScriptDialog(QStringList ,
QWidget * parent, const char * name, bool modal, WFlags fl);
~ScriptDialog() {}
// ----- MEMBERS -----
public:
QMultiLineEdit * script;
};
class GpsStatus : public QVBox
{
Q_OBJECT
// ----- METHODS -----
public:
//GpsStatus(GpsData *gdata, QWidget *parent=0, const char *name=0, WFlags fl=0);
GpsStatus(Qpegps * appl, GpsData * gps, GpsOptions * gpsOpts, QWidget * parent = 0,
const char * name = 0, WFlags f = 0);
~GpsStatus() {}
void updateQuick();
void update();
protected:
virtual void paintEvent(QPaintEvent *);
public slots:
void updateConfig();
private slots:
// void setGpsdDefaultArg();
void setGpsdDefaultHostPort();
// void gpsdArgLEChanged();
void gpsdHostArgLEChanged();
void gpsdPortArgLEChanged();
void setSysTime() { requestTimeAdj = true; }
void setGpsdStart();
void setGpsdResume();
void setGpsdStop();
// ----- MEMBERS -----
private:
GpsData * gpsData;
GpsOptions * gpsOptions;
Qpegps * app;
Client * gpsd;
//QLineEdit *gpsdArguments, *gpsdHostArg, *gpsdPortArg;
QLineEdit *gpsdHostArg, *gpsdPortArg;
//QPushButton *gpsdArgumentsB, *gpsdHostPortB;
QPushButton * d_pStatus;
QLabel * d_pReceiverStatus;
QLabel * d_pGpsdStatus;
QLabel * d_pLongitude;
QLabel * d_pLatitude;
SatSNR * d_pSatSNR;
SatStat * d_pSatStat;
bool d_fullUpdate, requestTimeAdj;
QGroupBox *group1, *group2;
signals:
void gpsdArgChanged();
};
#endif // GPSSTATUS_H
// end of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -