|
|
|
@ -91,14 +91,9 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
|
std::vector<QString> longi_button_texts{tr("Aggressive"), tr("Standard"), tr("Relaxed")}; |
|
|
|
|
long_personality_setting = new ButtonParamControl("LongitudinalPersonality", tr("Driving Personality"), |
|
|
|
|
tr("Standard is recommended. In aggressive mode, openpilot will follow lead cars closer and be more aggressive with the gas and brake. " |
|
|
|
|
"In relaxed mode openpilot will stay further away from lead cars. On supported cars, you can cycle through these personalities with " |
|
|
|
|
"your steering wheel distance button."), |
|
|
|
|
"In relaxed mode openpilot will stay further away from lead cars."), |
|
|
|
|
"../assets/offroad/icon_speed_limit.png", |
|
|
|
|
longi_button_texts); |
|
|
|
|
|
|
|
|
|
// set up uiState update for personality setting
|
|
|
|
|
QObject::connect(uiState(), &UIState::uiUpdate, this, &TogglesPanel::updateState); |
|
|
|
|
|
|
|
|
|
for (auto &[param, title, desc, icon] : toggle_defs) { |
|
|
|
|
auto toggle = new ParamControl(param, title, desc, icon, this); |
|
|
|
|
|
|
|
|
@ -124,18 +119,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TogglesPanel::updateState(const UIState &s) { |
|
|
|
|
const SubMaster &sm = *(s.sm); |
|
|
|
|
|
|
|
|
|
if (sm.updated("controlsState")) { |
|
|
|
|
auto personality = sm["controlsState"].getControlsState().getPersonality(); |
|
|
|
|
if (personality != s.scene.personality && s.scene.started && isVisible()) { |
|
|
|
|
long_personality_setting->setCheckedButton(static_cast<int>(personality)); |
|
|
|
|
} |
|
|
|
|
uiState()->scene.personality = personality; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TogglesPanel::expandToggleDescription(const QString ¶m) { |
|
|
|
|
toggles[param.toStdString()]->showDescription(); |
|
|
|
|
} |
|
|
|
|