mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#691) Added option to keep the depth range fixed
This commit is contained in:
@@ -125,7 +125,7 @@ void RicDeleteItemExec::redo()
|
||||
if (wellLogPlot)
|
||||
{
|
||||
wellLogPlot->calculateAvailableDepthRange();
|
||||
wellLogPlot->zoomAllDepth();
|
||||
wellLogPlot->updateDepthZoom();
|
||||
}
|
||||
|
||||
RimWellLogTrack* wellLogPlotTrack;
|
||||
|
@@ -109,7 +109,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
plot->calculateAvailableDepthRange();
|
||||
plot->zoomAllDepth();
|
||||
plot->updateDepthZoom();
|
||||
plotTrack->viewer()->replot();
|
||||
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
|
@@ -71,7 +71,7 @@ void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
|
||||
delete track;
|
||||
|
||||
wellLogPlot->calculateAvailableDepthRange();
|
||||
wellLogPlot->zoomAllDepth();
|
||||
wellLogPlot->updateDepthZoom();
|
||||
wellLogPlot->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot(RimWellLogPlot* dst
|
||||
{
|
||||
(*pIt)->calculateAvailableDepthRange();
|
||||
(*pIt)->updateTrackNames();
|
||||
(*pIt)->zoomAllDepth();
|
||||
(*pIt)->updateDepthZoom();
|
||||
(*pIt)->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
@@ -277,7 +277,7 @@ void RimWellLogCurve::zoomAllOwnerTrackAndPlot()
|
||||
if (wellLogPlot)
|
||||
{
|
||||
wellLogPlot->calculateAvailableDepthRange();
|
||||
wellLogPlot->zoomAllDepth();
|
||||
wellLogPlot->updateDepthZoom();
|
||||
}
|
||||
|
||||
RimWellLogTrack* plotTrack;
|
||||
|
@@ -71,6 +71,7 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
|
||||
CAF_PDM_InitField(&m_minVisibleDepth, "MinimumDepth", 0.0, "Min", "", "", "");
|
||||
CAF_PDM_InitField(&m_maxVisibleDepth, "MaximumDepth", 1000.0, "Max", "", "", "");
|
||||
CAF_PDM_InitField(&m_isAutoScaleDepthEnabled, "AutoScaleDepthEnabled", true, "Auto Scale", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_tracks, "Tracks", "", "", "", "");
|
||||
m_tracks.uiCapability()->setUiHidden(true);
|
||||
@@ -147,7 +148,13 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
else if (changedField == &m_minVisibleDepth || changedField == &m_maxVisibleDepth)
|
||||
{
|
||||
updateDepthZoomInQwt();
|
||||
applyDepthZoomFromVisibleDepth();
|
||||
|
||||
m_isAutoScaleDepthEnabled = false;
|
||||
}
|
||||
else if (changedField == &m_isAutoScaleDepthEnabled)
|
||||
{
|
||||
updateDepthZoom();
|
||||
}
|
||||
else if (changedField == &m_userName)
|
||||
{
|
||||
@@ -279,7 +286,7 @@ void RimWellLogPlot::setDepthZoomMinMax(double minimumDepth, double maximumDepth
|
||||
m_minVisibleDepth.uiCapability()->updateConnectedEditors();
|
||||
m_maxVisibleDepth.uiCapability()->updateConnectedEditors();
|
||||
|
||||
updateDepthZoomInQwt();
|
||||
applyDepthZoomFromVisibleDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -373,6 +380,7 @@ void RimWellLogPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
uiOrdering.add(&m_depthUnit);
|
||||
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Visible Depth Range");
|
||||
gridGroup->add(&m_isAutoScaleDepthEnabled);
|
||||
gridGroup->add(&m_minVisibleDepth);
|
||||
gridGroup->add(&m_maxVisibleDepth);
|
||||
}
|
||||
@@ -400,7 +408,7 @@ void RimWellLogPlot::updateTracks()
|
||||
}
|
||||
|
||||
calculateAvailableDepthRange();
|
||||
updateDepthZoomInQwt();
|
||||
updateDepthZoom();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +426,22 @@ void RimWellLogPlot::updateTrackNames()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::updateDepthZoomInQwt()
|
||||
void RimWellLogPlot::updateDepthZoom()
|
||||
{
|
||||
if (m_isAutoScaleDepthEnabled)
|
||||
{
|
||||
applyZoomAllDepths();
|
||||
}
|
||||
else
|
||||
{
|
||||
applyDepthZoomFromVisibleDepth();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::applyDepthZoomFromVisibleDepth()
|
||||
{
|
||||
if (m_viewer)
|
||||
{
|
||||
@@ -433,7 +456,7 @@ void RimWellLogPlot::updateDepthZoomInQwt()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::zoomAllDepth()
|
||||
void RimWellLogPlot::applyZoomAllDepths()
|
||||
{
|
||||
if (hasAvailableDepthRange())
|
||||
{
|
||||
|
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
RiuWellLogPlot* viewer();
|
||||
|
||||
void zoomAllDepth();
|
||||
void updateDepthZoom();
|
||||
void setDepthZoomByFactorAndCenter(double zoomFactor, double zoomCenter);
|
||||
void panDepth(double panFactor);
|
||||
void setDepthZoomMinMax(double minimumDepth, double maximumDepth);
|
||||
@@ -96,13 +96,13 @@ protected:
|
||||
private:
|
||||
void updateViewerWidget();
|
||||
void updateViewerWidgetWindowTitle();
|
||||
void updateDepthZoomInQwt();
|
||||
void applyZoomAllDepths();
|
||||
void applyDepthZoomFromVisibleDepth();
|
||||
void recreateTrackPlots();
|
||||
void detachAllCurves();
|
||||
void handleViewerDeletion();
|
||||
|
||||
private:
|
||||
|
||||
caf::PdmField<bool> m_showWindow;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
@@ -113,6 +113,7 @@ private:
|
||||
|
||||
caf::PdmField<double> m_minVisibleDepth;
|
||||
caf::PdmField<double> m_maxVisibleDepth;
|
||||
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
|
||||
|
||||
double m_minAvailableDepth;
|
||||
double m_maxAvailableDepth;
|
||||
|
@@ -92,7 +92,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
if (wellLogPlot)
|
||||
{
|
||||
wellLogPlot->calculateAvailableDepthRange();
|
||||
wellLogPlot->zoomAllDepth();
|
||||
wellLogPlot->updateDepthZoom();
|
||||
if (wellLogPlot->viewer()) wellLogPlot->viewer()->updateChildrenLayout();
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot()
|
||||
firstAnchestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot)
|
||||
{
|
||||
wellLogPlot->zoomAllDepth();
|
||||
wellLogPlot->updateDepthZoom();
|
||||
}
|
||||
|
||||
zoomAllXAxisIfAutoScale();
|
||||
|
Reference in New Issue
Block a user