|
|
@ -3,6 +3,7 @@ |
|
|
|
#include "selfdrive/ui/qt/offroad/developer_panel.h" |
|
|
|
#include "selfdrive/ui/qt/offroad/developer_panel.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/ssh_keys.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/ssh_keys.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/controls.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/controls.h" |
|
|
|
|
|
|
|
#include "common/util.h" |
|
|
|
|
|
|
|
|
|
|
|
DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
// SSH keys
|
|
|
|
// SSH keys
|
|
|
@ -31,13 +32,16 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
alphaLongToggle->setConfirmation(true, false); |
|
|
|
alphaLongToggle->setConfirmation(true, false); |
|
|
|
|
|
|
|
|
|
|
|
// Joystick and longitudinal maneuvers should be hidden on release branches
|
|
|
|
// Joystick and longitudinal maneuvers should be hidden on release branches
|
|
|
|
// also the toggles should be not available to change in onroad state
|
|
|
|
|
|
|
|
const bool is_release = params.getBool("IsReleaseBranch"); |
|
|
|
const bool is_release = params.getBool("IsReleaseBranch"); |
|
|
|
QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { |
|
|
|
|
|
|
|
for (auto btn : findChildren<ParamControl *>()) { |
|
|
|
for (auto btn : findChildren<ParamControl *>()) { |
|
|
|
if (btn != alphaLongToggle) { |
|
|
|
if (btn != alphaLongToggle) { |
|
|
|
btn->setVisible(!is_release); |
|
|
|
btn->setVisible(!is_release); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Toggles should be not available to change in onroad state
|
|
|
|
|
|
|
|
QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { |
|
|
|
|
|
|
|
for (auto btn : findChildren<ParamControl *>()) { |
|
|
|
btn->setEnabled(offroad); |
|
|
|
btn->setEnabled(offroad); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -73,8 +77,12 @@ void DeveloperPanel::updateToggles() { |
|
|
|
if (CP.getOpenpilotLongitudinalControl()) { |
|
|
|
if (CP.getOpenpilotLongitudinalControl()) { |
|
|
|
alphaLongToggle->setVisible(false); |
|
|
|
alphaLongToggle->setVisible(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
alphaLongToggle->refresh(); |
|
|
|
alphaLongToggle->refresh(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// longManeuverToggle should not be toggable if the car don't have longitudinal control
|
|
|
|
|
|
|
|
if (!hasLongitudinalControl(CP)) { |
|
|
|
|
|
|
|
longManeuverToggle->setEnabled(false); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
alphaLongToggle->setDescription("<b>" + tr("openpilot longitudinal control may come in a future update.") + "</b>"); |
|
|
|
alphaLongToggle->setDescription("<b>" + tr("openpilot longitudinal control may come in a future update.") + "</b>"); |
|
|
|
alphaLongToggle->setEnabled(false); |
|
|
|
alphaLongToggle->setEnabled(false); |
|
|
|