Skip to content
Permalink
Browse files

removed status label in temporal properties

  • Loading branch information
Samweli authored and nyalldawson committed Feb 17, 2020
1 parent 1cbb8e7 commit 872094cf8aaedd15a84168181e35f7c0873e426a
@@ -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

};
@@ -74,9 +74,6 @@ void QgsRasterDataProviderTemporalProperties::setReferenceTemporalRange( const Q
if ( !isActive() )
setIsActive( true );

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

mReferenceRange = dateTimeRange;

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

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

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

@@ -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;
@@ -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;


};

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

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

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

void QgsTemporalLayerWidget::setDateTimeInputsLimit()
@@ -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() )
@@ -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 );
}
}
}
@@ -93,6 +93,7 @@ bool QgsWmsSettings::parseUri( const QString &uriString )
QString referenceExtent = uri.param( QStringLiteral( "reference_time" ) );
mFixedReferenceRange = parseTemporalExtent( mReferenceTimeDimensionExtent,
referenceExtent );
mIsBiTemporal = true;
}
}

@@ -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;

@@ -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 );
}
}
}

@@ -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();

@@ -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>
@@ -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">

0 comments on commit 872094c

Please sign in to comment.
You can’t perform that action at this time.