mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#1897 Curve creator. Use only one region editor for region to region category
This commit is contained in:
parent
47a531909a
commit
b0554516dd
@ -76,8 +76,7 @@ RicSummaryCurveCreator::RicSummaryCurveCreator() : m_identifierFieldsMap(
|
||||
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_VECTOR_NAME) }
|
||||
} },
|
||||
{ RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION,{
|
||||
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_REGION_NUMBER) },
|
||||
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_REGION2_NUMBER) },
|
||||
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_REGION_2_REGION) },
|
||||
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_VECTOR_NAME) }
|
||||
} },
|
||||
{ RifEclipseSummaryAddress::SUMMARY_WELL_GROUP,{
|
||||
@ -137,8 +136,7 @@ RicSummaryCurveCreator::RicSummaryCurveCreator() : m_identifierFieldsMap(
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][0]->pdmField(), "Region2RegionRegions", "Regions", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][1]->pdmField(), "Region2RegionRegion2s", "Region2s", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][2]->pdmField(), "Region2RegionVectors", "Region2s Vectors", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][1]->pdmField(), "Region2RegionVectors", "Region2s Vectors", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_WELL_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Well groups", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_WELL_GROUP][1]->pdmField(), "WellGroupVectors", "Well Group Vectors", "", "", "");
|
||||
@ -504,10 +502,9 @@ void RicSummaryCurveCreator::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
{
|
||||
caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup("Regions");
|
||||
myGroup->add(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][0]->pdmField());
|
||||
myGroup->add(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][1]->pdmField());
|
||||
}
|
||||
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][2]->pdmField();
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION][1]->pdmField();
|
||||
}
|
||||
else if (sumCategory == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||
{
|
||||
|
@ -33,14 +33,16 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress(SummaryVarCategory category,
|
||||
m_cellK(-1)
|
||||
{
|
||||
std::tuple<int, int, int> ijkTuple;
|
||||
std::pair<int, int> reg2regPair;
|
||||
switch (category)
|
||||
{
|
||||
case SUMMARY_REGION:
|
||||
m_regionNumber = std::stoi(identifiers[INPUT_REGION_NUMBER]);
|
||||
break;
|
||||
case SUMMARY_REGION_2_REGION:
|
||||
m_regionNumber = std::stoi(identifiers[INPUT_REGION_NUMBER]);
|
||||
m_regionNumber2 = std::stoi(identifiers[INPUT_REGION2_NUMBER]);
|
||||
reg2regPair = regionToRegionPairFromUiText(identifiers[INPUT_REGION_2_REGION]);
|
||||
m_regionNumber = reg2regPair.first;
|
||||
m_regionNumber2 = reg2regPair.second;
|
||||
break;
|
||||
case SUMMARY_WELL_GROUP:
|
||||
m_wellGroupName = identifiers[INPUT_WELL_GROUP_NAME];
|
||||
@ -117,8 +119,7 @@ std::string RifEclipseSummaryAddress::uiText() const
|
||||
break;
|
||||
case RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION:
|
||||
{
|
||||
text += ":" + std::to_string(this->regionNumber());
|
||||
text += "-" + std::to_string(this->regionNumber2());
|
||||
text += ":" + formatUiTextRegionToRegion();
|
||||
}
|
||||
break;
|
||||
case RifEclipseSummaryAddress::SUMMARY_WELL_GROUP:
|
||||
@ -180,7 +181,7 @@ std::string RifEclipseSummaryAddress::uiText(RifEclipseSummaryAddress::SummaryId
|
||||
switch (identifierType)
|
||||
{
|
||||
case RifEclipseSummaryAddress::INPUT_REGION_NUMBER: return std::to_string(regionNumber());
|
||||
case RifEclipseSummaryAddress::INPUT_REGION2_NUMBER: return std::to_string(regionNumber2());
|
||||
case RifEclipseSummaryAddress::INPUT_REGION_2_REGION: return formatUiTextRegionToRegion();
|
||||
case RifEclipseSummaryAddress::INPUT_WELL_NAME: return wellName();
|
||||
case RifEclipseSummaryAddress::INPUT_WELL_GROUP_NAME: return wellGroupName();
|
||||
case RifEclipseSummaryAddress::INPUT_CELL_IJK: return formatUiTextIJK();
|
||||
@ -215,6 +216,27 @@ std::tuple<int, int, int> RifEclipseSummaryAddress::ijkTupleFromUiText(const std
|
||||
return std::make_tuple(std::stoi(textI), std::stoi(textJ), std::stoi(textK));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEclipseSummaryAddress::formatUiTextRegionToRegion() const
|
||||
{
|
||||
return std::to_string(this->regionNumber()) + " -> "
|
||||
+ std::to_string(this->regionNumber2());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<int, int> RifEclipseSummaryAddress::regionToRegionPairFromUiText(const std::string &s)
|
||||
{
|
||||
auto sep = s.find("->");
|
||||
CVF_ASSERT(sep != std::string::npos );
|
||||
auto textReg = s.substr(0, sep);
|
||||
auto textReg2 = s.substr(sep + 2);
|
||||
return std::make_pair(std::stoi(textReg), std::stoi(textReg2));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
enum SummaryIdentifierType
|
||||
{
|
||||
INPUT_REGION_NUMBER,
|
||||
INPUT_REGION2_NUMBER,
|
||||
INPUT_REGION_2_REGION,
|
||||
INPUT_WELL_NAME,
|
||||
INPUT_WELL_GROUP_NAME,
|
||||
INPUT_CELL_IJK,
|
||||
@ -130,6 +130,8 @@ private:
|
||||
|
||||
std::string formatUiTextIJK() const;
|
||||
std::tuple<int, int, int> ijkTupleFromUiText(const std::string &s);
|
||||
std::string formatUiTextRegionToRegion() const;
|
||||
std::pair<int, int> regionToRegionPairFromUiText(const std::string &s);
|
||||
|
||||
SummaryVarCategory m_variableCategory;
|
||||
std::string m_quantityName;
|
||||
|
Loading…
Reference in New Issue
Block a user