Add ignored cameras regex to command-line arguemnts (#849)

This adds a regex that ignores cameras if they match it, for if you have another piece of software running that needs a second camera, or if you have a webcam in your laptop that cscore hates.
This commit is contained in:
person4268
2023-06-03 21:04:04 -04:00
committed by GitHub
parent 80f479344d
commit 6d2eae7f20
20 changed files with 78 additions and 14 deletions

View File

@@ -75,6 +75,11 @@ public class Main {
"Run in test mode with 2019 and 2020 WPI field images in place of cameras");
options.addOption("p", "path", true, "Point test mode to a specific folder");
options.addOption(
"i",
"ignore-cameras",
true,
"Ignore cameras that match a regex. Uses camera name as provided by cscore.");
CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(options, args);
@@ -99,6 +104,11 @@ public class Main {
testModeFolder = p;
}
}
if (cmd.hasOption("ignore-cameras")) {
VisionSourceManager.getInstance()
.setIgnoredCamerasRegex(cmd.getOptionValue("ignore-cameras"));
}
}
return true;
}