Version mismatch is harder to miss. (#1088)

This commit is contained in:
Chris Gerth
2023-12-30 14:34:52 -06:00
committed by GitHub
parent ef039da728
commit e3eff8731f
3 changed files with 85 additions and 14 deletions

View File

@@ -374,13 +374,35 @@ public class PhotonCamera implements AutoCloseable {
if (!versionString.isEmpty() && !PhotonVersion.versionMatches(versionString)) {
// Error on a verified version mismatch
// But stay silent otherwise
DriverStation.reportWarning(
String bfw =
"\n\n\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
+ ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
+ ">>> ____ _________ ____ ________ ___________ __ \n"
+ ">>> / __ \\/ ____/ | / __ \\ /_ __/ / / / _/ ___/ / / \n"
+ ">>> / /_/ / __/ / /| | / / / / / / / /_/ // / \\__ \\ / / \n"
+ ">>> / _, _/ /___/ ___ |/ /_/ / / / / __ // / ___/ / /_/ \n"
+ ">>>/_/ |_/_____/_/ |_/_____/ /_/ /_/ /_/___//____/ (_) \n"
+ ">>> \n"
+ ">>> You are running an incompatible version \n"
+ ">>> of PhotonVision on your coprocessor! \n"
+ ">>> \n"
+ ">>> This is neither tested nor supported. \n"
+ ">>> You MUST update either PhotonVision, PhotonLib, or both. \n"
+ ">>> \n"
+ ">>> Your code will now crash. We hope your day gets better. \n"
+ ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
+ ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n\n";
DriverStation.reportWarning(bfw, false);
var versionMismatchMessage =
"Photon version "
+ PhotonVersion.versionString
+ " does not match coprocessor version "
+ versionString
+ "!",
true);
+ "!";
DriverStation.reportError(versionMismatchMessage, false);
throw new UnsupportedOperationException(versionMismatchMessage);
}
}
}