Skip to content

Commit

Permalink
Empty structure for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 14, 2022
1 parent 91e5130 commit 6571b9b
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 0 deletions.
49 changes: 49 additions & 0 deletions python/core/auto_generated/gps/qgsgpslogger.sip.in
@@ -0,0 +1,49 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsgpslogger.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsGpsLogger : QObject
%Docstring
Handles logging of incoming GPS data to a vector layer.

:py:class:`QgsBabelFormatRegistry` is not usually directly created, but rather accessed through
:py:func:`QgsApplication.gpsBabelFormatRegistry()`.

.. versionadded:: 3.30
%End
{

public:

QgsGpsLogger( QgsGpsConnection *connection, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for :py:class:`QgsGpsLogger` with the specified ``parent`` object.

The logger will automatically record GPS information from the specified ``connection``.
%End

~QgsGpsLogger();

QgsGpsConnection *connection();
%Docstring
Returns the associated GPS connection.
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsgpslogger.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Expand Up @@ -357,6 +357,7 @@
%Include auto_generated/gps/qgsgpsconnection.sip
%Include auto_generated/gps/qgsgpsdconnection.sip
%Include auto_generated/gps/qgsgpsdetector.sip
%Include auto_generated/gps/qgsgpslogger.sip
%Include auto_generated/gps/qgsnmeaconnection.sip
%Include auto_generated/labeling/qgscalloutposition.sip
%Include auto_generated/labeling/qgslabeling.sip
Expand Down
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Expand Up @@ -67,6 +67,7 @@ set(QGIS_CORE_SRCS
gps/qgsgpsconnectionregistry.cpp
gps/qgsgpsdconnection.cpp
gps/qgsgpsdetector.cpp
gps/qgsgpslogger.cpp
gps/qgsnmeaconnection.cpp

plot/qgsplot.cpp
Expand Down Expand Up @@ -1402,6 +1403,7 @@ set(QGIS_CORE_HDRS
gps/qgsgpsconnection.h
gps/qgsgpsdconnection.h
gps/qgsgpsdetector.h
gps/qgsgpslogger.h
gps/qgsnmeaconnection.h

labeling/qgscalloutposition.h
Expand Down
34 changes: 34 additions & 0 deletions src/core/gps/qgsgpslogger.cpp
@@ -0,0 +1,34 @@
/***************************************************************************
qgsgpslogger.cpp
-------------------
begin : November 2022
copyright : (C) 2022 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* 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. *
* *
***************************************************************************/

#include "qgsgpslogger.h"
#include "qgsgpsconnection.h"

QgsGpsLogger::QgsGpsLogger( QgsGpsConnection *connection, QObject *parent )
: QObject( parent )
, mConnection( connection )
{

}

QgsGpsLogger::~QgsGpsLogger()
{

}

QgsGpsConnection *QgsGpsLogger::connection()
{
return mConnection;
}
63 changes: 63 additions & 0 deletions src/core/gps/qgsgpslogger.h
@@ -0,0 +1,63 @@
/***************************************************************************
qgsgpslogger.h
-------------------
begin : November 2022
copyright : (C) 2022 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* 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. *
* *
***************************************************************************/

#ifndef QGSGPSLOGGER_H
#define QGSGPSLOGGER_H

#include "qgis_core.h"
#include "qgis.h"
#include <QObject>
#include <QPointer>

class QgsGpsConnection;


/**
* \ingroup core
* \class QgsGpsLogger
* \brief Handles logging of incoming GPS data to a vector layer.
*
* QgsBabelFormatRegistry is not usually directly created, but rather accessed through
* QgsApplication::gpsBabelFormatRegistry().
*
* \since QGIS 3.30
*/
class CORE_EXPORT QgsGpsLogger : QObject
{
Q_OBJECT

public:

/**
* Constructor for QgsGpsLogger with the specified \a parent object.
*
* The logger will automatically record GPS information from the specified \a connection.
*/
QgsGpsLogger( QgsGpsConnection *connection, QObject *parent SIP_TRANSFERTHIS = nullptr );

~QgsGpsLogger() override;

/**
* Returns the associated GPS connection.
*/
QgsGpsConnection *connection();

private:

QPointer< QgsGpsConnection > mConnection;
};


#endif // QGSGPSLOGGER_H

0 comments on commit 6571b9b

Please sign in to comment.