From a76ec7f1b06c470498dd4e6aec050b8f7e8ff355 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Thu, 2 Oct 2025 16:16:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=A0=D0=B5=D0=B6=D0=B8=D0=BC=20=D0=9A=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C.=20=D0=91=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D1=88=D0=B5=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=20=D0=90=D0=A4=D0=A1=D0=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.godot | 4 ++-- scenes/pribor-afsp/pribor-afsp-1.tscn | 4 ++-- scenes/pribor-afsp/pribor-afsp-2.tscn | 1 + scenes/pribor-afsp/pribor-afsp.gd | 3 ++- scenes/pribor-afsp/pribor-bpo.tscn | 3 ++- scenes/контроль/request.gd | 3 +-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/project.godot b/project.godot index 1fa004a5..de2e4e59 100644 --- a/project.godot +++ b/project.godot @@ -31,11 +31,11 @@ interfer/select_color=Vector3(1, 1, 1) interfer/interfer_color=Vector3(0.58, 0.47, 0.51) interfer/resend_timeout=1000.0 config/external_cu=false -config/unit_rr_request_period=20.0 +config/unit_rr_request_period=30.0 config/kems_files_path="user://kems/" config/emsg_files_path="user://emsg/" config/settings_path="user://settings.json" -config/unit_bpo_request_period=20.0 +config/unit_bpo_request_period=30.0 [autoload] diff --git a/scenes/pribor-afsp/pribor-afsp-1.tscn b/scenes/pribor-afsp/pribor-afsp-1.tscn index 3081df5c..58cb3de7 100644 --- a/scenes/pribor-afsp/pribor-afsp-1.tscn +++ b/scenes/pribor-afsp/pribor-afsp-1.tscn @@ -7,7 +7,7 @@ [sub_resource type="GDScript" id="GDScript_yhnwg"] script/source = "extends Timer -func _ready(): wait_time = ProjectSettings.get_setting('application/config/unit_rr_request_period') +func _ready(): wait_time = ProjectSettings.get_setting('application/config/unit_bpo_request_period') " [node name="pribor_afsp" type="Control"] @@ -29,7 +29,7 @@ projsettings_path_left = "application/config/Адрес АФСП левого б projsettings_path_right = "application/config/Адрес АФСП правого борта" [node name="timer" type="Timer" parent="request"] -wait_time = 20.0 +wait_time = 30.0 autostart = true script = SubResource("GDScript_yhnwg") diff --git a/scenes/pribor-afsp/pribor-afsp-2.tscn b/scenes/pribor-afsp/pribor-afsp-2.tscn index 2f252167..1bbfa3d4 100644 --- a/scenes/pribor-afsp/pribor-afsp-2.tscn +++ b/scenes/pribor-afsp/pribor-afsp-2.tscn @@ -29,6 +29,7 @@ projsettings_path_left = "application/config/Адрес АФСП левого б projsettings_path_right = "application/config/Адрес АФСП правого борта" [node name="timer" type="Timer" parent="request"] +wait_time = 30.0 autostart = true script = SubResource("GDScript_yhnwg") diff --git a/scenes/pribor-afsp/pribor-afsp.gd b/scenes/pribor-afsp/pribor-afsp.gd index d7d5ca14..cc24c2bb 100644 --- a/scenes/pribor-afsp/pribor-afsp.gd +++ b/scenes/pribor-afsp/pribor-afsp.gd @@ -7,6 +7,7 @@ class_name pribor_afsp extends 'res://scenes/контроль/прибор.gd' static var json_conv: JSON = JSON.new() static var node_maper = load('res://scenes/контроль/node-maper.gd') +# SystemName: "gen" DevList - там состояние связи с генератором по кан шине func _on_request_completed(result, _response_code, headers, body: PackedByteArray): @@ -50,7 +51,7 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra var received_afsp_name: StringName = ret_val[0] if this_afsp_name != received_afsp_name: - push_error('не известное устройство: \"%s\"' % received_afsp_name) + push_error('не известное устройство: \"%s\", ожидадось: \"%s\"' % [received_afsp_name, this_afsp_name]) return if not unit_instance.online: diff --git a/scenes/pribor-afsp/pribor-bpo.tscn b/scenes/pribor-afsp/pribor-bpo.tscn index 0dc97f30..c1951261 100644 --- a/scenes/pribor-afsp/pribor-bpo.tscn +++ b/scenes/pribor-afsp/pribor-bpo.tscn @@ -198,13 +198,14 @@ self_size = Vector2i(50, 145) fname = "Яч. связи" [node name="request" type="HTTPRequest" parent="."] +use_threads = true script = ExtResource("4_crej3") projsettings_path_left = "application/config/Адрес БПО левого борта" projsettings_path_right = "application/config/Адрес БПО правого борта" projsettings_path_wait_time = "application/config/Период опроса состояния БПО, секунды" [node name="timer" type="Timer" parent="request"] -wait_time = 5.0 +wait_time = 30.0 autostart = true script = SubResource("GDScript_bhc4e") diff --git a/scenes/контроль/request.gd b/scenes/контроль/request.gd index 94815447..92cbd33f 100644 --- a/scenes/контроль/request.gd +++ b/scenes/контроль/request.gd @@ -64,11 +64,10 @@ func _ready(): func _on_request_timer(): - cancel_request() var addr = [addr_right, addr_left][i_bort] var hdrs = [headers_right, headers_left][i_bort] var rc: = request(addr, hdrs) if rc != Error.OK: var s: String = '%s: %s' % [error_string(rc), addr] log.error('%s' % s) - i_bort = (i_bort + 1) % 2 + i_bort = (i_bort + 1) % 2