Add function converting from integer to GuideRateTarget
This commit is contained in:
parent
37443b8c38
commit
4d5b4a9815
@ -112,7 +112,7 @@ enum class GuideRateTarget {
|
|||||||
NO_GUIDE_RATE = 11
|
NO_GUIDE_RATE = 11
|
||||||
};
|
};
|
||||||
static GuideRateTarget GuideRateTargetFromString( const std::string& stringValue );
|
static GuideRateTarget GuideRateTargetFromString( const std::string& stringValue );
|
||||||
|
static GuideRateTarget GuideRateTargetFromInt(int ecl_id);
|
||||||
|
|
||||||
|
|
||||||
struct GroupInjectionProperties {
|
struct GroupInjectionProperties {
|
||||||
|
@ -747,6 +747,31 @@ Group::GuideRateTarget Group::GuideRateTargetFromString( const std::string& stri
|
|||||||
return GuideRateTarget::NO_GUIDE_RATE;
|
return GuideRateTarget::NO_GUIDE_RATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Integer values defined vectoritems/group.hpp
|
||||||
|
Group::GuideRateTarget Group::GuideRateTargetFromInt(int ecl_id) {
|
||||||
|
switch(ecl_id) {
|
||||||
|
case 0:
|
||||||
|
return GuideRateTarget::NO_GUIDE_RATE;
|
||||||
|
case 1:
|
||||||
|
return GuideRateTarget::OIL;
|
||||||
|
case 2:
|
||||||
|
return GuideRateTarget::WAT;
|
||||||
|
case 3:
|
||||||
|
return GuideRateTarget::GAS;
|
||||||
|
case 4:
|
||||||
|
return GuideRateTarget::LIQ;
|
||||||
|
case 7:
|
||||||
|
return GuideRateTarget::POTN;
|
||||||
|
case 8:
|
||||||
|
return GuideRateTarget::FORM;
|
||||||
|
case 9:
|
||||||
|
return GuideRateTarget::COMB;
|
||||||
|
default:
|
||||||
|
throw std::logic_error(fmt::format("Integer GuideRateTarget: {} not recognized", ecl_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Group::operator==(const Group& data) const
|
bool Group::operator==(const Group& data) const
|
||||||
{
|
{
|
||||||
return this->name() == data.name() &&
|
return this->name() == data.name() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user