From a3e050220ec1ccee8914ddfde439a3af51d4d8b8 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 29 Dec 2023 16:00:42 -0600 Subject: [PATCH] more fiddling --- photon-lib/py/photonlibpy/photonCamera.py | 43 +++++++++--------- .../main/native/cpp/photon/PhotonCamera.cpp | 44 +++++++++---------- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/photon-lib/py/photonlibpy/photonCamera.py b/photon-lib/py/photonlibpy/photonCamera.py index ff4f5dffa2..187013a286 100644 --- a/photon-lib/py/photonlibpy/photonCamera.py +++ b/photon-lib/py/photonlibpy/photonCamera.py @@ -167,28 +167,29 @@ def _versionCheck(self) -> None: if len(versionString) > 0 and versionString != PHOTONVISION_VERSION: # Verified version mismatch - bfw = "" - bfw += ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" - bfw += ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" - bfw += ">>> ____ _________ ____ ________ ___________ __ \n" - bfw += ">>> / __ \\/ ____/ | / __ \\ /_ __/ / / / _/ ___/ / / \n" - bfw += ">>> / /_/ / __/ / /| | / / / / / / / /_/ // / \\__ \\ / / \n" - bfw += ">>> / _, _/ /___/ ___ |/ /_/ / / / / __ // / ___/ / /_/ \n" - bfw += ">>>/_/ |_/_____/_/ |_/_____/ /_/ /_/ /_/___//____/ (_) \n" - bfw += ">>> \n" - bfw += ">>> You are running an incompatible version \n" - bfw += ">>> of PhotonVision on your coprocessor! \n" - bfw += ">>> \n" - bfw += ">>> This is neither tested nor supported. \n" - bfw += ">>> You MUST update either PhotonVision, PhotonLib, or both. \n" - bfw += ">>> \n" - bfw += ">>> Your code will now crash. We hope your day gets better. \n" - bfw += ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" - bfw += ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" - - wpilib.reportWarning("\n\n\n\n") + bfw = """ + \n\n\n + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + >>> ____ _________ ____ ________ ___________ __ + >>> / __ \\/ ____/ | / __ \\ /_ __/ / / / _/ ___/ / / + >>> / /_/ / __/ / /| | / / / / / / / /_/ // / \\__ \\ / / + >>> / _, _/ /___/ ___ |/ /_/ / / / / __ // / ___/ / /_/ + >>>/_/ |_/_____/_/ |_/_____/ /_/ /_/ /_/___//____/ (_) + >>> + >>> You are running an incompatible version + >>> of PhotonVision on your coprocessor! + >>> + >>> This is neither tested nor supported. + >>> You MUST update either PhotonVision, PhotonLib, or both. + >>> + >>> Your code will now crash. We hope your day gets better. + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + \n\n + """ + wpilib.reportWarning(bfw) - wpilib.reportWarning("\n\n") errText = f"Photon version {PHOTONLIB_VERSION} does not match coprocessor version {versionString}. Please install photonlibpy version {PHOTONLIB_VERSION}." wpilib.reportError(errText, True) diff --git a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp index 04ea38160a..9d3b81482c 100644 --- a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp +++ b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp @@ -200,28 +200,28 @@ void PhotonCamera::VerifyVersion() { cameraNameOutString); } } else if (!VersionMatches(versionString)) { - - FRC_ReportError(frc::warn::Warning, "\n\n\n\n"); - FRC_ReportError(frc::warn::Warning, - ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\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" - ); - FRC_ReportError(frc::warn::Warning, "\n\n"); + std::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"; + + FRC_ReportError(frc::warn::Warning, bfw); FRC_ReportError(frc::err::Error, "Photon version {} does not match coprocessor version {}!", PhotonVersion::versionString, versionString);