Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
removed status label in temporal properties
  • Loading branch information
Samweli authored and nyalldawson committed Mar 5, 2020
1 parent 1cbb8e7 commit 872094c
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 25 deletions.
Expand Up @@ -115,6 +115,20 @@ Sets the reference range status.
Returns the reference range presence status.

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

void setReferenceEnable( bool enabled );
%Docstring
Sets the usage status of the reference range.

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

bool isReferenceEnable() const;
%Docstring
Returns the enabled status of the reference range.

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

};
Expand Down
13 changes: 10 additions & 3 deletions src/core/raster/qgsrasterdataprovidertemporalproperties.cpp
Expand Up @@ -74,9 +74,6 @@ void QgsRasterDataProviderTemporalProperties::setReferenceTemporalRange( const Q
if ( !isActive() )
setIsActive( true );

if ( !hasReference() )
setHasReference( true );

mReferenceRange = dateTimeRange;

}
Expand Down Expand Up @@ -111,3 +108,13 @@ bool QgsRasterDataProviderTemporalProperties::hasReference() const
return mHasReferenceRange;
}

void QgsRasterDataProviderTemporalProperties::setReferenceEnable( bool enabled )
{
mReferenceEnable = enabled;
}

bool QgsRasterDataProviderTemporalProperties::isReferenceEnable() const
{
return mReferenceEnable;
}

17 changes: 17 additions & 0 deletions src/core/raster/qgsrasterdataprovidertemporalproperties.h
Expand Up @@ -130,6 +130,20 @@ class CORE_EXPORT QgsRasterDataProviderTemporalProperties : public QgsDataProvid
*/
bool hasReference() const;

/**
* Sets the usage status of the reference range.
*
* \see isReferenceEnable()
*/
void setReferenceEnable( bool enabled );

/**
* Returns the enabled status of the reference range.
*
* \see setReferenceEnable()
*/
bool isReferenceEnable() const;

private:
//! Represents current active datetime range member.
QgsDateTimeRange mRange;
Expand Down Expand Up @@ -168,6 +182,9 @@ class CORE_EXPORT QgsRasterDataProviderTemporalProperties : public QgsDataProvid
//! If these properties has reference temporal range
bool mHasReferenceRange = false;

//! If reference range has been enabled to be used in these properties
bool mReferenceEnable = false;


};

Expand Down
17 changes: 12 additions & 5 deletions src/gui/qgstemporallayerwidget.cpp
Expand Up @@ -37,7 +37,7 @@ void QgsTemporalLayerWidget::setEndAsStartNormalButton_clicked()
{
mEndTemporalDateTimeEdit->setDateTime( mStartTemporalDateTimeEdit->dateTime() );
// Update current selection label
updateRangeLabel( "layer", mRangeLabel );
// updateRangeLabel( "layer", mRangeLabel );
}

void QgsTemporalLayerWidget::setEndAsStartReferenceButton_clicked()
Expand All @@ -50,7 +50,7 @@ void QgsTemporalLayerWidget::layerRadioButton_clicked()
if ( mLayerRadioButton->isChecked() )
{
setInputWidgetState( "normal", true );
updateRangeLabel( "layer", mRangeLabel );
// updateRangeLabel( "layer", mRangeLabel );
mProjectRadioButton->setChecked( false );
}
else
Expand All @@ -63,7 +63,7 @@ void QgsTemporalLayerWidget::projectRadioButton_clicked()
{
mLayerRadioButton->setChecked( false );
setInputWidgetState( "normal", false );
updateRangeLabel( "project", mRangeLabel );
// updateRangeLabel( "project", mRangeLabel );
}
}

Expand All @@ -81,7 +81,7 @@ void QgsTemporalLayerWidget::init()
setInputWidgetState( "reference", false );
setDateTimeInputsLimit();

updateRangeLabel( "layer", mRangeLabel );
// updateRangeLabel( "layer", mRangeLabel );
}

void QgsTemporalLayerWidget::setDateTimeInputsLimit()
Expand Down Expand Up @@ -141,14 +141,17 @@ void QgsTemporalLayerWidget::saveTemporalProperties()
rasterLayer->dataProvider()->temporalProperties()->setEnableTime( true );

// Update current selection label
updateRangeLabel( "layer", mRangeLabel );
// updateRangeLabel( "layer", mRangeLabel );

if ( mReferenceCheckBox->isChecked() )
{
QgsDateTimeRange referenceRange = QgsDateTimeRange( mStartReferenceDateTimeEdit->dateTime(),
mEndReferenceDateTimeEdit->dateTime() );
rasterLayer->dataProvider()->temporalProperties()->setReferenceTemporalRange( referenceRange );
rasterLayer->dataProvider()->temporalProperties()->setReferenceEnable( true );
}
else
rasterLayer->dataProvider()->temporalProperties()->setReferenceEnable( false );
}

if ( mProjectRadioButton->isChecked() )
Expand All @@ -160,6 +163,10 @@ void QgsTemporalLayerWidget::saveTemporalProperties()
QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *> ( mLayer );
rasterLayer->dataProvider()->temporalProperties()->setTemporalRange( projectRange );

if ( mReferenceCheckBox->isChecked() )
rasterLayer->dataProvider()->temporalProperties()->setReferenceEnable( true );
else
rasterLayer->dataProvider()->temporalProperties()->setReferenceEnable( false );
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/providers/wms/qgswmscapabilities.cpp
Expand Up @@ -93,6 +93,7 @@ bool QgsWmsSettings::parseUri( const QString &uriString )
QString referenceExtent = uri.param( QStringLiteral( "reference_time" ) );
mFixedReferenceRange = parseTemporalExtent( mReferenceTimeDimensionExtent,
referenceExtent );
mIsBiTemporal = true;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/providers/wms/qgswmscapabilities.h
Expand Up @@ -721,6 +721,9 @@ class QgsWmsSettings
//! Whether we are dealing with WMS-T
bool mIsTemporal = false;

//! Whether we are dealing bi-temporal dimensional WMS-T
bool mIsBiTemporal = false;

//! Temporal extent from dimension property in WMS-T
QString mTemporalExtent;

Expand Down
10 changes: 8 additions & 2 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -155,6 +155,11 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri, const ProviderOptions &optio
if ( mSettings.mIsTemporal )
{
temporalProperties()->setFixedTemporalRange( mSettings.mFixedRange );
if ( mSettings.mIsBiTemporal )
{
temporalProperties()->setFixedReferenceTemporalRange( mSettings.mFixedReferenceRange );
temporalProperties()->setHasReference( true );
}
}
}

Expand Down Expand Up @@ -1092,8 +1097,9 @@ void QgsWmsProvider::addWmstParameters( QUrlQuery &query )
setQueryItem( query, QStringLiteral( "TIME" ), extent );
}
}
// If the data provider has bi-temporal properties,
if ( temporalProperties()->hasReference() )
// If the data provider has bi-temporal properties and they are enabled
if ( temporalProperties()->hasReference() &&
temporalProperties()->isReferenceEnable() )
{
QgsDateTimeRange referenceRange = temporalProperties()->referenceTemporalRange();

Expand Down
16 changes: 1 addition & 15 deletions src/ui/temporalwidgets/qgstemporallayerwidgetbase.ui
Expand Up @@ -57,7 +57,7 @@
</property>
<property name="styleSheet">
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}
background: white;QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
background: white;QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
</property>
<property name="title">
<string>Temporal</string>
Expand Down Expand Up @@ -93,20 +93,6 @@ background: white;QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::ti
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="mRangeLabel">
<property name="styleSheet">
<string notr="true">color:rgb(46, 52, 54);
</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="mLayerRadioButton">
<property name="text">
Expand Down

0 comments on commit 872094c

Please sign in to comment.