mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#859 Added time from start of simulation option
This commit is contained in:
@@ -143,6 +143,14 @@ bool RimSummaryPlot::isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) co
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryTimeAxisProperties* RimSummaryPlot::timeAxisProperties()
|
||||
{
|
||||
return m_timeAxisProperties();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -163,6 +171,40 @@ void RimSummaryPlot::selectAxisInPropertyEditor(int axis)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
time_t RimSummaryPlot::firstTimeStepOfFirstCurve()
|
||||
{
|
||||
RimSummaryCurve * firstCurve = nullptr;
|
||||
|
||||
for (RimSummaryCurveFilter* curveFilter : m_curveFilters )
|
||||
{
|
||||
if (curveFilter)
|
||||
{
|
||||
std::vector<RimSummaryCurve *> curves = curveFilter->curves();
|
||||
int i = 0;
|
||||
while (firstCurve == nullptr)
|
||||
{
|
||||
firstCurve = curves[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
if (firstCurve) break;
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
while (firstCurve == nullptr)
|
||||
{
|
||||
firstCurve = m_curves[i];
|
||||
++i;
|
||||
}
|
||||
|
||||
if (firstCurve) return firstCurve->timeSteps()[0];
|
||||
else return time_t(0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -276,6 +318,15 @@ void RimSummaryPlot::updateTimeAxis()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_timeAxisProperties->timeMode() == RimSummaryTimeAxisProperties::DATE)
|
||||
{
|
||||
m_qwtPlot->useDateBasedTimeAxis();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlot->useTimeBasedTimeAxis();
|
||||
}
|
||||
|
||||
m_qwtPlot->enableAxis(QwtPlot::xBottom, true);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user