This commit is contained in:
parent
5e244507f3
commit
e46146681a
|
@ -77,21 +77,22 @@ class FrogPilotEvents:
|
|||
self.events.add(EventName.holidayActive)
|
||||
self.holiday_theme_played = True
|
||||
|
||||
if frogpilot_toggles.lead_departing_alert and self.frogpilot_planner.tracking_lead and carState.standstill:
|
||||
if self.tracking_lead_distance == 0:
|
||||
self.tracking_lead_distance = lead_distance
|
||||
if self.tracking_lead_distance < 10 :
|
||||
if frogpilot_toggles.lead_departing_alert and self.frogpilot_planner.tracking_lead and carState.standstill:
|
||||
if self.tracking_lead_distance == 0:
|
||||
self.tracking_lead_distance = lead_distance
|
||||
|
||||
lead_departing = lead_distance - self.tracking_lead_distance > 1
|
||||
lead_departing &= v_lead > 1
|
||||
lead_departing = lead_distance - self.tracking_lead_distance > 1
|
||||
lead_departing &= v_lead > 1
|
||||
|
||||
if lead_departing:
|
||||
self.events.add(EventName.leadDeparting)
|
||||
if lead_departing:
|
||||
self.events.add(EventName.leadDeparting)
|
||||
##################################################################
|
||||
if autoacc_caraway:
|
||||
self.params_memory.put_int("AutoACCCarAwaystatus", 1)
|
||||
if autoacc_caraway:
|
||||
self.params_memory.put_int("AutoACCCarAwaystatus", 1)
|
||||
##################################################################
|
||||
else:
|
||||
self.tracking_lead_distance = 0
|
||||
else:
|
||||
self.tracking_lead_distance = 0
|
||||
|
||||
if not self.openpilot_crashed_played and os.path.isfile(os.path.join(sentry.CRASHES_DIR, 'error.txt')):
|
||||
if frogpilot_toggles.random_events:
|
||||
|
|
|
@ -41,15 +41,15 @@ FrogPilotDevicePanel::FrogPilotDevicePanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
} else if (param == "DeviceShutdown") {
|
||||
std::map<int, QString> shutdownLabels;
|
||||
for (int i = 0; i <= 33; ++i) {
|
||||
shutdownLabels[i] = i == 0 ? tr("5 mins") : i <= 3 ? QString::number(i * 15) + tr(" mins") : QString::number(i - 3) + (i == 4 ? tr(" hour") : tr(" hours"));
|
||||
shutdownLabels[i] = i == 0 ? tr("5 分鐘") : i <= 3 ? QString::number(i * 15) + tr(" 分鐘") : QString::number(i - 3) + (i == 4 ? tr(" 小時]") : tr(" 小時"));
|
||||
}
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 33, QString(), shutdownLabels);
|
||||
} else if (param == "NoUploads") {
|
||||
std::vector<QString> uploadsToggles{"DisableOnroadUploads"};
|
||||
std::vector<QString> uploadsToggleNames{tr("Only Onroad")};
|
||||
std::vector<QString> uploadsToggleNames{tr("僅在公路上")};
|
||||
deviceToggle = new FrogPilotButtonToggleControl(param, title, desc, uploadsToggles, uploadsToggleNames);
|
||||
} else if (param == "LowVoltageShutdown") {
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, 11.8, 12.5, tr(" volts"), std::map<int, QString>(), 0.01);
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, 11.8, 12.5, tr(" 伏特"), std::map<int, QString>(), 0.01);
|
||||
|
||||
} else if (param == "ScreenManagement") {
|
||||
FrogPilotParamManageControl *screenToggle = new FrogPilotParamManageControl(param, title, desc, icon);
|
||||
|
@ -63,11 +63,11 @@ FrogPilotDevicePanel::FrogPilotDevicePanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
std::map<int, QString> brightnessLabels;
|
||||
int minBrightness = (param == "ScreenBrightnessOnroad") ? 0 : 1;
|
||||
for (int i = 0; i <= 101; ++i) {
|
||||
brightnessLabels[i] = i == 101 ? tr("Auto") : i == 0 ? tr("Screen Off") : QString::number(i) + "%";
|
||||
brightnessLabels[i] = i == 101 ? tr("自動") : i == 0 ? tr("Screen Off") : QString::number(i) + "%";
|
||||
}
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, minBrightness, 101, QString(), brightnessLabels, 1, false, true);
|
||||
} else if (param == "ScreenTimeout" || param == "ScreenTimeoutOnroad") {
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, 5, 60, tr(" seconds"));
|
||||
deviceToggle = new FrogPilotParamValueControl(param, title, desc, icon, 5, 60, tr(" 秒"));
|
||||
|
||||
} else {
|
||||
deviceToggle = new ParamControl(param, title, desc, icon);
|
||||
|
@ -90,24 +90,24 @@ FrogPilotDevicePanel::FrogPilotDevicePanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
QObject::connect(static_cast<ToggleControl*>(toggles["IncreaseThermalLimits"]), &ToggleControl::toggleFlipped, [this](bool state) {
|
||||
if (state) {
|
||||
FrogPilotConfirmationDialog::toggleAlert(
|
||||
tr("WARNING: This can cause premature wear or damage by running the device over comma's recommended temperature limits!"),
|
||||
tr("I understand the risks."), this);
|
||||
tr("警告:如果設備運作超過 Comma 建議的溫度限制,可能會導致過早磨損或損壞!"),
|
||||
tr("我了解風險."), this);
|
||||
}
|
||||
});
|
||||
|
||||
QObject::connect(static_cast<ToggleControl*>(toggles["NoLogging"]), &ToggleControl::toggleFlipped, [this](bool state) {
|
||||
if (state) {
|
||||
FrogPilotConfirmationDialog::toggleAlert(
|
||||
tr("WARNING: This will prevent your drives from being recorded and the data will be unobtainable!"),
|
||||
tr("I understand the risks."), this);
|
||||
tr("警告:這將阻止您的驅動器被記錄並且資料將無法獲取!"),
|
||||
tr("我了解風險."), this);
|
||||
}
|
||||
});
|
||||
|
||||
QObject::connect(static_cast<ToggleControl*>(toggles["NoUploads"]), &ToggleControl::toggleFlipped, [this](bool state) {
|
||||
if (state) {
|
||||
FrogPilotConfirmationDialog::toggleAlert(
|
||||
tr("WARNING: This will prevent your drives from appearing on comma connect which may impact debugging and support!"),
|
||||
tr("I understand the risks."), this);
|
||||
tr("警告:這將阻止您的驅動器出現在逗號連接上,這可能會影響調試和支援!"),
|
||||
tr("我了解風險."), this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ FrogPilotLateralPanel::FrogPilotLateralPanel(FrogPilotSettingsWindow *parent) :
|
|||
});
|
||||
lateralToggle = laneChangeToggle;
|
||||
} else if (param == "LaneChangeTime") {
|
||||
lateralToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 5, tr(" seconds"), {{0, "Instant"}, {10, "1.0 second"}}, 0.1);
|
||||
lateralToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 5, tr(" 秒"), {{0, "Instant"}, {10, "1.0 second"}}, 0.1);
|
||||
} else if (param == "LaneDetectionWidth") {
|
||||
lateralToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 15, tr(" feet"), std::map<int, QString>(), 0.1);
|
||||
} else if (param == "MinimumLaneChangeSpeed") {
|
||||
|
@ -149,9 +149,9 @@ FrogPilotLateralPanel::FrogPilotLateralPanel(FrogPilotSettingsWindow *parent) :
|
|||
} else if (param == "PauseLateralSpeed") {
|
||||
std::vector<QString> pauseLateralToggles{"PauseLateralOnSignal"};
|
||||
std::vector<QString> pauseLateralToggleNames{"Turn Signal Only"};
|
||||
lateralToggle = new FrogPilotParamValueButtonControl(param, title, desc, icon, 0, 99, tr("mph"), std::map<int, QString>(), 1, pauseLateralToggles, pauseLateralToggleNames, true);
|
||||
lateralToggle = new FrogPilotParamValueButtonControl(param, title, desc, icon, 0, 99, tr("英里/小時"), std::map<int, QString>(), 1, pauseLateralToggles, pauseLateralToggleNames, true);
|
||||
} else if (param == "PauseLateralOnSignal") {
|
||||
lateralToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("mph"));
|
||||
lateralToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("英里/小時"));
|
||||
|
||||
} else {
|
||||
lateralToggle = new ParamControl(param, title, desc, icon);
|
||||
|
@ -195,11 +195,11 @@ FrogPilotLateralPanel::FrogPilotLateralPanel(FrogPilotSettingsWindow *parent) :
|
|||
QObject::connect(static_cast<ToggleControl*>(toggles[key.toStdString().c_str()]), &ToggleControl::toggleFlipped, [this, key](bool state) {
|
||||
if (started) {
|
||||
if (key == "AlwaysOnLateral" && state) {
|
||||
if (FrogPilotConfirmationDialog::toggle(tr("Reboot required to take effect."), tr("Reboot Now"), this)) {
|
||||
if (FrogPilotConfirmationDialog::toggle(tr("需要重新啟動才能生效."), tr("馬上重啟"), this)) {
|
||||
Hardware::reboot();
|
||||
}
|
||||
} else if (key != "AlwaysOnLateral") {
|
||||
if (FrogPilotConfirmationDialog::toggle(tr("Reboot required to take effect."), tr("Reboot Now"), this)) {
|
||||
if (FrogPilotConfirmationDialog::toggle(tr("需要重新啟動才能生效."), tr("馬上重啟"), this)) {
|
||||
Hardware::reboot();
|
||||
}
|
||||
}
|
||||
|
@ -299,15 +299,15 @@ void FrogPilotLateralPanel::updateMetric() {
|
|||
FrogPilotParamValueControl *pauseLateralToggle = static_cast<FrogPilotParamValueControl*>(toggles["PauseLateralSpeed"]);
|
||||
|
||||
if (isMetric) {
|
||||
minimumLaneChangeSpeedToggle->updateControl(0, 150, tr("kph"));
|
||||
pauseAOLOnBrakeToggle->updateControl(0, 99, tr("kph"));
|
||||
pauseLateralToggle->updateControl(0, 99, tr("kph"));
|
||||
minimumLaneChangeSpeedToggle->updateControl(0, 150, tr("公里/小時"));
|
||||
pauseAOLOnBrakeToggle->updateControl(0, 99, tr("公里/小時"));
|
||||
pauseLateralToggle->updateControl(0, 99, tr("公里/小時"));
|
||||
|
||||
laneWidthToggle->updateControl(0, 5, tr(" meters"));
|
||||
laneWidthToggle->updateControl(0, 5, tr(" 米"));
|
||||
} else {
|
||||
minimumLaneChangeSpeedToggle->updateControl(0, 99, tr("mph"));
|
||||
pauseAOLOnBrakeToggle->updateControl(0, 99, tr("mph"));
|
||||
pauseLateralToggle->updateControl(0, 99, tr("mph"));
|
||||
minimumLaneChangeSpeedToggle->updateControl(0, 99, tr("英里/小時"));
|
||||
pauseAOLOnBrakeToggle->updateControl(0, 99, tr("英里/小時"));
|
||||
pauseLateralToggle->updateControl(0, 99, tr("英里/小時"));
|
||||
|
||||
laneWidthToggle->updateControl(0, 15, tr(" feet"));
|
||||
}
|
||||
|
|
|
@ -168,28 +168,28 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
});
|
||||
longitudinalToggle = conditionalExperimentalToggle;
|
||||
} else if (param == "CESpeed") {
|
||||
FrogPilotParamValueControl *CESpeed = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("mph"), std::map<int, QString>(), 1.0, true);
|
||||
FrogPilotParamValueControl *CESpeedLead = new FrogPilotParamValueControl("CESpeedLead", tr(" With Lead"), tr("Switches to 'Experimental Mode' when driving below the set speed with a lead vehicle."), icon, 0, 99, tr("mph"), std::map<int, QString>(), 1.0, true);
|
||||
FrogPilotParamValueControl *CESpeed = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("英里/小時"), std::map<int, QString>(), 1.0, true);
|
||||
FrogPilotParamValueControl *CESpeedLead = new FrogPilotParamValueControl("CESpeedLead", tr(" 有前車"), tr("當領先車輛低於設定速度行駛時切換到“實驗模式”."), icon, 0, 99, tr("mph"), std::map<int, QString>(), 1.0, true);
|
||||
FrogPilotDualParamControl *conditionalSpeeds = new FrogPilotDualParamControl(CESpeed, CESpeedLead);
|
||||
longitudinalToggle = reinterpret_cast<AbstractControl*>(conditionalSpeeds);
|
||||
} else if (param == "CECurves") {
|
||||
std::vector<QString> curveToggles{"CECurvesLead"};
|
||||
std::vector<QString> curveToggleNames{tr("With Lead")};
|
||||
std::vector<QString> curveToggleNames{tr(" 有前車")};
|
||||
longitudinalToggle = new FrogPilotButtonToggleControl(param, title, desc, curveToggles, curveToggleNames);
|
||||
} else if (param == "CELead") {
|
||||
std::vector<QString> leadToggles{"CESlowerLead", "CEStoppedLead"};
|
||||
std::vector<QString> leadToggleNames{tr("Slower Lead"), tr("Stopped Lead")};
|
||||
std::vector<QString> leadToggleNames{tr("慢速車"), tr("停止車輛")};
|
||||
longitudinalToggle = new FrogPilotButtonToggleControl(param, title, desc, leadToggles, leadToggleNames);
|
||||
} else if (param == "CENavigation") {
|
||||
std::vector<QString> navigationToggles{"CENavigationIntersections", "CENavigationTurns", "CENavigationLead"};
|
||||
std::vector<QString> navigationToggleNames{tr("Intersections"), tr("Turns"), tr("With Lead")};
|
||||
std::vector<QString> navigationToggleNames{tr("交叉口"), tr("轉彎"), tr("含前車")};
|
||||
longitudinalToggle = new FrogPilotButtonToggleControl(param, title, desc, navigationToggles, navigationToggleNames);
|
||||
} else if (param == "CEModelStopTime") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 10, tr(" seconds"), {{0, "Off"}});
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 10, tr(" 秒"), {{0, "關閉"}});
|
||||
} else if (param == "CESignalSpeed") {
|
||||
std::vector<QString> ceSignalToggles{"CESignalLaneDetection"};
|
||||
std::vector<QString> ceSignalToggleNames{"Only For Detected Lanes"};
|
||||
longitudinalToggle = new FrogPilotParamValueButtonControl(param, title, desc, icon, 0, 99, tr("mph"), std::map<int, QString>(), 1.0, ceSignalToggles, ceSignalToggleNames, true);
|
||||
longitudinalToggle = new FrogPilotParamValueButtonControl(param, title, desc, icon, 0, 99, tr("英里/小時"), std::map<int, QString>(), 1.0, ceSignalToggles, ceSignalToggleNames, true);
|
||||
|
||||
} else if (param == "CurveSpeedControl") {
|
||||
FrogPilotParamManageControl *curveControlToggle = new FrogPilotParamManageControl(param, title, desc, icon);
|
||||
|
@ -214,7 +214,7 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
});
|
||||
longitudinalToggle = curveControlToggle;
|
||||
} else if (param == "CurveDetectionMethod") {
|
||||
curveDetectionBtn = new FrogPilotButtonsControl(title, desc, {tr("Map Based"), tr("Vision")}, true, false);
|
||||
curveDetectionBtn = new FrogPilotButtonsControl(title, desc, {tr("地圖"), tr("畫面")}, true, false);
|
||||
QObject::connect(curveDetectionBtn, &FrogPilotButtonsControl::buttonClicked, [=](int id) {
|
||||
bool mtscEnabled = params.getBool("MTSCEnabled");
|
||||
bool vtscEnabled = params.getBool("VisionTurnControl");
|
||||
|
@ -284,11 +284,11 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
});
|
||||
longitudinalToggle = longitudinalTuneToggle;
|
||||
} else if (param == "AccelerationProfile") {
|
||||
std::vector<QString> accelerationProfiles{tr("Standard"), tr("Eco"), tr("Sport"), tr("Sport+")};
|
||||
std::vector<QString> accelerationProfiles{tr("標準"), tr("節能"), tr("運動"), tr("跑車+")};
|
||||
ButtonParamControl *accelerationProfileToggle = new ButtonParamControl(param, title, desc, icon, accelerationProfiles);
|
||||
longitudinalToggle = accelerationProfileToggle;
|
||||
} else if (param == "DecelerationProfile") {
|
||||
std::vector<QString> decelerationProfiles{tr("Standard"), tr("Eco"), tr("Sport")};
|
||||
std::vector<QString> decelerationProfiles{tr("標準"), tr("節能"), tr("運動")};
|
||||
ButtonParamControl *decelerationProfileToggle = new ButtonParamControl(param, title, desc, icon, decelerationProfiles);
|
||||
longitudinalToggle = decelerationProfileToggle;
|
||||
} else if (param == "IncreasedStoppedDistance") {
|
||||
|
@ -326,15 +326,15 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
});
|
||||
longitudinalToggle = qolLongitudinalToggle;
|
||||
} else if (param == "CustomCruise") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 1, 99, tr("mph"));
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 1, 99, tr("英里/小時"));
|
||||
} else if (param == "CustomCruiseLong") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 1, 99, tr("mph"));
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 1, 99, tr("英里/小時"));
|
||||
} else if (param == "MapGears") {
|
||||
std::vector<QString> mapGearsToggles{"MapAcceleration", "MapDeceleration"};
|
||||
std::vector<QString> mapGearsToggleNames{tr("Acceleration"), tr("Deceleration")};
|
||||
std::vector<QString> mapGearsToggleNames{tr("加速度"), tr("減速度")};
|
||||
longitudinalToggle = new FrogPilotButtonToggleControl(param, title, desc, mapGearsToggles, mapGearsToggleNames);
|
||||
} else if (param == "SetSpeedOffset") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("mph"));
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 99, tr("英里/小時"));
|
||||
|
||||
} else if (param == "SpeedLimitController") {
|
||||
FrogPilotParamManageControl *speedLimitControllerToggle = new FrogPilotParamManageControl(param, title, desc, icon);
|
||||
|
@ -358,21 +358,21 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
longitudinalToggle = speedLimitControllerToggle;
|
||||
} else if (param == "SLCConfirmation") {
|
||||
std::vector<QString> confirmationToggles{"SLCConfirmationLower", "SLCConfirmationHigher"};
|
||||
std::vector<QString> confirmationToggleNames{tr("Lower Limits"), tr("Higher Limits")};
|
||||
std::vector<QString> confirmationToggleNames{tr("較低的限制"), tr("較高的限制")};
|
||||
longitudinalToggle = new FrogPilotButtonToggleControl(param, title, desc, confirmationToggles, confirmationToggleNames);
|
||||
} else if (param == "SLCFallback") {
|
||||
std::vector<QString> fallbackOptions{tr("Set Speed"), tr("Experimental Mode"), tr("Previous Limit")};
|
||||
std::vector<QString> fallbackOptions{tr("設定速度"), tr("實驗模式"), tr("先前限制")};
|
||||
ButtonParamControl *fallbackSelection = new ButtonParamControl(param, title, desc, icon, fallbackOptions);
|
||||
longitudinalToggle = fallbackSelection;
|
||||
} else if (param == "SLCOverride") {
|
||||
std::vector<QString> overrideOptions{tr("None"), tr("Set With Gas Pedal"), tr("Max Set Speed")};
|
||||
std::vector<QString> overrideOptions{tr("無"), tr("手動設定"), tr("直接變更")};
|
||||
ButtonParamControl *overrideSelection = new ButtonParamControl(param, title, desc, icon, overrideOptions);
|
||||
longitudinalToggle = overrideSelection;
|
||||
} else if (param == "SLCPriority") {
|
||||
ButtonControl *slcPriorityButton = new ButtonControl(title, tr("SELECT"), desc);
|
||||
QStringList primaryPriorities = {tr("None"), tr("Dashboard"), tr("Navigation"), tr("Offline Maps"), tr("Highest"), tr("Lowest")};
|
||||
QStringList secondaryTertiaryPriorities = {tr("None"), tr("Dashboard"), tr("Navigation"), tr("Offline Maps")};
|
||||
QStringList priorityPrompts = {tr("Select your primary priority"), tr("Select your secondary priority"), tr("Select your tertiary priority")};
|
||||
ButtonControl *slcPriorityButton = new ButtonControl(title, tr("選擇"), desc);
|
||||
QStringList primaryPriorities = {tr("無"), tr("儀表板"), tr("導航"), tr("離線地圖"), tr("最高"), tr("最低")};
|
||||
QStringList secondaryTertiaryPriorities = {tr("無"), tr("儀表板"), tr("導航"), tr("離線地圖")};
|
||||
QStringList priorityPrompts = {tr("選擇您的第一優先"), tr("選擇您的第二優先"), tr("選擇您的第三優先")};
|
||||
|
||||
QObject::connect(slcPriorityButton, &ButtonControl::clicked, [=]() {
|
||||
QStringList selectedPriorities;
|
||||
|
@ -386,10 +386,10 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
}
|
||||
|
||||
if (!hasDashSpeedLimits) {
|
||||
prioritiesToDisplay.removeAll(tr("Dashboard"));
|
||||
prioritiesToDisplay.removeAll(tr("儀表板"));
|
||||
}
|
||||
|
||||
if (prioritiesToDisplay.size() == 1 && prioritiesToDisplay.contains(tr("None"))) {
|
||||
if (prioritiesToDisplay.size() == 1 && prioritiesToDisplay.contains(tr("無"))) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -411,14 +411,14 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
break;
|
||||
}
|
||||
|
||||
if (selection == tr("Lowest") || selection == tr("Highest")) {
|
||||
if (selection == tr("最低") || selection == tr("最高")) {
|
||||
break;
|
||||
}
|
||||
|
||||
updateFrogPilotToggles();
|
||||
}
|
||||
|
||||
selectedPriorities.removeAll(tr("None"));
|
||||
selectedPriorities.removeAll(tr("無"));
|
||||
slcPriorityButton->setValue(selectedPriorities.join(", "));
|
||||
});
|
||||
|
||||
|
@ -427,21 +427,21 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
QString priorityKey = QString("SLCPriority%1").arg(i);
|
||||
QString priority = QString::fromStdString(params.get(priorityKey.toStdString()));
|
||||
|
||||
if (!priority.isEmpty() && primaryPriorities.contains(priority) && priority != tr("None")) {
|
||||
if (!priority.isEmpty() && primaryPriorities.contains(priority) && priority != tr("無")) {
|
||||
initialPriorities.append(priority);
|
||||
}
|
||||
}
|
||||
slcPriorityButton->setValue(initialPriorities.join(", "));
|
||||
longitudinalToggle = slcPriorityButton;
|
||||
} else if (param == "SLCOffsets") {
|
||||
ButtonControl *manageSLCOffsetsBtn = new ButtonControl(title, tr("MANAGE"), desc);
|
||||
ButtonControl *manageSLCOffsetsBtn = new ButtonControl(title, tr("管理"), desc);
|
||||
QObject::connect(manageSLCOffsetsBtn, &ButtonControl::clicked, [this]() {
|
||||
openSubParentToggle();
|
||||
showToggles(speedLimitControllerOffsetsKeys);
|
||||
});
|
||||
longitudinalToggle = reinterpret_cast<AbstractControl*>(manageSLCOffsetsBtn);
|
||||
} else if (param == "SLCQOL") {
|
||||
ButtonControl *manageSLCQOLBtn = new ButtonControl(title, tr("MANAGE"), desc);
|
||||
ButtonControl *manageSLCQOLBtn = new ButtonControl(title, tr("管理"), desc);
|
||||
QObject::connect(manageSLCQOLBtn, &ButtonControl::clicked, [this]() {
|
||||
openSubParentToggle();
|
||||
std::set<QString> modifiedSpeedLimitControllerQOLKeys = speedLimitControllerQOLKeys;
|
||||
|
@ -458,9 +458,9 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
});
|
||||
longitudinalToggle = reinterpret_cast<AbstractControl*>(manageSLCQOLBtn);
|
||||
} else if (param == "SLCLookaheadHigher" || param == "SLCLookaheadLower") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 60, tr(" seconds"));
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 60, tr(" 秒"));
|
||||
} else if (param == "Offset1" || param == "Offset2" || param == "Offset3" || param == "Offset4") {
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, -99, 99, tr("mph"));
|
||||
longitudinalToggle = new FrogPilotParamValueControl(param, title, desc, icon, -99, 99, tr("英里/小時"));
|
||||
|
||||
} else {
|
||||
longitudinalToggle = new ParamControl(param, title, desc, icon);
|
||||
|
@ -494,7 +494,7 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
FrogPilotParamValueControl *trafficSpeedDecreaseToggle = static_cast<FrogPilotParamValueControl*>(toggles["TrafficJerkSpeedDecrease"]);
|
||||
FrogPilotButtonsControl *trafficResetButton = static_cast<FrogPilotButtonsControl*>(toggles["ResetTrafficPersonality"]);
|
||||
QObject::connect(trafficResetButton, &FrogPilotButtonsControl::buttonClicked, this, [=]() {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("Are you sure you want to completely reset your settings for 'Traffic Mode'?"), this)) {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("您確定要完全重置「塞車模式」個性設定嗎?"), this)) {
|
||||
params.putFloat("TrafficFollow", 0.5);
|
||||
params.putFloat("TrafficJerkAcceleration", 50);
|
||||
params.putFloat("TrafficJerkDeceleration", 50);
|
||||
|
@ -519,7 +519,7 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
FrogPilotParamValueControl *aggressiveSpeedDecreaseToggle = static_cast<FrogPilotParamValueControl*>(toggles["AggressiveJerkSpeedDecrease"]);
|
||||
FrogPilotButtonsControl *aggressiveResetButton = static_cast<FrogPilotButtonsControl*>(toggles["ResetAggressivePersonality"]);
|
||||
QObject::connect(aggressiveResetButton, &FrogPilotButtonsControl::buttonClicked, this, [=]() {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("Are you sure you want to completely reset your settings for the 'Aggressive' personality?"), this)) {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("您確定要完全重置「積極駕駛」個性的設定嗎?"), this)) {
|
||||
params.putFloat("AggressiveFollow", 1.25);
|
||||
params.putFloat("AggressiveJerkAcceleration", 50);
|
||||
params.putFloat("AggressiveJerkDeceleration", 50);
|
||||
|
@ -544,7 +544,7 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
FrogPilotParamValueControl *standardSpeedDecreaseToggle = static_cast<FrogPilotParamValueControl*>(toggles["StandardJerkSpeedDecrease"]);
|
||||
FrogPilotButtonsControl *standardResetButton = static_cast<FrogPilotButtonsControl*>(toggles["ResetStandardPersonality"]);
|
||||
QObject::connect(standardResetButton, &FrogPilotButtonsControl::buttonClicked, this, [=]() {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("Are you sure you want to completely reset your settings for the 'Standard' personality?"), this)) {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("您確定要完全重置“標準”個性設定嗎?"), this)) {
|
||||
params.putFloat("StandardFollow", 1.45);
|
||||
params.putFloat("StandardJerkAcceleration", 100);
|
||||
params.putFloat("StandardJerkDeceleration", 100);
|
||||
|
@ -569,7 +569,7 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
|
|||
FrogPilotParamValueControl *relaxedSpeedDecreaseToggle = static_cast<FrogPilotParamValueControl*>(toggles["RelaxedJerkSpeedDecrease"]);
|
||||
FrogPilotButtonsControl *relaxedResetButton = static_cast<FrogPilotButtonsControl*>(toggles["ResetRelaxedPersonality"]);
|
||||
QObject::connect(relaxedResetButton, &FrogPilotButtonsControl::buttonClicked, this, [=]() {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("Are you sure you want to completely reset your settings for the 'Relaxed' personality?"), this)) {
|
||||
if (FrogPilotConfirmationDialog::yesorno(tr("您確定要完全重置「輕鬆」個性的設定嗎?"), this)) {
|
||||
params.putFloat("RelaxedFollow", 1.75);
|
||||
params.putFloat("RelaxedJerkAcceleration", 100);
|
||||
params.putFloat("RelaxedJerkDeceleration", 100);
|
||||
|
|
|
@ -29,7 +29,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
themeToggle = personalizeOpenpilotToggle;
|
||||
} else if (param == "CustomColors") {
|
||||
manageCustomColorsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageCustomColorsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatColorName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -85,8 +85,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
colorSchemesList.removeAll("Stock");
|
||||
colorSchemesList.removeAll(currentColor);
|
||||
|
||||
QString colorSchemeToDelete = MultiOptionDialog::getSelection(tr("Select a color scheme to delete"), colorSchemesList, "", this);
|
||||
if (!colorSchemeToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' color scheme?").arg(colorSchemeToDelete), tr("Delete"), this)) {
|
||||
QString colorSchemeToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的配色方案"), colorSchemesList, "", this);
|
||||
if (!colorSchemeToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 配色方案?").arg(colorSchemeToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
colorsDownloaded = false;
|
||||
|
||||
|
@ -124,14 +124,14 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableColors = QString::fromStdString(params.get("DownloadableColors")).split(",");
|
||||
QString colorSchemeToDownload = MultiOptionDialog::getSelection(tr("Select a color scheme to download"), downloadableColors, "", this);
|
||||
QString colorSchemeToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的配色方案"), downloadableColors, "", this);
|
||||
|
||||
if (!colorSchemeToDownload.isEmpty()) {
|
||||
device()->resetInteractiveTimeout(300);
|
||||
|
||||
QString convertedColorScheme = formatColorNameForStorage(colorSchemeToDownload);
|
||||
paramsMemory.put("ColorToDownload", convertedColorScheme.toStdString());
|
||||
downloadStatusLabel->setText("Downloading...");
|
||||
downloadStatusLabel->setText("正在下載...");
|
||||
paramsMemory.put("ThemeDownloadProgress", "Downloading...");
|
||||
colorDownloading = true;
|
||||
themeDownloading = true;
|
||||
|
@ -141,7 +141,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString colorSchemeToSelect = MultiOptionDialog::getSelection(tr("Select a color scheme"), availableColors, currentColor, this);
|
||||
QString colorSchemeToSelect = MultiOptionDialog::getSelection(tr("選擇配色方案"), availableColors, currentColor, this);
|
||||
if (!colorSchemeToSelect.isEmpty()) {
|
||||
params.put("CustomColors", formatColorNameForStorage(colorSchemeToSelect).toStdString());
|
||||
manageCustomColorsBtn->setValue(colorSchemeToSelect);
|
||||
|
@ -163,7 +163,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
manageCustomColorsBtn->setValue(currentColor);
|
||||
themeToggle = manageCustomColorsBtn;
|
||||
} else if (param == "CustomDistanceIcons") {
|
||||
manageDistanceIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageDistanceIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatIconName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -217,8 +217,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
iconPackList.removeAll("Stock");
|
||||
iconPackList.removeAll(currentDistanceIcon);
|
||||
|
||||
QString iconPackToDelete = MultiOptionDialog::getSelection(tr("Select an icon pack to delete"), iconPackList, "", this);
|
||||
if (!iconPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' icon pack?").arg(iconPackToDelete), tr("Delete"), this)) {
|
||||
QString iconPackToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的圖示包"), iconPackList, "", this);
|
||||
if (!iconPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 圖示包?").arg(iconPackToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
distanceIconsDownloaded = false;
|
||||
|
||||
|
@ -254,7 +254,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableIcons = QString::fromStdString(params.get("DownloadableDistanceIcons")).split(",");
|
||||
QString iconPackToDownload = MultiOptionDialog::getSelection(tr("Select an icon pack to download"), downloadableIcons, "", this);
|
||||
QString iconPackToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的圖示包"), downloadableIcons, "", this);
|
||||
|
||||
if (!iconPackToDownload.isEmpty()) {
|
||||
QString convertedIconPack = formatIconNameForStorage(iconPackToDownload);
|
||||
|
@ -269,7 +269,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString iconPackToSelect = MultiOptionDialog::getSelection(tr("Select an icon pack"), availableIcons, currentDistanceIcon, this);
|
||||
QString iconPackToSelect = MultiOptionDialog::getSelection(tr("選擇一個圖標包"), availableIcons, currentDistanceIcon, this);
|
||||
if (!iconPackToSelect.isEmpty()) {
|
||||
params.put("CustomDistanceIcons", formatIconNameForStorage(iconPackToSelect).toStdString());
|
||||
manageDistanceIconsBtn->setValue(iconPackToSelect);
|
||||
|
@ -291,7 +291,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
manageDistanceIconsBtn->setValue(currentDistanceIcon);
|
||||
themeToggle = reinterpret_cast<AbstractControl*>(manageDistanceIconsBtn);
|
||||
} else if (param == "CustomIcons") {
|
||||
manageCustomIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageCustomIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatIconName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -346,8 +346,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
customIconsList.removeAll("Stock");
|
||||
customIconsList.removeAll(currentIcon);
|
||||
|
||||
QString iconPackToDelete = MultiOptionDialog::getSelection(tr("Select an icon pack to delete"), customIconsList, "", this);
|
||||
if (!iconPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' icon pack?").arg(iconPackToDelete), tr("Delete"), this)) {
|
||||
QString iconPackToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的圖示包"), customIconsList, "", this);
|
||||
if (!iconPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 圖示包?").arg(iconPackToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
iconsDownloaded = false;
|
||||
|
||||
|
@ -385,7 +385,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableIcons = QString::fromStdString(params.get("DownloadableIcons")).split(",");
|
||||
QString iconPackToDownload = MultiOptionDialog::getSelection(tr("Select an icon pack to download"), downloadableIcons, "", this);
|
||||
QString iconPackToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的圖示包"), downloadableIcons, "", this);
|
||||
|
||||
if (!iconPackToDownload.isEmpty()) {
|
||||
device()->resetInteractiveTimeout(300);
|
||||
|
@ -402,7 +402,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString iconPackToSelect = MultiOptionDialog::getSelection(tr("Select an icon pack"), availableIcons, currentIcon, this);
|
||||
QString iconPackToSelect = MultiOptionDialog::getSelection(tr("選擇一個圖標包"), availableIcons, currentIcon, this);
|
||||
if (!iconPackToSelect.isEmpty()) {
|
||||
params.put("CustomIcons", formatIconNameForStorage(iconPackToSelect).toStdString());
|
||||
manageCustomIconsBtn->setValue(iconPackToSelect);
|
||||
|
@ -424,7 +424,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
manageCustomIconsBtn->setValue(currentIcon);
|
||||
themeToggle = manageCustomIconsBtn;
|
||||
} else if (param == "CustomSignals") {
|
||||
manageCustomSignalsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageCustomSignalsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatSignalName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -479,8 +479,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
customSignalsList.removeAll("Stock");
|
||||
customSignalsList.removeAll(currentSignal);
|
||||
|
||||
QString signalPackToDelete = MultiOptionDialog::getSelection(tr("Select a signal pack to delete"), customSignalsList, "", this);
|
||||
if (!signalPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' signal pack?").arg(signalPackToDelete), tr("Delete"), this)) {
|
||||
QString signalPackToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的訊號包"), customSignalsList, "", this);
|
||||
if (!signalPackToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 訊號包?").arg(signalPackToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
signalsDownloaded = false;
|
||||
|
||||
|
@ -518,7 +518,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableSignals = QString::fromStdString(params.get("DownloadableSignals")).split(",");
|
||||
QString signalPackToDownload = MultiOptionDialog::getSelection(tr("Select a signal pack to download"), downloadableSignals, "", this);
|
||||
QString signalPackToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的信號包"), downloadableSignals, "", this);
|
||||
|
||||
if (!signalPackToDownload.isEmpty()) {
|
||||
device()->resetInteractiveTimeout(300);
|
||||
|
@ -535,7 +535,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString signalPackToSelect = MultiOptionDialog::getSelection(tr("Select a signal pack"), availableSignals, currentSignal, this);
|
||||
QString signalPackToSelect = MultiOptionDialog::getSelection(tr("選擇訊號包"), availableSignals, currentSignal, this);
|
||||
if (!signalPackToSelect.isEmpty()) {
|
||||
params.put("CustomSignals", formatSignalNameForStorage(signalPackToSelect).toStdString());
|
||||
manageCustomSignalsBtn->setValue(signalPackToSelect);
|
||||
|
@ -557,7 +557,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
manageCustomSignalsBtn->setValue(currentSignal);
|
||||
themeToggle = manageCustomSignalsBtn;
|
||||
} else if (param == "CustomSounds") {
|
||||
manageCustomSoundsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageCustomSoundsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatSoundName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -612,8 +612,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
customSoundsList.removeAll("Stock");
|
||||
customSoundsList.removeAll(currentSound);
|
||||
|
||||
QString soundSchemeToDelete = MultiOptionDialog::getSelection(tr("Select a sound pack to delete"), customSoundsList, "", this);
|
||||
if (!soundSchemeToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' sound scheme?").arg(soundSchemeToDelete), tr("Delete"), this)) {
|
||||
QString soundSchemeToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的聲音包"), customSoundsList, "", this);
|
||||
if (!soundSchemeToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 聲音方案?").arg(soundSchemeToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
soundsDownloaded = false;
|
||||
|
||||
|
@ -651,7 +651,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableSounds = QString::fromStdString(params.get("DownloadableSounds")).split(",");
|
||||
QString soundSchemeToDownload = MultiOptionDialog::getSelection(tr("Select a sound pack to download"), downloadableSounds, "", this);
|
||||
QString soundSchemeToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的聲音包"), downloadableSounds, "", this);
|
||||
|
||||
if (!soundSchemeToDownload.isEmpty()) {
|
||||
device()->resetInteractiveTimeout(300);
|
||||
|
@ -668,7 +668,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString soundSchemeToSelect = MultiOptionDialog::getSelection(tr("Select a sound scheme"), availableSounds, currentSound, this);
|
||||
QString soundSchemeToSelect = MultiOptionDialog::getSelection(tr("選擇聲音方案"), availableSounds, currentSound, this);
|
||||
if (!soundSchemeToSelect.isEmpty()) {
|
||||
params.put("CustomSounds", formatSoundNameForStorage(soundSchemeToSelect).toStdString());
|
||||
manageCustomSoundsBtn->setValue(soundSchemeToSelect);
|
||||
|
@ -690,7 +690,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
manageCustomSoundsBtn->setValue(currentSound);
|
||||
themeToggle = manageCustomSoundsBtn;
|
||||
} else if (param == "WheelIcon") {
|
||||
manageWheelIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("DELETE"), tr("DOWNLOAD"), tr("SELECT")});
|
||||
manageWheelIconsBtn = new FrogPilotButtonsControl(title, desc, {tr("刪除"), tr("下載"), tr("選擇")});
|
||||
|
||||
std::function<QString(QString)> formatWheelName = [](QString name) -> QString {
|
||||
QChar separator = name.contains('_') ? '_' : '-';
|
||||
|
@ -748,8 +748,8 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
steeringWheelList.removeAll("Stock");
|
||||
steeringWheelList.removeAll(currentWheel);
|
||||
|
||||
QString imageToDelete = MultiOptionDialog::getSelection(tr("Select a steering wheel to delete"), steeringWheelList, "", this);
|
||||
if (!imageToDelete.isEmpty() && ConfirmationDialog::confirm(tr("Are you sure you want to delete the '%1' steering wheel image?").arg(imageToDelete), tr("Delete"), this)) {
|
||||
QString imageToDelete = MultiOptionDialog::getSelection(tr("選擇要刪除的方向盤"), steeringWheelList, "", this);
|
||||
if (!imageToDelete.isEmpty() && ConfirmationDialog::confirm(tr("您確定要刪除 '%1' 方向盤影像?").arg(imageToDelete), tr("刪除"), this)) {
|
||||
themeDeleting = true;
|
||||
wheelsDownloaded = false;
|
||||
|
||||
|
@ -784,7 +784,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
});
|
||||
} else {
|
||||
QStringList downloadableWheels = QString::fromStdString(params.get("DownloadableWheels")).split(",");
|
||||
QString wheelToDownload = MultiOptionDialog::getSelection(tr("Select a steering wheel to download"), downloadableWheels, "", this);
|
||||
QString wheelToDownload = MultiOptionDialog::getSelection(tr("選擇要下載的方向盤"), downloadableWheels, "", this);
|
||||
|
||||
if (!wheelToDownload.isEmpty()) {
|
||||
device()->resetInteractiveTimeout(300);
|
||||
|
@ -801,7 +801,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
}
|
||||
}
|
||||
} else if (id == 2) {
|
||||
QString imageToSelect = MultiOptionDialog::getSelection(tr("Select a steering wheel"), availableWheels, currentWheel, this);
|
||||
QString imageToSelect = MultiOptionDialog::getSelection(tr("選擇方向盤"), availableWheels, currentWheel, this);
|
||||
if (!imageToSelect.isEmpty()) {
|
||||
params.put("WheelIcon", formatWheelNameForStorage(imageToSelect).toStdString());
|
||||
manageWheelIconsBtn->setValue(imageToSelect);
|
||||
|
@ -826,7 +826,7 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
downloadStatusLabel = new LabelControl(title, "Idle");
|
||||
themeToggle = reinterpret_cast<AbstractControl*>(downloadStatusLabel);
|
||||
} else if (param == "StartupAlert") {
|
||||
FrogPilotButtonsControl *startupAlertButton = new FrogPilotButtonsControl(title, desc, {tr("STOCK"), tr("FROGPILOT"), tr("CUSTOM"), tr("CLEAR")}, false, true, icon);
|
||||
FrogPilotButtonsControl *startupAlertButton = new FrogPilotButtonsControl(title, desc, {tr("原始"), tr("FROGPILOT"), tr("CUSTOM"), tr("清除")}, false, true, icon);
|
||||
QObject::connect(startupAlertButton, &FrogPilotButtonsControl::buttonClicked, [=](int id) {
|
||||
int maxLengthTop = 35;
|
||||
int maxLengthBottom = 45;
|
||||
|
@ -847,10 +847,10 @@ FrogPilotThemesPanel::FrogPilotThemesPanel(FrogPilotSettingsWindow *parent) : Fr
|
|||
params.put("StartupMessageTop", frogpilotTop.toStdString());
|
||||
params.put("StartupMessageBottom", frogpilotBottom.toStdString());
|
||||
} else if (id == 2) {
|
||||
QString newTop = InputDialog::getText(tr("Enter the text for the top half"), this, tr("Characters: 0/%1").arg(maxLengthTop), false, -1, currentTop, maxLengthTop).trimmed();
|
||||
QString newTop = InputDialog::getText(tr("輸入上半部的文字"), this, tr("字串: 0/%1").arg(maxLengthTop), false, -1, currentTop, maxLengthTop).trimmed();
|
||||
if (newTop.length() > 0) {
|
||||
params.putNonBlocking("StartupMessageTop", newTop.toStdString());
|
||||
QString newBottom = InputDialog::getText(tr("Enter the text for the bottom half"), this, tr("Characters: 0/%1").arg(maxLengthBottom), false, -1, currentBottom, maxLengthBottom).trimmed();
|
||||
QString newBottom = InputDialog::getText(tr("輸入下半部的文字"), this, tr("字串: 0/%1").arg(maxLengthBottom), false, -1, currentBottom, maxLengthBottom).trimmed();
|
||||
if (newBottom.length() > 0) {
|
||||
params.putNonBlocking("StartupMessageBottom", newBottom.toStdString());
|
||||
}
|
||||
|
@ -946,32 +946,32 @@ void FrogPilotThemesPanel::updateState(const UIState &s) {
|
|||
}
|
||||
}
|
||||
|
||||
manageCustomColorsBtn->setText(1, colorDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageCustomColorsBtn->setText(1, colorDownloading ? tr("取消") : tr("下載"));
|
||||
manageCustomColorsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageCustomColorsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || colorDownloading) && !cancellingDownload && !themeDeleting && !colorsDownloaded);
|
||||
manageCustomColorsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
||||
manageCustomIconsBtn->setText(1, iconDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageCustomIconsBtn->setText(1, iconDownloading ? tr("取消") : tr("下載"));
|
||||
manageCustomIconsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageCustomIconsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || iconDownloading) && !cancellingDownload && !themeDeleting && !iconsDownloaded);
|
||||
manageCustomIconsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
||||
manageCustomSignalsBtn->setText(1, signalDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageCustomSignalsBtn->setText(1, signalDownloading ? tr("取消") : tr("下載"));
|
||||
manageCustomSignalsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageCustomSignalsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || signalDownloading) && !cancellingDownload && !themeDeleting && !signalsDownloaded);
|
||||
manageCustomSignalsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
||||
manageCustomSoundsBtn->setText(1, soundDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageCustomSoundsBtn->setText(1, soundDownloading ? tr("取消") : tr("下載"));
|
||||
manageCustomSoundsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageCustomSoundsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || soundDownloading) && !cancellingDownload && !themeDeleting && !soundsDownloaded);
|
||||
manageCustomSoundsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
||||
manageDistanceIconsBtn->setText(1, distanceIconDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageDistanceIconsBtn->setText(1, distanceIconDownloading ? tr("取消") : tr("下載"));
|
||||
manageDistanceIconsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageDistanceIconsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || distanceIconDownloading) && !cancellingDownload && !themeDeleting && !distanceIconsDownloaded);
|
||||
manageDistanceIconsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
||||
manageWheelIconsBtn->setText(1, wheelDownloading ? tr("CANCEL") : tr("DOWNLOAD"));
|
||||
manageWheelIconsBtn->setText(1, wheelDownloading ? tr("取消") : tr("下載"));
|
||||
manageWheelIconsBtn->setEnabledButtons(0, !themeDeleting && !themeDownloading);
|
||||
manageWheelIconsBtn->setEnabledButtons(1, s.scene.online && (!themeDownloading || wheelDownloading) && !cancellingDownload && !themeDeleting && !wheelsDownloaded);
|
||||
manageWheelIconsBtn->setEnabledButtons(2, !themeDeleting && !themeDownloading);
|
||||
|
|
|
@ -77,7 +77,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
});
|
||||
visualToggle = qolToggle;
|
||||
} else if (param == "CameraView") {
|
||||
std::vector<QString> cameraOptions{tr("Auto"), tr("Driver"), tr("Standard"), tr("Wide")};
|
||||
std::vector<QString> cameraOptions{tr("自動"), tr("駕駛"), tr("標準"), tr("廣角")};
|
||||
ButtonParamControl *preferredCamera = new ButtonParamControl(param, title, desc, icon, cameraOptions);
|
||||
visualToggle = preferredCamera;
|
||||
|
||||
|
@ -112,22 +112,22 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
visualToggle = developerUIToggle;
|
||||
} else if (param == "BorderMetrics") {
|
||||
std::vector<QString> borderToggles{"BlindSpotMetrics", "ShowSteering", "SignalMetrics"};
|
||||
std::vector<QString> borderToggleNames{tr("Blind Spot"), tr("Steering Torque"), tr("Turn Signal")};
|
||||
std::vector<QString> borderToggleNames{tr("盲點"), tr("轉向扭矩"), tr("轉向訊號")};
|
||||
borderMetricsBtn = new FrogPilotButtonToggleControl(param, title, desc, borderToggles, borderToggleNames);
|
||||
visualToggle = borderMetricsBtn;
|
||||
} else if (param == "LateralMetrics") {
|
||||
std::vector<QString> lateralToggles{"AdjacentPathMetrics", "TuningInfo"};
|
||||
std::vector<QString> lateralToggleNames{tr("Adjacent Path Metrics"), tr("Auto Tune")};
|
||||
std::vector<QString> lateralToggleNames{tr("相鄰路徑距離"), tr("Auto Tune")};
|
||||
lateralMetricsBtn = new FrogPilotButtonToggleControl(param, title, desc, lateralToggles, lateralToggleNames);
|
||||
visualToggle = lateralMetricsBtn;
|
||||
} else if (param == "LongitudinalMetrics") {
|
||||
std::vector<QString> longitudinalToggles{"AdjacentLeadsUI", "LeadInfo", "JerkInfo"};
|
||||
std::vector<QString> longitudinalToggleNames{tr("Adjacent Leads"), tr("Lead Info"), tr("Jerk Values")};
|
||||
std::vector<QString> longitudinalToggleNames{tr("前車功能"), tr("前車訊息"), tr("Jerk Values")};
|
||||
longitudinalMetricsBtn = new FrogPilotButtonToggleControl(param, title, desc, longitudinalToggles, longitudinalToggleNames);
|
||||
visualToggle = longitudinalMetricsBtn;
|
||||
} else if (param == "NumericalTemp") {
|
||||
std::vector<QString> temperatureToggles{"Fahrenheit"};
|
||||
std::vector<QString> temperatureToggleNames{tr("Fahrenheit")};
|
||||
std::vector<QString> temperatureToggleNames{tr("華氏度")};
|
||||
visualToggle = new FrogPilotButtonToggleControl(param, title, desc, temperatureToggles, temperatureToggleNames);
|
||||
} else if (param == "SidebarMetrics") {
|
||||
std::vector<QString> sidebarMetricsToggles{"ShowCPU", "ShowGPU", "ShowIP", "ShowMemoryUsage", "ShowStorageLeft", "ShowStorageUsed"};
|
||||
|
@ -165,14 +165,14 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
});
|
||||
visualToggle = modelUIToggle;
|
||||
} else if (param == "LaneLinesWidth" || param == "RoadEdgesWidth") {
|
||||
visualToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 24, tr(" inches"));
|
||||
visualToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 24, tr(" 英吋"));
|
||||
} else if (param == "PathEdgeWidth") {
|
||||
visualToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 100, tr("%"));
|
||||
} else if (param == "PathWidth") {
|
||||
visualToggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 10, tr(" feet"), std::map<int, QString>(), 0.1);
|
||||
} else if (param == "ShowStoppingPoint") {
|
||||
std::vector<QString> stoppingPointToggles{"ShowStoppingPointMetrics"};
|
||||
std::vector<QString> stoppingPointToggleNames{tr("Show Distance")};
|
||||
std::vector<QString> stoppingPointToggleNames{tr("顯示距離")};
|
||||
visualToggle = new FrogPilotButtonToggleControl(param, title, desc, stoppingPointToggles, stoppingPointToggleNames);
|
||||
|
||||
} else if (param == "NavigationUI") {
|
||||
|
@ -196,7 +196,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
visualToggle = customUIToggle;
|
||||
} else if (param == "BigMap") {
|
||||
std::vector<QString> mapToggles{"FullMap"};
|
||||
std::vector<QString> mapToggleNames{tr("Full Map")};
|
||||
std::vector<QString> mapToggleNames{tr("完整地圖")};
|
||||
visualToggle = new FrogPilotButtonToggleControl(param, title, desc, mapToggles, mapToggleNames);
|
||||
} else if (param == "MapStyle") {
|
||||
QMap<int, QString> styleMap {
|
||||
|
@ -210,12 +210,13 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
{7, tr("Mapbox Navigation Day")},
|
||||
{8, tr("Mapbox Navigation Night")},
|
||||
{9, tr("Mapbox Traffic Night")},
|
||||
{10, tr("mike854's (Satellite hybrid)")}
|
||||
{10, tr("mike854's (Satellite hybrid)")},
|
||||
{11, tr("huifan's (街道)")}
|
||||
};
|
||||
|
||||
ButtonControl *mapStyleButton = new ButtonControl(title, tr("SELECT"), desc);
|
||||
ButtonControl *mapStyleButton = new ButtonControl(title, tr("選擇"), desc);
|
||||
QObject::connect(mapStyleButton, &ButtonControl::clicked, [this, mapStyleButton, styleMap]() {
|
||||
QString selection = MultiOptionDialog::getSelection(tr("Select a map style"), styleMap.values(), "", this);
|
||||
QString selection = MultiOptionDialog::getSelection(tr("選擇地圖樣式"), styleMap.values(), "", this);
|
||||
if (!selection.isEmpty()) {
|
||||
int selectedStyle = styleMap.key(selection);
|
||||
params.putInt("MapStyle", selectedStyle);
|
||||
|
@ -251,7 +252,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(FrogPilotSettingsWindow *parent) :
|
|||
visualToggle = customUIToggle;
|
||||
} else if (param == "PedalsOnUI") {
|
||||
std::vector<QString> pedalsToggles{"DynamicPedalsOnUI", "StaticPedalsOnUI"};
|
||||
std::vector<QString> pedalsToggleNames{tr("Dynamic"), tr("Static")};
|
||||
std::vector<QString> pedalsToggleNames{tr("動態"), tr("固定")};
|
||||
FrogPilotButtonToggleControl *pedalsToggle = new FrogPilotButtonToggleControl(param, title, desc, pedalsToggles, pedalsToggleNames, true);
|
||||
QObject::connect(pedalsToggle, &FrogPilotButtonToggleControl::buttonClicked, [this](int index) {
|
||||
if (index == 0) {
|
||||
|
@ -325,19 +326,19 @@ void FrogPilotVisualsPanel::updateMetric() {
|
|||
FrogPilotParamValueControl *roadEdgesWidthToggle = static_cast<FrogPilotParamValueControl*>(toggles["RoadEdgesWidth"]);
|
||||
|
||||
if (isMetric) {
|
||||
laneLinesWidthToggle->setDescription(tr("Adjust how thick the lane lines appear on the display.\n\nDefault matches the Vienna standard of 10 centimeters."));
|
||||
roadEdgesWidthToggle->setDescription(tr("Adjust how thick the road edges appear on the display.\n\nDefault matches half of the Vienna standard of 10 centimeters."));
|
||||
laneLinesWidthToggle->setDescription(tr("調整顯示器上車道線的粗細程度.\n\n預設符合維也納標準 10 厘米."));
|
||||
roadEdgesWidthToggle->setDescription(tr("調整道路邊緣在顯示幕上顯示的厚度.\n\n預設值符合維也納標準 10 公分的一半."));
|
||||
|
||||
laneLinesWidthToggle->updateControl(0, 60, tr(" centimeters"));
|
||||
roadEdgesWidthToggle->updateControl(0, 60, tr(" centimeters"));
|
||||
laneLinesWidthToggle->updateControl(0, 60, tr(" 公分"));
|
||||
roadEdgesWidthToggle->updateControl(0, 60, tr(" 公分"));
|
||||
|
||||
pathWidthToggle->updateControl(0, 3, tr(" meters"));
|
||||
pathWidthToggle->updateControl(0, 3, tr(" 公尺"));
|
||||
} else {
|
||||
laneLinesWidthToggle->setDescription(tr("Adjust how thick the lane lines appear on the display.\n\nDefault matches the MUTCD standard of 4 inches."));
|
||||
roadEdgesWidthToggle->setDescription(tr("Adjust how thick the road edges appear on the display.\n\nDefault matches half of the MUTCD standard of 4 inches."));
|
||||
laneLinesWidthToggle->setDescription(tr("調整顯示器上車道線的粗細程度.\n\n預設符合MUTCD標準4英寸."));
|
||||
roadEdgesWidthToggle->setDescription(tr("調整道路邊緣在顯示幕上顯示的厚度.\n\n預設匹配 4 英寸 MUTCD 標準的一半."));
|
||||
|
||||
laneLinesWidthToggle->updateControl(0, 24, tr(" inches"));
|
||||
roadEdgesWidthToggle->updateControl(0, 24, tr(" inches"));
|
||||
laneLinesWidthToggle->updateControl(0, 24, tr(" 英吋"));
|
||||
roadEdgesWidthToggle->updateControl(0, 24, tr(" 英吋"));
|
||||
|
||||
pathWidthToggle->updateControl(0, 10, tr(" feet"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue