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);
|
populateCurveCreator(*m_targetPlot);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setDefaultCurveSelection();
|
||||||
|
}
|
||||||
|
|
||||||
syncPreviewCurvesFromUiSelection();
|
syncPreviewCurvesFromUiSelection();
|
||||||
|
|
||||||
@ -554,6 +558,14 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
|
|||||||
curveCopy->loadDataAndUpdate(false);
|
curveCopy->loadDataAndUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSummaryCurveCreator::setDefaultCurveSelection()
|
||||||
|
{
|
||||||
|
m_summaryCurveSelectionEditor->summaryAddressSelection()->setDefaultSelection();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -84,6 +84,7 @@ private:
|
|||||||
void populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot);
|
void populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot);
|
||||||
void updateTargetPlot();
|
void updateTargetPlot();
|
||||||
static void copyCurveAndAddToPlot(const RimSummaryCurve *curve, RimSummaryPlot *plot, bool forceVisible = false);
|
static void copyCurveAndAddToPlot(const RimSummaryCurve *curve, RimSummaryPlot *plot, bool forceVisible = false);
|
||||||
|
void setDefaultCurveSelection();
|
||||||
|
|
||||||
void resetAllFields();
|
void resetAllFields();
|
||||||
void initCurveAppearanceCalculator(RimSummaryCurveAppearanceCalculator& curveAppearanceCalc);
|
void initCurveAppearanceCalculator(RimSummaryCurveAppearanceCalculator& curveAppearanceCalc);
|
||||||
|
@ -252,7 +252,7 @@ std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selectedCurv
|
|||||||
|
|
||||||
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
||||||
|
|
||||||
for (RimSummaryCase* currCase : summaryCases())
|
for (RimSummaryCase* currCase : selectedSummaryCases())
|
||||||
{
|
{
|
||||||
if (currCase && currCase->summaryReader())
|
if (currCase && currCase->summaryReader())
|
||||||
{
|
{
|
||||||
@ -291,6 +291,25 @@ void RiuSummaryCurveDefSelection::setFieldChangedHandler(const std::function<voi
|
|||||||
m_toggleChangedHandler = handlerFunc;
|
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;
|
std::vector<RimSummaryCase*> cases;
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ public:
|
|||||||
void setMultiSelectionMode(bool multiSelectionMode);
|
void setMultiSelectionMode(bool multiSelectionMode);
|
||||||
void setFieldChangedHandler(const std::function<void()>& handlerFunc);
|
void setFieldChangedHandler(const std::function<void()>& handlerFunc);
|
||||||
|
|
||||||
|
void setDefaultSelection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
@ -86,7 +88,7 @@ private:
|
|||||||
void resetAllFields();
|
void resetAllFields();
|
||||||
bool isObservedData(RimSummaryCase *sumCase) const;
|
bool isObservedData(RimSummaryCase *sumCase) const;
|
||||||
|
|
||||||
std::vector<RimSummaryCase*> summaryCases() const;
|
std::vector<RimSummaryCase*> selectedSummaryCases() const;
|
||||||
static RimSummaryCase* calculatedSummaryCase();
|
static RimSummaryCase* calculatedSummaryCase();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user