This commit is contained in:
shurongsen 2024-12-25 23:19:40 +08:00
parent 897ac024a5
commit 8d1a8f6a97
5 changed files with 272 additions and 6 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@ extends HBoxContainer
@onready var power_texture_rect: TextureRect = %PowerTextureRect
@onready var power_label: Label = %PowerLabel
@onready var control_mode_texture_rect: TextureRect = %control_modeTextureRect
@onready var map_texture_rect: TextureRect = %mapTextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
side_display_texture_rect.texture = Global.EgoVehicle3D.SideDisplayGetTexture()
@ -15,6 +15,7 @@ func _ready() -> void:
Websocket.message_received.connect(message_received)
pass # Replace with function body.
func connected_to_server():
update_bms_report()
Mode_Report()
@ -28,6 +29,12 @@ func message_received(data:Dictionary):
if data.is_empty():return
if !data.has("topic"):return
match data.topic:
"/hmi_input/pix_robobus/vcu_report1":#大灯信息
if data.msg.headlight_actual:
%Vcu_Report1TextureRect4.texture = preload("res://pad_hmi_ui/home/highbeam_icon.png")
else:
%Vcu_Report1TextureRect4.texture = preload("res://pad_hmi_ui/home/lowbeam_icon.png")
"/hmi_input/app/cloud_control_platform/vehicle_info":#车辆信息
#电量显示
power_label.text = str(data.msg.p_l) + "%"
@ -64,6 +71,17 @@ func message_received(data:Dictionary):
%seatbelt.texture = preload("res://pad_hmi_ui/home/belts_icon_high.png")
else:
%seatbelt.texture = preload("res://pad_hmi_ui/home/belts_icon_dis.png")
#二氧化碳检测
if data.msg.co2 >0:
%CarbonDioxideTextureRect.texture = preload("res://pad_hmi_ui/home/co2_icon_dis.png")
else:
%CarbonDioxideTextureRect.texture = preload("res://pad_hmi_ui/home/co2_icon_high.png")
#烟雾检测
if data.msg.smoke > 0:
%smokeTextureRect2.texture = preload("res://pad_hmi_ui/home/smoke_icon_dis.png")
else:
%smokeTextureRect2.texture = preload("res://pad_hmi_ui/home/smoke_icon_high.png")
"/hmi_input/perception/traffic_light_recognition/traffic_signals":#红绿灯
match data.msg.signals[0].elements[0].color:
0:
@ -178,6 +196,13 @@ func VehicleDoor_Report():#车门
}
Websocket.send_msg(str(send_data))
func Vcu_Report1():#车辆大灯
var send_data = {
"op": "subscribe",
"topic": "/hmi_input/pix_robobus/vcu_report1",
"type": "pix_robobus_driver_msgs/msg/VcuReport1"
}
Websocket.send_msg(str(send_data))
signal OnClick3DVehicle
func _on_d_vehicle_on_click(_node: Variant) -> void:
OnClick3DVehicle.emit()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=48 format=3 uid="uid://dx5owafvbqdec"]
[gd_scene load_steps=49 format=3 uid="uid://dx5owafvbqdec"]
[ext_resource type="Script" path="res://common/base/base_control.gd" id="1_gebae"]
[ext_resource type="Script" path="res://Modules/data_panel.gd" id="1_h1ywm"]
@ -95,6 +95,14 @@ spacing_space = 4
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dyppf"]
content_margin_left = 58.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_p77x8"]
texture = ExtResource("26_h2ca6")
texture_margin_left = 32.0
texture_margin_top = 32.0
texture_margin_right = 32.0
texture_margin_bottom = 28.0
region_rect = Rect2(0, 0, 576, 100)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_v7412"]
texture = ExtResource("26_h2ca6")
expand_margin_top = 50.0
@ -472,7 +480,8 @@ theme_override_constants/margin_top = 29
theme_override_constants/margin_right = 40
theme_override_constants/margin_bottom = 27
[node name="TextureRect" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
[node name="CarbonDioxideTextureRect" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
@ -482,7 +491,8 @@ script = ExtResource("1_gebae")
size_max = 2.0
is_OnClickScaleAwt = null
[node name="TextureRect2" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
[node name="smokeTextureRect2" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0
@ -503,7 +513,8 @@ script = ExtResource("1_gebae")
size_max = 2.0
is_OnClickScaleAwt = null
[node name="TextureRect4" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
[node name="Vcu_Report1TextureRect4" type="TextureRect" parent="MediumMenu/VBoxContainer/CarInfoDisplay/VehicleInformation/VBoxContainer/InformationDisplay4/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
@ -524,7 +535,8 @@ is_Rotation = null
is_OnClickScaleAwt = null
StatusTime = null
[node name="TextureRect" type="TextureRect" parent="MediumMenu/VBoxContainer/HBoxContainer2"]
[node name="mapTextureRect" type="TextureRect" parent="MediumMenu/VBoxContainer/HBoxContainer2"]
unique_name_in_owner = true
modulate = Color(1, 0, 0, 1)
material = SubResource("ShaderMaterial_7qxv8")
layout_mode = 2
@ -627,6 +639,27 @@ layout_mode = 2
size_flags_vertical = 4
texture = ExtResource("27_mc4go")
[node name="Control" type="Control" parent="RightMenu/VBoxContainer/MarginContainer3"]
z_index = 1
layout_mode = 2
mouse_filter = 2
[node name="ScrollContainer" type="ScrollContainer" parent="RightMenu/VBoxContainer/MarginContainer3/Control"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 4.61
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_use_anchors_ = true
[node name="VBoxContainer" type="VBoxContainer" parent="RightMenu/VBoxContainer/MarginContainer3/Control/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_gebae")
styleBox = SubResource("StyleBoxTexture_p77x8")
[node name="MarginContainer4" type="MarginContainer" parent="RightMenu/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4

View File

@ -0,0 +1,207 @@
[preset.0]
name="Android"
platform="Android"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.0.options]
custom_template/debug=""
custom_template/release=""
gradle_build/use_gradle_build=false
gradle_build/gradle_build_directory=""
gradle_build/android_source_template=""
gradle_build/compress_native_libraries=false
gradle_build/export_format=0
gradle_build/min_sdk=""
gradle_build/target_sdk=""
architectures/armeabi-v7a=false
architectures/arm64-v8a=true
architectures/x86=false
architectures/x86_64=false
version/code=1
version/name=""
package/unique_name="com.example.$genname"
package/name=""
package/signed=true
package/app_category=2
package/retain_data_on_uninstall=false
package/exclude_from_recents=false
package/show_in_android_tv=false
package/show_in_app_library=true
package/show_as_launcher_app=false
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/opengl_debug=false
xr_features/xr_mode=0
screen/immersive_mode=true
screen/support_small=true
screen/support_normal=true
screen/support_large=true
screen/support_xlarge=true
user_data_backup/allow=false
command_line/extra_args=""
apk_expansion/enable=false
apk_expansion/SALT=""
apk_expansion/public_key=""
permissions/custom_permissions=PackedStringArray()
permissions/access_checkin_properties=false
permissions/access_coarse_location=false
permissions/access_fine_location=false
permissions/access_location_extra_commands=false
permissions/access_mock_location=false
permissions/access_network_state=false
permissions/access_surface_flinger=false
permissions/access_wifi_state=false
permissions/account_manager=false
permissions/add_voicemail=false
permissions/authenticate_accounts=false
permissions/battery_stats=false
permissions/bind_accessibility_service=false
permissions/bind_appwidget=false
permissions/bind_device_admin=false
permissions/bind_input_method=false
permissions/bind_nfc_service=false
permissions/bind_notification_listener_service=false
permissions/bind_print_service=false
permissions/bind_remoteviews=false
permissions/bind_text_service=false
permissions/bind_vpn_service=false
permissions/bind_wallpaper=false
permissions/bluetooth=false
permissions/bluetooth_admin=false
permissions/bluetooth_privileged=false
permissions/brick=false
permissions/broadcast_package_removed=false
permissions/broadcast_sms=false
permissions/broadcast_sticky=false
permissions/broadcast_wap_push=false
permissions/call_phone=false
permissions/call_privileged=false
permissions/camera=false
permissions/capture_audio_output=false
permissions/capture_secure_video_output=false
permissions/capture_video_output=false
permissions/change_component_enabled_state=false
permissions/change_configuration=false
permissions/change_network_state=false
permissions/change_wifi_multicast_state=false
permissions/change_wifi_state=false
permissions/clear_app_cache=false
permissions/clear_app_user_data=false
permissions/control_location_updates=false
permissions/delete_cache_files=false
permissions/delete_packages=false
permissions/device_power=false
permissions/diagnostic=false
permissions/disable_keyguard=false
permissions/dump=false
permissions/expand_status_bar=false
permissions/factory_test=false
permissions/flashlight=false
permissions/force_back=false
permissions/get_accounts=false
permissions/get_package_size=false
permissions/get_tasks=false
permissions/get_top_activity_info=false
permissions/global_search=false
permissions/hardware_test=false
permissions/inject_events=false
permissions/install_location_provider=false
permissions/install_packages=false
permissions/install_shortcut=false
permissions/internal_system_window=false
permissions/internet=false
permissions/kill_background_processes=false
permissions/location_hardware=false
permissions/manage_accounts=false
permissions/manage_app_tokens=false
permissions/manage_documents=false
permissions/manage_external_storage=false
permissions/master_clear=false
permissions/media_content_control=false
permissions/modify_audio_settings=false
permissions/modify_phone_state=false
permissions/mount_format_filesystems=false
permissions/mount_unmount_filesystems=false
permissions/nfc=false
permissions/persistent_activity=false
permissions/post_notifications=false
permissions/process_outgoing_calls=false
permissions/read_calendar=false
permissions/read_call_log=false
permissions/read_contacts=false
permissions/read_external_storage=false
permissions/read_frame_buffer=false
permissions/read_history_bookmarks=false
permissions/read_input_state=false
permissions/read_logs=false
permissions/read_phone_state=false
permissions/read_profile=false
permissions/read_sms=false
permissions/read_social_stream=false
permissions/read_sync_settings=false
permissions/read_sync_stats=false
permissions/read_user_dictionary=false
permissions/reboot=false
permissions/receive_boot_completed=false
permissions/receive_mms=false
permissions/receive_sms=false
permissions/receive_wap_push=false
permissions/record_audio=false
permissions/reorder_tasks=false
permissions/restart_packages=false
permissions/send_respond_via_message=false
permissions/send_sms=false
permissions/set_activity_watcher=false
permissions/set_alarm=false
permissions/set_always_finish=false
permissions/set_animation_scale=false
permissions/set_debug_app=false
permissions/set_orientation=false
permissions/set_pointer_speed=false
permissions/set_preferred_applications=false
permissions/set_process_limit=false
permissions/set_time=false
permissions/set_time_zone=false
permissions/set_wallpaper=false
permissions/set_wallpaper_hints=false
permissions/signal_persistent_processes=false
permissions/status_bar=false
permissions/subscribed_feeds_read=false
permissions/subscribed_feeds_write=false
permissions/system_alert_window=false
permissions/transmit_ir=false
permissions/uninstall_shortcut=false
permissions/update_device_stats=false
permissions/use_credentials=false
permissions/use_sip=false
permissions/vibrate=false
permissions/wake_lock=false
permissions/write_apn_settings=false
permissions/write_calendar=false
permissions/write_call_log=false
permissions/write_contacts=false
permissions/write_external_storage=false
permissions/write_gservices=false
permissions/write_history_bookmarks=false
permissions/write_profile=false
permissions/write_secure_settings=false
permissions/write_settings=false
permissions/write_sms=false
permissions/write_social_stream=false
permissions/write_sync_settings=false
permissions/write_user_dictionary=false

View File

@ -35,3 +35,4 @@ pointing/emulate_touch_from_mouse=true
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
textures/vram_compression/import_etc2_astc=true