Navigation Menu

Skip to content

Commit

Permalink
formatted wms provider code
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Mar 12, 2020
1 parent c119ea5 commit d446c0a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 3 deletions.
Expand Up @@ -9,6 +9,7 @@




class QgsRasterDataProviderTemporalCapabilities : QgsDataProviderTemporalCapabilities
{
%Docstring
Expand Down Expand Up @@ -111,6 +112,10 @@ Intended to be used by the provider in fetching data.
void setEnableTime( bool enabled );
%Docstring
Sets the time enabled status.
This enables whether time part in the temporal range should be
used when updated the temporal range of these capabilities.

This is useful in some temporal layers who use dates only.

.. seealso:: :py:func:`isTimeEnabled`
%End
Expand All @@ -134,6 +139,20 @@ Sets the usage status of the reference range.
Returns the enabled status of the reference range.

.. seealso:: :py:func:`setReferenceEnable`
%End

void setDateTimes( QList<QDateTime> dateTimes );
%Docstring
Sets the list of available datetimes.

.. seealso:: :py:func:`dateTimes`
%End

const QList<QDateTime> dateTimes() const;
%Docstring
Returns the list of the available datetimes.

.. seealso:: :py:func:`setDateTimes`
%End

};
Expand Down
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -196,6 +196,7 @@
%Include auto_generated/qgstablewidgetitem.sip
%Include auto_generated/qgstabwidget.sip
%Include auto_generated/qgstaskmanagerwidget.sip
%Include auto_generated/qgstemporalvcrdockwidget.sip
%Include auto_generated/qgstextformatwidget.sip
%Include auto_generated/qgstextpreview.sip
%Include auto_generated/qgstreewidgetitem.sip
Expand Down
7 changes: 7 additions & 0 deletions src/core/qgstemporalcontroller.h
Expand Up @@ -26,6 +26,8 @@
/**
* \class QgsTemporalController
* \ingroup core
* A controller base class for temporal objects, contains a signal for notifying
* updates of the objects temporal range.
*
* \since QGIS 3.14
*/
Expand All @@ -45,6 +47,11 @@ class CORE_EXPORT QgsTemporalController : public QObject
virtual ~QgsTemporalController() = default;

signals:

/**
* Signals that a temporal \a range has changed and need to be updated to
* the related objects.
*/
void updateTemporalRange( const QgsDateTimeRange &range );

};
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgstemporalnavigationobject.h
Expand Up @@ -56,7 +56,7 @@ class CORE_EXPORT QgsTemporalNavigationObject : public QgsTemporalController
enum Mode
{
NearestPreviousProduct, //! Get the nearest previous data if the requested one is not available
Snapshot, //! Return the layer data whic match exactly the datetime value in the request
Snapshot, //! Return the layer data which match exactly the datetime value in the request
Composite //! Get the range of datetimes, using the specified time steps
};

Expand Down
Expand Up @@ -160,7 +160,7 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
/**
* Returns the list of the available datetimes.
*
* \see setDateTime()
* \see setDateTimes()
*/
const QList<QDateTime> dateTimes() const;

Expand Down
1 change: 1 addition & 0 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -157,6 +157,7 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri, const ProviderOptions &optio
Q_ASSERT_X( temporalCapabilities(), "QgsWmsProvider::QgsWmsProvider()", "Data provider temporal capabilities object does not exist" );
temporalCapabilities()->setHasTemporalCapabilities( true );
temporalCapabilities()->setFixedTemporalRange( mSettings.mFixedRange );

temporalCapabilities()->setDateTimes( mSettings.mDateTimes );
if ( mSettings.mIsBiTemporal )
{
Expand Down
1 change: 0 additions & 1 deletion tests/src/gui/CMakeLists.txt
Expand Up @@ -162,4 +162,3 @@ ADD_QGIS_TEST(relationreferencewidget testqgsrelationreferencewidget.cpp)
ADD_QGIS_TEST(featurelistcombobox testqgsfeaturelistcombobox.cpp)
ADD_QGIS_TEST(texteditwrapper testqgstexteditwrapper.cpp)
ADD_QGIS_TEST(tableeditorwidget testqgstableeditor.cpp)
ADD_QGIS_TEST(temporalvcrdockwidget testqgstemporalvcrdockwidget.cpp)

0 comments on commit d446c0a

Please sign in to comment.