Add Developer Panel in Settings (#33828)
* hello world * hello btn * add ssh toggles * split out developer panel code * test this * fix * add ZMQ button * add developer panel case to bot autogen screenshots * give up bridge * fix CI (generate screenshots) * change from btn to toggles and interlock protection * duplicated --------- Co-authored-by: Comma Device <device@comma.ai>pull/33877/head
parent
1570aa7961
commit
72a88c9319
18 changed files with 226 additions and 7 deletions
@ -0,0 +1,36 @@ |
|||||||
|
#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); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "selfdrive/ui/qt/offroad/settings.h" |
||||||
|
|
||||||
|
class DeveloperPanel : public ListWidget { |
||||||
|
Q_OBJECT |
||||||
|
public: |
||||||
|
explicit DeveloperPanel(SettingsWindow *parent); |
||||||
|
|
||||||
|
private: |
||||||
|
Params params; |
||||||
|
ParamControl* joystickToggle; |
||||||
|
ParamControl* longManeuverToggle; |
||||||
|
}; |
Loading…
Reference in new issue