diff --git a/Robo-Bus-A31-HMI/Modules/update_progress.gd b/Robo-Bus-A31-HMI/Modules/update_progress.gd new file mode 100644 index 0000000..92c445a --- /dev/null +++ b/Robo-Bus-A31-HMI/Modules/update_progress.gd @@ -0,0 +1,7 @@ +extends HBoxContainer + +#用来进行动画的tween +var animation_tween + +#用来标记当前进度的index,可能的取值为0,1,2,3 +@export var now_progress_index:int=0 diff --git a/Robo-Bus-A31-HMI/Modules/update_progress.tscn b/Robo-Bus-A31-HMI/Modules/update_progress.tscn new file mode 100644 index 0000000..18a06fe --- /dev/null +++ b/Robo-Bus-A31-HMI/Modules/update_progress.tscn @@ -0,0 +1,121 @@ +[gd_scene load_steps=4 format=3 uid="uid://ctjlpah7am5se"] + +[ext_resource type="Script" path="res://Modules/update_progress.gd" id="1_hcogg"] +[ext_resource type="Texture2D" uid="uid://4cphf0gmdmla" path="res://pad_hmi_ui/setting/line_icon_high.png" id="3_1ww13"] +[ext_resource type="Texture2D" uid="uid://dc88flrbrvoas" path="res://pad_hmi_ui/setting/line_icon_dis.png" id="5_swik2"] + +[node name="UpdateProgress" type="VBoxContainer"] +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("1_hcogg") + +[node name="hbox" type="HBoxContainer" parent="."] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="text_1" type="VBoxContainer" parent="hbox"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progressItem1" type="Control" parent="hbox/text_1"] +unique_name_in_owner = true +custom_minimum_size = Vector2(94.925, 73) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 + +[node name="progress_state_1" type="Label" parent="hbox/text_1"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "已完成" +horizontal_alignment = 1 + +[node name="progress_name_1" type="Label" parent="hbox/text_1"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "查询" +horizontal_alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="hbox"] +layout_mode = 2 + +[node name="tab" type="Control" parent="hbox/VBoxContainer"] +layout_mode = 2 + +[node name="line1" type="TextureRect" parent="hbox/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("3_1ww13") + +[node name="text_2" type="VBoxContainer" parent="hbox"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progressItem2" type="Control" parent="hbox/text_2"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progress_state_2" type="Label" parent="hbox/text_2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "已完成" +horizontal_alignment = 1 + +[node name="progress_name_2" type="Label" parent="hbox/text_2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "查询" +horizontal_alignment = 1 + +[node name="line2" type="TextureRect" parent="hbox"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("5_swik2") + +[node name="text_3" type="VBoxContainer" parent="hbox"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progressItem3" type="Control" parent="hbox/text_3"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progress_state_3" type="Label" parent="hbox/text_3"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "已完成" +horizontal_alignment = 1 + +[node name="progress_name_3" type="Label" parent="hbox/text_3"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "查询" +horizontal_alignment = 1 + +[node name="line3" type="TextureRect" parent="hbox"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("5_swik2") + +[node name="text_4" type="VBoxContainer" parent="hbox"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progressItem4" type="Control" parent="hbox/text_4"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="progress_state_4" type="Label" parent="hbox/text_4"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "已完成" +horizontal_alignment = 1 + +[node name="progress_name_4" type="Label" parent="hbox/text_4"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "查询" +horizontal_alignment = 1 diff --git a/Robo-Bus-A31-HMI/Modules/ws_connect_button.gd b/Robo-Bus-A31-HMI/Modules/ws_connect_button.gd new file mode 100644 index 0000000..946c47b --- /dev/null +++ b/Robo-Bus-A31-HMI/Modules/ws_connect_button.gd @@ -0,0 +1,14 @@ +extends BaseControl + +@export var TextureNormal :Texture2D +@export var TexturePressed : Texture2D + + +func _on_button_down() -> void: + $TextureRect.texture=TexturePressed + pass # Replace with function body. + + +func _on_button_up() -> void: + $TextureRect.texture=TextureNormal + pass # Replace with function body. diff --git a/Robo-Bus-A31-HMI/control.tscn b/Robo-Bus-A31-HMI/control.tscn index 55bfdf2..e94543f 100644 --- a/Robo-Bus-A31-HMI/control.tscn +++ b/Robo-Bus-A31-HMI/control.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=70 format=4 uid="uid://cxqxr0p1wkkdy"] +[gd_scene load_steps=76 format=4 uid="uid://cxqxr0p1wkkdy"] [ext_resource type="Texture2D" uid="uid://vc7lcwu566lf" path="res://1.png" id="1_21tqn"] [ext_resource type="Texture2D" uid="uid://blakv4vhyfyro" path="res://pad_hmi_ui/home/home page_bg.png" id="1_brgxr"] @@ -28,8 +28,13 @@ [ext_resource type="PackedScene" uid="uid://df31a6g0oklv" path="res://Modules/language_tabs.tscn" id="50_8t5s4"] [ext_resource type="Texture2D" uid="uid://dsl2hpmaayodk" path="res://pad_hmi_ui/taskbar/PIX_logo.png" id="50_86b81"] [ext_resource type="PackedScene" uid="uid://84vxs0ksabkq" path="res://Modules/tabs.tscn" id="50_mi4fd"] +[ext_resource type="Script" path="res://Modules/ws_connect_button.gd" id="51_ac4eh"] [ext_resource type="Texture2D" uid="uid://ruvsjrmynxch" path="res://pad_hmi_ui/taskbar/title.png" id="51_ptwd7"] +[ext_resource type="Texture2D" uid="uid://bgykactp343j6" path="res://pad_hmi_ui/setting/connect_icon_pressed.png" id="52_oloqp"] +[ext_resource type="Texture2D" uid="uid://c15ltf6sdq5m1" path="res://pad_hmi_ui/setting/cancel_btn.png" id="53_663io"] [ext_resource type="Texture2D" uid="uid://83ghm43vg1e5" path="res://pad_hmi_ui/setting/fileformat_btn_high.png" id="53_t2ril"] +[ext_resource type="Texture2D" uid="uid://o418ai5uhori" path="res://pad_hmi_ui/setting/confirm_btn.png" id="54_qf1b0"] +[ext_resource type="PackedScene" uid="uid://ctjlpah7am5se" path="res://Modules/update_progress.tscn" id="55_bwxbw"] [ext_resource type="Texture2D" uid="uid://eevtiqj5g6a8" path="res://3.png" id="57_v7hfe"] [ext_resource type="Texture2D" uid="uid://dncdx223e1re4" path="res://pad_hmi_ui/setting/function_bg.png" id="58_7tose"] [ext_resource type="Texture2D" uid="uid://4d4n8nhdloy" path="res://pad_hmi_ui/setting/build_icon.png" id="59_ykyo4"] @@ -913,6 +918,9 @@ texture = ExtResource("65_6ujfn") [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_heghw"] texture = ExtResource("70_xatqx") +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rplcn"] +texture = ExtResource("60_jy5qr") + [node name="Control" type="Control"] layout_mode = 3 anchors_preset = 15 @@ -1624,6 +1632,7 @@ size_flags_stretch_ratio = 21.0 [node name="DataPanel" parent="MarginContainer/HBoxContainer/MarginContainer" instance=ExtResource("47_jqspi")] unique_name_in_owner = true +visible = false layout_mode = 2 [node name="Main3DVehicle" parent="MarginContainer/HBoxContainer/MarginContainer" instance=ExtResource("48_p5kic")] @@ -1638,6 +1647,7 @@ layout_mode = 2 layout_mode = 2 [node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting"] +visible = false layout_mode = 1 anchors_preset = 6 anchor_left = 1.0 @@ -1915,20 +1925,202 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_styles/panel = SubResource("StyleBoxTexture_heghw") -[node name="LineEdit" type="LineEdit" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WebsocketAddress"] +[node name="WebsocketAddressInput" type="LineEdit" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WebsocketAddress"] layout_mode = 2 theme_override_font_sizes/font_size = 30 text = "ws://192.168.4.88:9091" alignment = 1 flat = true -[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer"] +[node name="WsConnectButton" type="Button" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer"] +custom_minimum_size = Vector2(100, 0) layout_mode = 2 -texture = ExtResource("60_jy5qr") +focus_mode = 0 +flat = true +script = ExtResource("51_ac4eh") +TextureNormal = ExtResource("61_l5w4b") +TexturePressed = ExtResource("52_oloqp") +styleBox = SubResource("StyleBoxTexture_rplcn") +is_Scale = true +size_max = 1.2 -[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer"] +[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WsConnectButton"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 19.0 +offset_bottom = 23.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("61_l5w4b") +expand_mode = 1 + +[node name="RightBottonPanel" type="MarginContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 +theme_override_constants/margin_left = 48 +theme_override_constants/margin_top = 42 +theme_override_constants/margin_right = 45 +theme_override_constants/margin_bottom = 48 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "VCU固件版本:" +vertical_alignment = 1 + +[node name="VCU_version" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 32 +text = "1.1.1" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="tab" type="Control" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(80, 0) +layout_mode = 2 + +[node name="Label3" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 31 +text = "自动驾驶版本:" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ADAS_version" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 32 +text = "1.1.1" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="tab" type="Control" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 52) +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "OTA升级" +vertical_alignment = 1 + +[node name="UpdateButton" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 10 +texture = ExtResource("67_6xjbf") +script = ExtResource("79_i36i4") +is_Scale = true + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/HBoxContainer2/UpdateButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 32 +text = "检查更新" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="tab2" type="Control" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 52) +layout_mode = 2 + +[node name="UpdateLog" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +texture = ExtResource("66_aybjc") + +[node name="UpdateMessage" type="MarginContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 52 +theme_override_constants/margin_top = 40 +theme_override_constants/margin_right = 35 +theme_override_constants/margin_bottom = 29 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage"] +layout_mode = 2 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage/HBoxContainer"] +custom_minimum_size = Vector2(571, 191) +layout_mode = 2 +size_flags_vertical = 0 +theme_override_colors/font_color = Color(0.403922, 0.403922, 0.403922, 1) +theme_override_constants/line_spacing = 19 +theme_override_font_sizes/font_size = 24 +text = "找到可更新的固件,是否立即开始升级 +固件名称:0214_00_08_0712 固件大小:87.8MB +更新日期:2024-07-12 11:54:53 +更新内容:-- +" +autowrap_mode = 3 + +[node name="tab" type="Control" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage/HBoxContainer"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 + +[node name="UpdateCancelBtn" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 8 +texture = ExtResource("53_663io") +script = ExtResource("79_i36i4") +is_Scale = true + +[node name="tab2" type="Control" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage/HBoxContainer"] +custom_minimum_size = Vector2(34.895, 0) +layout_mode = 2 + +[node name="UpdateAcceptBtn" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/UpdateMessage/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 8 +texture = ExtResource("54_qf1b0") +script = ExtResource("79_i36i4") +is_Scale = true + +[node name="Updating" type="MarginContainer" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 52 +theme_override_constants/margin_top = 40 +theme_override_constants/margin_right = 35 +theme_override_constants/margin_bottom = 29 + +[node name="UpdateProgress" parent="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/RightBottonPanel/VBoxContainer/UpdateLog/Updating" instance=ExtResource("55_bwxbw")] +layout_mode = 2 [node name="TextureRect" type="TextureRect" parent="."] visible = false @@ -1944,6 +2136,7 @@ texture = ExtResource("57_v7hfe") expand_mode = 1 [node name="Control" type="Control" parent="."] +visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -1951,3 +2144,6 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 + +[connection signal="button_down" from="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WsConnectButton" to="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WsConnectButton" method="_on_button_down"] +[connection signal="button_up" from="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WsConnectButton" to="MarginContainer/HBoxContainer/MarginContainer/Setting/HBoxContainer/VBoxContainer/margin/VBoxContainer/HBoxContainer3/VBoxContainer2/HBoxContainer/WsConnectButton" method="_on_button_up"] diff --git a/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png b/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png new file mode 100644 index 0000000..51c65ef Binary files /dev/null and b/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png differ diff --git a/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png.import b/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png.import new file mode 100644 index 0000000..20e307f --- /dev/null +++ b/Robo-Bus-A31-HMI/pad_hmi_ui/setting/connect_icon_pressed.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bgykactp343j6" +path="res://.godot/imported/connect_icon_pressed.png-fef6a1f51bb5c8d583dcd420488b31d2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://pad_hmi_ui/setting/connect_icon_pressed.png" +dest_files=["res://.godot/imported/connect_icon_pressed.png-fef6a1f51bb5c8d583dcd420488b31d2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1