Merge pull request #4804 from OPM/feature-minor-wbs-changes

Minor wbs changes
This commit is contained in:
Gaute Lindkvist
2019-10-02 17:56:09 +02:00
committed by GitHub
12 changed files with 356 additions and 286 deletions

View File

@@ -68,6 +68,12 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
RicExportToLasFileResampleUi featureUi;
featureUi.exportFolder = defaultDir;
if ( RicWellLogPlotCurveFeatureImpl::parentWellBoreStabilityPlot() )
{
featureUi.filePrefix = "WBS_";
featureUi.capitalizeFileName = true;
}
{
std::vector<QString> wellNames;
std::vector<double> rkbDiffs;
@@ -101,7 +107,7 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
lasExporter.setRkbDiffs( wellNames, userDefRkbDiff );
}
lasExporter.writeToFolder( featureUi.exportFolder() );
lasExporter.writeToFolder( featureUi.exportFolder(), featureUi.filePrefix(), featureUi.capitalizeFileName() );
// Remember the path to next time
RiaApplication::instance()->setLastUsedDialogDirectory( "WELL_LOGS_DIR", featureUi.exportFolder() );

View File

@@ -47,6 +47,8 @@ RicExportToLasFileResampleUi::RicExportToLasFileResampleUi( void )
CAF_PDM_InitField( &exportFolder, "ExportFolder", QString(), "Export Folder", "", "", "" );
exportFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
CAF_PDM_InitField( &filePrefix, "FilePrefix", QString( "" ), "File Prefix", "", "", "" );
CAF_PDM_InitField( &capitalizeFileName, "CapitalizeFileName", false, "Capitalize File Name", "", "", "" );
CAF_PDM_InitField( &activateResample, "ActivateResample", false, "Resample Curve Data", "", "", "" );
activateResample.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
@@ -168,7 +170,8 @@ void RicExportToLasFileResampleUi::updateFieldVisibility()
void RicExportToLasFileResampleUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &exportFolder );
uiOrdering.add( &filePrefix );
uiOrdering.add( &capitalizeFileName );
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Resampling" );

View File

@@ -47,6 +47,8 @@ public:
~RicExportToLasFileResampleUi() override;
caf::PdmField<QString> exportFolder;
caf::PdmField<QString> filePrefix;
caf::PdmField<bool> capitalizeFileName;
caf::PdmField<bool> activateResample;
caf::PdmField<double> resampleInterval;

View File

@@ -208,22 +208,16 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechView->geoMechCase() );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::CURVE_ANNOTATIONS );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::NO_ANNOTATIONS );
stabilityCurvesTrack->setShowRegionLabels( true );
std::vector<QString> resultNames = RiaDefines::wellPathStabilityResultNames();
std::vector<cvf::Color3f> colors = {cvf::Color3f::RED,
std::vector<cvf::Color3f> colors = {cvf::Color3f::BLUE,
cvf::Color3f::BROWN,
cvf::Color3f::RED,
cvf::Color3f::PURPLE,
cvf::Color3f::GREEN,
cvf::Color3f::BLUE,
cvf::Color3f::ORANGE};
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH,
RiuQwtPlotCurve::STYLE_DASH_DOT,
RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH};
cvf::Color3f::DARK_GREEN};
for ( size_t i = 0; i < resultNames.size(); ++i )
{
@@ -240,7 +234,6 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
curve->setCurrentTimeStep( geoMechView->currentTimeStep() );
curve->setCustomName( resultName );
curve->setColor( colors[i % colors.size()] );
curve->setLineStyle( lineStyles[i % lineStyles.size()] );
curve->setLineThickness( 2 );
curve->loadDataAndUpdate( false );
}
@@ -261,7 +254,7 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
const double angleIncrement = 90.0;
std::vector<QString> resultNames = RiaDefines::wellPathAngleResultNames();
std::vector<cvf::Color3f> colors = {cvf::Color3f::DARK_RED, cvf::Color3f::BLUE};
std::vector<cvf::Color3f> colors = {cvf::Color3f::GREEN, cvf::Color3f::ORANGE};
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH};

View File

@@ -22,6 +22,7 @@
#include "RiaColorTables.h"
#include "RimWellAllocationPlot.h"
#include "RimWellBoreStabilityPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellRftPlot.h"
@@ -42,7 +43,10 @@ cvf::Color3f RicWellLogPlotCurveFeatureImpl::curveColorFromTable( size_t index )
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves()
{
std::set<RimWellLogCurve*> curveSet;
// Use std::set to determine uniqueness but a vector for inserting curves.
// This is to retain deterministic order.
std::vector<RimWellLogCurve*> allCurves;
std::set<RimWellLogCurve*> uniqueCurves;
{
std::vector<caf::PdmUiItem*> selectedItems;
@@ -58,17 +62,21 @@ std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCur
for ( RimWellLogCurve* curve : childCurves )
{
curveSet.insert( curve );
if ( !uniqueCurves.count( curve ) )
{
uniqueCurves.insert( curve );
allCurves.push_back( curve );
}
}
}
}
}
std::vector<RimWellLogCurve*> allCurves;
for ( RimWellLogCurve* curve : curveSet )
{
allCurves.push_back( curve );
}
// Sort by curve name in a way that retains the original order of equivalent items
// This way we have a completely deterministic order
std::stable_sort( allCurves.begin(), allCurves.end(), []( const RimWellLogCurve* lhs, const RimWellLogCurve* rhs ) {
return lhs->curveName() < rhs->curveName();
} );
return allCurves;
}
@@ -102,3 +110,18 @@ RimWellRftPlot* RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()
return wellRftPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellBoreStabilityPlot* RicWellLogPlotCurveFeatureImpl::parentWellBoreStabilityPlot()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
if ( !destinationObject ) return nullptr;
RimWellBoreStabilityPlot* wbsPlot = nullptr;
destinationObject->firstAncestorOrThisOfType( wbsPlot );
return wbsPlot;
}

View File

@@ -21,6 +21,7 @@
#include "cafPdmFieldCvfColor.h"
class RimWellBoreStabilityPlot;
class RimWellLogCurve;
class RimWellAllocationPlot;
class RimWellRftPlot;
@@ -35,4 +36,5 @@ public:
static std::vector<RimWellLogCurve*> selectedWellLogCurves();
static RimWellAllocationPlot* parentWellAllocationPlot();
static RimWellRftPlot* parentWellRftPlot();
static RimWellBoreStabilityPlot* parentWellBoreStabilityPlot();
};