Skip to content
Snippets Groups Projects
Commit 70a1d8bc authored by Franck Dary's avatar Franck Dary
Browse files

Corrected bug with multiple classifiers

parent 41c1ae12
No related branches found
No related tags found
No related merge requests found
...@@ -13,17 +13,21 @@ Classifier::Classifier(const std::string & name, std::filesystem::path path, std ...@@ -13,17 +13,21 @@ Classifier::Classifier(const std::string & name, std::filesystem::path path, std
for (auto & ss : splited) for (auto & ss : splited)
{ {
std::vector<std::string> tsFiles; std::vector<std::string> tsFiles;
std::vector<std::string> curStates;
for (auto & elem : util::split(ss, ',')) for (auto & elem : util::split(ss, ','))
if (std::filesystem::path(elem).extension().empty()) if (std::filesystem::path(elem).extension().empty())
{
states.emplace_back(elem); states.emplace_back(elem);
curStates.emplace_back(elem);
}
else else
tsFiles.emplace_back(path / elem); tsFiles.emplace_back(path / elem);
if (tsFiles.empty()) if (tsFiles.empty())
util::myThrow(fmt::format("invalid '{}' no .ts files specified", ss)); util::myThrow(fmt::format("invalid '{}' no .ts files specified", ss));
if (states.empty()) if (curStates.empty())
util::myThrow(fmt::format("invalid '{}' no states specified", ss)); util::myThrow(fmt::format("invalid '{}' no states specified", ss));
for (auto & stateName : states) for (auto & stateName : curStates)
{ {
if (transitionSets.count(stateName)) if (transitionSets.count(stateName))
util::myThrow(fmt::format("state '{}' already assigned", stateName)); util::myThrow(fmt::format("state '{}' already assigned", stateName));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment