mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#4990 Column and row span
This commit is contained in:
@@ -57,6 +57,9 @@ RimGridCrossPlot::RimGridCrossPlot()
|
|||||||
CAF_PDM_InitField( &m_showInfoBox, "ShowInfoBox", true, "Show Info Box", "", "", "" );
|
CAF_PDM_InitField( &m_showInfoBox, "ShowInfoBox", true, "Show Info Box", "", "", "" );
|
||||||
CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", false, "Show Legend", "", "", "" );
|
CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", false, "Show Legend", "", "", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_rowSpan, "RowSpan", "Row Span", "", "", "" );
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_colSpan, "ColSpan", "Col Span", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "Name Config", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "Name Config", "", "", "" );
|
||||||
m_nameConfig.uiCapability()->setUiTreeHidden( true );
|
m_nameConfig.uiCapability()->setUiTreeHidden( true );
|
||||||
m_nameConfig.uiCapability()->setUiTreeChildrenHidden( true );
|
m_nameConfig.uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
@@ -387,6 +390,73 @@ void RimGridCrossPlot::onAxisSelected( int axis, bool toggle )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCrossPlot::addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
||||||
|
{
|
||||||
|
if ( m_plotWidget )
|
||||||
|
{
|
||||||
|
m_plotWidget->addOrUpdateDataSetLegend( dataSet );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCrossPlot::removeDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
||||||
|
{
|
||||||
|
if ( m_plotWidget )
|
||||||
|
{
|
||||||
|
m_plotWidget->removeDataSetLegend( dataSet );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCrossPlot::removeFromMdiAreaAndCollection()
|
||||||
|
{
|
||||||
|
RimGridCrossPlotCollection* crossPlotCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType( crossPlotCollection );
|
||||||
|
if ( crossPlotCollection )
|
||||||
|
{
|
||||||
|
crossPlotCollection->removeGridCrossPlot( this );
|
||||||
|
this->revokeMdiWindowStatus();
|
||||||
|
crossPlotCollection->updateAllRequiredEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCrossPlot::updateAfterInsertingIntoGridPlotWindow()
|
||||||
|
{
|
||||||
|
if ( m_plotWidget )
|
||||||
|
{
|
||||||
|
m_plotWidget->setTitle( "" );
|
||||||
|
m_plotWidget->setInternalQwtLegendVisible( false );
|
||||||
|
}
|
||||||
|
updateAxes();
|
||||||
|
updateLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RimGridCrossPlot::rowSpan() const
|
||||||
|
{
|
||||||
|
return static_cast<int>( m_rowSpan() );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RimGridCrossPlot::colSpan() const
|
||||||
|
{
|
||||||
|
return static_cast<int>( m_colSpan() );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -463,6 +533,11 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
|||||||
uiOrdering.add( &m_legendFontSize );
|
uiOrdering.add( &m_legendFontSize );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uiOrdering.add( &m_rowSpan );
|
||||||
|
uiOrdering.add( &m_colSpan );
|
||||||
|
}
|
||||||
|
|
||||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Name Configuration" );
|
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Name Configuration" );
|
||||||
m_nameConfig->uiOrdering( uiConfigName, *nameGroup );
|
m_nameConfig->uiOrdering( uiConfigName, *nameGroup );
|
||||||
@@ -497,7 +572,14 @@ void RimGridCrossPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
|||||||
{
|
{
|
||||||
updateLegend();
|
updateLegend();
|
||||||
}
|
}
|
||||||
onLoadDataAndUpdate();
|
else if ( changedField == &m_colSpan || changedField == &m_rowSpan )
|
||||||
|
{
|
||||||
|
updatePlotWindowLayout();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onLoadDataAndUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1021,7 +1103,7 @@ void RimGridCrossPlot::setShowInfoBox( bool enable )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::set<RimPlotAxisPropertiesInterface*> RimGridCrossPlot::allPlotAxes() const
|
std::set<RimPlotAxisPropertiesInterface*> RimGridCrossPlot::allPlotAxes() const
|
||||||
{
|
{
|
||||||
return {m_xAxisProperties, m_yAxisProperties};
|
return { m_xAxisProperties, m_yAxisProperties };
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1032,57 +1114,6 @@ void RimGridCrossPlot::updatePlotTitle()
|
|||||||
updateCurveNamesAndPlotTitle();
|
updateCurveNamesAndPlotTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridCrossPlot::addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
|
||||||
{
|
|
||||||
if ( m_plotWidget )
|
|
||||||
{
|
|
||||||
m_plotWidget->addOrUpdateDataSetLegend( dataSet );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridCrossPlot::removeDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
|
||||||
{
|
|
||||||
if ( m_plotWidget )
|
|
||||||
{
|
|
||||||
m_plotWidget->removeDataSetLegend( dataSet );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridCrossPlot::removeFromMdiAreaAndCollection()
|
|
||||||
{
|
|
||||||
RimGridCrossPlotCollection* crossPlotCollection = nullptr;
|
|
||||||
this->firstAncestorOrThisOfType( crossPlotCollection );
|
|
||||||
if ( crossPlotCollection )
|
|
||||||
{
|
|
||||||
crossPlotCollection->removeGridCrossPlot( this );
|
|
||||||
this->revokeMdiWindowStatus();
|
|
||||||
crossPlotCollection->updateAllRequiredEditors();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridCrossPlot::updateAfterInsertingIntoGridPlotWindow()
|
|
||||||
{
|
|
||||||
if ( m_plotWidget )
|
|
||||||
{
|
|
||||||
m_plotWidget->setTitle( "" );
|
|
||||||
m_plotWidget->setInternalQwtLegendVisible( false );
|
|
||||||
}
|
|
||||||
updateAxes();
|
|
||||||
updateLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Name Configuration
|
/// Name Configuration
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ public:
|
|||||||
void removeFromMdiAreaAndCollection() override;
|
void removeFromMdiAreaAndCollection() override;
|
||||||
void updateAfterInsertingIntoGridPlotWindow() override;
|
void updateAfterInsertingIntoGridPlotWindow() override;
|
||||||
|
|
||||||
|
int rowSpan() const override;
|
||||||
|
int colSpan() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||||
void deleteViewWidget() override;
|
void deleteViewWidget() override;
|
||||||
@@ -155,6 +158,9 @@ private:
|
|||||||
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
||||||
caf::PdmChildField<RimGridCrossPlotNameConfig*> m_nameConfig;
|
caf::PdmChildField<RimGridCrossPlotNameConfig*> m_nameConfig;
|
||||||
|
|
||||||
|
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_rowSpan;
|
||||||
|
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_colSpan;
|
||||||
|
|
||||||
caf::PdmChildField<RimPlotAxisProperties*> m_yAxisProperties;
|
caf::PdmChildField<RimPlotAxisProperties*> m_yAxisProperties;
|
||||||
caf::PdmChildField<RimPlotAxisProperties*> m_xAxisProperties;
|
caf::PdmChildField<RimPlotAxisProperties*> m_xAxisProperties;
|
||||||
|
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ int RimGridPlotWindow::columnCount() const
|
|||||||
{
|
{
|
||||||
if ( m_columnCountEnum() == COLUMNS_UNLIMITED )
|
if ( m_columnCountEnum() == COLUMNS_UNLIMITED )
|
||||||
{
|
{
|
||||||
return static_cast<int>( visiblePlots().size() );
|
std::numeric_limits<int>::max();
|
||||||
}
|
}
|
||||||
return static_cast<int>( m_columnCountEnum() );
|
return static_cast<int>( m_columnCountEnum() );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,17 @@ void RimPlotInterface::WidthScaleFactorEnum::setUp()
|
|||||||
addItem( RimPlotInterface::EXTRA_WIDE, "EXTRA_WIDE_TRACK", "Extra wide" );
|
addItem( RimPlotInterface::EXTRA_WIDE, "EXTRA_WIDE_TRACK", "Extra wide" );
|
||||||
setDefault( RimPlotInterface::NORMAL );
|
setDefault( RimPlotInterface::NORMAL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
void RimPlotInterface::RowOrColSpanEnum::setUp()
|
||||||
|
{
|
||||||
|
addItem( RimPlotInterface::ONE, "ONE", "1" );
|
||||||
|
addItem( RimPlotInterface::TWO, "TWO", "2" );
|
||||||
|
addItem( RimPlotInterface::THREE, "THREE", "3" );
|
||||||
|
addItem( RimPlotInterface::FOUR, "FOUR", "4" );
|
||||||
|
setDefault( RimPlotInterface::ONE );
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -45,3 +56,19 @@ QString RimPlotInterface::asciiDataForPlotExport() const
|
|||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlotInterface::updatePlotWindowLayout()
|
||||||
|
{
|
||||||
|
const caf::PdmObject* thisPdm = dynamic_cast<const caf::PdmObject*>( this );
|
||||||
|
CAF_ASSERT( thisPdm );
|
||||||
|
|
||||||
|
RimGridPlotWindow* plotWindow;
|
||||||
|
thisPdm->firstAncestorOrThisOfType( plotWindow );
|
||||||
|
if ( plotWindow )
|
||||||
|
{
|
||||||
|
plotWindow->updateLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,9 +41,17 @@ public:
|
|||||||
WIDE = 7,
|
WIDE = 7,
|
||||||
EXTRA_WIDE = 10
|
EXTRA_WIDE = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef caf::AppEnum<WidthScaleFactor> WidthScaleFactorEnum;
|
typedef caf::AppEnum<WidthScaleFactor> WidthScaleFactorEnum;
|
||||||
|
|
||||||
|
enum RowOrColSpan
|
||||||
|
{
|
||||||
|
ONE = 1,
|
||||||
|
TWO = 2,
|
||||||
|
THREE = 3,
|
||||||
|
FOUR = 4
|
||||||
|
};
|
||||||
|
typedef caf::AppEnum<RowOrColSpan> RowOrColSpanEnum;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RimPlotInterface() = default;
|
RimPlotInterface() = default;
|
||||||
virtual ~RimPlotInterface() = default;
|
virtual ~RimPlotInterface() = default;
|
||||||
@@ -99,6 +107,6 @@ public:
|
|||||||
virtual void updateAfterInsertingIntoGridPlotWindow() {}
|
virtual void updateAfterInsertingIntoGridPlotWindow() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void updatePlotWindowLayout() {}
|
void updatePlotWindowLayout();
|
||||||
virtual void onWidthScaleFactorChange() {}
|
virtual void onWidthScaleFactorChange() {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -882,19 +882,6 @@ void RimWellLogTrack::updateZoomFromQwt()
|
|||||||
m_visibleYRangeMax = depthInterval.maxValue();
|
m_visibleYRangeMax = depthInterval.maxValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimWellLogTrack::updatePlotWindowLayout()
|
|
||||||
{
|
|
||||||
RimGridPlotWindow* plotWindow;
|
|
||||||
this->firstAncestorOrThisOfType( plotWindow );
|
|
||||||
if ( plotWindow )
|
|
||||||
{
|
|
||||||
plotWindow->updateLayout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -2253,7 +2240,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
|
|||||||
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
||||||
|
|
||||||
std::vector<QString> sourceNames =
|
std::vector<QString> sourceNames =
|
||||||
{"", "PP=Grid", "PP=Las-File", "PP=Element Property Table", "", "PP=Hydrostatic"};
|
{ "", "PP=Grid", "PP=Las-File", "PP=Element Property Table", "", "PP=Hydrostatic" };
|
||||||
curveData.data = ppValues;
|
curveData.data = ppValues;
|
||||||
|
|
||||||
std::vector<QString> sourceNamesToPlot;
|
std::vector<QString> sourceNamesToPlot;
|
||||||
@@ -2277,12 +2264,12 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
|
|||||||
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
||||||
|
|
||||||
std::vector<QString> sourceNames =
|
std::vector<QString> sourceNames =
|
||||||
{"",
|
{ "",
|
||||||
"",
|
"",
|
||||||
"Poisson=Las-File",
|
"Poisson=Las-File",
|
||||||
"Poisson=Element Property Table",
|
"Poisson=Element Property Table",
|
||||||
QString( "Poisson=%1" ).arg( wellBoreStabilityPlot->userDefinedPoissonRatio() ),
|
QString( "Poisson=%1" ).arg( wellBoreStabilityPlot->userDefinedPoissonRatio() ),
|
||||||
""};
|
"" };
|
||||||
curveData.data = poissonValues;
|
curveData.data = poissonValues;
|
||||||
|
|
||||||
std::vector<QString> sourceNamesToPlot;
|
std::vector<QString> sourceNamesToPlot;
|
||||||
@@ -2305,12 +2292,12 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
|
|||||||
{
|
{
|
||||||
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
||||||
|
|
||||||
std::vector<QString> sourceNames = {"",
|
std::vector<QString> sourceNames = { "",
|
||||||
"",
|
"",
|
||||||
"UCS=Las-File",
|
"UCS=Las-File",
|
||||||
"UCS=Element Property Table",
|
"UCS=Element Property Table",
|
||||||
QString( "UCS=%1" ).arg( wellBoreStabilityPlot->userDefinedUcs() ),
|
QString( "UCS=%1" ).arg( wellBoreStabilityPlot->userDefinedUcs() ),
|
||||||
""};
|
"" };
|
||||||
|
|
||||||
curveData.data = ucsValues;
|
curveData.data = ucsValues;
|
||||||
|
|
||||||
@@ -2380,16 +2367,16 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<RiaDefines::WellPathComponentType, int> sortIndices = {{RiaDefines::WELL_PATH, 0},
|
const std::map<RiaDefines::WellPathComponentType, int> sortIndices = { { RiaDefines::WELL_PATH, 0 },
|
||||||
{RiaDefines::CASING, 1},
|
{ RiaDefines::CASING, 1 },
|
||||||
{RiaDefines::LINER, 2},
|
{ RiaDefines::LINER, 2 },
|
||||||
{RiaDefines::PERFORATION_INTERVAL, 3},
|
{ RiaDefines::PERFORATION_INTERVAL, 3 },
|
||||||
{RiaDefines::FISHBONES, 4},
|
{ RiaDefines::FISHBONES, 4 },
|
||||||
{RiaDefines::FRACTURE, 5},
|
{ RiaDefines::FRACTURE, 5 },
|
||||||
{RiaDefines::PACKER, 6},
|
{ RiaDefines::PACKER, 6 },
|
||||||
{RiaDefines::ICD, 7},
|
{ RiaDefines::ICD, 7 },
|
||||||
{RiaDefines::AICD, 8},
|
{ RiaDefines::AICD, 8 },
|
||||||
{RiaDefines::ICV, 9}};
|
{ RiaDefines::ICV, 9 } };
|
||||||
|
|
||||||
std::stable_sort( allWellPathComponents.begin(),
|
std::stable_sort( allWellPathComponents.begin(),
|
||||||
allWellPathComponents.end(),
|
allWellPathComponents.end(),
|
||||||
|
|||||||
@@ -198,8 +198,6 @@ public:
|
|||||||
int fontSize,
|
int fontSize,
|
||||||
bool forceChange = false ) override;
|
bool forceChange = false ) override;
|
||||||
|
|
||||||
void updatePlotWindowLayout() override;
|
|
||||||
|
|
||||||
void onAxisSelected( int axis, bool toggle ) override;
|
void onAxisSelected( int axis, bool toggle ) override;
|
||||||
|
|
||||||
void updateAxes() override;
|
void updateAxes() override;
|
||||||
|
|||||||
@@ -156,6 +156,9 @@ RimSummaryPlot::RimSummaryPlot()
|
|||||||
|
|
||||||
CAF_PDM_InitField( &m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves", "", "", "" );
|
CAF_PDM_InitField( &m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves", "", "", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_rowSpan, "RowSpan", "Row Span", "", "", "" );
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_colSpan, "ColSpan", "Col Span", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "" );
|
||||||
m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||||
|
|
||||||
@@ -331,7 +334,7 @@ QString RimSummaryPlot::asciiDataForSummaryPlotExport( DateTimePeriod resampling
|
|||||||
populateTimeHistoryCurvesData( m_gridTimeHistoryCurves.childObjects(), &timeHistoryCurvesData );
|
populateTimeHistoryCurvesData( m_gridTimeHistoryCurves.childObjects(), &timeHistoryCurvesData );
|
||||||
|
|
||||||
// Export observed data
|
// Export observed data
|
||||||
appendToExportData( out, {summaryCurvesObsData}, showTimeAsLongString );
|
appendToExportData( out, { summaryCurvesObsData }, showTimeAsLongString );
|
||||||
|
|
||||||
std::vector<CurvesData> exportData( 2 );
|
std::vector<CurvesData> exportData( 2 );
|
||||||
|
|
||||||
@@ -353,7 +356,7 @@ QString RimSummaryPlot::asciiDataForSummaryPlotExport( DateTimePeriod resampling
|
|||||||
CurvesData asciiCurvesData;
|
CurvesData asciiCurvesData;
|
||||||
populateAsciiDataCurvesData( m_asciiDataCurves.childObjects(), &asciiCurvesData );
|
populateAsciiDataCurvesData( m_asciiDataCurves.childObjects(), &asciiCurvesData );
|
||||||
|
|
||||||
appendToExportData( out, {asciiCurvesData}, showTimeAsLongString );
|
appendToExportData( out, { asciiCurvesData }, showTimeAsLongString );
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
@@ -1176,7 +1179,7 @@ void RimSummaryPlot::addCurveNoUpdate( RimSummaryCurve* curve )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::deleteCurve( RimSummaryCurve* curve )
|
void RimSummaryPlot::deleteCurve( RimSummaryCurve* curve )
|
||||||
{
|
{
|
||||||
deleteCurves( {curve} );
|
deleteCurves( { curve } );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1343,6 +1346,11 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( changedField == &m_rowSpan || changedField == &m_colSpan )
|
||||||
|
{
|
||||||
|
updatePlotWindowLayout();
|
||||||
|
}
|
||||||
|
|
||||||
if ( changedField == &m_normalizeCurveYValues )
|
if ( changedField == &m_normalizeCurveYValues )
|
||||||
{
|
{
|
||||||
this->loadDataAndUpdate();
|
this->loadDataAndUpdate();
|
||||||
@@ -1497,7 +1505,7 @@ void RimSummaryPlot::updateZoomFromQwt()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::set<RimPlotAxisPropertiesInterface*> RimSummaryPlot::allPlotAxes() const
|
std::set<RimPlotAxisPropertiesInterface*> RimSummaryPlot::allPlotAxes() const
|
||||||
{
|
{
|
||||||
return {m_timeAxisProperties, m_bottomAxisProperties, m_leftYAxisProperties, m_rightYAxisProperties};
|
return { m_timeAxisProperties, m_bottomAxisProperties, m_leftYAxisProperties, m_rightYAxisProperties };
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1555,6 +1563,22 @@ void RimSummaryPlot::updateAfterInsertingIntoGridPlotWindow()
|
|||||||
updateAxes();
|
updateAxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RimSummaryPlot::rowSpan() const
|
||||||
|
{
|
||||||
|
return static_cast<int>( m_rowSpan() );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RimSummaryPlot::colSpan() const
|
||||||
|
{
|
||||||
|
return static_cast<int>( m_colSpan() );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1654,6 +1678,8 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
{
|
{
|
||||||
mainOptions->add( &m_useAutoPlotTitle );
|
mainOptions->add( &m_useAutoPlotTitle );
|
||||||
mainOptions->add( &m_description );
|
mainOptions->add( &m_description );
|
||||||
|
mainOptions->add( &m_rowSpan );
|
||||||
|
mainOptions->add( &m_colSpan );
|
||||||
}
|
}
|
||||||
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle );
|
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle );
|
||||||
|
|
||||||
@@ -2095,13 +2121,13 @@ void populateTimeHistoryCurvesData( std::vector<RimGridTimeHistoryCurve*> curves
|
|||||||
if ( curveCaseName == curvesData->caseNames[i] ) casePosInList = i;
|
if ( curveCaseName == curvesData->caseNames[i] ) casePosInList = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurveData curveData = {curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues()};
|
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
||||||
|
|
||||||
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
||||||
{
|
{
|
||||||
curvesData->caseNames.push_back( curveCaseName );
|
curvesData->caseNames.push_back( curveCaseName );
|
||||||
curvesData->timeSteps.push_back( curve->timeStepValues() );
|
curvesData->timeSteps.push_back( curve->timeStepValues() );
|
||||||
curvesData->allCurveData.push_back( std::vector<CurveData>( {curveData} ) );
|
curvesData->allCurveData.push_back( std::vector<CurveData>( { curveData } ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2127,13 +2153,13 @@ void populateAsciiDataCurvesData( std::vector<RimAsciiDataCurve*> curves, Curves
|
|||||||
|
|
||||||
size_t casePosInList = cvf::UNDEFINED_SIZE_T;
|
size_t casePosInList = cvf::UNDEFINED_SIZE_T;
|
||||||
|
|
||||||
CurveData curveData = {curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues()};
|
CurveData curveData = { curve->curveExportDescription(), RifEclipseSummaryAddress(), curve->yValues() };
|
||||||
|
|
||||||
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
||||||
{
|
{
|
||||||
curvesData->caseNames.push_back( "" );
|
curvesData->caseNames.push_back( "" );
|
||||||
curvesData->timeSteps.push_back( curve->timeSteps() );
|
curvesData->timeSteps.push_back( curve->timeSteps() );
|
||||||
curvesData->allCurveData.push_back( std::vector<CurveData>( {curveData} ) );
|
curvesData->allCurveData.push_back( std::vector<CurveData>( { curveData } ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2169,7 +2195,7 @@ void populateSummaryCurvesData( std::vector<RimSummaryCurve*> curves, SummaryCur
|
|||||||
if ( curveCaseName == curvesData->caseNames[i] ) casePosInList = i;
|
if ( curveCaseName == curvesData->caseNames[i] ) casePosInList = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurveData curveData = {curve->curveExportDescription(), curve->summaryAddressY(), curve->valuesY()};
|
CurveData curveData = { curve->curveExportDescription(), curve->summaryAddressY(), curve->valuesY() };
|
||||||
CurveData errorCurveData;
|
CurveData errorCurveData;
|
||||||
|
|
||||||
// Error data
|
// Error data
|
||||||
@@ -2185,7 +2211,7 @@ void populateSummaryCurvesData( std::vector<RimSummaryCurve*> curves, SummaryCur
|
|||||||
|
|
||||||
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
if ( casePosInList == cvf::UNDEFINED_SIZE_T )
|
||||||
{
|
{
|
||||||
auto curveDataList = std::vector<CurveData>( {curveData} );
|
auto curveDataList = std::vector<CurveData>( { curveData } );
|
||||||
if ( hasErrorData ) curveDataList.push_back( errorCurveData );
|
if ( hasErrorData ) curveDataList.push_back( errorCurveData );
|
||||||
|
|
||||||
curvesData->caseNames.push_back( curveCaseName );
|
curvesData->caseNames.push_back( curveCaseName );
|
||||||
|
|||||||
@@ -179,6 +179,9 @@ public:
|
|||||||
void removeFromMdiAreaAndCollection() override;
|
void removeFromMdiAreaAndCollection() override;
|
||||||
void updateAfterInsertingIntoGridPlotWindow() override;
|
void updateAfterInsertingIntoGridPlotWindow() override;
|
||||||
|
|
||||||
|
int rowSpan() const override;
|
||||||
|
int colSpan() const override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||||
@@ -226,6 +229,9 @@ private:
|
|||||||
|
|
||||||
caf::PdmField<bool> m_useAutoPlotTitle;
|
caf::PdmField<bool> m_useAutoPlotTitle;
|
||||||
|
|
||||||
|
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_rowSpan;
|
||||||
|
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_colSpan;
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimGridTimeHistoryCurve*> m_gridTimeHistoryCurves;
|
caf::PdmChildArrayField<RimGridTimeHistoryCurve*> m_gridTimeHistoryCurves;
|
||||||
caf::PdmChildField<RimSummaryCurveCollection*> m_summaryCurveCollection;
|
caf::PdmChildField<RimSummaryCurveCollection*> m_summaryCurveCollection;
|
||||||
caf::PdmChildField<RimEnsembleCurveSetCollection*> m_ensembleCurveSetCollection;
|
caf::PdmChildField<RimEnsembleCurveSetCollection*> m_ensembleCurveSetCollection;
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ void RiuGridPlotWindow::dropEvent( QDropEvent* event )
|
|||||||
|
|
||||||
if ( insertAfter != plotToMove )
|
if ( insertAfter != plotToMove )
|
||||||
{
|
{
|
||||||
m_plotDefinition->movePlotsToThis( {plotToMove}, insertAfter );
|
m_plotDefinition->movePlotsToThis( { plotToMove }, insertAfter );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -573,6 +573,7 @@ void RiuGridPlotWindow::reinsertPlotWidgets()
|
|||||||
{
|
{
|
||||||
m_plotWidgets[tIdx]->hide();
|
m_plotWidgets[tIdx]->hide();
|
||||||
m_legends[tIdx]->hide();
|
m_legends[tIdx]->hide();
|
||||||
|
m_subTitles[tIdx]->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QPointer<QLabel>> subTitles = this->visibleTitles();
|
QList<QPointer<QLabel>> subTitles = this->visibleTitles();
|
||||||
@@ -591,14 +592,21 @@ void RiuGridPlotWindow::reinsertPlotWidgets()
|
|||||||
|
|
||||||
auto rowAndColumnCount = this->rowAndColumnCount( plotWidgets.size() );
|
auto rowAndColumnCount = this->rowAndColumnCount( plotWidgets.size() );
|
||||||
|
|
||||||
|
int row = 0;
|
||||||
|
int column = 0;
|
||||||
for ( int visibleIndex = 0; visibleIndex < plotWidgets.size(); ++visibleIndex )
|
for ( int visibleIndex = 0; visibleIndex < plotWidgets.size(); ++visibleIndex )
|
||||||
{
|
{
|
||||||
int row = visibleIndex / rowAndColumnCount.second;
|
std::tie( row, column ) = findAvailableRowAndColumn( row,
|
||||||
int column = visibleIndex % rowAndColumnCount.second;
|
column,
|
||||||
|
rowAndColumnCount.first,
|
||||||
|
rowAndColumnCount.second );
|
||||||
|
|
||||||
m_gridLayout->addWidget( subTitles[visibleIndex], 3 * row, column );
|
int colSpan = plotWidgets[visibleIndex]->plotDefinition()->colSpan();
|
||||||
m_gridLayout->addWidget( legends[visibleIndex], 3 * row + 1, column );
|
int rowSpan = plotWidgets[visibleIndex]->plotDefinition()->rowSpan();
|
||||||
m_gridLayout->addWidget( plotWidgets[visibleIndex], 3 * row + 2, column );
|
|
||||||
|
m_gridLayout->addWidget( subTitles[visibleIndex], 3 * row, column, 1, colSpan );
|
||||||
|
m_gridLayout->addWidget( legends[visibleIndex], 3 * row + 1, column, 1, colSpan );
|
||||||
|
m_gridLayout->addWidget( plotWidgets[visibleIndex], 3 * row + 2, column, 1 + ( rowSpan - 1 ) * 3, colSpan );
|
||||||
|
|
||||||
subTitles[visibleIndex]->setVisible( m_plotDefinition->showPlotTitles() );
|
subTitles[visibleIndex]->setVisible( m_plotDefinition->showPlotTitles() );
|
||||||
|
|
||||||
@@ -627,15 +635,24 @@ void RiuGridPlotWindow::reinsertPlotWidgets()
|
|||||||
|
|
||||||
plotWidgets[visibleIndex]->show();
|
plotWidgets[visibleIndex]->show();
|
||||||
|
|
||||||
|
// Set basic row and column stretches
|
||||||
|
for ( int r = row; r < row + rowSpan; ++r )
|
||||||
|
{
|
||||||
|
m_gridLayout->setRowStretch( 3 * r + 2, 1 );
|
||||||
|
}
|
||||||
|
for ( int c = column; c < column + colSpan; ++c )
|
||||||
|
{
|
||||||
|
m_gridLayout->setColumnStretch( c, std::max( 1, m_gridLayout->columnStretch( c ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set column stretches for main widget column based on width scale factor
|
||||||
int widthScaleFactor = plotWidgets[visibleIndex]->widthScaleFactor();
|
int widthScaleFactor = plotWidgets[visibleIndex]->widthScaleFactor();
|
||||||
if ( showYAxis( row, column ) )
|
if ( showYAxis( row, column ) )
|
||||||
{
|
{
|
||||||
widthScaleFactor += 1; // Give it a bit extra room due to axis
|
widthScaleFactor += 1; // Give it a bit extra room due to axis
|
||||||
}
|
}
|
||||||
m_gridLayout->setColumnStretch( column,
|
|
||||||
std::max( m_gridLayout->columnStretch( column ),
|
m_gridLayout->setColumnStretch( column, std::max( m_gridLayout->columnStretch( column ), widthScaleFactor ) );
|
||||||
plotWidgets[visibleIndex]->widthScaleFactor() ) );
|
|
||||||
m_gridLayout->setRowStretch( 3 * row + 2, 1 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -758,3 +775,28 @@ QList<QPointer<QLabel>> RiuGridPlotWindow::visibleTitles() const
|
|||||||
}
|
}
|
||||||
return subTitles;
|
return subTitles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::pair<int, int> RiuGridPlotWindow::findAvailableRowAndColumn( int startRow,
|
||||||
|
int startColumn,
|
||||||
|
int expectedRows,
|
||||||
|
int expectedColumns ) const
|
||||||
|
{
|
||||||
|
int availableRow = startRow;
|
||||||
|
int availableColumn = startColumn;
|
||||||
|
while ( true )
|
||||||
|
{
|
||||||
|
for ( ; availableColumn < expectedColumns; ++availableColumn )
|
||||||
|
{
|
||||||
|
if ( m_gridLayout->itemAtPosition( 3 * availableRow, availableColumn ) == nullptr )
|
||||||
|
{
|
||||||
|
return std::make_pair( availableRow, availableColumn );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
availableColumn = 0;
|
||||||
|
availableRow++;
|
||||||
|
}
|
||||||
|
return std::make_pair( availableRow, availableColumn );
|
||||||
|
}
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ protected:
|
|||||||
QList<QPointer<RiuQwtPlotLegend>> visibleLegends() const;
|
QList<QPointer<RiuQwtPlotLegend>> visibleLegends() const;
|
||||||
QList<QPointer<QLabel>> visibleTitles() const;
|
QList<QPointer<QLabel>> visibleTitles() const;
|
||||||
|
|
||||||
|
std::pair<int, int>
|
||||||
|
findAvailableRowAndColumn( int startRow, int startColumn, int expectedRows, int expectedColumns ) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
virtual void performUpdate();
|
virtual void performUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -93,14 +93,15 @@ bool RiuWellLogPlot::showYAxis( int row, int column ) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuWellLogPlot::reinsertScrollbar()
|
void RiuWellLogPlot::reinsertScrollbar()
|
||||||
{
|
{
|
||||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
||||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
||||||
auto rowAndColumnCount = this->rowAndColumnCount( plotWidgets.size() );
|
int rowCount = this->m_gridLayout->rowCount();
|
||||||
|
int colCount = this->m_gridLayout->columnCount();
|
||||||
|
|
||||||
m_trackScrollBar->setVisible( !plotWidgets.empty() );
|
m_trackScrollBar->setVisible( !plotWidgets.empty() );
|
||||||
|
|
||||||
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, rowAndColumnCount.second, rowAndColumnCount.first * 2 - 1, 1 );
|
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, colCount, rowCount * 2 - 1, 1 );
|
||||||
m_gridLayout->setColumnStretch( rowAndColumnCount.second, 0 );
|
m_gridLayout->setColumnStretch( colCount, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user