mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[sysid] Filter valid test names (#6200)
Currently the analysis portion only supports quasistatic and dynamic, forward and reverse. Check for anything not matching and remove it, along with providing diagnostics of what is being loaded.
This commit is contained in:
@@ -91,6 +91,31 @@ void DataSelector::Display() {
|
||||
if (m_testsFuture.valid() &&
|
||||
m_testsFuture.wait_for(0s) == std::future_status::ready) {
|
||||
m_tests = m_testsFuture.get();
|
||||
for (auto it = m_tests.begin(); it != m_tests.end();) {
|
||||
if (it->first != "quasistatic" && it->first != "dynamic") {
|
||||
WPI_WARNING(m_logger, "Unrecognized test {}, removing", it->first);
|
||||
it = m_tests.erase(it);
|
||||
continue;
|
||||
}
|
||||
for (auto it2 = it->second.begin(); it2 != it->second.end();) {
|
||||
auto direction = wpi::rsplit(it2->first, '-').second;
|
||||
if (direction != "forward" && direction != "reverse") {
|
||||
WPI_WARNING(m_logger, "Unrecognized direction {}, removing",
|
||||
direction);
|
||||
it2 = it->second.erase(it2);
|
||||
continue;
|
||||
}
|
||||
WPI_INFO(m_logger, "Loaded test state {}", it2->first);
|
||||
++it2;
|
||||
}
|
||||
if (it->second.empty()) {
|
||||
WPI_WARNING(m_logger, "No data for test {}, removing", it->first);
|
||||
it = m_tests.erase(it);
|
||||
continue;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
WPI_INFO(m_logger, "Loaded {} tests", m_tests.size());
|
||||
}
|
||||
|
||||
if (m_tests.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user