mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-27 11:13:43 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 38893bdc71 |
@@ -517,6 +517,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
||||
{"PIPPreviewMask", {PERSISTENT, JSON, "{\"width\":1928,\"height\":1208,\"center_left\":[315,548],\"center_right\":[1571,539],\"crop_size\":580}", "{\"width\":1928,\"height\":1208,\"center_left\":[315,548],\"center_right\":[1571,539],\"crop_size\":580}", 2}},
|
||||
{"PIPPreviewShowOnBlinker", {PERSISTENT, BOOL, "0", "0", 1}},
|
||||
{"PIPPreviewShowOnBSM", {PERSISTENT, BOOL, "0", "0", 1}},
|
||||
{"PIPPreviewInvert", {PERSISTENT, BOOL, "0", "0", 1}},
|
||||
{"GalaxyPaired", {PERSISTENT, BOOL, "0", "0", 0}},
|
||||
{"GalaxyUploadPending", {PERSISTENT, BOOL, "0", "0", 0}},
|
||||
{"PreferredSchedule", {PERSISTENT, INT, "2", "0", 0}},
|
||||
|
||||
@@ -266,6 +266,7 @@ class PipSideCamera(Widget):
|
||||
self._enabled = self._params.get_bool("PIPPreviewEnabled") and self._params.get_bool("GalaxyDeveloperMode")
|
||||
self._show_on_blinker = self._params.get_bool("PIPPreviewShowOnBlinker")
|
||||
self._show_on_bsm = self._params.get_bool("PIPPreviewShowOnBSM")
|
||||
self._flip_x_value[0] = 1 if self._params.get_bool("PIPPreviewInvert") else 0
|
||||
try:
|
||||
raw = self._params.get("PIPPreviewMask")
|
||||
if isinstance(raw, (bytes, str)):
|
||||
|
||||
@@ -29,6 +29,36 @@ def test_pip_driver_camera_shader_mirrors_the_crop():
|
||||
assert "cropCoord.x = 1.0 - cropCoord.x" in PIP_FRAGMENT_SHADER
|
||||
|
||||
|
||||
class _FakeParams:
|
||||
def __init__(self, invert: bool = False):
|
||||
self._invert = invert
|
||||
|
||||
def get_bool(self, key: str) -> bool:
|
||||
if key == "PIPPreviewInvert":
|
||||
return self._invert
|
||||
if key == "GalaxyDeveloperMode":
|
||||
return True
|
||||
return False
|
||||
|
||||
def get(self, key: str):
|
||||
return None
|
||||
|
||||
|
||||
def test_pip_flip_value_follows_invert_param():
|
||||
camera = PipSideCamera.__new__(PipSideCamera)
|
||||
camera._closed = True
|
||||
camera._last_param_refresh = 0.0
|
||||
camera._flip_x_value = __import__("pyray").ffi.new("int[1]", [1])
|
||||
camera._params = _FakeParams(invert=False)
|
||||
camera._mask = {}
|
||||
camera._refresh_config(force=True)
|
||||
assert camera._flip_x_value[0] == 0
|
||||
|
||||
camera._params = _FakeParams(invert=True)
|
||||
camera._refresh_config(force=True)
|
||||
assert camera._flip_x_value[0] == 1
|
||||
|
||||
|
||||
def test_pip_driver_camera_shader_masks_before_sampling_and_keeps_two_texture_reads():
|
||||
assert "fwidth(radius)" in PIP_FRAGMENT_SHADER
|
||||
assert "if (radius > 1.0 + aa)" in PIP_FRAGMENT_SHADER
|
||||
|
||||
@@ -2279,7 +2279,7 @@
|
||||
{
|
||||
"key": "PIPPreviewShowOnBlinker",
|
||||
"label": "Show on Turn Signal",
|
||||
"description": "Display the side preview bubble while the corresponding turn signal is engaged.",
|
||||
"description": "Display the side preview while the corresponding turn signal is engaged.",
|
||||
"picker_description": "Shows the side preview while a turn signal is on.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
@@ -2289,13 +2289,23 @@
|
||||
{
|
||||
"key": "PIPPreviewShowOnBSM",
|
||||
"label": "Show on Blind Spot Detection",
|
||||
"description": "Display the side preview bubble when a vehicle is detected in the blind spot, whether from factory BSM, V-ASM, or both.",
|
||||
"description": "Display the side preview when a vehicle is detected in the blind spot, whether from factory BSM, V-ASM, or both.",
|
||||
"picker_description": "Shows the side preview when a blind spot is detected.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "PIPPreviewEnabled",
|
||||
"settings_tier": "advanced"
|
||||
},
|
||||
{
|
||||
"key": "PIPPreviewInvert",
|
||||
"label": "Invert Side View Orientation",
|
||||
"description": "Flips the camera horizontally to switch whether your car's body appears on the inner/left or outer/right edge of the preview.",
|
||||
"picker_description": "Keep off for the default view with the car body along the inside edge.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "PIPPreviewEnabled",
|
||||
"settings_tier": "advanced"
|
||||
},
|
||||
{
|
||||
"key": "Compass",
|
||||
"label": "Compass",
|
||||
|
||||
@@ -279,17 +279,20 @@ def test_pip_preview_is_under_driving_screen_widgets_and_configured_only_in_gala
|
||||
sections = _params_by_section(_layout())
|
||||
visual = sections["Visual (Display & UI)"]
|
||||
|
||||
assert {"PIPPreviewEnabled", "PIPPreviewShowOnBlinker", "PIPPreviewShowOnBSM"} <= visual.keys()
|
||||
assert {"PIPPreviewEnabled", "PIPPreviewShowOnBlinker", "PIPPreviewShowOnBSM", "PIPPreviewInvert"} <= visual.keys()
|
||||
assert visual["PIPPreviewEnabled"]["parent_key"] == "CustomUI"
|
||||
assert visual["PIPPreviewShowOnBlinker"]["parent_key"] == "PIPPreviewEnabled"
|
||||
assert visual["PIPPreviewShowOnBSM"]["parent_key"] == "PIPPreviewEnabled"
|
||||
assert visual["PIPPreviewInvert"]["parent_key"] == "PIPPreviewEnabled"
|
||||
assert visual["PIPPreviewEnabled"]["settings_tier"] == "advanced"
|
||||
assert visual["PIPPreviewShowOnBlinker"]["settings_tier"] == "advanced"
|
||||
assert visual["PIPPreviewShowOnBSM"]["settings_tier"] == "advanced"
|
||||
assert visual["PIPPreviewInvert"]["settings_tier"] == "advanced"
|
||||
|
||||
assert _declared_default("PIPPreviewEnabled") == "0"
|
||||
assert _declared_default("PIPPreviewShowOnBlinker") == "0"
|
||||
assert _declared_default("PIPPreviewShowOnBSM") == "0"
|
||||
assert _declared_default("PIPPreviewInvert") == "0"
|
||||
assert '"{\\"width\\":1928,\\"height\\":1208,\\"center_left\\":[315,548],\\"center_right\\":[1571,539],\\"crop_size\\":580}"' in PARAM_KEYS_PATH.read_text(encoding="utf-8")
|
||||
|
||||
physical_settings = (
|
||||
|
||||
@@ -111,7 +111,7 @@ GITLAB_SUBMISSIONS_PROJECT_ID = "71992109"
|
||||
GITLAB_TOKEN = os.environ.get("GITLAB_TOKEN", "")
|
||||
LEGACY_LATERAL_METHOD_API_PREFIX = "/api/" + "".join(("f", "t", "m"))
|
||||
VASM_CONFIGURATION_KEYS = {"VASMEnabled", "VASMConfidenceThreshold", "VASMSmoothSeconds", "VASMAnnotationConfig"}
|
||||
PIP_PREVIEW_CONFIGURATION_KEYS = {"PIPPreviewEnabled", "PIPPreviewMask", "PIPPreviewShowOnBlinker", "PIPPreviewShowOnBSM"}
|
||||
PIP_PREVIEW_CONFIGURATION_KEYS = {"PIPPreviewEnabled", "PIPPreviewMask", "PIPPreviewShowOnBlinker", "PIPPreviewShowOnBSM", "PIPPreviewInvert"}
|
||||
MODEL_SMOOTHING_KEYS = {"LatSmoothSeconds", "LongSmoothSeconds"}
|
||||
GALAXY_DEVELOPER_ONLY_KEYS = {"TurnSteeringLimitMuteSpeed"}
|
||||
PULSE_GLIDE_BUTTON_KEYS = {
|
||||
|
||||
Reference in New Issue
Block a user