mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1978 Curve Creator. Separate selections of observed data and simulated data
This commit is contained in:
parent
8e80245544
commit
0e832fad06
@ -802,9 +802,9 @@ bool RicSummaryCurveCreator::isAddressCompatibleWithControllingFieldSelection(co
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::set<RifEclipseSummaryAddress> RicSummaryCurveCreator::buildAddressListFromSelections()
|
std::set<std::pair<RifEclipseSummaryAddress,bool>> RicSummaryCurveCreator::buildAddressListFromSelections()
|
||||||
{
|
{
|
||||||
std::set<RifEclipseSummaryAddress> addressSet;
|
std::set<std::pair<RifEclipseSummaryAddress,bool>> addressSet;
|
||||||
for (const auto& category : m_selectedSummaryCategories())
|
for (const auto& category : m_selectedSummaryCategories())
|
||||||
{
|
{
|
||||||
auto identifierAndFieldList = m_identifierFieldsMap[category];
|
auto identifierAndFieldList = m_identifierFieldsMap[category];
|
||||||
@ -820,17 +820,19 @@ std::set<RifEclipseSummaryAddress> RicSummaryCurveCreator::buildAddressListFromS
|
|||||||
void RicSummaryCurveCreator::buildAddressListForCategoryRecursively(RifEclipseSummaryAddress::SummaryVarCategory category,
|
void RicSummaryCurveCreator::buildAddressListForCategoryRecursively(RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||||
std::vector<SummaryIdentifierAndField*>::const_iterator identifierAndFieldItr,
|
std::vector<SummaryIdentifierAndField*>::const_iterator identifierAndFieldItr,
|
||||||
std::vector<std::pair<RifEclipseSummaryAddress::SummaryIdentifierType, QString>>& identifierPath,
|
std::vector<std::pair<RifEclipseSummaryAddress::SummaryIdentifierType, QString>>& identifierPath,
|
||||||
std::set<RifEclipseSummaryAddress>& addressSet)
|
std::set<std::pair<RifEclipseSummaryAddress,bool>>& addressPairSet)
|
||||||
|
|
||||||
{
|
{
|
||||||
for (const auto& identifierText : (*identifierAndFieldItr)->pdmField()->v())
|
for (const auto& identifierText : (*identifierAndFieldItr)->pdmField()->v())
|
||||||
{
|
{
|
||||||
auto idText = identifierText;
|
auto idText = identifierText;
|
||||||
idText.remove(OBSERVED_DATA_AVALUE_POSTFIX);
|
bool isObservedData = idText.contains(OBSERVED_DATA_AVALUE_POSTFIX);
|
||||||
|
if(isObservedData)
|
||||||
|
idText.remove(OBSERVED_DATA_AVALUE_POSTFIX);
|
||||||
identifierPath.push_back(std::make_pair((*identifierAndFieldItr)->summaryIdentifier(), idText));
|
identifierPath.push_back(std::make_pair((*identifierAndFieldItr)->summaryIdentifier(), idText));
|
||||||
if ((*identifierAndFieldItr)->summaryIdentifier() != RifEclipseSummaryAddress::INPUT_VECTOR_NAME)
|
if ((*identifierAndFieldItr)->summaryIdentifier() != RifEclipseSummaryAddress::INPUT_VECTOR_NAME)
|
||||||
{
|
{
|
||||||
buildAddressListForCategoryRecursively(category, std::next(identifierAndFieldItr, 1), identifierPath, addressSet);
|
buildAddressListForCategoryRecursively(category, std::next(identifierAndFieldItr, 1), identifierPath, addressPairSet);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -839,8 +841,8 @@ void RicSummaryCurveCreator::buildAddressListForCategoryRecursively(RifEclipseSu
|
|||||||
{
|
{
|
||||||
selectedIdentifiers.insert(std::make_pair(identifier.first, identifier.second.toStdString()));
|
selectedIdentifiers.insert(std::make_pair(identifier.first, identifier.second.toStdString()));
|
||||||
}
|
}
|
||||||
auto address = RifEclipseSummaryAddress(category, selectedIdentifiers);
|
auto addressPair = std::make_pair(RifEclipseSummaryAddress(category, selectedIdentifiers), isObservedData);
|
||||||
addressSet.insert(address);
|
addressPairSet.insert(addressPair);
|
||||||
}
|
}
|
||||||
identifierPath.pop_back();
|
identifierPath.pop_back();
|
||||||
}
|
}
|
||||||
@ -857,7 +859,7 @@ void RicSummaryCurveCreator::syncPreviewCurvesFromUiSelection()
|
|||||||
|
|
||||||
// Populate the newCurveDefinitions from the Gui
|
// Populate the newCurveDefinitions from the Gui
|
||||||
|
|
||||||
std::set<RifEclipseSummaryAddress> selectedAddresses = buildAddressListFromSelections();
|
std::set<std::pair<RifEclipseSummaryAddress, bool>> selectedAddresses = buildAddressListFromSelections();
|
||||||
|
|
||||||
// Find the addresses to display
|
// Find the addresses to display
|
||||||
std::set<RifEclipseSummaryAddress> addrUnion;
|
std::set<RifEclipseSummaryAddress> addrUnion;
|
||||||
@ -872,7 +874,7 @@ void RicSummaryCurveCreator::syncPreviewCurvesFromUiSelection()
|
|||||||
|
|
||||||
for (int i = 0; i < addressCount; i++)
|
for (int i = 0; i < addressCount; i++)
|
||||||
{
|
{
|
||||||
if (selectedAddresses.count(allAddresses[i]) > 0)
|
if (selectedAddresses.count(std::make_pair(allAddresses[i], isObservedData(currCase))) > 0)
|
||||||
{
|
{
|
||||||
addrUnion.insert(allAddresses[i]);
|
addrUnion.insert(allAddresses[i]);
|
||||||
allCurveDefinitions.insert(std::make_pair(currCase, allAddresses[i]));
|
allCurveDefinitions.insert(std::make_pair(currCase, allAddresses[i]));
|
||||||
@ -1076,6 +1078,8 @@ void RicSummaryCurveCreator::populateCurveCreator(const RimSummaryPlot& sourceSu
|
|||||||
m_selectedSummaryCategories.v().clear();
|
m_selectedSummaryCategories.v().clear();
|
||||||
for (const auto& curve : sourceSummaryPlot.summaryCurves())
|
for (const auto& curve : sourceSummaryPlot.summaryCurves())
|
||||||
{
|
{
|
||||||
|
bool isObservedDataCase = isObservedData(curve->summaryCase());
|
||||||
|
|
||||||
// Select summary category if not already selected
|
// Select summary category if not already selected
|
||||||
auto& selectedCategories = m_selectedSummaryCategories();
|
auto& selectedCategories = m_selectedSummaryCategories();
|
||||||
if (std::find(selectedCategories.begin(), selectedCategories.end(),
|
if (std::find(selectedCategories.begin(), selectedCategories.end(),
|
||||||
@ -1093,12 +1097,17 @@ void RicSummaryCurveCreator::populateCurveCreator(const RimSummaryPlot& sourceSu
|
|||||||
auto identifierAndFieldList = m_identifierFieldsMap[curve->summaryAddress().category()];
|
auto identifierAndFieldList = m_identifierFieldsMap[curve->summaryAddress().category()];
|
||||||
for (const auto& identifierAndField : identifierAndFieldList)
|
for (const auto& identifierAndField : identifierAndFieldList)
|
||||||
{
|
{
|
||||||
QString uiText = QString::fromStdString(curve->summaryAddress().uiText(identifierAndField->summaryIdentifier()));
|
bool isVectorField = identifierAndField->summaryIdentifier() == RifEclipseSummaryAddress::INPUT_VECTOR_NAME;
|
||||||
|
QString avalue = QString::fromStdString(curve->summaryAddress().uiText(identifierAndField->summaryIdentifier()));
|
||||||
|
if (isVectorField && isObservedDataCase)
|
||||||
|
{
|
||||||
|
avalue = avalue + QString(OBSERVED_DATA_AVALUE_POSTFIX);
|
||||||
|
}
|
||||||
const auto& currentSelectionVector = identifierAndField->pdmField()->v();
|
const auto& currentSelectionVector = identifierAndField->pdmField()->v();
|
||||||
if (std::find(currentSelectionVector.begin(), currentSelectionVector.end(), uiText) == currentSelectionVector.end())
|
if (std::find(currentSelectionVector.begin(), currentSelectionVector.end(), avalue) == currentSelectionVector.end())
|
||||||
{
|
{
|
||||||
std::vector<QString> newSelectionVector(currentSelectionVector.begin(), currentSelectionVector.end());
|
std::vector<QString> newSelectionVector(currentSelectionVector.begin(), currentSelectionVector.end());
|
||||||
newSelectionVector.push_back(uiText);
|
newSelectionVector.push_back(avalue);
|
||||||
(*identifierAndField->pdmField()) = newSelectionVector;
|
(*identifierAndField->pdmField()) = newSelectionVector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,11 +102,11 @@ private:
|
|||||||
SummaryIdentifierAndField* lookupControllingField(const SummaryIdentifierAndField *dependentField);
|
SummaryIdentifierAndField* lookupControllingField(const SummaryIdentifierAndField *dependentField);
|
||||||
bool isAddressCompatibleWithControllingFieldSelection(const RifEclipseSummaryAddress &address,
|
bool isAddressCompatibleWithControllingFieldSelection(const RifEclipseSummaryAddress &address,
|
||||||
const std::vector<SummaryIdentifierAndField*>& identifierAndFieldList);
|
const std::vector<SummaryIdentifierAndField*>& identifierAndFieldList);
|
||||||
std::set<RifEclipseSummaryAddress> buildAddressListFromSelections();
|
std::set<std::pair<RifEclipseSummaryAddress,bool>> buildAddressListFromSelections();
|
||||||
void buildAddressListForCategoryRecursively(RifEclipseSummaryAddress::SummaryVarCategory category,
|
void buildAddressListForCategoryRecursively(RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||||
std::vector<SummaryIdentifierAndField*>::const_iterator identifierAndFieldItr,
|
std::vector<SummaryIdentifierAndField*>::const_iterator identifierAndFieldItr,
|
||||||
std::vector<std::pair<RifEclipseSummaryAddress::SummaryIdentifierType, QString>>& identifierPath,
|
std::vector<std::pair<RifEclipseSummaryAddress::SummaryIdentifierType, QString>>& identifierPath,
|
||||||
std::set<RifEclipseSummaryAddress>& addressSet);
|
std::set<std::pair<RifEclipseSummaryAddress,bool>>& addressPairSet);
|
||||||
|
|
||||||
void syncPreviewCurvesFromUiSelection();
|
void syncPreviewCurvesFromUiSelection();
|
||||||
void updatePreviewCurvesFromCurveDefinitions(const std::set<std::pair<RimSummaryCase*, RifEclipseSummaryAddress> >& allCurveDefsToDisplay,
|
void updatePreviewCurvesFromCurveDefinitions(const std::set<std::pair<RimSummaryCase*, RifEclipseSummaryAddress> >& allCurveDefsToDisplay,
|
||||||
|
Loading…
Reference in New Issue
Block a user