mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
RFT segment plot adjustments (#9912)
* Delete RFT plot when associated case is deleted * Rename * Hide track/curves with no data
This commit is contained in:
parent
8f786fed5d
commit
c248c9fb57
@ -21,6 +21,8 @@
|
|||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
|
|
||||||
|
#include "RicDeleteItemFeature.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
@ -28,6 +30,7 @@
|
|||||||
#include "RimSummaryMultiPlot.h"
|
#include "RimSummaryMultiPlot.h"
|
||||||
#include "RimSummaryMultiPlotCollection.h"
|
#include "RimSummaryMultiPlotCollection.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
|
#include "RimWellLogPlot.h"
|
||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
@ -59,6 +62,7 @@ void RicCloseSummaryCaseFeature::deleteSummaryCases( std::vector<RimSummaryCase*
|
|||||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = RiaSummaryTools::summaryCaseMainCollection();
|
RimSummaryCaseMainCollection* summaryCaseMainCollection = RiaSummaryTools::summaryCaseMainCollection();
|
||||||
|
|
||||||
std::set<RimSummaryMultiPlot*> plotsToUpdate;
|
std::set<RimSummaryMultiPlot*> plotsToUpdate;
|
||||||
|
std::set<RimWellLogPlot*> wellLogPlotsToDelete;
|
||||||
|
|
||||||
for ( RimSummaryCase* summaryCase : cases )
|
for ( RimSummaryCase* summaryCase : cases )
|
||||||
{
|
{
|
||||||
@ -70,6 +74,23 @@ void RicCloseSummaryCaseFeature::deleteSummaryCases( std::vector<RimSummaryCase*
|
|||||||
}
|
}
|
||||||
plotsToUpdate.insert( multiPlot );
|
plotsToUpdate.insert( multiPlot );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<caf::PdmObjectHandle*> referringObjects;
|
||||||
|
summaryCase->objectsWithReferringPtrFields( referringObjects );
|
||||||
|
|
||||||
|
for ( auto object : referringObjects )
|
||||||
|
{
|
||||||
|
if ( !object ) continue;
|
||||||
|
|
||||||
|
RimWellLogPlot* wellLogPlot = nullptr;
|
||||||
|
object->firstAncestorOrThisOfType( wellLogPlot );
|
||||||
|
if ( wellLogPlot ) wellLogPlotsToDelete.insert( wellLogPlot );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( auto wellLogPlot : wellLogPlotsToDelete )
|
||||||
|
{
|
||||||
|
RicDeleteItemFeature::deleteObject( wellLogPlot );
|
||||||
}
|
}
|
||||||
|
|
||||||
summaryCaseMainCollection->removeCases( cases );
|
summaryCaseMainCollection->removeCases( cases );
|
||||||
|
@ -44,12 +44,12 @@ bool RicDeleteItemFeature::isCommandEnabled()
|
|||||||
|
|
||||||
for ( caf::PdmUiItem* item : items )
|
for ( caf::PdmUiItem* item : items )
|
||||||
{
|
{
|
||||||
caf::PdmObject* currentPdmObject = dynamic_cast<caf::PdmObject*>( item );
|
auto* currentPdmObject = dynamic_cast<caf::PdmObject*>( item );
|
||||||
if ( !currentPdmObject ) return false;
|
if ( !currentPdmObject ) return false;
|
||||||
|
|
||||||
if ( !currentPdmObject->isDeletable() ) return false;
|
if ( !currentPdmObject->isDeletable() ) return false;
|
||||||
|
|
||||||
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( currentPdmObject->parentField() );
|
auto* childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( currentPdmObject->parentField() );
|
||||||
if ( !childArrayFieldHandle ) return false;
|
if ( !childArrayFieldHandle ) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,50 +63,58 @@ void RicDeleteItemFeature::onActionTriggered( bool isChecked )
|
|||||||
{
|
{
|
||||||
std::vector<caf::PdmUiItem*> items;
|
std::vector<caf::PdmUiItem*> items;
|
||||||
caf::SelectionManager::instance()->selectedItems( items );
|
caf::SelectionManager::instance()->selectedItems( items );
|
||||||
assert( items.size() > 0 );
|
|
||||||
|
|
||||||
for ( caf::PdmUiItem* item : items )
|
for ( caf::PdmUiItem* item : items )
|
||||||
{
|
{
|
||||||
caf::PdmObject* currentPdmObject = dynamic_cast<caf::PdmObject*>( item );
|
auto* currentPdmObject = dynamic_cast<caf::PdmObject*>( item );
|
||||||
if ( !currentPdmObject ) continue;
|
if ( !currentPdmObject ) continue;
|
||||||
|
|
||||||
if ( !currentPdmObject->isDeletable() ) continue;
|
deleteObject( currentPdmObject );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( currentPdmObject->parentField() );
|
//--------------------------------------------------------------------------------------------------
|
||||||
if ( !childArrayFieldHandle ) continue;
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicDeleteItemFeature::deleteObject( caf::PdmObject* objectToDelete )
|
||||||
|
{
|
||||||
|
if ( !objectToDelete || !objectToDelete->isDeletable() ) return;
|
||||||
|
|
||||||
int indexAfter = -1;
|
auto* childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( objectToDelete->parentField() );
|
||||||
|
if ( !childArrayFieldHandle ) return;
|
||||||
|
|
||||||
|
int indexToObject = -1;
|
||||||
|
|
||||||
std::vector<caf::PdmObjectHandle*> childObjects;
|
std::vector<caf::PdmObjectHandle*> childObjects;
|
||||||
childArrayFieldHandle->children( &childObjects );
|
childArrayFieldHandle->children( &childObjects );
|
||||||
|
|
||||||
for ( size_t i = 0; i < childObjects.size(); i++ )
|
for ( size_t i = 0; i < childObjects.size(); i++ )
|
||||||
{
|
{
|
||||||
if ( childObjects[i] == currentPdmObject )
|
if ( childObjects[i] == objectToDelete )
|
||||||
{
|
{
|
||||||
indexAfter = static_cast<int>( i );
|
indexToObject = static_cast<int>( i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Did not find currently selected pdm object in the current list field
|
// Did not find object in the current list field
|
||||||
assert( indexAfter != -1 );
|
if ( indexToObject == -1 ) return;
|
||||||
|
|
||||||
RicDeleteItemExec* executeCmd = new RicDeleteItemExec( caf::SelectionManager::instance()->notificationCenter() );
|
auto* executeCmd = new RicDeleteItemExec( caf::SelectionManager::instance()->notificationCenter() );
|
||||||
|
|
||||||
RicDeleteItemExecData& data = executeCmd->commandData();
|
RicDeleteItemExecData& data = executeCmd->commandData();
|
||||||
data.m_rootObject = caf::PdmReferenceHelper::findRoot( childArrayFieldHandle );
|
data.m_rootObject = caf::PdmReferenceHelper::findRoot( childArrayFieldHandle );
|
||||||
data.m_pathToField = caf::PdmReferenceHelper::referenceFromRootToField( data.m_rootObject, childArrayFieldHandle );
|
data.m_pathToField = caf::PdmReferenceHelper::referenceFromRootToField( data.m_rootObject, childArrayFieldHandle );
|
||||||
data.m_indexToObject = indexAfter;
|
data.m_indexToObject = indexToObject;
|
||||||
|
|
||||||
{
|
{
|
||||||
QString desc;
|
QString desc;
|
||||||
if ( currentPdmObject->userDescriptionField() )
|
if ( objectToDelete->userDescriptionField() )
|
||||||
{
|
{
|
||||||
desc = currentPdmObject->userDescriptionField()->uiCapability()->uiValue().toString();
|
desc = objectToDelete->userDescriptionField()->uiCapability()->uiValue().toString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
desc = currentPdmObject->uiName();
|
desc = objectToDelete->uiName();
|
||||||
}
|
}
|
||||||
|
|
||||||
data.m_description = desc + " (delete)";
|
data.m_description = desc + " (delete)";
|
||||||
@ -125,7 +133,6 @@ void RicDeleteItemFeature::onActionTriggered( bool isChecked )
|
|||||||
executeCmd->redo();
|
executeCmd->redo();
|
||||||
delete executeCmd;
|
delete executeCmd;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
class PdmObject;
|
||||||
|
}
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -28,8 +33,12 @@ class RicDeleteItemFeature : public caf::CmdFeature
|
|||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void deleteObject( caf::PdmObject* objectToDelete );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
|
|
||||||
void setupActionLook( QAction* actionToSetup ) override;
|
void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
@ -681,7 +681,7 @@ void RicSummaryPlotEditorUi::updateTargetPlot()
|
|||||||
// Add edited curves to target plot
|
// Add edited curves to target plot
|
||||||
for ( const auto& editedCurve : m_previewPlot->summaryCurves() )
|
for ( const auto& editedCurve : m_previewPlot->summaryCurves() )
|
||||||
{
|
{
|
||||||
if ( !editedCurve->isCurveVisible() )
|
if ( !editedCurve->isChecked() )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ void RicSummaryPlotEditorUi::copyCurveAndAddToPlot( const RimSummaryCurve* curve
|
|||||||
|
|
||||||
if ( forceVisible )
|
if ( forceVisible )
|
||||||
{
|
{
|
||||||
curveCopy->setCurveVisibility( true );
|
curveCopy->setCheckState( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
plot->addCurveNoUpdate( curveCopy, false );
|
plot->addCurveNoUpdate( curveCopy, false );
|
||||||
@ -747,7 +747,7 @@ void RicSummaryPlotEditorUi::copyEnsembleCurveAndAddToCurveSet( const RimSummary
|
|||||||
|
|
||||||
if ( forceVisible )
|
if ( forceVisible )
|
||||||
{
|
{
|
||||||
curveCopy->setCurveVisibility( true );
|
curveCopy->setCheckState( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
curveSet->addCurve( curveCopy );
|
curveSet->addCurve( curveCopy );
|
||||||
@ -951,7 +951,7 @@ void RicSummaryPlotEditorUi::setInitialCurveVisibility( const RimSummaryPlot* ta
|
|||||||
auto curveDef = std::make_pair( curve->summaryCaseY(), curve->summaryAddressY() );
|
auto curveDef = std::make_pair( curve->summaryCaseY(), curve->summaryAddressY() );
|
||||||
if ( sourceCurveDefs.count( curveDef ) == 0 )
|
if ( sourceCurveDefs.count( curveDef ) == 0 )
|
||||||
{
|
{
|
||||||
curve->setCurveVisibility( false );
|
curve->setCheckState( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
if ( !wellNames.empty() ) wellName = *wellNames.begin();
|
if ( !wellNames.empty() ) wellName = *wellNames.begin();
|
||||||
|
|
||||||
appendTrackAndCurveForBranchType( plot,
|
appendTrackAndCurveForBranchType( plot,
|
||||||
"Connection Rates",
|
"Reservoir Rates",
|
||||||
{ "CONGRAT", "CONORAT", "CONWRAT" },
|
{ "CONGRAT", "CONORAT", "CONWRAT" },
|
||||||
wellName,
|
wellName,
|
||||||
RiaDefines::RftBranchType::RFT_ANNULUS,
|
RiaDefines::RftBranchType::RFT_ANNULUS,
|
||||||
@ -90,7 +90,10 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
for ( auto branchType :
|
for ( auto branchType :
|
||||||
{ RiaDefines::RftBranchType::RFT_ANNULUS, RiaDefines::RftBranchType::RFT_DEVICE, RiaDefines::RftBranchType::RFT_TUBING } )
|
{ RiaDefines::RftBranchType::RFT_ANNULUS, RiaDefines::RftBranchType::RFT_DEVICE, RiaDefines::RftBranchType::RFT_TUBING } )
|
||||||
{
|
{
|
||||||
appendTrackAndCurveForBranchType( plot, "Segment Rates", { "SEGGRAT", "SEGORAT", "SEGWRAT" }, wellName, branchType, summaryCase );
|
QString trackName = caf::AppEnum<RiaDefines::RftBranchType>::uiText( branchType );
|
||||||
|
trackName += " Rates";
|
||||||
|
|
||||||
|
appendTrackAndCurveForBranchType( plot, trackName, { "SEGGRAT", "SEGORAT", "SEGWRAT" }, wellName, branchType, summaryCase );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +102,7 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( plot, wellName, summaryCase );
|
RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( plot, wellName, summaryCase );
|
||||||
|
|
||||||
plot->loadDataAndUpdate();
|
plot->loadDataAndUpdate();
|
||||||
|
plot->updateTrackVisibility();
|
||||||
|
|
||||||
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
|
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
|
||||||
plot->updateLayout();
|
plot->updateLayout();
|
||||||
@ -116,12 +120,10 @@ void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( Ri
|
|||||||
RiaDefines::RftBranchType branchType,
|
RiaDefines::RftBranchType branchType,
|
||||||
RimSummaryCase* summaryCase )
|
RimSummaryCase* summaryCase )
|
||||||
{
|
{
|
||||||
auto plotTrack = new RimWellLogTrack();
|
auto plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogTrackWithAutoUpdate();
|
||||||
plot->addPlot( plotTrack );
|
plot->addPlot( plotTrack );
|
||||||
plotTrack->setDescription( trackName );
|
plotTrack->setDescription( trackName );
|
||||||
|
|
||||||
plot->loadDataAndUpdate();
|
|
||||||
|
|
||||||
for ( const auto& resultName : resultNames )
|
for ( const auto& resultName : resultNames )
|
||||||
{
|
{
|
||||||
auto curve = RicWellLogTools::addSummaryRftSegmentCurve( plotTrack, resultName, wellName, branchType, summaryCase );
|
auto curve = RicWellLogTools::addSummaryRftSegmentCurve( plotTrack, resultName, wellName, branchType, summaryCase );
|
||||||
@ -137,7 +139,6 @@ void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( Ri
|
|||||||
curve->setFillStyle( Qt::SolidPattern );
|
curve->setFillStyle( Qt::SolidPattern );
|
||||||
|
|
||||||
curve->setIsStacked( true );
|
curve->setIsStacked( true );
|
||||||
curve->loadDataAndUpdate( true );
|
|
||||||
|
|
||||||
curve->updateAllRequiredEditors();
|
curve->updateAllRequiredEditors();
|
||||||
}
|
}
|
||||||
|
@ -79,9 +79,9 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
if ( !wellNames.empty() ) wellName = *wellNames.begin();
|
if ( !wellNames.empty() ) wellName = *wellNames.begin();
|
||||||
|
|
||||||
{
|
{
|
||||||
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogTrackWithAutoUpdate();
|
||||||
plot->addPlot( plotTrack );
|
plot->addPlot( plotTrack );
|
||||||
plotTrack->setDescription( "Connection Rates" );
|
plotTrack->setDescription( "Reservoir Rates" );
|
||||||
|
|
||||||
auto curve = createAndAddCurve( plotTrack, "CONGRAT", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
|
auto curve = createAndAddCurve( plotTrack, "CONGRAT", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
|
||||||
curve->setScaleFactor( 1e-3 );
|
curve->setScaleFactor( 1e-3 );
|
||||||
@ -92,7 +92,8 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
{ RiaDefines::RftBranchType::RFT_ANNULUS, RiaDefines::RftBranchType::RFT_DEVICE, RiaDefines::RftBranchType::RFT_TUBING } )
|
{ RiaDefines::RftBranchType::RFT_ANNULUS, RiaDefines::RftBranchType::RFT_DEVICE, RiaDefines::RftBranchType::RFT_TUBING } )
|
||||||
{
|
{
|
||||||
QString resultName = "SEGGRAT";
|
QString resultName = "SEGGRAT";
|
||||||
QString trackName = "Segment Rates";
|
QString trackName = caf::AppEnum<RiaDefines::RftBranchType>::uiText( branchType );
|
||||||
|
trackName += " Rates";
|
||||||
auto curve = appendTrackAndCurveForBranchType( plot, trackName, resultName, wellName, branchType, summaryCase );
|
auto curve = appendTrackAndCurveForBranchType( plot, trackName, resultName, wellName, branchType, summaryCase );
|
||||||
curve->setScaleFactor( 1e-3 );
|
curve->setScaleFactor( 1e-3 );
|
||||||
curve->setFillStyle( Qt::SolidPattern );
|
curve->setFillStyle( Qt::SolidPattern );
|
||||||
@ -103,6 +104,7 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
appendTopologyTrack( plot, wellName, summaryCase );
|
appendTopologyTrack( plot, wellName, summaryCase );
|
||||||
|
|
||||||
plot->loadDataAndUpdate();
|
plot->loadDataAndUpdate();
|
||||||
|
plot->updateTrackVisibility();
|
||||||
|
|
||||||
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
|
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
|
||||||
plot->updateLayout();
|
plot->updateLayout();
|
||||||
@ -120,15 +122,12 @@ RimWellLogRftCurve* RicNewRftSegmentWellLogPlotFeature::appendTrackAndCurveForBr
|
|||||||
RiaDefines::RftBranchType branchType,
|
RiaDefines::RftBranchType branchType,
|
||||||
RimSummaryCase* summaryCase )
|
RimSummaryCase* summaryCase )
|
||||||
{
|
{
|
||||||
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogTrackWithAutoUpdate();
|
||||||
plot->addPlot( plotTrack );
|
plot->addPlot( plotTrack );
|
||||||
plotTrack->setDescription( trackName );
|
plotTrack->setDescription( trackName );
|
||||||
|
|
||||||
plot->loadDataAndUpdate();
|
|
||||||
|
|
||||||
auto curve = createAndAddCurve( plotTrack, resultName, wellName, branchType, summaryCase );
|
auto curve = createAndAddCurve( plotTrack, resultName, wellName, branchType, summaryCase );
|
||||||
|
|
||||||
curve->loadDataAndUpdate( true );
|
|
||||||
curve->updateAllRequiredEditors();
|
curve->updateAllRequiredEditors();
|
||||||
|
|
||||||
return curve;
|
return curve;
|
||||||
@ -231,7 +230,8 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase )
|
void RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase )
|
||||||
{
|
{
|
||||||
auto track = new RimWellLogTrack();
|
auto track = RicNewWellLogPlotFeatureImpl::createWellLogTrackWithAutoUpdate();
|
||||||
|
track->setAutoCheckStateBasedOnCurveData( true );
|
||||||
track->setDescription( "Pressure" );
|
track->setDescription( "Pressure" );
|
||||||
|
|
||||||
plot->addPlot( track );
|
plot->addPlot( track );
|
||||||
@ -244,10 +244,12 @@ void RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( RimWellLogPlot* pl
|
|||||||
auto color = RimRftTopologyCurve::colorForRftBranchType( branchType );
|
auto color = RimRftTopologyCurve::colorForRftBranchType( branchType );
|
||||||
curve->setColor( color );
|
curve->setColor( color );
|
||||||
curve->setLineThickness( 3 );
|
curve->setLineThickness( 3 );
|
||||||
|
curve->setAutoCheckStateBasedOnCurveData( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
auto curve = createAndAddCurve( track, "PRESSURE", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
|
auto curve = createAndAddCurve( track, "PRESSURE", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
|
||||||
curve->setLineThickness( 3 );
|
curve->setLineThickness( 3 );
|
||||||
|
curve->setAutoCheckStateBasedOnCurveData( true );
|
||||||
|
|
||||||
track->updateAllRequiredEditors();
|
track->updateAllRequiredEditors();
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
|
|||||||
curve->setSmoothingThreshold( 0.002 );
|
curve->setSmoothingThreshold( 0.002 );
|
||||||
if ( resultNames[i] == RiaResultNames::wbsSHMkResult() )
|
if ( resultNames[i] == RiaResultNames::wbsSHMkResult() )
|
||||||
{
|
{
|
||||||
curve->setCurveVisibility( false );
|
curve->setCheckState( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,17 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot()
|
|||||||
return plot;
|
return plot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogTrackWithAutoUpdate()
|
||||||
|
{
|
||||||
|
auto track = new RimWellLogTrack();
|
||||||
|
track->setAutoCheckStateBasedOnCurveData( true );
|
||||||
|
|
||||||
|
return track;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
const RimWbsParameters* params = nullptr );
|
const RimWbsParameters* params = nullptr );
|
||||||
|
|
||||||
static RimWellLogPlot* createHorizontalWellLogPlot();
|
static RimWellLogPlot* createHorizontalWellLogPlot();
|
||||||
|
static RimWellLogTrack* createWellLogTrackWithAutoUpdate();
|
||||||
|
|
||||||
static RimWellLogPlot* createWellLogPlot( bool showAfterCreation = true, const QString& plotDescription = QString( "" ) );
|
static RimWellLogPlot* createWellLogPlot( bool showAfterCreation = true, const QString& plotDescription = QString( "" ) );
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ void RimWellAllocationPlot::updateFromWell()
|
|||||||
{
|
{
|
||||||
for ( auto c : t->curves() )
|
for ( auto c : t->curves() )
|
||||||
{
|
{
|
||||||
if ( !c->isCurveVisible() )
|
if ( !c->isChecked() )
|
||||||
{
|
{
|
||||||
uncheckedCurveNames.insert( c->curveName() );
|
uncheckedCurveNames.insert( c->curveName() );
|
||||||
}
|
}
|
||||||
@ -462,7 +462,7 @@ void RimWellAllocationPlot::addStackedCurve( const QString& tracerNa
|
|||||||
plotTrack->addCurve( curve );
|
plotTrack->addCurve( curve );
|
||||||
|
|
||||||
curve->loadDataAndUpdate( true );
|
curve->loadDataAndUpdate( true );
|
||||||
curve->setCurveVisibility( showCurve );
|
curve->setCheckState( showCurve );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -968,7 +968,7 @@ std::vector<const RimPlotCurve*> RimGridCrossPlot::visibleCurves() const
|
|||||||
{
|
{
|
||||||
for ( auto curve : dataSet->curves() )
|
for ( auto curve : dataSet->curves() )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() )
|
if ( curve->isChecked() )
|
||||||
{
|
{
|
||||||
plotCurves.push_back( curve );
|
plotCurves.push_back( curve );
|
||||||
}
|
}
|
||||||
|
@ -705,7 +705,7 @@ size_t RimGridCrossPlotDataSet::visibleCurveCount() const
|
|||||||
size_t visibleCurves = 0;
|
size_t visibleCurves = 0;
|
||||||
for ( auto curve : m_crossPlotCurves )
|
for ( auto curve : m_crossPlotCurves )
|
||||||
{
|
{
|
||||||
if ( curve && curve->isCurveVisible() ) visibleCurves++;
|
if ( curve && curve->isChecked() ) visibleCurves++;
|
||||||
}
|
}
|
||||||
return visibleCurves;
|
return visibleCurves;
|
||||||
}
|
}
|
||||||
@ -718,7 +718,7 @@ size_t RimGridCrossPlotDataSet::sampleCount() const
|
|||||||
size_t sampleCount = 0;
|
size_t sampleCount = 0;
|
||||||
for ( auto curve : m_crossPlotCurves )
|
for ( auto curve : m_crossPlotCurves )
|
||||||
{
|
{
|
||||||
if ( curve && curve->isCurveVisible() ) sampleCount += curve->sampleCount();
|
if ( curve && curve->isChecked() ) sampleCount += curve->sampleCount();
|
||||||
}
|
}
|
||||||
return sampleCount;
|
return sampleCount;
|
||||||
}
|
}
|
||||||
|
@ -1530,6 +1530,17 @@ RiuPlotAxis RimDepthTrackPlot::annotationAxis( RiaDefines::Orientation depthOrie
|
|||||||
return RiuPlotAxis( oppositeAxis );
|
return RiuPlotAxis( oppositeAxis );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimDepthTrackPlot::updateTrackVisibility()
|
||||||
|
{
|
||||||
|
for ( auto& track : m_plots )
|
||||||
|
{
|
||||||
|
track->updateCheckStateBasedOnCurveData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -172,6 +172,8 @@ public:
|
|||||||
static RiuPlotAxis valueAxis( RiaDefines::Orientation depthOrientation );
|
static RiuPlotAxis valueAxis( RiaDefines::Orientation depthOrientation );
|
||||||
static RiuPlotAxis annotationAxis( RiaDefines::Orientation depthOrientation );
|
static RiuPlotAxis annotationAxis( RiaDefines::Orientation depthOrientation );
|
||||||
|
|
||||||
|
void updateTrackVisibility();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QImage snapshotWindowContent() override;
|
QImage snapshotWindowContent() override;
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||||
|
|
||||||
if ( isCurveVisible() && m_plotCurve )
|
if ( isChecked() && m_plotCurve )
|
||||||
{
|
{
|
||||||
std::vector<double> values;
|
std::vector<double> values;
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ RimPlotCurve::RimPlotCurve()
|
|||||||
CAF_PDM_InitField( &m_showCurve, "Show", true, "Show curve" );
|
CAF_PDM_InitField( &m_showCurve, "Show", true, "Show curve" );
|
||||||
m_showCurve.uiCapability()->setUiHidden( true );
|
m_showCurve.uiCapability()->setUiHidden( true );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_autoCheckStateBasedOnCurveData, "AutoCheckStateBasedOnCurveData", false, "Hide Curve If No Curve Data" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_curveName, "CurveName", "" );
|
CAF_PDM_InitFieldNoDefault( &m_curveName, "CurveName", "" );
|
||||||
|
|
||||||
auto templateText = QString( "%1, %2" ).arg( RiaDefines::namingVariableCase() ).arg( RiaDefines::namingVariableResultName() );
|
auto templateText = QString( "%1, %2" ).arg( RiaDefines::namingVariableCase() ).arg( RiaDefines::namingVariableResultName() );
|
||||||
@ -158,6 +160,10 @@ void RimPlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, co
|
|||||||
if ( m_showCurve() ) loadDataAndUpdate( false );
|
if ( m_showCurve() ) loadDataAndUpdate( false );
|
||||||
visibilityChanged.send( m_showCurve() );
|
visibilityChanged.send( m_showCurve() );
|
||||||
}
|
}
|
||||||
|
else if ( changedField == &m_autoCheckStateBasedOnCurveData )
|
||||||
|
{
|
||||||
|
updateCheckStateBasedOnCurveData();
|
||||||
|
}
|
||||||
else if ( changedField == &m_curveName )
|
else if ( changedField == &m_curveName )
|
||||||
{
|
{
|
||||||
updateCurveNameAndUpdatePlotLegendAndTitle();
|
updateCurveNameAndUpdatePlotLegendAndTitle();
|
||||||
@ -359,7 +365,7 @@ cvf::Color3f RimPlotCurve::color() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimPlotCurve::isCurveVisible() const
|
bool RimPlotCurve::isChecked() const
|
||||||
{
|
{
|
||||||
return m_showCurve;
|
return m_showCurve;
|
||||||
}
|
}
|
||||||
@ -367,9 +373,27 @@ bool RimPlotCurve::isCurveVisible() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotCurve::setCurveVisibility( bool visible )
|
void RimPlotCurve::setCheckState( bool isChecked )
|
||||||
{
|
{
|
||||||
m_showCurve = visible;
|
m_showCurve = isChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlotCurve::setAutoCheckStateBasedOnCurveData( bool enable )
|
||||||
|
{
|
||||||
|
m_autoCheckStateBasedOnCurveData = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlotCurve::updateCheckStateBasedOnCurveData()
|
||||||
|
{
|
||||||
|
if ( !m_autoCheckStateBasedOnCurveData ) return;
|
||||||
|
|
||||||
|
setCheckState( isAnyCurveDataPresent() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -861,6 +885,14 @@ void RimPlotCurve::updateAxisInPlot( RiuPlotAxis plotAxis )
|
|||||||
if ( m_plotCurve ) m_plotCurve->setYAxis( plotAxis );
|
if ( m_plotCurve ) m_plotCurve->setYAxis( plotAxis );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimPlotCurve::isAnyCurveDataPresent() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -79,8 +79,14 @@ public:
|
|||||||
void setFillStyle( Qt::BrushStyle brushStyle );
|
void setFillStyle( Qt::BrushStyle brushStyle );
|
||||||
void setFillColor( const cvf::Color3f& fillColor );
|
void setFillColor( const cvf::Color3f& fillColor );
|
||||||
|
|
||||||
bool isCurveVisible() const;
|
bool isChecked() const;
|
||||||
void setCurveVisibility( bool visible );
|
void setCheckState( bool isChecked );
|
||||||
|
|
||||||
|
// The check state of the curve (m_showCurve) can automatically be updated based on presens of curve data. The virtual method
|
||||||
|
// isAnyCurveDataPresent() can be overridden. Similar concept is used in RimWellLogTrack
|
||||||
|
void setAutoCheckStateBasedOnCurveData( bool enable );
|
||||||
|
void updateCheckStateBasedOnCurveData();
|
||||||
|
virtual bool isAnyCurveDataPresent() const;
|
||||||
|
|
||||||
void updateCurveName();
|
void updateCurveName();
|
||||||
void updateCurveNameAndUpdatePlotLegendAndTitle();
|
void updateCurveNameAndUpdatePlotLegendAndTitle();
|
||||||
@ -184,6 +190,7 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<bool> m_showCurve;
|
caf::PdmField<bool> m_showCurve;
|
||||||
|
caf::PdmField<bool> m_autoCheckStateBasedOnCurveData;
|
||||||
|
|
||||||
caf::PdmField<QString> m_curveName;
|
caf::PdmField<QString> m_curveName;
|
||||||
caf::PdmField<QString> m_curveNameTemplateText;
|
caf::PdmField<QString> m_curveNameTemplateText;
|
||||||
|
@ -127,7 +127,7 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( isChecked() )
|
||||||
{
|
{
|
||||||
std::vector<time_t> dateTimes = this->timeSteps();
|
std::vector<time_t> dateTimes = this->timeSteps();
|
||||||
std::vector<double> values = this->yValues();
|
std::vector<double> values = this->yValues();
|
||||||
|
@ -598,7 +598,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
setZIndexFromCurveInfo();
|
setZIndexFromCurveInfo();
|
||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( isChecked() )
|
||||||
{
|
{
|
||||||
std::vector<double> curveValuesY = this->valuesY();
|
std::vector<double> curveValuesY = this->valuesY();
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ void RimSummaryCurveCollection::reattachPlotCurves()
|
|||||||
{
|
{
|
||||||
for ( RimSummaryCurve* curve : m_curves )
|
for ( RimSummaryCurve* curve : m_curves )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() ) curve->reattach();
|
if ( curve->isChecked() ) curve->reattach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ void RimSummaryCurvesData::populateTimeHistoryCurvesData( std::vector<RimGridTim
|
|||||||
|
|
||||||
for ( RimGridTimeHistoryCurve* curve : curves )
|
for ( RimGridTimeHistoryCurve* curve : curves )
|
||||||
{
|
{
|
||||||
if ( !curve->isCurveVisible() ) continue;
|
if ( !curve->isChecked() ) continue;
|
||||||
QString curveCaseName = curve->caseName();
|
QString curveCaseName = curve->caseName();
|
||||||
|
|
||||||
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
||||||
@ -63,7 +63,7 @@ void RimSummaryCurvesData::populateAsciiDataCurvesData( std::vector<RimAsciiData
|
|||||||
|
|
||||||
for ( RimAsciiDataCurve* curve : curves )
|
for ( RimAsciiDataCurve* curve : curves )
|
||||||
{
|
{
|
||||||
if ( !curve->isCurveVisible() ) continue;
|
if ( !curve->isChecked() ) continue;
|
||||||
|
|
||||||
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ void RimSummaryCurvesData::populateSummaryCurvesData( std::vector<RimSummaryCurv
|
|||||||
{
|
{
|
||||||
bool isObservedCurve = curve->summaryCaseY() ? curve->summaryCaseY()->isObservedData() : false;
|
bool isObservedCurve = curve->summaryCaseY() ? curve->summaryCaseY()->isObservedData() : false;
|
||||||
|
|
||||||
if ( !curve->isCurveVisible() ) continue;
|
if ( !curve->isChecked() ) continue;
|
||||||
if ( isObservedCurve && ( curveType != SummaryCurveType::CURVE_TYPE_OBSERVED ) ) continue;
|
if ( isObservedCurve && ( curveType != SummaryCurveType::CURVE_TYPE_OBSERVED ) ) continue;
|
||||||
if ( !isObservedCurve && ( curveType != SummaryCurveType::CURVE_TYPE_GRID ) ) continue;
|
if ( !isObservedCurve && ( curveType != SummaryCurveType::CURVE_TYPE_GRID ) ) continue;
|
||||||
if ( !curve->summaryCaseY() ) continue;
|
if ( !curve->summaryCaseY() ) continue;
|
||||||
|
@ -1171,7 +1171,7 @@ std::vector<RimSummaryCurve*> RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPl
|
|||||||
{
|
{
|
||||||
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() )
|
if ( curve->isChecked() )
|
||||||
{
|
{
|
||||||
curves.push_back( curve );
|
curves.push_back( curve );
|
||||||
}
|
}
|
||||||
@ -1184,7 +1184,7 @@ std::vector<RimSummaryCurve*> RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPl
|
|||||||
{
|
{
|
||||||
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() && curve->axisY() == plotAxis )
|
if ( curve->isChecked() && curve->axisY() == plotAxis )
|
||||||
{
|
{
|
||||||
curves.push_back( curve );
|
curves.push_back( curve );
|
||||||
}
|
}
|
||||||
@ -1197,7 +1197,7 @@ std::vector<RimSummaryCurve*> RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPl
|
|||||||
{
|
{
|
||||||
for ( RimSummaryCurve* curve : curveSet->curves() )
|
for ( RimSummaryCurve* curve : curveSet->curves() )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() && curve->axisY() == plotAxis )
|
if ( curve->isChecked() && curve->axisY() == plotAxis )
|
||||||
{
|
{
|
||||||
curves.push_back( curve );
|
curves.push_back( curve );
|
||||||
}
|
}
|
||||||
@ -1254,7 +1254,7 @@ std::vector<RimGridTimeHistoryCurve*> RimSummaryPlot::visibleTimeHistoryCurvesFo
|
|||||||
|
|
||||||
for ( const auto& c : m_gridTimeHistoryCurves )
|
for ( const auto& c : m_gridTimeHistoryCurves )
|
||||||
{
|
{
|
||||||
if ( c->isCurveVisible() )
|
if ( c->isChecked() )
|
||||||
{
|
{
|
||||||
if ( c->yAxis() == plotAxis || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
if ( c->yAxis() == plotAxis || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||||
{
|
{
|
||||||
@ -1275,7 +1275,7 @@ std::vector<RimAsciiDataCurve*> RimSummaryPlot::visibleAsciiDataCurvesForAxis( R
|
|||||||
|
|
||||||
for ( const auto& c : m_asciiDataCurves )
|
for ( const auto& c : m_asciiDataCurves )
|
||||||
{
|
{
|
||||||
if ( c->isCurveVisible() )
|
if ( c->isChecked() )
|
||||||
{
|
{
|
||||||
if ( c->yAxis() == plotAxis || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
if ( c->yAxis() == plotAxis || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||||
{
|
{
|
||||||
@ -2041,7 +2041,7 @@ std::vector<RimPlotCurve*> RimSummaryPlot::visibleCurvesForLegend()
|
|||||||
|
|
||||||
for ( auto c : summaryCurves() )
|
for ( auto c : summaryCurves() )
|
||||||
{
|
{
|
||||||
if ( !c->isCurveVisible() ) continue;
|
if ( !c->isChecked() ) continue;
|
||||||
if ( !c->showInLegend() ) continue;
|
if ( !c->showInLegend() ) continue;
|
||||||
curves.push_back( c );
|
curves.push_back( c );
|
||||||
}
|
}
|
||||||
@ -2815,7 +2815,7 @@ void RimSummaryPlot::updateCurveNames()
|
|||||||
{
|
{
|
||||||
for ( auto c : summaryCurves() )
|
for ( auto c : summaryCurves() )
|
||||||
{
|
{
|
||||||
if ( c->isCurveVisible() )
|
if ( c->isChecked() )
|
||||||
{
|
{
|
||||||
c->updateCurveNameNoLegendUpdate();
|
c->updateCurveNameNoLegendUpdate();
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,14 @@ void RimWellLogCurve::setPropertyAndDepthsAndErrors( const std::vector<double>&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogCurve::clearCurveData()
|
||||||
|
{
|
||||||
|
m_curveData->clear();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -458,3 +466,11 @@ RiuPlotAxis RimWellLogCurve::valueAxis() const
|
|||||||
|
|
||||||
return depthTrackPlot->valueAxis();
|
return depthTrackPlot->valueAxis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimWellLogCurve::isAnyCurveDataPresent() const
|
||||||
|
{
|
||||||
|
return !m_curveData->propertyValues().empty();
|
||||||
|
}
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
||||||
|
|
||||||
const RigWellLogCurveData* curveData() const;
|
const RigWellLogCurveData* curveData() const;
|
||||||
|
bool isAnyCurveDataPresent() const override;
|
||||||
|
|
||||||
void updateCurveAppearance() override;
|
void updateCurveAppearance() override;
|
||||||
|
|
||||||
@ -105,6 +106,8 @@ protected:
|
|||||||
const std::vector<double>& depthValues,
|
const std::vector<double>& depthValues,
|
||||||
const std::vector<double>& errorValues );
|
const std::vector<double>& errorValues );
|
||||||
|
|
||||||
|
void clearCurveData();
|
||||||
|
|
||||||
bool isVerticalCurve() const;
|
bool isVerticalCurve() const;
|
||||||
RiuPlotAxis depthAxis() const;
|
RiuPlotAxis depthAxis() const;
|
||||||
RiuPlotAxis valueAxis() const;
|
RiuPlotAxis valueAxis() const;
|
||||||
|
@ -328,10 +328,6 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
|
|||||||
// Check to see if the parameters are unique
|
// Check to see if the parameters are unique
|
||||||
for ( RimWellLogCurve* curve : curves )
|
for ( RimWellLogCurve* curve : curves )
|
||||||
{
|
{
|
||||||
if ( !curve->isCurveVisible() )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
|
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
|
||||||
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
|
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
|
||||||
auto* flowRateCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
|
auto* flowRateCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
|
||||||
@ -521,10 +517,6 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
|
|||||||
std::set<RimWellLogPlot*> plots;
|
std::set<RimWellLogPlot*> plots;
|
||||||
for ( RimWellLogCurve* curve : curves )
|
for ( RimWellLogCurve* curve : curves )
|
||||||
{
|
{
|
||||||
if ( !curve->isCurveVisible() )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
|
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
|
||||||
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
|
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
|
||||||
auto* measurementCurve = dynamic_cast<RimWellMeasurementCurve*>( curve );
|
auto* measurementCurve = dynamic_cast<RimWellMeasurementCurve*>( curve );
|
||||||
@ -719,6 +711,11 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges()
|
|||||||
parentPlot->descendantsIncludingThisOfType( tracks );
|
parentPlot->descendantsIncludingThisOfType( tracks );
|
||||||
|
|
||||||
this->applyDataSourceChanges( curves, tracks );
|
this->applyDataSourceChanges( curves, tracks );
|
||||||
|
|
||||||
|
for ( auto& track : tracks )
|
||||||
|
{
|
||||||
|
track->updateCheckStateBasedOnCurveData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||||
{
|
{
|
||||||
if ( isCurveVisible() )
|
if ( isChecked() )
|
||||||
{
|
{
|
||||||
bool isUsingPseudoLength = false;
|
bool isUsingPseudoLength = false;
|
||||||
performDataExtraction( &isUsingPseudoLength );
|
performDataExtraction( &isUsingPseudoLength );
|
||||||
|
@ -78,7 +78,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( isChecked() )
|
||||||
{
|
{
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
|
@ -648,7 +648,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
DerivedMDSource derivedMDSource = DerivedMDSource::NO_SOURCE;
|
DerivedMDSource derivedMDSource = DerivedMDSource::NO_SOURCE;
|
||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( m_autoCheckStateBasedOnCurveData() || isChecked() )
|
||||||
{
|
{
|
||||||
RimDepthTrackPlot* wellLogPlot;
|
RimDepthTrackPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
@ -666,6 +666,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
if ( values.empty() || values.size() != tvDepthVector.size() )
|
if ( values.empty() || values.size() != tvDepthVector.size() )
|
||||||
{
|
{
|
||||||
|
clearCurveData();
|
||||||
this->detach( true );
|
this->detach( true );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -747,6 +748,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
displayUnit = wellLogPlot->depthUnit();
|
displayUnit = wellLogPlot->depthUnit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_plotCurve )
|
||||||
|
{
|
||||||
if ( wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
|
if ( wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
|
||||||
{
|
{
|
||||||
m_plotCurve->setPerPointLabels( perPointLabels );
|
m_plotCurve->setPerPointLabels( perPointLabels );
|
||||||
@ -819,6 +822,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||||
|
}
|
||||||
|
|
||||||
if ( updateParentPlot )
|
if ( updateParentPlot )
|
||||||
{
|
{
|
||||||
@ -847,6 +851,10 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
|||||||
curveDataGroup->add( &m_rftDataType );
|
curveDataGroup->add( &m_rftDataType );
|
||||||
curveDataGroup->add( &m_scaleFactor );
|
curveDataGroup->add( &m_scaleFactor );
|
||||||
|
|
||||||
|
caf::PdmUiGroup* automationGroup = uiOrdering.addNewGroup( "Automation" );
|
||||||
|
automationGroup->setCollapsedByDefault();
|
||||||
|
automationGroup->add( &m_autoCheckStateBasedOnCurveData );
|
||||||
|
|
||||||
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
|
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
|
||||||
{
|
{
|
||||||
curveDataGroup->add( &m_wellLogChannelName );
|
curveDataGroup->add( &m_wellLogChannelName );
|
||||||
|
@ -270,6 +270,8 @@ RimWellLogTrack::RimWellLogTrack()
|
|||||||
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path" );
|
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes" );
|
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes" );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_autoCheckStateBasedOnCurveData, "AutoCheckStateBasedOnCurveData", false, "Hide Track if No Curve Data" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 0.0, "Overburden Height" );
|
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 0.0, "Overburden Height" );
|
||||||
m_overburdenHeight.uiCapability()->setUiHidden( true );
|
m_overburdenHeight.uiCapability()->setUiHidden( true );
|
||||||
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 0.0, "Underburden Height" );
|
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 0.0, "Underburden Height" );
|
||||||
@ -379,7 +381,7 @@ void RimWellLogTrack::calculatePropertyValueZoomRange()
|
|||||||
double minCurveValue = HUGE_VAL;
|
double minCurveValue = HUGE_VAL;
|
||||||
double maxCurveValue = -HUGE_VAL;
|
double maxCurveValue = -HUGE_VAL;
|
||||||
|
|
||||||
if ( curve->isCurveVisible() )
|
if ( curve->isChecked() )
|
||||||
{
|
{
|
||||||
visibleCurves++;
|
visibleCurves++;
|
||||||
if ( curve->propertyValueRangeInData( &minCurveValue, &maxCurveValue ) )
|
if ( curve->propertyValueRangeInData( &minCurveValue, &maxCurveValue ) )
|
||||||
@ -443,7 +445,7 @@ void RimWellLogTrack::calculateDepthZoomRange()
|
|||||||
double minCurveDepth = HUGE_VAL;
|
double minCurveDepth = HUGE_VAL;
|
||||||
double maxCurveDepth = -HUGE_VAL;
|
double maxCurveDepth = -HUGE_VAL;
|
||||||
|
|
||||||
if ( curve->isCurveVisible() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
|
if ( curve->isChecked() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
|
||||||
{
|
{
|
||||||
if ( minCurveDepth < minDepth )
|
if ( minCurveDepth < minDepth )
|
||||||
{
|
{
|
||||||
@ -759,6 +761,10 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
updateParentLayout();
|
updateParentLayout();
|
||||||
RiuPlotMainWindowTools::refreshToolbars();
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
}
|
}
|
||||||
|
else if ( changedField == &m_autoCheckStateBasedOnCurveData )
|
||||||
|
{
|
||||||
|
updateCheckStateBasedOnCurveData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -954,7 +960,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
|||||||
|
|
||||||
for ( RimWellLogCurve* curve : m_curves() )
|
for ( RimWellLogCurve* curve : m_curves() )
|
||||||
{
|
{
|
||||||
if ( !curve->isCurveVisible() ) continue;
|
if ( !curve->isChecked() ) continue;
|
||||||
|
|
||||||
const RigWellLogCurveData* curveData = curve->curveData();
|
const RigWellLogCurveData* curveData = curve->curveData();
|
||||||
if ( !curveData ) continue;
|
if ( !curveData ) continue;
|
||||||
@ -1281,6 +1287,36 @@ bool RimWellLogTrack::isEmptyVisiblePropertyRange() const
|
|||||||
1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) );
|
1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogTrack::setAutoCheckStateBasedOnCurveData( bool enable )
|
||||||
|
{
|
||||||
|
m_autoCheckStateBasedOnCurveData = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogTrack::updateCheckStateBasedOnCurveData()
|
||||||
|
{
|
||||||
|
bool curveDataPresent = false;
|
||||||
|
for ( const auto& curve : curves() )
|
||||||
|
{
|
||||||
|
curve->updateCheckStateBasedOnCurveData();
|
||||||
|
curve->updateCurveVisibility();
|
||||||
|
|
||||||
|
if ( curve->isAnyCurveDataPresent() ) curveDataPresent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// As the visibility of a curve might have changed, update the legend
|
||||||
|
updateLegend();
|
||||||
|
|
||||||
|
if ( !m_autoCheckStateBasedOnCurveData ) return;
|
||||||
|
|
||||||
|
setShowWindow( curveDataPresent );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1999,6 +2035,10 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
|||||||
else
|
else
|
||||||
uiOrdering.add( &m_colSpan );
|
uiOrdering.add( &m_colSpan );
|
||||||
|
|
||||||
|
caf::PdmUiGroup* automationGroup = uiOrdering.addNewGroup( "Automation" );
|
||||||
|
automationGroup->setCollapsedByDefault();
|
||||||
|
automationGroup->add( &m_autoCheckStateBasedOnCurveData );
|
||||||
|
|
||||||
caf::PdmUiGroup* annotationGroup = uiOrdering.addNewGroup( "Regions/Annotations" );
|
caf::PdmUiGroup* annotationGroup = uiOrdering.addNewGroup( "Regions/Annotations" );
|
||||||
annotationGroup->setCollapsedByDefault();
|
annotationGroup->setCollapsedByDefault();
|
||||||
|
|
||||||
@ -2373,11 +2413,11 @@ void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
|
|||||||
double pos = HUGE_VAL;
|
double pos = HUGE_VAL;
|
||||||
double neg = -HUGE_VAL;
|
double neg = -HUGE_VAL;
|
||||||
|
|
||||||
for ( size_t cIdx = 0; cIdx < m_curves.size(); cIdx++ )
|
for ( const auto& curve : m_curves )
|
||||||
{
|
{
|
||||||
if ( m_curves[cIdx]->isCurveVisible() && m_curves[cIdx]->curveData() )
|
if ( curve->isChecked() && curve->curveData() )
|
||||||
{
|
{
|
||||||
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(), pos, neg );
|
RigStatisticsCalculator::posNegClosestToZero( curve->curveData()->propertyValuesByIntervals(), pos, neg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2415,7 +2455,7 @@ std::map<int, std::vector<RimWellLogCurve*>> RimWellLogTrack::visibleStackedCurv
|
|||||||
std::map<int, std::vector<RimWellLogCurve*>> stackedCurves;
|
std::map<int, std::vector<RimWellLogCurve*>> stackedCurves;
|
||||||
for ( RimWellLogCurve* curve : m_curves )
|
for ( RimWellLogCurve* curve : m_curves )
|
||||||
{
|
{
|
||||||
if ( curve && curve->isCurveVisible() )
|
if ( curve && curve->isChecked() )
|
||||||
{
|
{
|
||||||
RimWellFlowRateCurve* wfrCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
|
RimWellFlowRateCurve* wfrCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
|
||||||
if ( wfrCurve != nullptr ) // Flow rate curves are always stacked
|
if ( wfrCurve != nullptr ) // Flow rate curves are always stacked
|
||||||
@ -2449,7 +2489,7 @@ std::vector<RimWellLogCurve*> RimWellLogTrack::visibleCurves() const
|
|||||||
|
|
||||||
for ( RimWellLogCurve* curve : m_curves.children() )
|
for ( RimWellLogCurve* curve : m_curves.children() )
|
||||||
{
|
{
|
||||||
if ( curve->isCurveVisible() )
|
if ( curve->isChecked() )
|
||||||
{
|
{
|
||||||
curvesVector.push_back( curve );
|
curvesVector.push_back( curve );
|
||||||
}
|
}
|
||||||
|
@ -236,6 +236,9 @@ public:
|
|||||||
void updateAxesVisibility( RiaDefines::Orientation orientation, bool isFirstTrack, bool isLastTrack );
|
void updateAxesVisibility( RiaDefines::Orientation orientation, bool isFirstTrack, bool isLastTrack );
|
||||||
void updateDepthMarkerLine();
|
void updateDepthMarkerLine();
|
||||||
|
|
||||||
|
void setAutoCheckStateBasedOnCurveData( bool enable );
|
||||||
|
void updateCheckStateBasedOnCurveData();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
void deleteViewWidget() override;
|
void deleteViewWidget() override;
|
||||||
@ -361,6 +364,8 @@ private:
|
|||||||
caf::PdmField<double> m_underburdenHeight;
|
caf::PdmField<double> m_underburdenHeight;
|
||||||
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
|
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
|
||||||
|
|
||||||
|
caf::PdmField<bool> m_autoCheckStateBasedOnCurveData;
|
||||||
|
|
||||||
std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects;
|
std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects;
|
||||||
|
|
||||||
bool m_formationsForCaseWithSimWellOnly;
|
bool m_formationsForCaseWithSimWellOnly;
|
||||||
|
@ -47,6 +47,17 @@ RigWellLogCurveData::~RigWellLogCurveData()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigWellLogCurveData::clear()
|
||||||
|
{
|
||||||
|
m_propertyValues.clear();
|
||||||
|
m_depths.clear();
|
||||||
|
m_intervalsOfContinousValidValues.clear();
|
||||||
|
m_propertyValueUnitString.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -41,6 +41,8 @@ public:
|
|||||||
RigWellLogCurveData();
|
RigWellLogCurveData();
|
||||||
~RigWellLogCurveData() override;
|
~RigWellLogCurveData() override;
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
|
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
|
||||||
|
|
||||||
void setValuesAndDepths( const std::vector<double>& propertyValues,
|
void setValuesAndDepths( const std::vector<double>& propertyValues,
|
||||||
|
Loading…
Reference in New Issue
Block a user