#1169 Added text on the x-axis

This commit is contained in:
Jacob Støren 2017-02-08 13:23:52 +01:00
parent d5ec760ddd
commit a736d41eb7
5 changed files with 37 additions and 2 deletions

View File

@ -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();
}
//--------------------------------------------------------------------------------------------------

View File

@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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;

View File

@ -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);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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);