Add python bindings

This commit is contained in:
Nyall Dawson 2021-07-30 08:03:22 +10:00
parent a9ebfc2908
commit 0a77401d1c
5 changed files with 181 additions and 10 deletions

View File

@ -0,0 +1,118 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsbabelformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAbstractBabelFormat
{
%Docstring(signature="appended")
Abstract base class for babel GPS formats.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsbabelformat.h"
%End
public:
virtual ~QgsAbstractBabelFormat();
QString name() const;
%Docstring
Returns the format's name.
%End
Qgis::BabelFormatCapabilities capabilities() const;
%Docstring
Returns the format's capabilities.
%End
virtual QStringList importCommand( const QString &babel,
Qgis::GpsFeatureType featureType,
const QString &input,
const QString &output ) const;
%Docstring
Generates a command for importing data into a GPS format using babel.
:param babel: babel path to the babel executable
:param featureType: type of GPS feature to import
:param input: input data path
:param output: output path
Returns an empty list if the format does not support imports (see :py:func:`~QgsAbstractBabelFormat.capabilities`).
%End
virtual QStringList exportCommand( const QString &babel,
Qgis::GpsFeatureType featureType,
const QString &input,
const QString &output ) const;
%Docstring
Generates a command for exporting GPS data into a different format using babel.
:param babel: path to the babel executable
:param featureType: type of GPS feature to export
:param input: input data path
:param output: output path
Returns an empty list if the format does not support exports (see :py:func:`~QgsAbstractBabelFormat.capabilities`).
%End
protected:
explicit QgsAbstractBabelFormat( const QString &name = QString() );
%Docstring
Constructor for QgsAbstractBabelFormat, with the specified ``name``.
%End
static QString featureTypeToArgument( Qgis::GpsFeatureType type );
%Docstring
Converts a GPS feature type to the equivalent babel argument.
%End
};
class QgsBabelSimpleImportFormat : QgsAbstractBabelFormat
{
%Docstring(signature="appended")
A babel format capable of converting input files to GPX files.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsbabelformat.h"
%End
public:
QgsBabelSimpleImportFormat( const QString &format, Qgis::BabelFormatCapabilities capabilities );
%Docstring
Constructor for QgsBabelSimpleImportFormat.
The ``format`` argument specifies a babel identifier for the input format.
The ``capabilities`` argument must reflect whether the format is capable of handling
waypoints, routes and/or tracks.
%End
virtual QStringList importCommand( const QString &babel,
Qgis::GpsFeatureType featureType,
const QString &input,
const QString &output ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsbabelformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,61 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsbabelgpsdevice.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsBabelGpsDeviceFormat : QgsAbstractBabelFormat
{
%Docstring(signature="appended")
A babel format capable of interacting directly with a GPS device.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsbabelgpsdevice.h"
%End
public:
QgsBabelGpsDeviceFormat();
%Docstring
Default constructor
%End
QgsBabelGpsDeviceFormat( const QString &waypointDownloadCommand,
const QString &waypointUploadCommand,
const QString &routeDownloadCommand,
const QString &routeUploadCommand,
const QString &trackDownloadCommand,
const QString &trackUploadCommand );
%Docstring
Constructor for QgsBabelGpsDeviceFormat.
:param waypointDownloadCommand: command for downloading waypoints from device
:param waypointUploadCommand: command for uploading waypoints to device
:param routeDownloadCommand: command for downloading routes from device
:param routeUploadCommand: command for uploading routes to device
:param trackDownloadCommand: command for downloading tracks from device
:param trackUploadCommand: command for uploading tracks to device
%End
virtual QStringList importCommand( const QString &babel, Qgis::GpsFeatureType type, const QString &in, const QString &out ) const;
virtual QStringList exportCommand( const QString &babel, Qgis::GpsFeatureType type, const QString &in, const QString &out ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/gps/qgsbabelgpsdevice.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -317,6 +317,8 @@
%Include auto_generated/geometry/qgswkbptr.sip
%Include auto_generated/geometry/qgswkbtypes.sip
%Include auto_generated/geometry/qgsray3d.sip
%Include auto_generated/gps/qgsbabelformat.sip
%Include auto_generated/gps/qgsbabelgpsdevice.sip
%Include auto_generated/gps/qgsgpsconnection.sip
%Include auto_generated/gps/qgsgpsdconnection.sip
%Include auto_generated/gps/qgsgpsdetector.sip

View File

@ -21,8 +21,6 @@
#include "qgis.h"
#include <QStringList>
#define SIP_NO_FILE
class QString;
/**
@ -30,8 +28,6 @@ class QString;
* \class QgsAbstractBabelFormat
* \brief Abstract base class for babel GPS formats.
*
* \note Not available in Python bindings
*
* \since QGIS 3.22
*/
class CORE_EXPORT QgsAbstractBabelFormat
@ -104,8 +100,6 @@ class CORE_EXPORT QgsAbstractBabelFormat
* \class QgsBabelSimpleImportFormat
* \brief A babel format capable of converting input files to GPX files.
*
* \note Not available in Python bindings
*
* \since QGIS 3.22
*/
class CORE_EXPORT QgsBabelSimpleImportFormat : public QgsAbstractBabelFormat

View File

@ -25,15 +25,11 @@
#include "qgsbabelformat.h"
#define SIP_NO_FILE
/**
* \ingroup core
* \class QgsBabelGpsDeviceFormat
* \brief A babel format capable of interacting directly with a GPS device.
*
* \note Not available in Python bindings
*
* \since QGIS 3.22
*/
class CORE_EXPORT QgsBabelGpsDeviceFormat : public QgsAbstractBabelFormat