|
Quantum GIS API Documentation
master-693a1fe
|
00001 /*************************************************************************** 00002 qgsgpsdetector.h - description 00003 ------------------- 00004 begin : January 13th, 2009 00005 copyright : (C) 2009 by Juergen E. Fischer 00006 email : jef at norbit dot de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QGSGPSDETECTOR_H 00019 #define QGSGPSDETECTOR_H 00020 00021 #include <QObject> 00022 #include <QList> 00023 #include <QPair> 00024 00025 #include "qextserialport.h" 00026 00027 class QgsGPSConnection; 00028 struct QgsGPSInformation; 00029 00030 // Class to detect the GPS port 00031 class CORE_EXPORT QgsGPSDetector : public QObject 00032 { 00033 Q_OBJECT 00034 public: 00035 QgsGPSDetector( QString portName ); 00036 ~QgsGPSDetector(); 00037 00038 static QList< QPair<QString, QString> > availablePorts(); 00039 00040 public slots: 00041 void advance(); 00042 void detected( const QgsGPSInformation& ); 00043 void connDestroyed( QObject * ); 00044 00045 signals: 00046 void detected( QgsGPSConnection * ); 00047 void detectionFailed(); 00048 00049 private: 00050 int mPortIndex; 00051 int mBaudIndex; 00052 QList< QPair< QString, QString > > mPortList; 00053 QList<BaudRateType> mBaudList; 00054 00055 QgsGPSConnection *mConn; 00056 }; 00057 00058 #endif // QGSGPSDETECTOR_H