show all toggles
This commit is contained in:
Binary file not shown.
@@ -113,6 +113,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
||||
{"RecordFrontLock", {PERSISTENT, BOOL}}, // for the internal fleet
|
||||
{"SecOCKey", {PERSISTENT | DONT_LOG, STRING}},
|
||||
{"ShowDebugInfo", {PERSISTENT, BOOL}},
|
||||
{"ShowAllToggles", {PERSISTENT, BOOL, "0", "0", 3}},
|
||||
{"UsePrebuilt", {PERSISTENT, BOOL, "1"}},
|
||||
{"RouteCount", {PERSISTENT, INT, "0"}},
|
||||
{"SnoozeUpdate", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}},
|
||||
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-ac4cec2e-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-3d8af236-DEBUG";
|
||||
|
||||
@@ -1 +1 @@
|
||||
DEV-ac4cec2e-DEBUG
|
||||
DEV-3d8af236-DEBUG
|
||||
Binary file not shown.
@@ -22,6 +22,14 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : QFrame(parent) {
|
||||
tr("When enabled (default), the device skips source compilation on boot if a prebuilt artifact exists. Disable this if you plan to edit code and rebuild on-device."), "");
|
||||
mainList->addItem(usePrebuiltToggle);
|
||||
|
||||
auto *showAllToggles = new ParamControl("ShowAllToggles", tr("Show All Toggles"),
|
||||
tr("<b>Show every toggle</b> in Settings and StarPilot, even when it would normally be hidden by tuning level, car support, or related feature gating."), "");
|
||||
QObject::connect(showAllToggles, &ParamControl::toggleFlipped, [this](bool) {
|
||||
updateToggles(offroad);
|
||||
emit showAllTogglesChanged();
|
||||
});
|
||||
mainList->addItem(showAllToggles);
|
||||
|
||||
// SSH keys
|
||||
mainList->addItem(new SshToggle());
|
||||
mainList->addItem(new SshControl());
|
||||
@@ -260,8 +268,10 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : QFrame(parent) {
|
||||
}
|
||||
|
||||
void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
const bool showAllToggles = params.getBool("ShowAllToggles");
|
||||
|
||||
for (auto btn : findChildren<ParamControl *>()) {
|
||||
btn->setVisible(!is_release);
|
||||
btn->setVisible(showAllToggles || !is_release);
|
||||
|
||||
/*
|
||||
* experimentalLongitudinalToggle should be toggelable when:
|
||||
@@ -291,9 +301,11 @@ void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
capnp::FlatArrayMessageReader cmsg(aligned_buf.align(cp_bytes.data(), cp_bytes.size()));
|
||||
cereal::CarParams::Reader CP = cmsg.getRoot<cereal::CarParams>();
|
||||
|
||||
if (!CP.getAlphaLongitudinalAvailable() || is_release) {
|
||||
if ((!CP.getAlphaLongitudinalAvailable() || is_release) && !showAllToggles) {
|
||||
params.remove("AlphaLongitudinalEnabled");
|
||||
experimentalLongitudinalToggle->setEnabled(false);
|
||||
} else {
|
||||
experimentalLongitudinalToggle->setEnabled(true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -301,18 +313,19 @@ void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
* - is not a release branch, and
|
||||
* - the car supports experimental longitudinal control (alpha)
|
||||
*/
|
||||
experimentalLongitudinalToggle->setVisible(CP.getAlphaLongitudinalAvailable() && !is_release);
|
||||
experimentalLongitudinalToggle->setVisible(showAllToggles || (CP.getAlphaLongitudinalAvailable() && !is_release));
|
||||
|
||||
longManeuverToggle->setEnabled(hasLongitudinalControl(CP) && _offroad);
|
||||
longManeuverToggle->setEnabled((showAllToggles || hasLongitudinalControl(CP)) && _offroad);
|
||||
|
||||
// StarPilot variables
|
||||
hasOpenpilotLongitudinal = hasLongitudinalControl(CP);
|
||||
hasRadar = !CP.getRadarUnavailable();
|
||||
|
||||
borderMetricsButton->setVisibleButton(0, CP.getEnableBsm());
|
||||
borderMetricsButton->setVisibleButton(0, showAllToggles || CP.getEnableBsm());
|
||||
} else {
|
||||
longManeuverToggle->setEnabled(false);
|
||||
experimentalLongitudinalToggle->setVisible(false);
|
||||
longManeuverToggle->setEnabled(showAllToggles && _offroad);
|
||||
experimentalLongitudinalToggle->setEnabled(showAllToggles);
|
||||
experimentalLongitudinalToggle->setVisible(showAllToggles);
|
||||
}
|
||||
experimentalLongitudinalToggle->refresh();
|
||||
|
||||
@@ -323,7 +336,7 @@ void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,18 +345,20 @@ void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = tuningLevel >= starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || tuningLevel >= starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "AdjacentLeadsUI") {
|
||||
setVisible &= hasRadar && !(params.getBool("AdvancedCustomUI") && params.getBool("HideLeadMarker"));
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (key == "AdjacentLeadsUI") {
|
||||
setVisible &= hasRadar && !(params.getBool("AdvancedCustomUI") && params.getBool("HideLeadMarker"));
|
||||
}
|
||||
|
||||
else if (key == "RadarTracksUI") {
|
||||
setVisible &= hasRadar;
|
||||
}
|
||||
else if (key == "RadarTracksUI") {
|
||||
setVisible &= hasRadar;
|
||||
}
|
||||
|
||||
else if (key == "ShowStoppingPoint") {
|
||||
setVisible &= hasOpenpilotLongitudinal;
|
||||
else if (key == "ShowStoppingPoint") {
|
||||
setVisible &= hasOpenpilotLongitudinal;
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
@@ -361,9 +376,9 @@ void DeveloperPanel::updateToggles(bool _offroad) {
|
||||
}
|
||||
}
|
||||
|
||||
borderMetricsButton->setVisibleButton(0, hasBSM);
|
||||
borderMetricsButton->setVisibleButton(0, showAllToggles || hasBSM);
|
||||
|
||||
developerUIToggle->setVisible(tuningLevel >= starpilotToggleLevels["DeveloperUI"].toDouble());
|
||||
developerUIToggle->setVisible(showAllToggles || tuningLevel >= starpilotToggleLevels["DeveloperUI"].toDouble());
|
||||
|
||||
openDescriptions(forceOpenDescriptions, toggles);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ public:
|
||||
signals:
|
||||
void openSubPanel();
|
||||
void openSubSubPanel();
|
||||
void showAllTogglesChanged();
|
||||
|
||||
private:
|
||||
Params params;
|
||||
|
||||
@@ -21,8 +21,8 @@ QT_BEGIN_MOC_NAMESPACE
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
struct qt_meta_stringdata_DeveloperPanel_t {
|
||||
QByteArrayData data[6];
|
||||
char stringdata0[68];
|
||||
QByteArrayData data[7];
|
||||
char stringdata0[90];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||
@@ -35,12 +35,14 @@ QT_MOC_LITERAL(0, 0, 14), // "DeveloperPanel"
|
||||
QT_MOC_LITERAL(1, 15, 12), // "openSubPanel"
|
||||
QT_MOC_LITERAL(2, 28, 0), // ""
|
||||
QT_MOC_LITERAL(3, 29, 15), // "openSubSubPanel"
|
||||
QT_MOC_LITERAL(4, 45, 13), // "updateToggles"
|
||||
QT_MOC_LITERAL(5, 59, 8) // "_offroad"
|
||||
QT_MOC_LITERAL(4, 45, 21), // "showAllTogglesChanged"
|
||||
QT_MOC_LITERAL(5, 67, 13), // "updateToggles"
|
||||
QT_MOC_LITERAL(6, 81, 8) // "_offroad"
|
||||
|
||||
},
|
||||
"DeveloperPanel\0openSubPanel\0\0"
|
||||
"openSubSubPanel\0updateToggles\0_offroad"
|
||||
"openSubSubPanel\0showAllTogglesChanged\0"
|
||||
"updateToggles\0_offroad"
|
||||
};
|
||||
#undef QT_MOC_LITERAL
|
||||
|
||||
@@ -50,26 +52,28 @@ static const uint qt_meta_data_DeveloperPanel[] = {
|
||||
8, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
3, 14, // methods
|
||||
4, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
2, // signalCount
|
||||
3, // signalCount
|
||||
|
||||
// signals: name, argc, parameters, tag, flags
|
||||
1, 0, 29, 2, 0x06 /* Public */,
|
||||
3, 0, 30, 2, 0x06 /* Public */,
|
||||
1, 0, 34, 2, 0x06 /* Public */,
|
||||
3, 0, 35, 2, 0x06 /* Public */,
|
||||
4, 0, 36, 2, 0x06 /* Public */,
|
||||
|
||||
// slots: name, argc, parameters, tag, flags
|
||||
4, 1, 31, 2, 0x08 /* Private */,
|
||||
5, 1, 37, 2, 0x08 /* Private */,
|
||||
|
||||
// signals: parameters
|
||||
QMetaType::Void,
|
||||
QMetaType::Void,
|
||||
QMetaType::Void,
|
||||
|
||||
// slots: parameters
|
||||
QMetaType::Void, QMetaType::Bool, 5,
|
||||
QMetaType::Void, QMetaType::Bool, 6,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
@@ -82,7 +86,8 @@ void DeveloperPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _
|
||||
switch (_id) {
|
||||
case 0: _t->openSubPanel(); break;
|
||||
case 1: _t->openSubSubPanel(); break;
|
||||
case 2: _t->updateToggles((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 2: _t->showAllTogglesChanged(); break;
|
||||
case 3: _t->updateToggles((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
default: ;
|
||||
}
|
||||
} else if (_c == QMetaObject::IndexOfMethod) {
|
||||
@@ -101,6 +106,13 @@ void DeveloperPanel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _
|
||||
return;
|
||||
}
|
||||
}
|
||||
{
|
||||
using _t = void (DeveloperPanel::*)();
|
||||
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DeveloperPanel::showAllTogglesChanged)) {
|
||||
*result = 2;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,13 +145,13 @@ int DeveloperPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 3)
|
||||
if (_id < 4)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 3;
|
||||
_id -= 4;
|
||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
if (_id < 3)
|
||||
if (_id < 4)
|
||||
*reinterpret_cast<int*>(_a[0]) = -1;
|
||||
_id -= 3;
|
||||
_id -= 4;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
@@ -155,5 +167,11 @@ void DeveloperPanel::openSubSubPanel()
|
||||
{
|
||||
QMetaObject::activate(this, &staticMetaObject, 1, nullptr);
|
||||
}
|
||||
|
||||
// SIGNAL 2
|
||||
void DeveloperPanel::showAllTogglesChanged()
|
||||
{
|
||||
QMetaObject::activate(this, &staticMetaObject, 2, nullptr);
|
||||
}
|
||||
QT_WARNING_POP
|
||||
QT_END_MOC_NAMESPACE
|
||||
|
||||
@@ -164,6 +164,7 @@ void TogglesPanel::showEvent(QShowEvent *event) {
|
||||
}
|
||||
|
||||
void TogglesPanel::updateToggles() {
|
||||
const bool showAllToggles = params.getBool("ShowAllToggles");
|
||||
auto experimental_mode_toggle = toggles["ExperimentalMode"];
|
||||
const QString e2e_description = QString("%1<br>"
|
||||
"<h4>%2</h4><br>"
|
||||
@@ -185,7 +186,7 @@ void TogglesPanel::updateToggles() {
|
||||
capnp::FlatArrayMessageReader cmsg(aligned_buf.align(cp_bytes.data(), cp_bytes.size()));
|
||||
cereal::CarParams::Reader CP = cmsg.getRoot<cereal::CarParams>();
|
||||
|
||||
if (hasLongitudinalControl(CP)) {
|
||||
if (hasLongitudinalControl(CP) || showAllToggles) {
|
||||
// normal description and toggle
|
||||
experimental_mode_toggle->setEnabled(true);
|
||||
experimental_mode_toggle->setDescription(e2e_description);
|
||||
@@ -221,12 +222,12 @@ void TogglesPanel::updateToggles() {
|
||||
QJsonObject &starpilot_toggles = starpilot_scene.starpilot_toggles;
|
||||
|
||||
auto disengage_on_accelerator_toggle = toggles["DisengageOnAccelerator"];
|
||||
disengage_on_accelerator_toggle->setVisible(!starpilot_toggles.value("always_on_lateral").toBool());
|
||||
disengage_on_accelerator_toggle->setVisible(showAllToggles || !starpilot_toggles.value("always_on_lateral").toBool());
|
||||
auto driver_camera_toggle = toggles["RecordFront"];
|
||||
driver_camera_toggle->setVisible(!starpilot_toggles.value("no_logging").toBool());
|
||||
experimental_mode_toggle->setVisible(!starpilot_toggles.value("conditional_experimental_mode").toBool());
|
||||
driver_camera_toggle->setVisible(showAllToggles || !starpilot_toggles.value("no_logging").toBool());
|
||||
experimental_mode_toggle->setVisible(showAllToggles || !starpilot_toggles.value("conditional_experimental_mode").toBool());
|
||||
auto record_audio_toggle = toggles["RecordAudio"];
|
||||
record_audio_toggle->setVisible(!starpilot_toggles.value("no_logging").toBool());
|
||||
record_audio_toggle->setVisible(showAllToggles || !starpilot_toggles.value("no_logging").toBool());
|
||||
}
|
||||
|
||||
GalaxyQRPopup::GalaxyQRPopup(const QString &url, QWidget *parent) : DialogBase(parent) {
|
||||
@@ -670,6 +671,9 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
|
||||
DeveloperPanel *developerPanel = new DeveloperPanel(this);
|
||||
QObject::connect(developerPanel, &DeveloperPanel::openSubPanel, [this]() {subPanelOpen=true;});
|
||||
QObject::connect(developerPanel, &DeveloperPanel::openSubSubPanel, [this]() {subSubPanelOpen=true;});
|
||||
QObject::connect(developerPanel, &DeveloperPanel::showAllTogglesChanged, [this]() {
|
||||
updateDeveloperToggle(params.getInt("TuningLevel"));
|
||||
});
|
||||
|
||||
QList<QPair<QString, QWidget *>> panels = {
|
||||
{tr("Device"), device},
|
||||
@@ -809,7 +813,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
|
||||
void SettingsWindow::updateDeveloperToggle(int tuningLevel) {
|
||||
for (QAbstractButton *btn : nav_btns->buttons()) {
|
||||
if (btn->text() == tr("Developer")) {
|
||||
btn->setVisible(tuningLevel >= 3);
|
||||
btn->setVisible(tuningLevel >= 3 || params.getBool("ShowAllToggles"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -209,9 +209,11 @@ void StarPilotDevicePanel::updateState(const UIState &s) {
|
||||
}
|
||||
|
||||
void StarPilotDevicePanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +222,9 @@ void StarPilotDevicePanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "HigherBitrate") {
|
||||
if (!showAllToggles && key == "HigherBitrate") {
|
||||
setVisible &= params.getBool("DeviceManagement") && params.getBool("NoUploads") && !params.getBool("DisableOnroadUploads");
|
||||
}
|
||||
|
||||
|
||||
@@ -321,9 +321,11 @@ void StarPilotLateralPanel::updateMetric(bool metric, bool bootRun) {
|
||||
}
|
||||
|
||||
void StarPilotLateralPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,72 +339,74 @@ void StarPilotLateralPanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "AlwaysOnLateralLKAS") {
|
||||
setVisible &= parent->lkasAllowedForAOL;
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (key == "AlwaysOnLateralLKAS") {
|
||||
setVisible &= parent->lkasAllowedForAOL;
|
||||
}
|
||||
|
||||
else if (key == "ForceAutoTune") {
|
||||
setVisible &= !parent->hasAutoTune;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
}
|
||||
else if (key == "ForceAutoTune") {
|
||||
setVisible &= !parent->hasAutoTune;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
}
|
||||
|
||||
else if (key == "ForceAutoTuneOff") {
|
||||
setVisible &= parent->hasAutoTune;
|
||||
}
|
||||
else if (key == "ForceAutoTuneOff") {
|
||||
setVisible &= parent->hasAutoTune;
|
||||
}
|
||||
|
||||
else if (key == "ForceTorqueController") {
|
||||
setVisible &= !parent->isAngleCar;
|
||||
setVisible &= !parent->isTorqueCar;
|
||||
}
|
||||
else if (key == "ForceTorqueController") {
|
||||
setVisible &= !parent->isAngleCar;
|
||||
setVisible &= !parent->isTorqueCar;
|
||||
}
|
||||
|
||||
else if (key == "LaneChangeTime") {
|
||||
setVisible &= params.getBool("LaneChanges") && params.getBool("NudgelessLaneChange");
|
||||
}
|
||||
else if (key == "LaneChangeTime") {
|
||||
setVisible &= params.getBool("LaneChanges") && params.getBool("NudgelessLaneChange");
|
||||
}
|
||||
|
||||
else if (key == "LaneDetectionWidth") {
|
||||
setVisible &= params.getBool("LaneChanges") && params.getBool("NudgelessLaneChange");
|
||||
}
|
||||
else if (key == "LaneDetectionWidth") {
|
||||
setVisible &= params.getBool("LaneChanges") && params.getBool("NudgelessLaneChange");
|
||||
}
|
||||
|
||||
else if (key == "NNFF") {
|
||||
setVisible &= parent->hasNNFFLog;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
else if (key == "NNFF") {
|
||||
setVisible &= parent->hasNNFFLog;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
|
||||
else if (key == "NNFFLite") {
|
||||
setVisible &= !usingNNFF;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
else if (key == "NNFFLite") {
|
||||
setVisible &= !usingNNFF;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
|
||||
else if (key == "SteerDelay") {
|
||||
setVisible &= parent->steerActuatorDelay != 0;
|
||||
}
|
||||
else if (key == "SteerDelay") {
|
||||
setVisible &= parent->steerActuatorDelay != 0;
|
||||
}
|
||||
|
||||
else if (key == "SteerFriction") {
|
||||
setVisible &= parent->friction != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !usingNNFF;
|
||||
}
|
||||
else if (key == "SteerFriction") {
|
||||
setVisible &= parent->friction != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !usingNNFF;
|
||||
}
|
||||
|
||||
else if (key == "SteerKP") {
|
||||
setVisible &= parent->steerKp != 0;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
else if (key == "SteerKP") {
|
||||
setVisible &= parent->steerKp != 0;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !parent->isAngleCar;
|
||||
}
|
||||
|
||||
else if (key == "SteerLatAccel") {
|
||||
setVisible &= parent->latAccelFactor != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !usingNNFF;
|
||||
}
|
||||
else if (key == "SteerLatAccel") {
|
||||
setVisible &= parent->latAccelFactor != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
setVisible &= parent->isTorqueCar || forcingTorqueController || usingNNFF;
|
||||
setVisible &= !usingNNFF;
|
||||
}
|
||||
|
||||
else if (key == "SteerRatio") {
|
||||
setVisible &= parent->steerRatio != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
else if (key == "SteerRatio") {
|
||||
setVisible &= parent->steerRatio != 0;
|
||||
setVisible &= parent->hasAutoTune ? forcingAutoTuneOff : !forcingAutoTune;
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
|
||||
@@ -1025,9 +1025,11 @@ void StarPilotLongitudinalPanel::updateMetric(bool metric, bool bootRun) {
|
||||
}
|
||||
|
||||
void StarPilotLongitudinalPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,40 +1038,42 @@ void StarPilotLongitudinalPanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "CEStopLights") {
|
||||
setVisible &= parent->tuningLevel < parent->starpilotToggleLevels["CEModelStopTime"].toDouble();
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (key == "CEStopLights") {
|
||||
setVisible &= parent->tuningLevel < parent->starpilotToggleLevels["CEModelStopTime"].toDouble();
|
||||
}
|
||||
|
||||
else if (key == "CustomCruise" || key == "CustomCruiseLong" || key == "SetSpeedLimit" || key == "SetSpeedOffset") {
|
||||
setVisible &= !parent->hasPCMCruise;
|
||||
}
|
||||
else if (key == "CustomCruise" || key == "CustomCruiseLong" || key == "SetSpeedLimit" || key == "SetSpeedOffset") {
|
||||
setVisible &= !parent->hasPCMCruise;
|
||||
}
|
||||
|
||||
else if (key == "HumanLaneChanges") {
|
||||
setVisible &= parent->hasRadar;
|
||||
}
|
||||
else if (key == "HumanLaneChanges") {
|
||||
setVisible &= parent->hasRadar;
|
||||
}
|
||||
|
||||
else if (key == "MapGears") {
|
||||
setVisible &= parent->isToyota;
|
||||
setVisible &= !parent->isTSK;
|
||||
}
|
||||
else if (key == "MapGears") {
|
||||
setVisible &= parent->isToyota;
|
||||
setVisible &= !parent->isTSK;
|
||||
}
|
||||
|
||||
else if (key == "ReverseCruise") {
|
||||
setVisible &= parent->isToyota;
|
||||
}
|
||||
else if (key == "ReverseCruise") {
|
||||
setVisible &= parent->isToyota;
|
||||
}
|
||||
|
||||
else if (key == "SLCMapboxFiller") {
|
||||
setVisible &= !params.get("MapboxSecretKey").empty();
|
||||
}
|
||||
else if (key == "SLCMapboxFiller") {
|
||||
setVisible &= !params.get("MapboxSecretKey").empty();
|
||||
}
|
||||
|
||||
else if (key == "StartAccel") {
|
||||
setVisible &= !(params.getBool("LongitudinalTune") && params.getBool("HumanAcceleration"));
|
||||
}
|
||||
else if (key == "StartAccel") {
|
||||
setVisible &= !(params.getBool("LongitudinalTune") && params.getBool("HumanAcceleration"));
|
||||
}
|
||||
|
||||
else if (key == "StoppingDecelRate" || key == "VEgoStarting" || key == "VEgoStopping") {
|
||||
setVisible &= !parent->isGM || !params.getBool("ExperimentalGMTune");
|
||||
setVisible &= !parent->isToyota || !params.getBool("FrogsGoMoosTweak");
|
||||
else if (key == "StoppingDecelRate" || key == "VEgoStarting" || key == "VEgoStopping") {
|
||||
setVisible &= !parent->isGM || !params.getBool("ExperimentalGMTune");
|
||||
setVisible &= !parent->isToyota || !params.getBool("FrogsGoMoosTweak");
|
||||
}
|
||||
}
|
||||
|
||||
if (key == "EVTuning") {
|
||||
|
||||
@@ -794,17 +794,21 @@ void StarPilotModelPanel::updateModelLabels(StarPilotListWidget *labelsList) {
|
||||
}
|
||||
|
||||
void StarPilotModelPanel::updateToggles() {
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
bool setVisible = tuningLevel >= starpilotToggleLevels[key].toDouble();
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
if (key == "ManageBlacklistedModels" || key == "ManageScores") {
|
||||
setVisible &= params.getBool("ModelRandomizer");
|
||||
} else if (key == "SelectModel") {
|
||||
setVisible &= !params.getBool("ModelRandomizer");
|
||||
} else if (key == "RecoveryPower") {
|
||||
setVisible &= (tuningLevel == 3); // Only visible in developer tuning level
|
||||
} else if (key == "StopDistance") {
|
||||
setVisible &= (tuningLevel == 3); // Only visible in developer tuning level
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
bool setVisible = showAllToggles || tuningLevel >= starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (!showAllToggles) {
|
||||
if (key == "ManageBlacklistedModels" || key == "ManageScores") {
|
||||
setVisible &= params.getBool("ModelRandomizer");
|
||||
} else if (key == "SelectModel") {
|
||||
setVisible &= !params.getBool("ModelRandomizer");
|
||||
} else if (key == "RecoveryPower") {
|
||||
setVisible &= (tuningLevel == 3); // Only visible in developer tuning level
|
||||
} else if (key == "StopDistance") {
|
||||
setVisible &= (tuningLevel == 3); // Only visible in developer tuning level
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
|
||||
@@ -241,7 +241,7 @@ void StarPilotNavigationPanel::showEvent(QShowEvent *event) {
|
||||
} else {
|
||||
updateSpeedLimitsToggle->setEnabledButton(1, starpilot_scene.online && util::system_time_valid() && parked);
|
||||
updateSpeedLimitsToggle->setValue(starpilot_scene.online ? (parked ? "" : "Not parked") : tr("Offline..."));
|
||||
updateSpeedLimitsToggle->setVisible(parent->tuningLevel >= parent->starpilotToggleLevels["SpeedLimitFiller"].toDouble());
|
||||
updateSpeedLimitsToggle->setVisible(parent->showAllTogglesEnabled() || parent->tuningLevel >= parent->starpilotToggleLevels["SpeedLimitFiller"].toDouble());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,9 +163,11 @@ void StarPilotSoundsPanel::updateState(const UIState &s) {
|
||||
}
|
||||
|
||||
void StarPilotSoundsPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,14 +176,16 @@ void StarPilotSoundsPanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "LoudBlindspotAlert") {
|
||||
setVisible &= parent->hasBSM;
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (key == "LoudBlindspotAlert") {
|
||||
setVisible &= parent->hasBSM;
|
||||
}
|
||||
|
||||
else if (key == "SpeedLimitChangedAlert") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits") || (parent->hasOpenpilotLongitudinal && params.getBool("SpeedLimitController"));
|
||||
else if (key == "SpeedLimitChangedAlert") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits") || (parent->hasOpenpilotLongitudinal && params.getBool("SpeedLimitController"));
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
|
||||
@@ -249,6 +249,10 @@ void StarPilotSettingsWindow::updateTuningLevel() {
|
||||
emit tuningLevelChanged(tuningLevel);
|
||||
}
|
||||
|
||||
bool StarPilotSettingsWindow::showAllTogglesEnabled() {
|
||||
return params.getBool("ShowAllToggles");
|
||||
}
|
||||
|
||||
void StarPilotSettingsWindow::showEvent(QShowEvent *event) {
|
||||
static bool alertShown = false;
|
||||
|
||||
@@ -307,6 +311,7 @@ void StarPilotSettingsWindow::updateVariables() {
|
||||
StarPilotUIState &fs = *starpilotUIState();
|
||||
StarPilotUIScene &starpilot_scene = fs.starpilot_scene;
|
||||
QJsonObject &starpilot_toggles = starpilot_scene.starpilot_toggles;
|
||||
const bool showAllToggles = showAllTogglesEnabled();
|
||||
|
||||
auto applyDesktopVehicleFallback = [&]() {
|
||||
QString fallbackMake = starpilot_toggles.value("car_make").toString();
|
||||
@@ -497,12 +502,12 @@ void StarPilotSettingsWindow::updateVariables() {
|
||||
hasAutoTune = LTP.getUseParams();
|
||||
}
|
||||
|
||||
drivingPanelButtons->setVisibleButton(0, tuningLevel >= starpilotToggleLevels.value("DrivingModel").toDouble());
|
||||
drivingPanelButtons->setVisibleButton(1, hasOpenpilotLongitudinal);
|
||||
drivingPanelButtons->setVisibleButton(0, showAllToggles || tuningLevel >= starpilotToggleLevels.value("DrivingModel").toDouble());
|
||||
drivingPanelButtons->setVisibleButton(1, showAllToggles || hasOpenpilotLongitudinal);
|
||||
|
||||
systemPanelButtons->setVisibleButton(1, tuningLevel >= starpilotToggleLevels.value("DeviceManagement").toDouble() || tuningLevel >= starpilotToggleLevels.value("ScreenManagement").toDouble());
|
||||
systemPanelButtons->setVisibleButton(1, showAllToggles || tuningLevel >= starpilotToggleLevels.value("DeviceManagement").toDouble() || tuningLevel >= starpilotToggleLevels.value("ScreenManagement").toDouble());
|
||||
|
||||
vehiclePanelButtons->setVisibleButton(1, tuningLevel >= starpilotToggleLevels.value("WheelControls").toDouble());
|
||||
vehiclePanelButtons->setVisibleButton(1, showAllToggles || tuningLevel >= starpilotToggleLevels.value("WheelControls").toDouble());
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
explicit StarPilotSettingsWindow(SettingsWindow *parent);
|
||||
|
||||
void updateVariables();
|
||||
bool showAllTogglesEnabled();
|
||||
|
||||
bool canUsePedal = false;
|
||||
bool canUseSDSU = false;
|
||||
|
||||
@@ -898,27 +898,31 @@ void StarPilotThemesPanel::updateState(const UIState &s, const StarPilotUIState
|
||||
parent->keepScreenOn = themeDownloading;
|
||||
}
|
||||
|
||||
void StarPilotThemesPanel::updateToggles() {
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
}
|
||||
}
|
||||
void StarPilotThemesPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "DistanceIconPack") {
|
||||
setVisible &= params.getBool("QOLVisuals") && params.getBool("OnroadDistanceButton");
|
||||
}
|
||||
|
||||
else if (key == "RandomThemes") {
|
||||
setVisible &= params.getBool("CustomThemes");
|
||||
}
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (!showAllToggles) {
|
||||
if (key == "DistanceIconPack") {
|
||||
setVisible &= params.getBool("QOLVisuals") && params.getBool("OnroadDistanceButton");
|
||||
}
|
||||
|
||||
else if (key == "RandomThemes") {
|
||||
setVisible &= params.getBool("CustomThemes");
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
|
||||
|
||||
@@ -389,9 +389,11 @@ void StarPilotVehiclesPanel::updateState(const UIState &s) {
|
||||
}
|
||||
|
||||
void StarPilotVehiclesPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,46 +402,48 @@ void StarPilotVehiclesPanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (gmKeys.contains(key)) {
|
||||
setVisible &= parent->isGM;
|
||||
} else if (hkgKeys.contains(key)) {
|
||||
setVisible &= parent->isHKG;
|
||||
} else if (subaruKeys.contains(key)) {
|
||||
setVisible &= parent->isSubaru;
|
||||
} else if (toyotaKeys.contains(key)) {
|
||||
setVisible &= parent->isToyota;
|
||||
} else if (vehicleInfoKeys.contains(key)) {
|
||||
setVisible = true;
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (gmKeys.contains(key)) {
|
||||
setVisible &= parent->isGM;
|
||||
} else if (hkgKeys.contains(key)) {
|
||||
setVisible &= parent->isHKG;
|
||||
} else if (subaruKeys.contains(key)) {
|
||||
setVisible &= parent->isSubaru;
|
||||
} else if (toyotaKeys.contains(key)) {
|
||||
setVisible &= parent->isToyota;
|
||||
} else if (vehicleInfoKeys.contains(key)) {
|
||||
setVisible = true;
|
||||
}
|
||||
|
||||
if (longitudinalKeys.contains(key)) {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
if (longitudinalKeys.contains(key)) {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
if (key == "SNGHack") {
|
||||
setVisible &= !parent->hasSNG;
|
||||
}
|
||||
if (key == "SNGHack") {
|
||||
setVisible &= !parent->hasSNG;
|
||||
}
|
||||
|
||||
else if (key == "GMPedalLongitudinal") {
|
||||
setVisible &= parent->hasPedal || (Hardware::PC() && parent->canUsePedal);
|
||||
}
|
||||
else if (key == "GMPedalLongitudinal") {
|
||||
setVisible &= parent->hasPedal || (Hardware::PC() && parent->canUsePedal);
|
||||
}
|
||||
|
||||
else if (key == "RemapCancelToDistance") {
|
||||
setVisible &= parent->isBolt && (parent->hasPedal || (Hardware::PC() && parent->canUsePedal));
|
||||
}
|
||||
else if (key == "RemapCancelToDistance") {
|
||||
setVisible &= parent->isBolt && (parent->hasPedal || (Hardware::PC() && parent->canUsePedal));
|
||||
}
|
||||
|
||||
else if (key == "SubaruSNG") {
|
||||
setVisible &= parent->hasSNG;
|
||||
}
|
||||
else if (key == "SubaruSNG") {
|
||||
setVisible &= parent->hasSNG;
|
||||
}
|
||||
|
||||
else if (key == "TacoTuneHacks") {
|
||||
setVisible &= parent->isHKGCanFd;
|
||||
}
|
||||
else if (key == "TacoTuneHacks") {
|
||||
setVisible &= parent->isHKGCanFd;
|
||||
}
|
||||
|
||||
else if (key == "VoltSNG") {
|
||||
setVisible &= parent->isVolt && !parent->hasSNG;
|
||||
else if (key == "VoltSNG") {
|
||||
setVisible &= parent->isVolt && !parent->hasSNG;
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
@@ -459,8 +463,8 @@ void StarPilotVehiclesPanel::updateToggles() {
|
||||
}
|
||||
}
|
||||
|
||||
disableOpenpilotLong->setVisible((parent->hasOpenpilotLongitudinal || parent->openpilotLongitudinalControlDisabled) && !parent->hasAlphaLongitudinal && parent->tuningLevel >= parent->starpilotToggleLevels["DisableOpenpilotLongitudinal"].toBool());
|
||||
forceFingerprint->setVisible(parent->tuningLevel >= parent->starpilotToggleLevels["ForceFingerprint"].toBool());
|
||||
disableOpenpilotLong->setVisible(showAllToggles || ((parent->hasOpenpilotLongitudinal || parent->openpilotLongitudinalControlDisabled) && !parent->hasAlphaLongitudinal && parent->tuningLevel >= parent->starpilotToggleLevels["DisableOpenpilotLongitudinal"].toDouble()));
|
||||
forceFingerprint->setVisible(showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels["ForceFingerprint"].toDouble());
|
||||
|
||||
openDescriptions(forceOpenDescriptions, toggles);
|
||||
|
||||
|
||||
@@ -254,9 +254,11 @@ void StarPilotVisualsPanel::updateMetric(bool metric, bool bootRun) {
|
||||
}
|
||||
|
||||
void StarPilotVisualsPanel::updateToggles() {
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
if (parentKeys.contains(key)) {
|
||||
toggle->setVisible(false);
|
||||
toggle->setVisible(showAllToggles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,44 +267,46 @@ void StarPilotVisualsPanel::updateToggles() {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (key == "AccelerationPath") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
if (!showAllToggles) {
|
||||
if (key == "AccelerationPath") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
else if (key == "BlindSpotPath") {
|
||||
setVisible &= parent->hasBSM;
|
||||
}
|
||||
else if (key == "BlindSpotPath") {
|
||||
setVisible &= parent->hasBSM;
|
||||
}
|
||||
|
||||
else if (key == "HideLeadMarker") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
else if (key == "HideLeadMarker") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
else if (key == "HideSpeedLimit") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal && params.getBool("SpeedLimitController");
|
||||
}
|
||||
else if (key == "HideSpeedLimit") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal && params.getBool("SpeedLimitController");
|
||||
}
|
||||
|
||||
else if (key == "OnroadDistanceButton") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
else if (key == "OnroadDistanceButton") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
else if (key == "PedalsOnUI") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
else if (key == "PedalsOnUI") {
|
||||
setVisible &= parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
else if (key == "ShowSpeedLimits") {
|
||||
setVisible &= !params.getBool("SpeedLimitController") || !parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
else if (key == "ShowSpeedLimits") {
|
||||
setVisible &= !params.getBool("SpeedLimitController") || !parent->hasOpenpilotLongitudinal;
|
||||
}
|
||||
|
||||
else if (key == "SLCMapboxFiller") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits");
|
||||
setVisible &= !params.getBool("SpeedLimitController") || !parent->hasOpenpilotLongitudinal;
|
||||
setVisible &= !params.get("MapboxSecretKey").empty();
|
||||
}
|
||||
else if (key == "SLCMapboxFiller") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits");
|
||||
setVisible &= !params.getBool("SpeedLimitController") || !parent->hasOpenpilotLongitudinal;
|
||||
setVisible &= !params.get("MapboxSecretKey").empty();
|
||||
}
|
||||
|
||||
else if (key == "UseVienna") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits") || params.getBool("SpeedLimitController");
|
||||
else if (key == "UseVienna") {
|
||||
setVisible &= params.getBool("ShowSpeedLimits") || params.getBool("SpeedLimitController");
|
||||
}
|
||||
}
|
||||
|
||||
toggle->setVisible(setVisible);
|
||||
|
||||
@@ -67,10 +67,12 @@ void StarPilotWheelPanel::showEvent(QShowEvent *event) {
|
||||
}
|
||||
|
||||
void StarPilotWheelPanel::updateToggles() {
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
bool setVisible = parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
const bool showAllToggles = parent->showAllTogglesEnabled();
|
||||
|
||||
if (key == "LKASButtonControl") {
|
||||
for (auto &[key, toggle] : toggles) {
|
||||
bool setVisible = showAllToggles || parent->tuningLevel >= parent->starpilotToggleLevels[key].toDouble();
|
||||
|
||||
if (!showAllToggles && key == "LKASButtonControl") {
|
||||
setVisible &= !parent->isSubaru;
|
||||
setVisible &= !parent->lkasAllowedForAOL || !(params.getBool("AlwaysOnLateral") && params.getBool("AlwaysOnLateralLKAS"));
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user