mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Issues related to user course
* #9277 Observed Data : Assign case ID when importing observed data If no case ID is assigned, the first observed case is always used when creating new plots of observed data * #9278 Match on summary vector name when curve unit text is missing
This commit is contained in:
parent
921c90beea
commit
8887676007
@ -29,6 +29,7 @@
|
|||||||
#include "RimObservedEclipseUserData.h"
|
#include "RimObservedEclipseUserData.h"
|
||||||
#include "RimObservedFmuRftData.h"
|
#include "RimObservedFmuRftData.h"
|
||||||
#include "RimObservedSummaryData.h"
|
#include "RimObservedSummaryData.h"
|
||||||
|
#include "RimProject.h"
|
||||||
#include "RimSummaryObservedDataFile.h"
|
#include "RimSummaryObservedDataFile.h"
|
||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
@ -154,6 +155,7 @@ RimObservedSummaryData*
|
|||||||
errorText->append( observedData->errorMessagesFromReader() );
|
errorText->append( observedData->errorMessagesFromReader() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject::current()->assignCaseIdToSummaryCase( observedData );
|
||||||
updateNewObservedDataCreated( observedData );
|
updateNewObservedDataCreated( observedData );
|
||||||
|
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
@ -221,6 +223,7 @@ RimObservedSummaryData*
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject::current()->assignCaseIdToSummaryCase( observedData );
|
||||||
updateNewObservedDataCreated( observedData );
|
updateNewObservedDataCreated( observedData );
|
||||||
|
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
|
@ -2884,16 +2884,45 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve )
|
|||||||
ALL_TO_LEFT,
|
ALL_TO_LEFT,
|
||||||
ALL_TO_RIGHT,
|
ALL_TO_RIGHT,
|
||||||
ALTERNATING,
|
ALTERNATING,
|
||||||
USE_MATCHING_UNIT
|
USE_MATCHING_UNIT,
|
||||||
|
USE_MATCHING_VECTOR
|
||||||
};
|
};
|
||||||
|
|
||||||
RiaDefines::PlotAxis plotAxis = RiaDefines::PlotAxis::PLOT_AXIS_LEFT;
|
|
||||||
|
|
||||||
auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT;
|
auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT;
|
||||||
if ( strategy == AxisAssignmentStrategy::USE_MATCHING_UNIT )
|
|
||||||
{
|
|
||||||
auto destinationUnit = destinationCurve->unitNameY();
|
|
||||||
|
|
||||||
|
auto destinationUnit = destinationCurve->unitNameY();
|
||||||
|
if ( destinationUnit.empty() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR;
|
||||||
|
|
||||||
|
auto anyCurveWithUnitText = [this, destinationCurve] {
|
||||||
|
for ( auto c : summaryCurves() )
|
||||||
|
{
|
||||||
|
if ( c == destinationCurve ) continue;
|
||||||
|
|
||||||
|
if ( !c->unitNameY().empty() ) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( !anyCurveWithUnitText() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR;
|
||||||
|
|
||||||
|
if ( strategy == AxisAssignmentStrategy::USE_MATCHING_VECTOR )
|
||||||
|
{
|
||||||
|
// Special handling if curve unit is matching. Try to match on summary vector name to avoid creation of new axis
|
||||||
|
|
||||||
|
for ( auto c : summaryCurves() )
|
||||||
|
{
|
||||||
|
if ( c == destinationCurve ) continue;
|
||||||
|
|
||||||
|
if ( c->summaryAddressY().vectorName() == destinationCurve->summaryAddressY().vectorName() )
|
||||||
|
{
|
||||||
|
destinationCurve->setLeftOrRightAxisY( c->axisY() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( strategy == AxisAssignmentStrategy::USE_MATCHING_UNIT )
|
||||||
|
{
|
||||||
bool isLeftUsed = false;
|
bool isLeftUsed = false;
|
||||||
bool isRightUsed = false;
|
bool isRightUsed = false;
|
||||||
|
|
||||||
@ -2936,6 +2965,8 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve )
|
|||||||
strategy = AxisAssignmentStrategy::ALTERNATING;
|
strategy = AxisAssignmentStrategy::ALTERNATING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RiaDefines::PlotAxis plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_LEFT;
|
||||||
|
|
||||||
if ( strategy == AxisAssignmentStrategy::ALTERNATING )
|
if ( strategy == AxisAssignmentStrategy::ALTERNATING )
|
||||||
{
|
{
|
||||||
size_t axisCountLeft = 0;
|
size_t axisCountLeft = 0;
|
||||||
@ -2948,15 +2979,15 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve )
|
|||||||
axisCountRight++;
|
axisCountRight++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( axisCountLeft > axisCountRight ) plotAxis = RiaDefines::PlotAxis::PLOT_AXIS_RIGHT;
|
if ( axisCountLeft > axisCountRight ) plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_RIGHT;
|
||||||
}
|
}
|
||||||
else if ( strategy == AxisAssignmentStrategy::ALL_TO_LEFT )
|
else if ( strategy == AxisAssignmentStrategy::ALL_TO_LEFT )
|
||||||
{
|
{
|
||||||
plotAxis = RiaDefines::PlotAxis::PLOT_AXIS_LEFT;
|
plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_LEFT;
|
||||||
}
|
}
|
||||||
else if ( strategy == AxisAssignmentStrategy::ALL_TO_RIGHT )
|
else if ( strategy == AxisAssignmentStrategy::ALL_TO_RIGHT )
|
||||||
{
|
{
|
||||||
plotAxis = RiaDefines::PlotAxis::PLOT_AXIS_RIGHT;
|
plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuPlotAxis newPlotAxis = RiuPlotAxis::defaultLeft();
|
RiuPlotAxis newPlotAxis = RiuPlotAxis::defaultLeft();
|
||||||
@ -2966,7 +2997,7 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve )
|
|||||||
if ( !destinationCurve->summaryAddressY().uiText().empty() )
|
if ( !destinationCurve->summaryAddressY().uiText().empty() )
|
||||||
axisObjectName = QString::fromStdString( destinationCurve->summaryAddressY().uiText() );
|
axisObjectName = QString::fromStdString( destinationCurve->summaryAddressY().uiText() );
|
||||||
|
|
||||||
newPlotAxis = plotWidget()->createNextPlotAxis( plotAxis );
|
newPlotAxis = plotWidget()->createNextPlotAxis( plotAxisType );
|
||||||
addNewAxisProperties( newPlotAxis, axisObjectName );
|
addNewAxisProperties( newPlotAxis, axisObjectName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user