Add model files loading for B&W radios

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:11 +01:00
parent 3eb55af228
commit 79181d1484
9 changed files with 85 additions and 40 deletions
@@ -52,6 +52,7 @@ bool loadModelsListFromYaml(std::vector<CategoryData>& categories,
YAML::Node node = loadYamlFromByteArray(data);
if (!node.IsSequence()) return false;
int modelIdx = 0;
for (const auto& cat : node) {
if (!cat.IsMap()) continue;
@@ -63,11 +64,11 @@ bool loadModelsListFromYaml(std::vector<CategoryData>& categories,
if (!models.IsSequence()) continue;
for (const auto& model : models) {
std::string filename;
std::string filename, name;
model["filename"] >> filename;
std::string name;
model["name"] >> name;
modelFiles.push_back({filename, name, (int)categories.size() - 1});
modelFiles.push_back(
{filename, name, (int)categories.size() - 1, modelIdx++});
}
}
}