сохранение/загрузка в эмс-г на доработке

This commit is contained in:
2025-03-11 19:18:42 +03:00
parent 228d1dfd19
commit 3c598d9bc6
4 changed files with 37 additions and 31 deletions

View File

@@ -29,7 +29,9 @@ var modul_um: Array = [0, 0, 0, 0]
func _ready() -> void:
$Background/lbl_commit.text = commit.VCS_HEAD
$Background/notice/lbl_commit.text = commit.VCS_HEAD
$Background/notice/bind_addr.text = '/Базовый адресс: %s' % Constants.UNICAST_ADDRESS
$Background/notice/bind_port.text = '/Базовый порт: %s ' % Constants.UNICAST_PORT
# Считывание аргументов с консоли (путь сохранения)
#var args = OS.get_cmdline_user_args()
@@ -609,10 +611,10 @@ func _save_selected_file(file_path: String):
if file != null:
file.store_string(JSON.stringify(param_ems_g))
file.close()
$Background/switch_panel/save_config/notice.visible = true
$Background/switch_panel/save_config/notice.text = '✅ Файл %s записан успешно!' % file_path
$Background/notice/load_notice.text = '✅ Файл %s записан успешно!' % file_path
$Background/notice/load_notice.visible = true
await get_tree().create_timer(2.0).timeout
$Background/switch_panel/save_config/notice.visible = false
$Background/notice/load_notice.visible = false
func _on_load_config():
@@ -640,11 +642,11 @@ func _load_selected_file():
if error == OK:
var data_received: Dictionary = json.data
if typeof(data_received) == TYPE_DICTIONARY:
$Background/switch_panel/load_config/notice.visible = true
$Background/switch_panel/load_config/notice.text = '✅ Файл %s прочитан успешно' % file_path
await get_tree().create_timer(2.0).timeout
$Background/switch_panel/load_config/notice.visible = false
$Background/notice/load_notice.text = '✅ Файл %s прочитан успешно' % file_path
$Background/notice/load_notice.visible = true
emit_signal('write_ems_g_start', data_received)
await get_tree().create_timer(2.0).timeout
$Background/notice/load_notice.visible = false
else:
print("Несоответствующий тип данных!")
else: