mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2198 Summary Plot : Set default curve selection
This commit is contained in:
parent
eaa0a1d6fe
commit
93b69b807f
@ -138,6 +138,10 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
|
||||
{
|
||||
populateCurveCreator(*m_targetPlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDefaultCurveSelection();
|
||||
}
|
||||
|
||||
syncPreviewCurvesFromUiSelection();
|
||||
|
||||
@ -554,6 +558,14 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
|
||||
curveCopy->loadDataAndUpdate(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::setDefaultCurveSelection()
|
||||
{
|
||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->setDefaultSelection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -84,6 +84,7 @@ private:
|
||||
void populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot);
|
||||
void updateTargetPlot();
|
||||
static void copyCurveAndAddToPlot(const RimSummaryCurve *curve, RimSummaryPlot *plot, bool forceVisible = false);
|
||||
void setDefaultCurveSelection();
|
||||
|
||||
void resetAllFields();
|
||||
void initCurveAppearanceCalculator(RimSummaryCurveAppearanceCalculator& curveAppearanceCalc);
|
||||
|
@ -252,7 +252,7 @@ std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selectedCurv
|
||||
|
||||
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
||||
|
||||
for (RimSummaryCase* currCase : summaryCases())
|
||||
for (RimSummaryCase* currCase : selectedSummaryCases())
|
||||
{
|
||||
if (currCase && currCase->summaryReader())
|
||||
{
|
||||
@ -291,6 +291,25 @@ void RiuSummaryCurveDefSelection::setFieldChangedHandler(const std::function<voi
|
||||
m_toggleChangedHandler = handlerFunc;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryCurveDefSelection::setDefaultSelection()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
auto allSumCases = proj->allSummaryCases();
|
||||
if (allSumCases.size() > 0)
|
||||
{
|
||||
RifEclipseSummaryAddress defaultAddress = RifEclipseSummaryAddress::fieldVarAddress("FOPT");
|
||||
|
||||
RiaSummaryCurveDefinition curveDef(allSumCases[0], defaultAddress);
|
||||
std::vector<RiaSummaryCurveDefinition> curveDefs;
|
||||
curveDefs.push_back(curveDef);
|
||||
|
||||
setSelectedCurveDefinitions(curveDefs);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -950,7 +969,7 @@ bool RiuSummaryCurveDefSelection::isObservedData(RimSummaryCase *sumCase) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RiuSummaryCurveDefSelection::summaryCases() const
|
||||
std::vector<RimSummaryCase*> RiuSummaryCurveDefSelection::selectedSummaryCases() const
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
|
||||
|
@ -55,6 +55,8 @@ public:
|
||||
void setMultiSelectionMode(bool multiSelectionMode);
|
||||
void setFieldChangedHandler(const std::function<void()>& handlerFunc);
|
||||
|
||||
void setDefaultSelection();
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
@ -86,7 +88,7 @@ private:
|
||||
void resetAllFields();
|
||||
bool isObservedData(RimSummaryCase *sumCase) const;
|
||||
|
||||
std::vector<RimSummaryCase*> summaryCases() const;
|
||||
std::vector<RimSummaryCase*> selectedSummaryCases() const;
|
||||
static RimSummaryCase* calculatedSummaryCase();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user