From 7afc72942c3072b3480eea542394d62b4731efd2 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 1 Feb 2025 00:03:59 -0500 Subject: [PATCH] add year list to bundle --- .../qt/offroad/settings/vehicle/platform_selector.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle/platform_selector.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle/platform_selector.cc index 22e79e6ec8..b801e58b71 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle/platform_selector.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle/platform_selector.cc @@ -7,6 +7,7 @@ #include "selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle/platform_selector.h" +#include #include #include #include @@ -74,6 +75,13 @@ void PlatformSelector::setPlatform(const QString &platform) { json_bundle["model"] = platform_data["model"].toString(); json_bundle["package"] = platform_data["package"].toString(); + QVariantList year_list = platform_data["year"].toList(); + QJsonArray year_array; + for (const QVariant &year : year_list) { + year_array.append(year.toString()); + } + json_bundle["year"] = year_array; + QString json_bundle_str = QString::fromUtf8(QJsonDocument(json_bundle).toJson(QJsonDocument::Compact)); params.put("CarPlatformBundle", json_bundle_str.toStdString());