mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user