mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1169 Added text on the x-axis
This commit is contained in:
parent
d5ec760ddd
commit
a736d41eb7
@ -41,6 +41,7 @@
|
||||
#include "RiuWellAllocationPlot.h"
|
||||
#include "RigAccWellFlowCalculator.h"
|
||||
#include "RimProject.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot");
|
||||
|
||||
@ -110,7 +111,7 @@ void RimWellAllocationPlot::setFromSimulationWell(RimEclipseWell* simWell)
|
||||
|
||||
m_flowDiagSolution = eclView->cellResult()->flowDiagSolution();
|
||||
|
||||
updateFromWell();
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -250,6 +251,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
addStackedCurve("Total", connNumbers, accFlow, plotTrack);
|
||||
}
|
||||
|
||||
plotTrack->setXAxisTitle("Flow Rate");
|
||||
}
|
||||
|
||||
QString wellStatusText = QString("(%1)").arg(RimWellAllocationPlot::wellStatusTextForTimeStep(m_wellName, m_case, m_timeStep));
|
||||
@ -524,7 +526,7 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
|| changedField == &m_case
|
||||
|| changedField == &m_timeStep)
|
||||
{
|
||||
updateFromWell();
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -565,6 +567,7 @@ void RimWellAllocationPlot::loadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
updateFromWell();
|
||||
m_accumulatedWellFlowPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -251,6 +251,7 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
if (wellLogPlot && m_wellLogTrackPlotWidget)
|
||||
{
|
||||
m_wellLogTrackPlotWidget->setDepthTitle(wellLogPlot->depthPlotTitle());
|
||||
m_wellLogTrackPlotWidget->setXTitle(m_xAxisTitle);
|
||||
}
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
|
||||
@ -259,6 +260,14 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::setXAxisTitle(const QString& text)
|
||||
{
|
||||
m_xAxisTitle = text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
void removeCurve(RimWellLogCurve* curve);
|
||||
size_t curveIndex(RimWellLogCurve* curve);
|
||||
size_t curveCount() { return curves.size(); }
|
||||
void setXAxisTitle(const QString& text);
|
||||
|
||||
void recreateViewer();
|
||||
void detachAllCurves();
|
||||
@ -82,6 +83,10 @@ private:
|
||||
void updateAxisScaleEngine();
|
||||
|
||||
private:
|
||||
QString m_xAxisTitle;
|
||||
|
||||
// Fields
|
||||
|
||||
caf::PdmField<bool> m_show;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmChildArrayField<RimWellLogCurve*> curves;
|
||||
|
@ -266,6 +266,13 @@ void RiuWellLogTrack::setDefaults()
|
||||
QFont xAxisFont = axisFont(QwtPlot::xTop);
|
||||
xAxisFont.setPixelSize(9);
|
||||
setAxisFont(QwtPlot::xTop, xAxisFont);
|
||||
QwtText axisTitleX = axisTitle(QwtPlot::yLeft);
|
||||
QFont xAxisTitleFont = axisTitleX.font();
|
||||
xAxisTitleFont.setPixelSize(9);
|
||||
xAxisTitleFont.setBold(false);
|
||||
axisTitleX.setFont(xAxisTitleFont);
|
||||
axisTitleX.setRenderFlags(Qt::AlignRight);
|
||||
setAxisTitle(QwtPlot::xTop, axisTitleX);
|
||||
|
||||
QFont yAxisFont = axisFont(QwtPlot::yLeft);
|
||||
yAxisFont.setPixelSize(9);
|
||||
@ -308,6 +315,16 @@ void RiuWellLogTrack::setDepthTitle(const QString& title)
|
||||
setAxisTitle(QwtPlot::yLeft, axisTitleY);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogTrack::setXTitle(const QString& title)
|
||||
{
|
||||
QwtText axisTitleX = axisTitle(QwtPlot::xTop);
|
||||
axisTitleX.setText(title);
|
||||
setAxisTitle(QwtPlot::xTop, axisTitleX);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
|
||||
void setDepthZoom(double minDepth, double maxDepth);
|
||||
void setDepthTitle(const QString& title);
|
||||
void setXTitle(const QString& title);
|
||||
|
||||
void setXRange(double min, double max);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user