diff --git a/scenes/tabs-switch/tab-switch.gd b/scenes/tabs-switch/tab-switch.gd index dc238c3..094ca3e 100644 --- a/scenes/tabs-switch/tab-switch.gd +++ b/scenes/tabs-switch/tab-switch.gd @@ -12,6 +12,7 @@ const TAB_TOSIGNAL_NAME = { func _enter_tree() -> void: network.logger_page = $Журнал signaller.connect('ems2_hide_pressed', on_ems2_hide_pressed) + ProjectSettings.connect('settings_changed', on_setting_changed) func on_ems2_hide_pressed(state): @@ -21,3 +22,8 @@ func on_ems2_hide_pressed(state): func _on_tab_changed(tab) -> void: if TAB_TOSIGNAL_NAME.has(tab): signaller.emit_signal(TAB_TOSIGNAL_NAME[tab]) + + +func on_setting_changed(): + var ext_cu = ProjectSettings.get_setting('application/config/external_cu', false) + get_parent().get_node('remote_control').visible = ext_cu diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn index 4b41cae..b534326 100644 --- a/scenes/tabs-switch/tab-switch.tscn +++ b/scenes/tabs-switch/tab-switch.tscn @@ -82,4 +82,20 @@ text = "Исправно" horizontal_alignment = 1 vertical_alignment = 1 +[node name="remote_control" type="Label" parent="."] +visible = false +layout_mode = 2 +offset_left = 1358.0 +offset_right = 1501.0 +offset_bottom = 27.0 +tooltip_text = "Комплекс находится под внешним управлением" +mouse_filter = 0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("7_i7l8n") +theme_override_font_sizes/font_size = 14 +theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22") +text = "Внешнее управление" +horizontal_alignment = 1 +vertical_alignment = 1 + [connection signal="tab_changed" from="tab_switch" to="tab_switch" method="_on_tab_changed"] diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index ca5ea4c..cfe4b29 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -209,6 +209,7 @@ func setting_tab(): func button_settings(): var extern_cu_node = $scroll_set/table.get_node2(1, EXTERNAL_CU).get_children()[0] extern_cu_node.connect('pressed', on_external_cu_btn_pressed.bind(extern_cu_node)) + on_external_cu_btn_pressed(extern_cu_node) $scroll_set/table.set_row_text(SUPPRESS,(['Кнопка «Подавление»'])) $scroll_set/table.set_row_text(KEYBOARD,(['Виртуальная клавиатура'])) var vk_node = $scroll_set/table.get_node2(1, KEYBOARD).get_children()[0] diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 196c974..9a75da6 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -285,6 +285,6 @@ texture_pressed = ExtResource("13_ggrwd") [connection signal="drag_continue" from="." to="." method="_on_drag_continue"] [connection signal="toggled" from="btn_view" to="." method="on_button_view_toggled"] [connection signal="toggled" from="chk_auto" to="." method="on_value_changed"] -[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] +[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] diff --git a/scripts/tcp5p28.gd b/scripts/tcp5p28.gd index 8d45a8f..02a2396 100644 --- a/scripts/tcp5p28.gd +++ b/scripts/tcp5p28.gd @@ -131,6 +131,9 @@ class TCP5P28 extends unit.Unit: var cu_data: PackedByteArray = [] cu_data.resize(4) for id in interfers.values(): + if not ecms.has(id): + push_error('не обнаружен ключ: %s, в словаре воздействий' %id) + continue var cu = ecms[id] cu_data.encode_u16(0, cu.ispp) var state: int = CU_STATE[cu.svk] if CU_STATE.has(cu.svk) else 9