From 69522ba9899cc95d16bf3993f4bf5addce85a0da Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Fri, 10 Jan 2025 12:11:22 +0100 Subject: [PATCH] uppercase for sts groups --- .../parts/short-term-storage/properties.cpp | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/libs/antares/study/parts/short-term-storage/properties.cpp b/src/libs/antares/study/parts/short-term-storage/properties.cpp index cce442ce98..893a4b193f 100644 --- a/src/libs/antares/study/parts/short-term-storage/properties.cpp +++ b/src/libs/antares/study/parts/short-term-storage/properties.cpp @@ -26,6 +26,8 @@ */ #include +#include + #include #include "properties.h" @@ -35,15 +37,15 @@ namespace Antares::Data::ShortTermStorage { const std::map Properties::ST_STORAGE_PROPERTY_GROUP_ENUM - = {{"PSP_open", Group::PSP_open}, - {"PSP_closed", Group::PSP_closed}, - {"Pondage", Group::Pondage}, - {"Battery", Group::Battery}, - {"Other1", Group::Other1}, - {"Other2", Group::Other2}, - {"Other3", Group::Other3}, - {"Other4", Group::Other4}, - {"Other5", Group::Other5}}; + = {{"PSP_OPEN", Group::PSP_open}, + {"PSP_CLOSED", Group::PSP_closed}, + {"PONDAGE", Group::Pondage}, + {"BATTERY", Group::Battery}, + {"OTHER1", Group::Other1}, + {"OTHER2", Group::Other2}, + {"OTHER3", Group::Other3}, + {"OTHER4", Group::Other4}, + {"OTHER5", Group::Other5}}; unsigned int groupIndex(Group group) { @@ -106,7 +108,9 @@ bool Properties::loadKey(const IniFile::Property* p) if (p->key == "group") { - if (auto it = Properties::ST_STORAGE_PROPERTY_GROUP_ENUM.find(p->value.c_str()); + std::string groupUpper = p->value.c_str(); + boost::to_upper(groupUpper); + if (auto it = Properties::ST_STORAGE_PROPERTY_GROUP_ENUM.find(groupUpper); it != Properties::ST_STORAGE_PROPERTY_GROUP_ENUM.end()) { this->group = it->second;