#1321 Added a comand to show Flow Characteristics plot. Added timestp colors, zoom, mouse tracking, and titles

This commit is contained in:
Jacob Støren
2017-03-28 23:35:53 +02:00
parent 960e6833c4
commit ba60bf3c13
15 changed files with 398 additions and 80 deletions

View File

@@ -74,6 +74,7 @@ void RimFlowCharacteristicsPlot::setFromFlowSolution(RimFlowDiagSolution* flowSo
}
m_flowDiagSolution = flowSolution;
m_showWindow = true;
loadDataAndUpdate();
}
@@ -143,6 +144,7 @@ QWidget* RimFlowCharacteristicsPlot::viewWidget()
//--------------------------------------------------------------------------------------------------
void RimFlowCharacteristicsPlot::zoomAll()
{
if (m_flowCharPlotWidget) m_flowCharPlotWidget->zoomAll();
}
@@ -187,7 +189,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate()
{
updateMdiWindowVisibility();
if (m_flowDiagSolution)
if (m_flowDiagSolution && m_flowCharPlotWidget)
{
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps();
@@ -195,23 +197,26 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate()
std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
std::vector<double> lorenzVals(timeStepDates.size(), HUGE_VAL);
for (int timeStepIdx: calculatedTimesteps)
{
lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx).m_lorenzCoefficient;
m_flowCharPlotWidget->removeAllCurves();
if ( m_flowCharPlotWidget)
{
const auto & flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx);
m_flowCharPlotWidget->addFlowCapStorageCapCurve(timeStepDates[timeStepIdx],
flowCharResults.m_flowCapStorageCapCurve.first,
flowCharResults.m_flowCapStorageCapCurve.second);
m_flowCharPlotWidget->addSweepEfficiencyCurve(timeStepDates[timeStepIdx],
flowCharResults.m_sweepEfficiencyCurve.first,
flowCharResults.m_sweepEfficiencyCurve.second);
}
for ( int timeStepIdx: calculatedTimesteps )
{
lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx).m_lorenzCoefficient;
}
m_flowCharPlotWidget->setLorenzCurve(timeStepDates, lorenzVals);
for ( int timeStepIdx: calculatedTimesteps )
{
const auto & flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx);
m_flowCharPlotWidget->addFlowCapStorageCapCurve(timeStepDates[timeStepIdx],
flowCharResults.m_flowCapStorageCapCurve.first,
flowCharResults.m_flowCapStorageCapCurve.second);
m_flowCharPlotWidget->addSweepEfficiencyCurve(timeStepDates[timeStepIdx],
flowCharResults.m_sweepEfficiencyCurve.first,
flowCharResults.m_sweepEfficiencyCurve.second);
}
if ( m_flowCharPlotWidget) m_flowCharPlotWidget->setLorenzCurve(timeStepDates, lorenzVals);
}
}