mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 11:32:21 +08:00
72a88c9319
* 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>
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
#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);
|
|
}
|
|
});
|
|
|
|
}
|