Skip to content
Snippets Groups Projects
Commit 22231dfe authored by Xiao Pan's avatar Xiao Pan
Browse files

Keep Astas as config for HostControlMode

parent 6e93267d
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ enum class QualityLevel
/// @brief Here all enums are mapped to a string, to allow a generic lookup
template <typename E>
inline std::map<E, std::string> GetEnumLookupMap()
inline std::multimap<E, std::string> GetEnumLookupMap()
{
if constexpr (std::is_same_v<E, ColorScheme>)
{
......@@ -55,16 +55,19 @@ inline std::map<E, std::string> GetEnumLookupMap()
}
else if constexpr (std::is_same_v<E, HostControlMode>)
{
return {{HostControlMode::kExternal, "ExternalVehicle"}, {HostControlMode::kInternal, "InternalVehicle"}};
/// @todo remove config HostControlMode option "Astas" once the internal setup has been updated
return {{HostControlMode::kExternal, "ExternalVehicle"},
{HostControlMode::kInternal, "Astas"},
{HostControlMode::kInternal, "InternalVehicle"}};
}
else if constexpr (std::is_same_v<E, QualityLevel>)
{
static std::map<E, std::string> quality_map{{QualityLevel::kFastest, "Fastest"},
{QualityLevel::kFast, "Fast"},
{QualityLevel::kSimple, "Simple"},
{QualityLevel::kGood, "Good"},
{QualityLevel::kBeautiful, "Beautiful"},
{QualityLevel::kFantastic, "Fantastic"}};
static std::multimap<E, std::string> quality_map{{QualityLevel::kFastest, "Fastest"},
{QualityLevel::kFast, "Fast"},
{QualityLevel::kSimple, "Simple"},
{QualityLevel::kGood, "Good"},
{QualityLevel::kBeautiful, "Beautiful"},
{QualityLevel::kFantastic, "Fantastic"}};
return quality_map;
}
......
......@@ -20,6 +20,7 @@ namespace astas::service::user_settings
TEST(UserSettingsEnumsTest, GivenValidInputEnum_WhenEnumValueToString_ThenEnumAsStringReturned)
{
EXPECT_EQ(EnumValueToString(HostControlMode::kExternal), "ExternalVehicle");
EXPECT_EQ(EnumValueToString(HostControlMode::kInternal), "Astas");
EXPECT_EQ(EnumValueToString(HostControlMode::kInternal), "InternalVehicle");
EXPECT_EQ(EnumValueToString(ColorScheme::kDark), "Dark");
......@@ -45,6 +46,7 @@ TEST(UserSettingsEnumsTest, GivenInvalidInputEnum_WhenEnumValueToString_ThenExce
TEST(UserSettingsEnumsTest, GivenValidInputString_WhenToEnum_ThenEnumReturned)
{
EXPECT_EQ(ToEnum<HostControlMode>("Astas"), HostControlMode::kInternal);
EXPECT_EQ(ToEnum<HostControlMode>("InternalVehicle"), HostControlMode::kInternal);
EXPECT_EQ(ToEnum<ColorScheme>("Dark"), ColorScheme::kDark);
EXPECT_EQ(ToEnum<QualityLevel>("Fantastic"), QualityLevel::kFantastic);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment