mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-29 12:53:42 +08:00
show it in UI!
This commit is contained in:
@@ -38,10 +38,12 @@ enum class SpeedLimitMode {
|
||||
OFF,
|
||||
INFORMATION,
|
||||
WARNING,
|
||||
ASSIST,
|
||||
};
|
||||
|
||||
inline const QString SpeedLimitModeTexts[]{
|
||||
QObject::tr("Off"),
|
||||
QObject::tr("Information"),
|
||||
QObject::tr("Warning"),
|
||||
QObject::tr("Assist"),
|
||||
};
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ SpeedLimitSettings::SpeedLimitSettings(QWidget *parent) : QStackedWidget(parent)
|
||||
SpeedLimitModeTexts[static_cast<int>(SpeedLimitMode::OFF)],
|
||||
SpeedLimitModeTexts[static_cast<int>(SpeedLimitMode::INFORMATION)],
|
||||
SpeedLimitModeTexts[static_cast<int>(SpeedLimitMode::WARNING)],
|
||||
SpeedLimitModeTexts[static_cast<int>(SpeedLimitMode::ASSIST)],
|
||||
};
|
||||
speed_limit_mode_settings = new ButtonParamControlSP(
|
||||
"SpeedLimitMode",
|
||||
|
||||
+6
-2
@@ -56,8 +56,11 @@ private:
|
||||
QString off_str = tr("⦿ Off: Disables the Speed Limit functions.");
|
||||
QString info_str = tr("⦿ Information: Displays the current road's speed limit.");
|
||||
QString warning_str = tr("⦿ Warning: Provides a warning when exceeding the current road's speed limit.");
|
||||
QString assist_str = tr("⦿ Assist: Adjusts the vehicle's cruise speed based on the current road's speed limit when operating the +/- buttons.");
|
||||
|
||||
if (mode == SpeedLimitMode::WARNING) {
|
||||
if (mode == SpeedLimitMode::ASSIST) {
|
||||
assist_str = "<font color='white'><b>" + assist_str + "</b></font>";
|
||||
} else if (mode == SpeedLimitMode::WARNING) {
|
||||
warning_str = "<font color='white'><b>" + warning_str + "</b></font>";
|
||||
} else if (mode == SpeedLimitMode::INFORMATION) {
|
||||
info_str = "<font color='white'><b>" + info_str + "</b></font>";
|
||||
@@ -68,6 +71,7 @@ private:
|
||||
return QString("%1<br>%2<br>%3")
|
||||
.arg(off_str)
|
||||
.arg(info_str)
|
||||
.arg(warning_str);
|
||||
.arg(warning_str)
|
||||
.arg(assist_str);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user