diff --git a/project.godot b/project.godot index 1fa004a..de2e4e5 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 3081df5..58cb3de 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 2f25216..1bbfa3d 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 d7d5ca1..cc24c2b 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 0dc97f3..c195126 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 9481544..92cbd33 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