Compare commits

..

5 Commits

Author SHA1 Message Date
royjr
c162629ce5 Merge branch 'master' into ui-neutral 2025-12-21 17:07:06 -05:00
royjr
7347c398f8 fix 2025-12-15 18:44:41 -05:00
royjr
7411ae3469 Update log.capnp 2025-12-15 18:44:41 -05:00
royjr
2a8bfaa34d fix 2025-12-15 18:44:40 -05:00
royjr
1ab3c81962 init 2025-12-15 18:27:09 -05:00
4 changed files with 23 additions and 6 deletions

View File

@@ -130,6 +130,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
userBookmark @95;
excessiveActuation @96;
audioFeedback @97;
neutralGear @98;
soundsUnavailableDEPRECATED @47;
}

View File

@@ -147,6 +147,8 @@ class CarSpecificEvents:
events.add(EventName.wrongGear)
if CS.gearShifter == GearShifter.reverse:
events.add(EventName.reverseGear)
if CS.gearShifter == GearShifter.neutral:
events.add(EventName.neutralGear)
if not CS.cruiseState.available:
events.add(EventName.wrongCarMode)
if CS.espDisabled:

View File

@@ -793,6 +793,16 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Reverse Gear"),
},
EventName.neutralGear: {
ET.PERMANENT: Alert(
"Neutral\nGear",
"",
AlertStatus.normal, AlertSize.full,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5),
ET.USER_DISABLE: ImmediateDisableAlert("Neutral Gear"),
ET.NO_ENTRY: NoEntryAlert("Neutral Gear"),
},
# On cars that use stock ACC the car can decide to cancel ACC for various reasons.
# When this happens we can no long control the car so the user needs to be warned immediately.
EventName.cruiseDisabled: {
@@ -912,6 +922,15 @@ if HARDWARE.get_device_type() == 'mici':
ET.USER_DISABLE: ImmediateDisableAlert("Reverse"),
ET.NO_ENTRY: NoEntryAlert("Reverse"),
},
EventName.neutralGear: {
ET.PERMANENT: Alert(
"Neutral",
"",
AlertStatus.normal, AlertSize.full,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5),
ET.USER_DISABLE: ImmediateDisableAlert("Neutral"),
ET.NO_ENTRY: NoEntryAlert("Neutral"),
},
})

View File

@@ -50,12 +50,7 @@ class ExpButton(Widget):
texture = self._txt_exp if self._held_or_actual_mode() else self._txt_wheel
rl.draw_circle(center_x, center_y, self._rect.width / 2, self._black_bg)
src_rect = rl.Rectangle(0.0, 0.0, texture.width, texture.height)
dest_rect = rl.Rectangle(center_x, center_y, texture.width, texture.height)
origin = rl.Vector2(texture.width / 2.0, texture.height / 2.0)
rotation = -ui_state.sm['carState'].steeringAngleDeg
rl.draw_texture_pro(texture, src_rect, dest_rect, origin, rotation, self._white_color)
rl.draw_texture(texture, center_x - texture.width // 2, center_y - texture.height // 2, self._white_color)
def _held_or_actual_mode(self):
now = time.monotonic()