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:
parent
d5f73e5117
commit
bee2a5524c
@ -43,7 +43,7 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_ty
|
|||||||
"PERMIT_BRAKING": 1,
|
"PERMIT_BRAKING": 1,
|
||||||
"RELEASE_STANDSTILL": not standstill_req,
|
"RELEASE_STANDSTILL": not standstill_req,
|
||||||
"CANCEL_REQ": pcm_cancel,
|
"CANCEL_REQ": pcm_cancel,
|
||||||
"ALLOW_LONG_PRESS": 1,
|
"ALLOW_LONG_PRESS": 2 if frogpilot_variables.reverse_cruise_increase else 1,
|
||||||
"ACC_CUT_IN": fcw_alert, # only shown when ACC enabled
|
"ACC_CUT_IN": fcw_alert, # only shown when ACC enabled
|
||||||
}
|
}
|
||||||
return packer.make_can_msg("ACC_CONTROL", 0, values)
|
return packer.make_can_msg("ACC_CONTROL", 0, values)
|
||||||
|
@ -101,6 +101,17 @@ void OnroadWindow::updateState(const UIState &s) {
|
|||||||
|
|
||||||
void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
||||||
// FrogPilot clickable widgets
|
// FrogPilot clickable widgets
|
||||||
|
QRect maxSpeedRect(7, 25, 225, 225);
|
||||||
|
bool isMaxSpeedClicked = maxSpeedRect.contains(e->pos()) && scene.reverse_cruise_ui;
|
||||||
|
|
||||||
|
if (isMaxSpeedClicked) {
|
||||||
|
bool currentReverseCruise = scene.reverse_cruise;
|
||||||
|
uiState()->scene.reverse_cruise = !currentReverseCruise;
|
||||||
|
params.putBoolNonBlocking("ReverseCruise", !currentReverseCruise);
|
||||||
|
updateFrogPilotToggles();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (scene.experimental_mode_via_screen && e->pos() != timeoutPoint) {
|
if (scene.experimental_mode_via_screen && e->pos() != timeoutPoint) {
|
||||||
if (clickTimer.isActive()) {
|
if (clickTimer.isActive()) {
|
||||||
clickTimer.stop();
|
clickTimer.stop();
|
||||||
@ -414,6 +425,8 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||||||
), 10));
|
), 10));
|
||||||
} else if (trafficModeActive) {
|
} else if (trafficModeActive) {
|
||||||
p.setPen(QPen(redColor(), 10));
|
p.setPen(QPen(redColor(), 10));
|
||||||
|
} else if (scene.reverse_cruise) {
|
||||||
|
p.setPen(QPen(blueColor(), 6));
|
||||||
} else {
|
} else {
|
||||||
p.setPen(QPen(whiteColor(75), 6));
|
p.setPen(QPen(whiteColor(75), 6));
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,7 @@ private:
|
|||||||
QString leadDistanceUnit;
|
QString leadDistanceUnit;
|
||||||
QString leadSpeedUnit;
|
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); }
|
inline QColor greenColor(int alpha = 242) { return QColor(23, 134, 68, alpha); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -288,6 +288,10 @@ void ui_update_frogpilot_params(UIState *s) {
|
|||||||
bool longitudinal_tune = scene.longitudinal_control && params.getBool("LongitudinalTune");
|
bool longitudinal_tune = scene.longitudinal_control && params.getBool("LongitudinalTune");
|
||||||
bool radarless_model = params.get("Model") == "radical-turtle";
|
bool radarless_model = params.get("Model") == "radical-turtle";
|
||||||
scene.lead_detection_threshold = longitudinal_tune && !radarless_model ? params.getInt("LeadDetectionThreshold") / 100.0f : 0.5;
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIState::updateStatus() {
|
void UIState::updateStatus() {
|
||||||
|
@ -196,6 +196,8 @@ typedef struct UIScene {
|
|||||||
bool online;
|
bool online;
|
||||||
bool onroad_distance_button;
|
bool onroad_distance_button;
|
||||||
bool parked;
|
bool parked;
|
||||||
|
bool reverse_cruise;
|
||||||
|
bool reverse_cruise_ui;
|
||||||
bool right_hand_drive;
|
bool right_hand_drive;
|
||||||
bool show_aol_status_bar;
|
bool show_aol_status_bar;
|
||||||
bool show_cem_status_bar;
|
bool show_cem_status_bar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user