checheche/Robo-Bus-A31-HMI/Modules/setting.gd
2024-12-14 20:09:43 +08:00

125 lines
3.0 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends MarginContainer
#左边进度条和label进度显示的控制变量
var progress:float=0:
set(value):
if progress!=value:
progress=value
%progressBar.value=progress*100
%progressLabel.text=str(int(progress*100))+"%"
#进度类型,-1为不工作隐藏进度条0为录制数据依次排列
var progress_type:int=-1:
set(value):
if progress_type!=value:
progress_type=value
match value:
-1:
%progressPanel.hide()
0:
%progressPanel.show()
%progressHead.text="录制数据 -"
1:
%progressPanel.show()
%progressHead.text="构建高清地图 -"
2:
%progressPanel.show()
%progressHead.text="导出 -"
3:
%progressPanel.show()
%progressHead.text="下载更新地图 -"
4:
%progressPanel.show()
%progressHead.text="上传 -"
pass
#语言映射0为中文1为English3为日语
var language:int=0:
set(value):
if value!=language:
%LanguageTabs.set_select_index_without_signal(value)
language=value
pass
#信号,当语言被用户主动改变时发出
signal language_changed(lang:int)
#用户输入的websocket地址映射
var WsAddress:String:
get():
return %WebsocketAddressInput.text
set(value):
%WebsocketAddressInput.text=value
#当录制按钮被按下时触发
func _on_record_on_click(_node: Variant) -> void:
pass # Replace with function body.
#当构建按钮被按下时触发
func _on_build_on_click(_node: Variant) -> void:
pass # Replace with function body.
#导出类型0为.bag,1为.pcd
var export_type:int=0
func _on_export_on_click(_node: Variant) -> void:
pass # Replace with function body.
#当下载按钮被按下时触发
func _on_download_on_click(_node: Variant) -> void:
pass # Replace with function body.
#上传类型0为.pcd,1为.osm
var upload_type:int=0
#当上传按钮被按下时触发
func _on_upload_on_click(_node: Variant) -> void:
pass # Replace with function body.
func _on_upload_tabs_onclick(State: int) -> void:
upload_type=State
pass # Replace with function body.
func _on_export_tabs_onclick(State: int) -> void:
export_type=State
pass # Replace with function body.
func _on_language_tabs_onclick(State: int) -> void:
if language!=State:
language=State
language_changed.emit()
pass # Replace with function body.
#当用户按下连接服务器按钮后触发
func _on_ws_connect_button_pressed() -> void:
pass # Replace with function body.
#向左下角的log面板添加一条消息
func add_info(str:String):
%infoLabel.text+=("\n"+str)
pass
#当用户在在更新选择时选择确定更新触发显示更新的label为%updateMessage可以更改里面的文本显示不同的更新信息
func _on_update_cancel_btn_on_click(_node: Variant) -> void:
pass # Replace with function body.
#当用户在更新选择时取消更新触发
func _on_update_accept_btn_on_click(_node: Variant) -> void:
pass # Replace with function body.
#当用户点击检查更新时触发
func _on_update_button_on_click(_node: Variant) -> void:
pass # Replace with function body.