QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
gps
qgsvectorlayergpslogger.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectorlayergpslogger.h
3
-------------------
4
begin : November 2022
5
copyright : (C) 2022 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSVECTORLAYERGPSLOGGER_H
17
#define QGSVECTORLAYERGPSLOGGER_H
18
19
#include "
qgis.h
"
20
#include "qgis_core.h"
21
#include "
qgis_sip.h
"
22
#include "
qgsgpslogger.h
"
23
24
#include <QDateTime>
25
26
class
QgsVectorLayer
;
27
35
class
CORE_EXPORT
QgsVectorLayerGpsLogger
:
public
QgsGpsLogger
36
{
37
Q_OBJECT
38
39
public
:
45
QgsVectorLayerGpsLogger
(
QgsGpsConnection
*
connection
, QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
46
47
~QgsVectorLayerGpsLogger
()
override
;
48
58
bool
writeToEditBuffer
()
const
{
return
mUseEditBuffer; }
59
69
void
setWriteToEditBuffer
(
bool
buffer ) { mUseEditBuffer = buffer; }
70
77
void
setPointsLayer(
QgsVectorLayer
*layer );
78
85
void
setTracksLayer(
QgsVectorLayer
*layer );
86
95
QgsVectorLayer
*pointsLayer();
96
105
QgsVectorLayer
*tracksLayer();
106
138
void
setDestinationField(
Qgis::GpsInformationComponent
component,
const
QString &field );
139
145
QString destinationField(
Qgis::GpsInformationComponent
component )
const
;
146
147
void
setTransformContext
(
const
QgsCoordinateTransformContext
&context )
override
;
148
149
public
slots:
150
154
void
endCurrentTrack();
155
156
private
slots:
157
158
void
gpsStateChanged(
const
QgsGpsInformation
&information );
159
160
private
:
161
bool
mUseEditBuffer =
true
;
162
163
QPointer< QgsVectorLayer > mPointsLayer;
164
QPointer< QgsVectorLayer > mTracksLayer;
165
166
QgsCoordinateTransform
mWgs84toPointLayerTransform;
167
QgsCoordinateTransform
mWgs84toTrackLayerTransform;
168
169
QMap< Qgis::GpsInformationComponent, QString > mDestinationFields;
170
171
QVariant timestamp(
QgsVectorLayer
*vlayer,
int
idx,
const
QDateTime &time );
172
};
173
174
175
#endif
// QGSVECTORLAYERGPSLOGGER_H
Qgis::GpsInformationComponent
GpsInformationComponent
GPS information component.
Definition
qgis.h:2126
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition
qgscoordinatetransformcontext.h:61
QgsCoordinateTransform
Handles coordinate transforms between two coordinate systems.
Definition
qgscoordinatetransform.h:63
QgsGpsConnection
Abstract base class for connections to a GPS device.
Definition
qgsgpsconnection.h:52
QgsGpsInformation
Encapsulates information relating to a GPS position fix.
Definition
qgsgpsinformation.h:35
QgsGpsLogger::setTransformContext
virtual void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the coordinate transform context to be used when transforming GPS coordinates.
Definition
qgsgpslogger.cpp:96
QgsGpsLogger::QgsGpsLogger
QgsGpsLogger(QgsGpsConnection *connection, QObject *parent=nullptr)
Constructor for QgsGpsLogger with the specified parent object.
Definition
qgsgpslogger.cpp:50
QgsGpsLogger::connection
QgsGpsConnection * connection()
Returns the associated GPS connection.
Definition
qgsgpslogger.cpp:70
QgsVectorLayerGpsLogger::writeToEditBuffer
bool writeToEditBuffer() const
Returns true if the logger will use the vector layer edit buffer for the destination layers.
Definition
qgsvectorlayergpslogger.h:58
QgsVectorLayerGpsLogger::setWriteToEditBuffer
void setWriteToEditBuffer(bool buffer)
Sets whether the logger will use the vector layer edit buffer for the destination layers.
Definition
qgsvectorlayergpslogger.h:69
QgsVectorLayerGpsLogger::QgsVectorLayerGpsLogger
QgsVectorLayerGpsLogger(QgsGpsConnection *connection, QObject *parent=nullptr)
Constructor for QgsVectorLayerGpsLogger with the specified parent object.
Definition
qgsvectorlayergpslogger.cpp:29
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgis.h
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsgpslogger.h
Generated on
for QGIS API Documentation by
1.17.0