mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Rft segment plot adjustments
* #9371 RFT Curves: Add scaling factor * Make sure isUsingAutoName is guarded by project file date * Rearrange font and legend group in property editor
This commit is contained in:
parent
0b7700024f
commit
493531626f
@ -979,10 +979,11 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis Settings" );
|
||||
uiOrderingForDepthAxis( uiConfigName, *depthGroup );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
plotLayoutGroup->setCollapsedByDefault();
|
||||
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup );
|
||||
RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Plot Name" );
|
||||
nameGroup->setCollapsedByDefault();
|
||||
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *nameGroup );
|
||||
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -981,7 +981,7 @@ void RimWellRftPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
plotLayoutGroup->setCollapsedByDefault();
|
||||
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup );
|
||||
RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
plotLayoutGroup->add( &m_depthOrientation );
|
||||
}
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
|
||||
if ( isMdiWindow() )
|
||||
{
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *generalGroup );
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1019,12 +1019,17 @@ void RimDepthTrackPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
|
||||
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
|
||||
uiOrderingForAutoName( uiConfigName, *titleGroup );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup, true );
|
||||
plotLayoutGroup->add( &m_subTitleFontSize );
|
||||
plotLayoutGroup->add( &m_axisTitleFontSize );
|
||||
plotLayoutGroup->add( &m_axisValueFontSize );
|
||||
plotLayoutGroup->add( &m_depthOrientation );
|
||||
caf::PdmUiGroup* legendGroup = uiOrdering.addNewGroup( "Legends" );
|
||||
legendGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForLegends( uiConfigName, *legendGroup, true );
|
||||
|
||||
caf::PdmUiGroup* fontGroup = uiOrdering.addNewGroup( "Fonts" );
|
||||
fontGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForFonts( uiConfigName, *fontGroup );
|
||||
fontGroup->add( &m_subTitleFontSize );
|
||||
fontGroup->add( &m_axisTitleFontSize );
|
||||
fontGroup->add( &m_axisValueFontSize );
|
||||
fontGroup->add( &m_depthOrientation );
|
||||
|
||||
std::vector<RimEnsembleWellLogCurveSet*> ensembleWellLogCurveSets;
|
||||
descendantsOfType( ensembleWellLogCurveSets );
|
||||
@ -1034,7 +1039,7 @@ void RimDepthTrackPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
|
||||
ensembleWellLogGroup->add( &m_depthEqualization );
|
||||
ensembleWellLogGroup->add( &m_ensembleCurveSet );
|
||||
|
||||
// Disable depth equalization if any of the ensmble is missing k-layer info
|
||||
// Disable depth equalization if any of the ensemble is missing k-layer info
|
||||
bool hasKLayerIndex = true;
|
||||
for ( auto wellLogCurveSet : ensembleWellLogCurveSets )
|
||||
if ( !wellLogCurveSet->hasPropertyInFile( RiaResultNames::indexKResultName() ) ) hasKLayerIndex = false;
|
||||
|
@ -94,8 +94,7 @@ void RimEnsembleFractureStatisticsPlot::defineUiOrdering( QString uiConfigName,
|
||||
bool showNumHistogramBins = true;
|
||||
RimStatisticsPlot::uiOrderingForHistogram( uiConfigName, uiOrdering, showNumHistogramBins );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
RimStatisticsPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -160,8 +160,7 @@ void RimGridStatisticsPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
bool showNumHistogramBins = false;
|
||||
RimStatisticsPlot::uiOrderingForHistogram( uiConfigName, uiOrdering, showNumHistogramBins );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
RimStatisticsPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ void RimMultiPlot::uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmU
|
||||
uiOrdering.add( &m_showIndividualPlotTitles );
|
||||
uiOrdering.add( &m_subTitleFontSize );
|
||||
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, uiOrdering );
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
uiOrdering.add( &m_columnCount );
|
||||
uiOrdering.add( &m_rowsPerPage );
|
||||
uiOrdering.add( &m_majorTickmarkCount );
|
||||
|
@ -70,7 +70,7 @@ RimPlotCurve::RimPlotCurve()
|
||||
CAF_PDM_InitFieldNoDefault( &m_legendEntryText, "LegendDescription", "Legend Name" );
|
||||
m_legendEntryText.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_isUsingAutoName_OBSOLETE, "AutoName", true, "Auto Name" );
|
||||
CAF_PDM_InitField( &m_isUsingAutoName_OBSOLETE, "AutoName", false, "Auto Name" );
|
||||
m_isUsingAutoName_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
m_isUsingAutoName_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
|
||||
@ -253,13 +253,16 @@ void RimPlotCurve::initAfterRead()
|
||||
updateCurveAppearanceForFilesOlderThan_2021_06();
|
||||
}
|
||||
|
||||
if ( m_isUsingAutoName_OBSOLETE() )
|
||||
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2022.06.1" ) )
|
||||
{
|
||||
m_namingMethod = RiaDefines::ObjectNamingMethod::AUTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_namingMethod = RiaDefines::ObjectNamingMethod::CUSTOM;
|
||||
if ( m_isUsingAutoName_OBSOLETE() )
|
||||
{
|
||||
m_namingMethod = RiaDefines::ObjectNamingMethod::AUTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_namingMethod = RiaDefines::ObjectNamingMethod::CUSTOM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,7 +332,7 @@ QList<caf::PdmOptionItemInfo> RimPlotWindow::calculateValueOptions( const caf::P
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition )
|
||||
void RimPlotWindow::uiOrderingForLegends( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition )
|
||||
{
|
||||
uiOrdering.add( &m_showPlotLegends );
|
||||
uiOrdering.add( &m_plotLegendsHorizontal );
|
||||
@ -341,10 +341,31 @@ void RimPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrd
|
||||
{
|
||||
uiOrdering.add( &m_legendPosition );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotWindow::uiOrderingForFonts( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_titleFontSize );
|
||||
uiOrdering.add( &m_legendFontSize );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotWindow::uiOrderingForLegendsAndFonts( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition )
|
||||
{
|
||||
caf::PdmUiGroup* legendGroup = uiOrdering.addNewGroup( "Legends" );
|
||||
legendGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForLegends( uiConfigName, *legendGroup, showLegendPosition );
|
||||
|
||||
caf::PdmUiGroup* fontGroup = uiOrdering.addNewGroup( "Fonts" );
|
||||
fontGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForFonts( uiConfigName, *fontGroup );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Re-implement this in sub classes to provide a custom page layout for printing/PDF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -95,7 +95,9 @@ protected:
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
void uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition = false );
|
||||
void uiOrderingForLegends( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition = false );
|
||||
void uiOrderingForFonts( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
void uiOrderingForLegendsAndFonts( QString uiConfigName, caf::PdmUiOrdering& uiOrdering, bool showLegendPosition = false );
|
||||
|
||||
void updateWindowVisibility();
|
||||
|
||||
|
@ -132,11 +132,17 @@ void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
|
||||
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleGroup );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
plotLayoutGroup->add( &m_subTitleFontSize );
|
||||
plotLayoutGroup->add( &m_axisTitleFontSize );
|
||||
plotLayoutGroup->add( &m_axisValueFontSize );
|
||||
caf::PdmUiGroup* legendGroup = uiOrdering.addNewGroup( "Legends" );
|
||||
legendGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForLegends( uiConfigName, *legendGroup, true );
|
||||
|
||||
caf::PdmUiGroup* fontGroup = uiOrdering.addNewGroup( "Fonts" );
|
||||
fontGroup->setCollapsedByDefault();
|
||||
RimPlotWindow::uiOrderingForFonts( uiConfigName, *fontGroup );
|
||||
|
||||
fontGroup->add( &m_subTitleFontSize );
|
||||
fontGroup->add( &m_axisTitleFontSize );
|
||||
fontGroup->add( &m_axisValueFontSize );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -96,8 +96,7 @@ void RimStimPlanModelPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd
|
||||
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
|
||||
RimDepthTrackPlot::uiOrderingForAutoName( uiConfigName, *titleGroup );
|
||||
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -2423,13 +2423,13 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
}
|
||||
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle );
|
||||
|
||||
mainOptions->add( &m_normalizeCurveYValues );
|
||||
|
||||
if ( isMdiWindow() )
|
||||
{
|
||||
uiOrderingForPlotLayout( uiConfigName, *mainOptions );
|
||||
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
|
||||
}
|
||||
|
||||
mainOptions->add( &m_normalizeCurveYValues );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,8 @@ RimWellLogRftCurve::RimWellLogRftCurve()
|
||||
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" );
|
||||
|
||||
CAF_PDM_InitField( &m_scaleFactor, "ScaleFactor", 1.0, "Scale Factor" );
|
||||
|
||||
CAF_PDM_InitField( &m_curveColorByPhase, "CurveColorByPhase", false, "Color by Phase" );
|
||||
}
|
||||
|
||||
@ -568,7 +570,17 @@ QString RimWellLogRftCurve::createCurveAutoName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellLogRftCurve::createCurveNameFromTemplate( const QString& templateText )
|
||||
{
|
||||
return RiaTextStringTools::replaceTemplateTextWithValues( templateText, createCurveNameKeyValueMap() );
|
||||
auto name = RiaTextStringTools::replaceTemplateTextWithValues( templateText, createCurveNameKeyValueMap() );
|
||||
|
||||
if ( m_scaleFactor() != 1.0 )
|
||||
{
|
||||
int exponent = std::log10( m_scaleFactor() );
|
||||
auto text = QString( "x1e%1" ).arg( QString::number( exponent ) );
|
||||
|
||||
name += QString( " [%1]" ).arg( text );
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -788,6 +800,7 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
curveDataGroup->add( &m_wellName );
|
||||
curveDataGroup->add( &m_timeStep );
|
||||
curveDataGroup->add( &m_rftDataType );
|
||||
curveDataGroup->add( &m_scaleFactor );
|
||||
|
||||
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
|
||||
{
|
||||
@ -864,6 +877,16 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
|
||||
{
|
||||
options = RimRftTools::segmentBranchIndexOptions( reader, m_wellName(), m_timeStep(), m_segmentBranchType() );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_scaleFactor )
|
||||
{
|
||||
for ( int exp = -12; exp <= 12; exp += 3 )
|
||||
{
|
||||
QString uiText = exp == 0 ? "1" : QString( "10 ^ %1" ).arg( exp );
|
||||
double value = std::pow( 10, exp );
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( uiText, value ) );
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -1094,9 +1117,9 @@ std::vector<size_t> RimWellLogRftCurve::sortedIndicesInRftFile()
|
||||
std::vector<double> RimWellLogRftCurve::xValues()
|
||||
{
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
std::vector<double> values;
|
||||
if ( !reader ) return {};
|
||||
|
||||
if ( !reader ) return values;
|
||||
std::vector<double> values;
|
||||
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
@ -1107,29 +1130,37 @@ std::vector<double> RimWellLogRftCurve::xValues()
|
||||
m_segmentBranchType() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto address = RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, m_wellLogChannelName() );
|
||||
|
||||
return values;
|
||||
reader->values( address, &values );
|
||||
|
||||
bool wellPathExists = createWellPathIdxToRftFileIdxMapping();
|
||||
|
||||
if ( wellPathExists )
|
||||
{
|
||||
std::vector<double> valuesSorted;
|
||||
|
||||
for ( size_t idx : sortedIndicesInRftFile() )
|
||||
{
|
||||
if ( idx < values.size() )
|
||||
{
|
||||
valuesSorted.push_back( ( values.at( idx ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
std::swap( valuesSorted, values );
|
||||
}
|
||||
}
|
||||
|
||||
auto address = RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, m_wellLogChannelName() );
|
||||
|
||||
reader->values( address, &values );
|
||||
|
||||
bool wellPathExists = createWellPathIdxToRftFileIdxMapping();
|
||||
|
||||
if ( wellPathExists )
|
||||
if ( m_scaleFactor() != 1.0 )
|
||||
{
|
||||
std::vector<double> valuesSorted;
|
||||
|
||||
for ( size_t idx : sortedIndicesInRftFile() )
|
||||
for ( auto& val : values )
|
||||
{
|
||||
if ( idx < values.size() )
|
||||
{
|
||||
valuesSorted.push_back( ( values.at( idx ) ) );
|
||||
}
|
||||
val *= m_scaleFactor();
|
||||
}
|
||||
|
||||
return valuesSorted;
|
||||
}
|
||||
|
||||
return values;
|
||||
|
@ -151,6 +151,8 @@ private:
|
||||
caf::PdmField<bool> m_branchDetection;
|
||||
caf::PdmField<bool> m_curveColorByPhase;
|
||||
|
||||
caf::PdmField<double> m_scaleFactor;
|
||||
|
||||
caf::PdmField<caf::AppEnum<RimWellLogRftCurve::RftDataType>> m_rftDataType;
|
||||
|
||||
caf::PdmField<QString> m_segmentResultName;
|
||||
|
Loading…
Reference in New Issue
Block a user