diff --git a/scenes/pribor-afsp/pribor-afsp-1.tscn b/scenes/pribor-afsp/pribor-afsp-1.tscn index 58cb3de..4c027fd 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_bpo_request_period') +func _enter_tree() -> void: wait_time = ProjectSettings.get_setting('application/config/unit_bpo_request_period') " [node name="pribor_afsp" type="Control"] diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 5a42002..8fb04b7 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -49,6 +49,7 @@ const null_units_names = ['уарэп-афсп-левый', 'уарэп-афсп func on_line_changed(u, conn_node, _pribor_meta): conn_node.set_val(u.online) +func on_mode_changed(): clean_pribor_items() func _ready(): @@ -71,6 +72,10 @@ func _ready(): for unit_name in null_units_names: var unit_instance = network.get_unit_instance(unit_name) unit_instance.connect('line_changed', on_line_changed) + signaller.conn(signaller.режим_работа, on_mode_changed) + signaller.conn(signaller.режим_журнал, on_mode_changed) + signaller.conn(signaller.режим_настройки, on_mode_changed) + signaller.conn(signaller.режим_эмс, on_mode_changed) func online_change_arr(_u, conn_node, pribor_meta): @@ -83,11 +88,15 @@ func online_change_arr(_u, conn_node, pribor_meta): conn_node.set_val(state_online) -func on_pribor_press(pribor_path, header_text, pribor_node): +func clean_pribor_items(): var items = get_tree().get_nodes_in_group('pribor_items') for item in items: remove_child(item) item.queue_free() + + +func on_pribor_press(pribor_path, header_text, pribor_node): + clean_pribor_items() var pribor_obj = load(pribor_path) if not pribor_obj: push_error('не загружено: \\\"%s\\\" (%s)' % [pribor_path, header_text])