mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1842 RFT plot. Removed unnecessary fields in RFT plot
This commit is contained in:
parent
9c3b199e7e
commit
536225eb7e
@ -100,21 +100,6 @@ void RicNewRftPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// This method is not called from within this class, only by other classes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellRftPlot* RicNewRftPlotFeature::createNewRftPlot(RimRftPlotCollection* rftPlotColl)
|
||||
{
|
||||
auto plot = new RimWellRftPlot();
|
||||
rftPlotColl->rftPlots().push_back(plot);
|
||||
|
||||
plot->setDescription(QString("RFT Plot %1").arg(rftPlotColl->rftPlots.size() + 1));
|
||||
|
||||
rftPlotColl->updateConnectedEditors();
|
||||
plot->loadDataAndUpdate();
|
||||
return plot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -43,7 +43,6 @@ protected:
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
|
||||
private:
|
||||
RimWellRftPlot* createNewRftPlot(RimRftPlotCollection* rftPlotColl);
|
||||
RimWellLogTrack* selectedWellLogPlotTrack() const;
|
||||
RimWellPath* selectedWellPath() const;
|
||||
RimEclipseWell* selectedSimulationWell(int * branchIndex) const;
|
||||
|
@ -87,25 +87,29 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowType, "FlowType", "Flow Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
|
||||
CAF_PDM_InitField(&m_smallContributionsThreshold, "SmallContributionsThreshold", 0.005, "Threshold", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
|
||||
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
|
||||
m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
||||
m_accumulatedWellFlowPlot->setDepthUnit(RiaDefines::UNIT_NONE);
|
||||
m_accumulatedWellFlowPlot->setDepthType(RimWellLogPlot::CONNECTION_NUMBER);
|
||||
m_accumulatedWellFlowPlot->setTrackLegendsVisible(false);
|
||||
m_accumulatedWellFlowPlot->uiCapability()->setUiIcon(QIcon(":/WellFlowPlot16x16.png"));
|
||||
//CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
|
||||
//m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
|
||||
//m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
||||
//m_accumulatedWellFlowPlot->setDepthUnit(RiaDefines::UNIT_NONE);
|
||||
//m_accumulatedWellFlowPlot->setDepthType(RimWellLogPlot::CONNECTION_NUMBER);
|
||||
//m_accumulatedWellFlowPlot->setTrackLegendsVisible(false);
|
||||
//m_accumulatedWellFlowPlot->uiCapability()->setUiIcon(QIcon(":/WellFlowPlot16x16.png"));
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_totalWellAllocationPlot, "TotalWellFlowPlot", "Total Well Flow", "", "", "");
|
||||
m_totalWellAllocationPlot.uiCapability()->setUiHidden(true);
|
||||
m_totalWellAllocationPlot = new RimTotalWellAllocationPlot;
|
||||
//CAF_PDM_InitFieldNoDefault(&m_totalWellAllocationPlot, "TotalWellFlowPlot", "Total Well Flow", "", "", "");
|
||||
//m_totalWellAllocationPlot.uiCapability()->setUiHidden(true);
|
||||
//m_totalWellAllocationPlot = new RimTotalWellAllocationPlot;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_WellRftPlotLegend, "WellAllocLegend", "Legend", "", "", "");
|
||||
m_WellRftPlotLegend.uiCapability()->setUiHidden(true);
|
||||
m_WellRftPlotLegend = new RimWellRftPlotLegend;
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellLogPlot, "WellLog", "WellLog", "", "", "");
|
||||
m_wellLogPlot.uiCapability()->setUiHidden(true);
|
||||
m_wellLogPlot = new RimWellLogPlot();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_tofAccumulatedPhaseFractionsPlot, "TofAccumulatedPhaseFractionsPlot", "TOF Accumulated Phase Fractions", "", "", "");
|
||||
m_tofAccumulatedPhaseFractionsPlot.uiCapability()->setUiHidden(true);
|
||||
m_tofAccumulatedPhaseFractionsPlot = new RimTofAccumulatedPhaseFractionsPlot;
|
||||
CAF_PDM_InitFieldNoDefault(&m_rftPlotLegend, "WellLogLegend", "Legend", "", "", "");
|
||||
m_rftPlotLegend.uiCapability()->setUiHidden(true);
|
||||
m_rftPlotLegend = new RimWellRftPlotLegend();
|
||||
|
||||
//CAF_PDM_InitFieldNoDefault(&m_tofAccumulatedPhaseFractionsPlot, "TofAccumulatedPhaseFractionsPlot", "TOF Accumulated Phase Fractions", "", "", "");
|
||||
//m_tofAccumulatedPhaseFractionsPlot.uiCapability()->setUiHidden(true);
|
||||
//m_tofAccumulatedPhaseFractionsPlot = new RimTofAccumulatedPhaseFractionsPlot;
|
||||
|
||||
this->setAsPlotMdiWindow();
|
||||
}
|
||||
@ -116,10 +120,6 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
RimWellRftPlot::~RimWellRftPlot()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
|
||||
delete m_accumulatedWellFlowPlot();
|
||||
delete m_totalWellAllocationPlot();
|
||||
delete m_tofAccumulatedPhaseFractionsPlot();
|
||||
|
||||
deleteViewWidget();
|
||||
}
|
||||
@ -153,10 +153,10 @@ void RimWellRftPlot::setFromSimulationWell(RimEclipseWell* simWell)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::deleteViewWidget()
|
||||
{
|
||||
if (m_WellRftPlotWidget)
|
||||
if (m_wellLogPlotWidget)
|
||||
{
|
||||
m_WellRftPlotWidget->deleteLater();
|
||||
m_WellRftPlotWidget = nullptr;
|
||||
m_wellLogPlotWidget->deleteLater();
|
||||
m_wellLogPlotWidget = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,22 +168,22 @@ void RimWellRftPlot::updateFromWell()
|
||||
// Delete existing tracks
|
||||
{
|
||||
std::vector<RimWellLogTrack*> tracks;
|
||||
accumulatedWellFlowPlot()->descendantsIncludingThisOfType(tracks);
|
||||
wellLogPlot()->descendantsIncludingThisOfType(tracks);
|
||||
|
||||
for (RimWellLogTrack* t : tracks)
|
||||
{
|
||||
accumulatedWellFlowPlot()->removeTrack(t);
|
||||
wellLogPlot()->removeTrack(t);
|
||||
delete t;
|
||||
}
|
||||
}
|
||||
|
||||
CVF_ASSERT(accumulatedWellFlowPlot()->trackCount() == 0);
|
||||
CVF_ASSERT(wellLogPlot()->trackCount() == 0);
|
||||
|
||||
QString description;
|
||||
if (m_flowType() == ACCUMULATED) description = "Accumulated Flow";
|
||||
if (m_flowType() == ACCUMULATED) description = "Well Log";
|
||||
if (m_flowType() == INFLOW) description = "Inflow Rates";
|
||||
|
||||
accumulatedWellFlowPlot()->setDescription(description + " (" + m_wellName + ")");
|
||||
wellLogPlot()->setDescription(description + " (" + m_wellName + ")");
|
||||
|
||||
if (!m_case) return;
|
||||
|
||||
@ -233,7 +233,7 @@ void RimWellRftPlot::updateFromWell()
|
||||
}
|
||||
}
|
||||
|
||||
auto depthType = accumulatedWellFlowPlot()->depthType();
|
||||
auto depthType = wellLogPlot()->depthType();
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH ) return;
|
||||
|
||||
@ -249,7 +249,7 @@ void RimWellRftPlot::updateFromWell()
|
||||
|
||||
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
|
||||
|
||||
accumulatedWellFlowPlot()->addTrack(plotTrack);
|
||||
wellLogPlot()->addTrack(plotTrack);
|
||||
|
||||
const std::vector<double>& depthValues = depthType == RimWellLogPlot::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop(brIdx) :
|
||||
depthType == RimWellLogPlot::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop(brIdx) :
|
||||
@ -291,37 +291,37 @@ void RimWellRftPlot::updateFromWell()
|
||||
|
||||
/// Pie chart
|
||||
|
||||
m_totalWellAllocationPlot->clearSlices();
|
||||
if (m_WellRftPlotWidget) m_WellRftPlotWidget->clearLegend();
|
||||
//m_totalWellAllocationPlot->clearSlices();
|
||||
//if (m_wellLogPlotWidget) m_WellRftPlotWidget->clearLegend();
|
||||
|
||||
if (wfCalculator)
|
||||
{
|
||||
std::vector<std::pair<QString, double> > totalTracerFractions = wfCalculator->totalTracerFractions() ;
|
||||
//if (wfCalculator)
|
||||
//{
|
||||
// std::vector<std::pair<QString, double> > totalTracerFractions = wfCalculator->totalTracerFractions() ;
|
||||
|
||||
for ( const auto& tracerVal : totalTracerFractions )
|
||||
{
|
||||
cvf::Color3f color;
|
||||
if (m_flowDiagSolution)
|
||||
color = m_flowDiagSolution->tracerColor(tracerVal.first);
|
||||
else
|
||||
color = getTracerColor(tracerVal.first);
|
||||
// for ( const auto& tracerVal : totalTracerFractions )
|
||||
// {
|
||||
// cvf::Color3f color;
|
||||
// if (m_flowDiagSolution)
|
||||
// color = m_flowDiagSolution->tracerColor(tracerVal.first);
|
||||
// else
|
||||
// color = getTracerColor(tracerVal.first);
|
||||
|
||||
double tracerPercent = 100*tracerVal.second;
|
||||
// double tracerPercent = 100*tracerVal.second;
|
||||
|
||||
m_totalWellAllocationPlot->addSlice(tracerVal.first, color, tracerPercent);
|
||||
if ( m_WellRftPlotWidget ) m_WellRftPlotWidget->addLegendItem(tracerVal.first, color, tracerPercent);
|
||||
}
|
||||
}
|
||||
// m_totalWellAllocationPlot->addSlice(tracerVal.first, color, tracerPercent);
|
||||
// if ( m_WellRftPlotWidget ) m_WellRftPlotWidget->addLegendItem(tracerVal.first, color, tracerPercent);
|
||||
// }
|
||||
//}
|
||||
|
||||
if (m_WellRftPlotWidget) m_WellRftPlotWidget->showLegend(m_WellRftPlotLegend->isShowingLegend());
|
||||
m_totalWellAllocationPlot->updateConnectedEditors();
|
||||
//if (m_WellRftPlotWidget) m_WellRftPlotWidget->showLegend(m_WellRftPlotLegend->isShowingLegend());
|
||||
//m_totalWellAllocationPlot->updateConnectedEditors();
|
||||
|
||||
accumulatedWellFlowPlot()->updateConnectedEditors();
|
||||
//accumulatedWellFlowPlot()->updateConnectedEditors();
|
||||
|
||||
m_tofAccumulatedPhaseFractionsPlot->reloadFromWell();
|
||||
m_tofAccumulatedPhaseFractionsPlot->updateConnectedEditors();
|
||||
//m_tofAccumulatedPhaseFractionsPlot->reloadFromWell();
|
||||
//m_tofAccumulatedPhaseFractionsPlot->updateConnectedEditors();
|
||||
|
||||
if (m_WellRftPlotWidget) m_WellRftPlotWidget->updateGeometry();
|
||||
//if (m_WellRftPlotWidget) m_WellRftPlotWidget->updateGeometry();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -443,15 +443,15 @@ void RimWellRftPlot::updateWidgetTitleWindowTitle()
|
||||
{
|
||||
updateMdiWindowTitle();
|
||||
|
||||
if (m_WellRftPlotWidget)
|
||||
if (m_wellLogPlotWidget)
|
||||
{
|
||||
if (m_showPlotTitle)
|
||||
{
|
||||
m_WellRftPlotWidget->showTitle(m_userName);
|
||||
m_wellLogPlotWidget->showTitle(m_userName);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_WellRftPlotWidget->hideTitle();
|
||||
m_wellLogPlotWidget->hideTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -506,7 +506,7 @@ QString RimWellRftPlot::wellStatusTextForTimeStep(const QString& wellName, const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellRftPlot::viewWidget()
|
||||
{
|
||||
return m_WellRftPlotWidget;
|
||||
return m_wellLogPlotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -514,31 +514,36 @@ QWidget* RimWellRftPlot::viewWidget()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::zoomAll()
|
||||
{
|
||||
m_accumulatedWellFlowPlot()->zoomAll();
|
||||
m_wellLogPlot()->zoomAll();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RimWellRftPlot::accumulatedWellFlowPlot()
|
||||
{
|
||||
return m_accumulatedWellFlowPlot();
|
||||
}
|
||||
//RimWellLogPlot* RimWellRftPlot::accumulatedWellFlowPlot()
|
||||
//{
|
||||
// return m_accumulatedWellFlowPlot();
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimTotalWellAllocationPlot* RimWellRftPlot::totalWellFlowPlot()
|
||||
{
|
||||
return m_totalWellAllocationPlot();
|
||||
}
|
||||
//RimTotalWellAllocationPlot* RimWellRftPlot::totalWellFlowPlot()
|
||||
//{
|
||||
// return m_totalWellAllocationPlot();
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimTofAccumulatedPhaseFractionsPlot * RimWellRftPlot::tofAccumulatedPhaseFractionsPlot()
|
||||
//RimTofAccumulatedPhaseFractionsPlot * RimWellRftPlot::tofAccumulatedPhaseFractionsPlot()
|
||||
//{
|
||||
// return m_tofAccumulatedPhaseFractionsPlot();
|
||||
//}
|
||||
|
||||
RimWellLogPlot* RimWellRftPlot::wellLogPlot() const
|
||||
{
|
||||
return m_tofAccumulatedPhaseFractionsPlot();
|
||||
return m_wellLogPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -546,7 +551,7 @@ RimTofAccumulatedPhaseFractionsPlot * RimWellRftPlot::tofAccumulatedPhaseFractio
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObject* RimWellRftPlot::plotLegend()
|
||||
{
|
||||
return m_WellRftPlotLegend;
|
||||
return m_rftPlotLegend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -661,7 +666,7 @@ void RimWellRftPlot::removeFromMdiAreaAndDeleteViewWidget()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::showPlotLegend(bool doShow)
|
||||
{
|
||||
if (m_WellRftPlotWidget) m_WellRftPlotWidget->showLegend(doShow);
|
||||
if (m_wellLogPlotWidget) m_wellLogPlotWidget->showLegend(doShow);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -736,9 +741,9 @@ QImage RimWellRftPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if (m_WellRftPlotWidget)
|
||||
if (m_wellLogPlotWidget)
|
||||
{
|
||||
QPixmap pix = QPixmap::grabWidget(m_WellRftPlotWidget);
|
||||
QPixmap pix = QPixmap::grabWidget(m_wellLogPlotWidget);
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
@ -791,7 +796,7 @@ void RimWellRftPlot::loadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
updateFromWell();
|
||||
m_accumulatedWellFlowPlot->loadDataAndUpdate();
|
||||
m_wellLogPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -799,8 +804,8 @@ void RimWellRftPlot::loadDataAndUpdate()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellRftPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
{
|
||||
m_WellRftPlotWidget = new RiuWellRftPlot(this, mainWindowParent);
|
||||
return m_WellRftPlotWidget;
|
||||
m_wellLogPlotWidget = new RiuWellRftPlot(this, mainWindowParent);
|
||||
return m_wellLogPlotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -71,9 +71,7 @@ public:
|
||||
virtual QWidget* viewWidget() override;
|
||||
virtual void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* accumulatedWellFlowPlot();
|
||||
RimTotalWellAllocationPlot* totalWellFlowPlot();
|
||||
RimTofAccumulatedPhaseFractionsPlot* tofAccumulatedPhaseFractionsPlot();
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
caf::PdmObject* plotLegend();
|
||||
RimEclipseResultCase* rimCase();
|
||||
int timeStep();
|
||||
@ -131,10 +129,8 @@ private:
|
||||
caf::PdmField<double> m_smallContributionsThreshold;
|
||||
caf::PdmField<caf::AppEnum<FlowType> > m_flowType;
|
||||
|
||||
QPointer<RiuWellRftPlot> m_WellRftPlotWidget;
|
||||
QPointer<RiuWellRftPlot> m_wellLogPlotWidget;
|
||||
|
||||
caf::PdmChildField<RimWellLogPlot*> m_accumulatedWellFlowPlot;
|
||||
caf::PdmChildField<RimTotalWellAllocationPlot*> m_totalWellAllocationPlot;
|
||||
caf::PdmChildField<RimWellRftPlotLegend*> m_WellRftPlotLegend;
|
||||
caf::PdmChildField<RimTofAccumulatedPhaseFractionsPlot*> m_tofAccumulatedPhaseFractionsPlot;
|
||||
caf::PdmChildField<RimWellLogPlot*> m_wellLogPlot;
|
||||
caf::PdmChildField<RimWellRftPlotLegend*> m_rftPlotLegend;
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ RiuWellRftPlot::RiuWellRftPlot(RimWellRftPlot* plotDefinition, QWidget* parent)
|
||||
this->layout()->setSpacing(2);
|
||||
|
||||
m_titleLabel = new QLabel(this);
|
||||
new RiuPlotObjectPicker(m_titleLabel, m_plotDefinition->accumulatedWellFlowPlot());
|
||||
new RiuPlotObjectPicker(m_titleLabel, m_plotDefinition->wellLogPlot());
|
||||
|
||||
QFont font = m_titleLabel->font();
|
||||
font.setPointSize(14);
|
||||
@ -86,15 +86,15 @@ RiuWellRftPlot::RiuWellRftPlot(RimWellRftPlot* plotDefinition, QWidget* parent)
|
||||
rightColumnLayout->addWidget(m_legendWidget);
|
||||
m_legendWidget->showPie(false);
|
||||
|
||||
QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget(this);
|
||||
new RiuPlotObjectPicker(totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot());
|
||||
new RiuContextMenuLauncher(totalFlowAllocationWidget, commandIds);
|
||||
//QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget(this);
|
||||
//new RiuPlotObjectPicker(totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot());
|
||||
//new RiuContextMenuLauncher(totalFlowAllocationWidget, commandIds);
|
||||
|
||||
rightColumnLayout->addWidget(totalFlowAllocationWidget, Qt::AlignTop);
|
||||
rightColumnLayout->addWidget(m_plotDefinition->tofAccumulatedPhaseFractionsPlot()->createViewWidget(this), Qt::AlignTop);
|
||||
rightColumnLayout->addStretch();
|
||||
//rightColumnLayout->addWidget(totalFlowAllocationWidget, Qt::AlignTop);
|
||||
//rightColumnLayout->addWidget(m_plotDefinition->tofAccumulatedPhaseFractionsPlot()->createViewWidget(this), Qt::AlignTop);
|
||||
//rightColumnLayout->addStretch();
|
||||
|
||||
QWidget* wellFlowWidget = m_plotDefinition->accumulatedWellFlowPlot()->createViewWidget(this);
|
||||
QWidget* wellFlowWidget = m_plotDefinition->wellLogPlot()->createViewWidget(this);
|
||||
|
||||
plotWidgetsLayout->addWidget(wellFlowWidget);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user