Controls - Quality of Life - Reverse Cruise Increase

Reverses the 'long press' functionality logic to increase the max set speed by 5 instead of 1. Useful to increase the max speed quickly.
This commit is contained in:
FrogAi
2024-06-08 13:30:34 -07:00
parent 14d7b4b88c
commit b01c296d76
6 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_ty
"PERMIT_BRAKING": 1,
"RELEASE_STANDSTILL": not standstill_req,
"CANCEL_REQ": pcm_cancel,
"ALLOW_LONG_PRESS": 1,
"ALLOW_LONG_PRESS": 2 if frogpilot_toggles.reverse_cruise_increase else 1,
"ACC_CUT_IN": fcw_alert, # only shown when ACC enabled
}
return packer.make_can_msg("ACC_CONTROL", 0, values)
@@ -123,6 +123,8 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
), 10));
} else if (trafficModeActive) {
p.setPen(QPen(redColor(), 10));
} else if (reverseCruise) {
p.setPen(QPen(blueColor(), 6));
} else {
p.setPen(QPen(whiteColor(75), 6));
}
@@ -541,6 +543,8 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
bottom_layout->setAlignment(distance_btn, (rightHandDM ? Qt::AlignRight : Qt::AlignLeft));
}
reverseCruise = scene.reverse_cruise;
trafficModeActive = scene.traffic_mode_active;
}
@@ -58,6 +58,7 @@ private:
bool experimentalMode;
bool mapOpen;
bool onroadDistanceButton;
bool reverseCruise;
bool showAlwaysOnLateralStatusBar;
bool showConditionalExperimentalStatusBar;
bool trafficModeActive;
@@ -76,6 +77,7 @@ private:
QString leadDistanceUnit;
QString leadSpeedUnit;
inline QColor blueColor(int alpha = 255) { return QColor(0, 150, 255, alpha); }
inline QColor greenColor(int alpha = 242) { return QColor(23, 134, 68, alpha); }
protected:
+9
View File
@@ -97,6 +97,15 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
// FrogPilot clickable widgets
QPoint pos = e->pos();
QRect maxSpeedRect(7, 25, 225, 225);
if (maxSpeedRect.contains(pos) && scene.reverse_cruise_ui) {
scene.reverse_cruise = !scene.reverse_cruise;
params.putBoolNonBlocking("ReverseCruise", scene.reverse_cruise);
updateFrogPilotToggles();
return;
}
if (scene.experimental_mode_via_screen && pos != timeoutPoint) {
if (clickTimer.isActive()) {
clickTimer.stop();
+4
View File
@@ -298,6 +298,10 @@ void ui_update_frogpilot_params(UIState *s) {
bool radarless_model = params.get("Model") == "radical-turtle";
scene.lead_detection_threshold = longitudinal_tune && !radarless_model ? params.getInt("LeadDetectionThreshold") / 100.0f : 0.5;
bool quality_of_life_controls = params.getBool("QOLControls");
scene.reverse_cruise = quality_of_life_controls && params.getBool("ReverseCruise");
scene.reverse_cruise_ui = params.getBool("ReverseCruiseUI");
scene.tethering_config = params.getInt("TetheringEnabled");
if (scene.tethering_config == 2) {
WifiManager(s).setTetheringEnabled(true);
+2
View File
@@ -132,6 +132,8 @@ typedef struct UIScene {
bool online;
bool onroad_distance_button;
bool parked;
bool reverse_cruise;
bool reverse_cruise_ui;
bool right_hand_drive;
bool show_aol_status_bar;
bool show_cem_status_bar;