GroupState: add serialization support

This commit is contained in:
Arne Morten Kvarving
2023-02-02 11:52:08 +01:00
parent 1a5ae624b1
commit b87bf2b3ae
3 changed files with 43 additions and 1 deletions

View File

@@ -33,6 +33,25 @@ GroupState::GroupState(std::size_t np) :
num_phases(np)
{}
GroupState GroupState::serializationTestObject()
{
GroupState result(3);
result.m_production_rates = {{"test1", {1.0, 2.0}}};
result.production_controls = {{"test2", Group::ProductionCMode::LRAT}};
result.prod_red_rates = {{"test3", {3.0, 4.0, 5.0}}};
result.inj_red_rates = {{"test4", {6.0, 7.0}}};
result.inj_surface_rates = {{"test5", {8.0}}};
result.inj_resv_rates = {{"test6", {9.0, 10.0}}};
result.inj_rein_rates = {{"test7", {11.0}}};
result.inj_vrep_rate = {{"test8", 12.0}, {"test9", 13.0}};
result.m_grat_sales_target = {{"test10", 14.0}};
result.m_gpmaint_target = {{"test11", 15.0}};
result.injection_controls = {{{Phase::FOAM, "test12"}, Group::InjectionCMode::REIN}};
result.gpmaint_state.add("foo", GPMaint::State::serializationTestObject());
return result;
}
bool GroupState::operator==(const GroupState& other) const {
return this->m_production_rates == other.m_production_rates &&
this->production_controls == other.production_controls &&