You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
6 months ago
|
#include <QDebug>
|
||
|
|
||
|
#include "selfdrive/ui/qt/offroad/developer_panel.h"
|
||
|
#include "selfdrive/ui/qt/widgets/ssh_keys.h"
|
||
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
||
|
|
||
|
DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) {
|
||
|
// SSH keys
|
||
|
addItem(new SshToggle());
|
||
|
addItem(new SshControl());
|
||
|
|
||
|
joystickToggle = new ParamControl("JoystickDebugMode", tr("Joystick Debug Mode"), "", "");
|
||
|
QObject::connect(joystickToggle, &ParamControl::toggleFlipped, [=](bool state) {
|
||
|
params.putBool("LongitudinalManeuverMode", false);
|
||
|
longManeuverToggle->refresh();
|
||
|
});
|
||
|
addItem(joystickToggle);
|
||
|
|
||
|
longManeuverToggle = new ParamControl("LongitudinalManeuverMode", tr("Longitudinal Maneuver Mode"), "", "");
|
||
|
QObject::connect(longManeuverToggle, &ParamControl::toggleFlipped, [=](bool state) {
|
||
|
params.putBool("JoystickDebugMode", false);
|
||
|
joystickToggle->refresh();
|
||
|
});
|
||
|
addItem(longManeuverToggle);
|
||
|
|
||
|
// 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");
|
||
|
QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) {
|
||
|
for (auto btn : findChildren<ParamControl *>()) {
|
||
|
btn->setVisible(!is_release);
|
||
|
btn->setEnabled(offroad);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|