Merge remote-tracking branch 'sasha/master'

This commit is contained in:
MaD_CaT
2025-09-23 14:39:59 +03:00
27 changed files with 1096 additions and 685 deletions

View File

@@ -1,17 +0,0 @@
@tool
class_name pribor_externals extends 'res://scenes/контроль/прибор.gd'
var UnitPanel = load('res://scenes/контроль/элемент-ю.tscn')
func on_line_changed(unit_inst: unit.Unit, unit_panel: Control): unit_panel.state = unit_inst.online
func _ready() -> void:
if Engine.is_editor_hint():
return
for unit_inst in network.units.values():
var unit_panel = UnitPanel.instantiate()
unit_panel.fname = unit_inst.name
$grid.add_child(unit_panel)
unit_inst.connect('line_changed', on_line_changed.bind(unit_panel))
on_line_changed(unit_inst, unit_panel)

View File

@@ -1 +0,0 @@
uid://beb41qdahkdp5

View File

@@ -1,16 +1,34 @@
[gd_scene load_steps=3 format=3 uid="uid://dwgvv4b4a5t1"]
[ext_resource type="Script" uid="uid://beb41qdahkdp5" path="res://scenes/pribor-externals/externals.gd" id="1_pacm1"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_pacm1"]
[sub_resource type="GDScript" id="GDScript_dk54t"]
script/source = "@tool
class_name externals extends 'res://scenes/контроль/прибор.gd'
var UnitPanel = load('res://scenes/контроль/элемент-ю.tscn')
func on_line_changed(unit_inst: unit.Unit, unit_panel: Control): unit_panel.state = unit_inst.online
func _ready() -> void:
if Engine.is_editor_hint():
return
for unit_inst in network.units.values():
var unit_panel = UnitPanel.instantiate()
unit_panel.fname = unit_inst.name
$grid.add_child(unit_panel)
unit_inst.connect('line_changed', on_line_changed.bind(unit_panel))
on_line_changed(unit_inst, unit_panel)
"
[node name="externals" type="PanelContainer"]
offset_left = 71.0
offset_top = 75.0
offset_right = 756.0
offset_bottom = 964.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_pacm1")
script = ExtResource("1_pacm1")
script = SubResource("GDScript_dk54t")
[node name="grid" type="GridContainer" parent="."]
layout_mode = 2

View File

@@ -69,7 +69,7 @@ func on_toggled_switch(val: bool, meta: Array, unit_sch3):
func _enter_tree() -> void:
super._enter_tree()
if Engine.is_editor_hint(): return
var unit_sch3 = network.get_unit_instance(unit_name)
var unit_sch3: = network.get_unit_instance(unit_name)
unit_sch3.base_holding_address = base_holding_address
unit_sch3.regs_holding_count = regs_holding_count
unit_sch3.base_input_address = base_input_address
@@ -82,7 +82,7 @@ func _enter_tree() -> void:
func _ready() -> void:
var unit_sch3 = network.get_unit_instance(unit_name)
var unit_sch3: = network.get_unit_instance(unit_name)
var items = get_tree().get_nodes_in_group('bits_items_switch')
for item in items:
var meta = item.get_meta('bits')

View File

@@ -0,0 +1,12 @@
extends TextureRect
@export var unit_name: StringName = ''
func _ready() -> void:
var unit_instance = network.get_unit_instance(unit_name)
unit_instance.connect('line_changed', on_line_changed)
func on_line_changed(unit_instance: unit.Unit):
$connect_pribor.set_val(unit_instance.online)

View File

@@ -0,0 +1 @@
uid://q3gmpsqspjfp

View File

@@ -5,7 +5,7 @@ extends Node
@export var state_colors: Array
func _on_toggled(toggled_on): $frame.visible = toggled_on
func _enter_tree() -> void: $label.self_modulate = state
func _enter_tree() -> void: $label.self_modulate = state_colors[state]
@export var state: int:

View File

@@ -1,81 +0,0 @@
extends Panel
"""
Режим контроль
"""
#TODO: рефактор: заменить подчёркивание на тире
const PRIBORS_RES = \
{
'externals': ['res://scenes/pribor-externals/externals.tscn', 'Контроль подключения внешних систем'],
'pribor_prd_k_1': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 1'],
'pribor_prd_k_2': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 2'],
'pribor_prd_k_3': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 3'],
'pribor_prd_k_4': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 4'],
'pribor_prd_n_1': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 1'],
'pribor_prd_n_2': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 2'],
'pribor_prd_n_3': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 3'],
'pribor_prd_n_4': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 4'],
'pribor_prd_v_1': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 1'],
'pribor_prd_v_2': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 2'],
'pribor_prd_v_3': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 3'],
'pribor_prd_v_4': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 4'],
'pribor_rtr': ['res://scenes/pribor-afsp/pribor-bpo.tscn', 'Контроль исправности прибора РТР'],
'pribor_afsp_1': ['res://scenes/pribor-afsp/pribor-afsp-1.tscn', 'Контроль исправности прибора АФСП 1'],
'pribor_afsp_2': ['res://scenes/pribor-afsp/pribor-afsp-2.tscn', 'Контроль исправности прибора АФСП 2'],
'pribor_uf': ['res://scenes/pribor-uf/pribor-uf.tscn', 'Контроль исправности прибора УФ'],
'pribor_uyep': ['res://scenes/pribor-uyep/pribor-uyep.tscn', 'Контроль исправности устройства У-ЭП'],
}
func on_line_changed(u, conn_node, _pribor_meta): conn_node.set_val(u.online)
func _ready():
var group = ButtonGroup.new()
for k in PRIBORS_RES:
var pribor_node = get_node(k)
var pribor_path = PRIBORS_RES[k][0]
var header_text = PRIBORS_RES[k][1]
pribor_node.set_button_group(group)
pribor_node.connect('button_down', Callable(self, 'on_pribor_press').bind(pribor_path, header_text, pribor_node))
var conn_node = pribor_node.get_node('connect_pribor')
var pribor_meta = pribor_node.get_meta('unit_name', [])
var pribor_proc = pribor_node.get_meta('online_proc', '')
if pribor_proc == '':
continue
if pribor_meta.size():
for i in pribor_meta.size():
var unit_pribor = network.get_unit_instance(pribor_meta[i])
unit_pribor.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, pribor_meta))
func online_change_arr(_u, conn_node, pribor_meta):
var state_online = true
for i in pribor_meta.size():
var unit_pribor = network.get_unit_instance(pribor_meta[i])
if not unit_pribor.online:
state_online = false
break
conn_node.set_val(state_online)
func on_pribor_press(pribor_path, header_text, pribor_node):
var items = get_tree().get_nodes_in_group('pribor_items')
for item in items:
remove_child(item)
item.queue_free()
var pribor_obj = load(pribor_path)
if not pribor_obj:
push_error('не загружено: \"%s\" (%s)' % [pribor_path, header_text])
return
var pribor = pribor_obj.instantiate()
if not pribor:
push_error('экземпляр не создан: \"%s\" (%s)' % [pribor_path, header_text])
return
$lbl_header.text = header_text
var meta_list = pribor_node.get_meta_list()
if meta_list.find('unit_name') > -1:
var unit_name = pribor_node.get_meta('unit_name')
pribor.set_meta('unit_name', unit_name)
pribor.add_to_group('pribor_items')
add_child(pribor)

View File

@@ -1 +0,0 @@
uid://b0wcp76bbl2jx

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=17 format=3 uid="uid://lwmw4egynmd1"]
[gd_scene load_steps=18 format=3 uid="uid://lwmw4egynmd1"]
[ext_resource type="Script" uid="uid://b0wcp76bbl2jx" path="res://scenes/контроль/контроль.gd" id="1_x5d6w"]
[ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_0nvm1"]
[ext_resource type="Script" uid="uid://q3gmpsqspjfp" path="res://scenes/контроль/внешний.gd" id="2_8r80x"]
[ext_resource type="Texture2D" uid="uid://bb80aigvv648i" path="res://data/кнопка-внешние-0.png" id="2_oysma"]
[ext_resource type="Script" uid="uid://bj4nndrurbunl" path="res://scenes/контроль/кнопка-прибора.gd" id="3_4pt7j"]
[ext_resource type="Texture2D" uid="uid://dkqlvd750pplc" path="res://data/СПТ.png" id="3_hhadv"]
@@ -16,6 +16,89 @@
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="9_ll0vs"]
[ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect_pribor.gd" id="11_u7tym"]
[sub_resource type="GDScript" id="GDScript_iqgf5"]
script/source = "extends Panel
\"\"\"
Режим контроль
\"\"\"
#TODO: рефактор: заменить подчёркивание на тире
const PRIBORS_RES = \\
{
'pribor_prd_k_1': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 1'],
'pribor_prd_k_2': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 2'],
'pribor_prd_k_3': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 3'],
'pribor_prd_k_4': ['res://scenes/pribor-prd-k/pribor-prd-k.tscn', 'Контроль исправности прибора ПРД-К 4'],
'pribor_prd_n_1': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 1'],
'pribor_prd_n_2': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 2'],
'pribor_prd_n_3': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 3'],
'pribor_prd_n_4': ['res://scenes/pribor-prd-n/pribor-prd-n.tscn', 'Контроль исправности прибора ПРД-Н 4'],
'pribor_prd_v_1': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 1'],
'pribor_prd_v_2': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 2'],
'pribor_prd_v_3': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 3'],
'pribor_prd_v_4': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 4'],
'pribor_rtr': ['res://scenes/pribor-afsp/pribor-bpo.tscn', 'Контроль исправности прибора РТР'],
'pribor_afsp_1': ['res://scenes/pribor-afsp/pribor-afsp-1.tscn', 'Контроль исправности прибора АФСП 1'],
'pribor_afsp_2': ['res://scenes/pribor-afsp/pribor-afsp-2.tscn', 'Контроль исправности прибора АФСП 2'],
'pribor_uf': ['res://scenes/pribor-uf/pribor-uf.tscn', 'Контроль исправности прибора УФ'],
'pribor_uyep': ['res://scenes/pribor-uyep/pribor-uyep.tscn', 'Контроль исправности устройства У-ЭП'],
}
func on_line_changed(u, conn_node, _pribor_meta): conn_node.set_val(u.online)
func _ready():
var group = ButtonGroup.new()
for k in PRIBORS_RES:
var pribor_node = get_node(k)
var pribor_path = PRIBORS_RES[k][0]
var header_text = PRIBORS_RES[k][1]
pribor_node.set_button_group(group)
pribor_node.connect('button_down', Callable(self, 'on_pribor_press').bind(pribor_path, header_text, pribor_node))
var conn_node = pribor_node.get_node('connect_pribor')
var pribor_meta = pribor_node.get_meta('unit_name', [])
var pribor_proc = pribor_node.get_meta('online_proc', '')
if pribor_proc == '':
continue
if pribor_meta.size():
for i in pribor_meta.size():
var unit_pribor = network.get_unit_instance(pribor_meta[i])
unit_pribor.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, pribor_meta))
func online_change_arr(_u, conn_node, pribor_meta):
var state_online = true
for i in pribor_meta.size():
var unit_pribor = network.get_unit_instance(pribor_meta[i])
if not unit_pribor.online:
state_online = false
break
conn_node.set_val(state_online)
func on_pribor_press(pribor_path, header_text, pribor_node):
var items = get_tree().get_nodes_in_group('pribor_items')
for item in items:
remove_child(item)
item.queue_free()
var pribor_obj = load(pribor_path)
if not pribor_obj:
push_error('не загружено: \\\"%s\\\" (%s)' % [pribor_path, header_text])
return
var pribor = pribor_obj.instantiate()
if not pribor:
push_error('экземпляр не создан: \\\"%s\\\" (%s)' % [pribor_path, header_text])
return
$lbl_header.text = header_text
var meta_list = pribor_node.get_meta_list()
if meta_list.find('unit_name') > -1:
var unit_name = pribor_node.get_meta('unit_name')
pribor.set_meta('unit_name', unit_name)
pribor.add_to_group('pribor_items')
add_child(pribor)
"
[sub_resource type="SpriteFrames" id="SpriteFrames_foasq"]
animations = [{
"frames": [{
@@ -36,58 +119,174 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_x5d6w")
script = SubResource("GDScript_iqgf5")
metadata/_edit_lock_ = true
[node name="externals" type="TextureButton" parent="." groups=["pribor_buttons"]]
[node name="capsrpb" type="TextureRect" parent="."]
editor_description = "Кнопка для отображения внешних соединений."
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
layout_mode = 0
offset_left = 1435.0
offset_top = 32.0
offset_right = 1691.0
offset_bottom = 288.0
scale = Vector2(0.5, 0.5)
offset_left = 959.0
offset_top = 1021.0
offset_right = 1215.0
offset_bottom = 1277.0
scale = Vector2(0.25, 0.25)
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
action_mode = 0
texture_normal = ExtResource("2_oysma")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.74, 0.37, 1), Color(0.854902, 0.0705882, 0.0705882, 1)]
texture = ExtResource("2_oysma")
script = ExtResource("2_8r80x")
unit_name = &"уарэп-капсрпб"
[node name="label" type="Label" parent="externals"]
self_modulate = Color(0, 0, 0, 0)
[node name="label" type="Label" parent="capsrpb"]
layout_mode = 0
offset_left = 58.0
offset_top = -26.0
offset_right = 219.0
offset_bottom = -7.0
text = "Внешние подключения"
offset_left = -44.0
offset_top = -128.0
offset_right = 41.0
offset_bottom = -109.0
scale = Vector2(4, 4)
text = "КАПС РПБ"
horizontal_alignment = 1
vertical_alignment = 1
[node name="frame" type="NinePatchRect" parent="externals"]
visible = false
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
layout_mode = 0
offset_left = -32.0
offset_top = -12.0
offset_right = 123.0
offset_bottom = 111.0
scale = Vector2(2, 2)
texture = ExtResource("4_rasbe")
region_rect = Rect2(-3, -3, 89, 89)
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="externals"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
[node name="connect_pribor" type="AnimatedSprite2D" parent="capsrpb"]
light_mask = 3
position = Vector2(47.9999, 30)
scale = Vector2(1.23077, 1.25)
position = Vector2(56, -4)
scale = Vector2(2.6, 2.6)
sprite_frames = SubResource("SpriteFrames_foasq")
script = ExtResource("11_u7tym")
[node name="5p28" type="TextureRect" parent="."]
editor_description = "Кнопка для отображения внешних соединений."
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
layout_mode = 0
offset_left = 1088.0
offset_top = 1021.0
offset_right = 1344.0
offset_bottom = 1277.0
scale = Vector2(0.25, 0.25)
size_flags_horizontal = 15
size_flags_vertical = 15
texture = ExtResource("2_oysma")
script = ExtResource("2_8r80x")
unit_name = &"уарэп-5п28"
[node name="label" type="Label" parent="5p28"]
layout_mode = 0
offset_left = 16.0
offset_top = -128.0
offset_right = 68.0
offset_bottom = -109.0
scale = Vector2(4, 4)
text = "5П28"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="5p28"]
light_mask = 3
position = Vector2(52, -4)
scale = Vector2(2.6, 2.6)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="akng" type="TextureRect" parent="."]
editor_description = "Кнопка для отображения внешних соединений."
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
layout_mode = 0
offset_left = 1216.0
offset_top = 1021.0
offset_right = 1472.0
offset_bottom = 1277.0
scale = Vector2(0.25, 0.25)
size_flags_horizontal = 15
size_flags_vertical = 15
texture = ExtResource("2_oysma")
script = ExtResource("2_8r80x")
unit_name = &"навигация"
[node name="label" type="Label" parent="akng"]
layout_mode = 0
offset_left = 4.0
offset_top = -128.0
offset_right = 53.0
offset_bottom = -109.0
scale = Vector2(4, 4)
text = "АКНГ"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="akng"]
light_mask = 3
position = Vector2(47.9999, -4)
scale = Vector2(2.6, 2.6)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="maps" type="TextureRect" parent="."]
editor_description = "Кнопка для отображения внешних соединений."
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
layout_mode = 0
offset_left = 1344.0
offset_top = 1021.0
offset_right = 1600.0
offset_bottom = 1277.0
scale = Vector2(0.25, 0.25)
size_flags_horizontal = 15
size_flags_vertical = 15
texture = ExtResource("2_oysma")
script = ExtResource("2_8r80x")
unit_name = &"навигация"
[node name="label" type="Label" parent="maps"]
layout_mode = 0
offset_left = 4.0
offset_top = -128.0
offset_right = 53.0
offset_bottom = -109.0
scale = Vector2(4, 4)
text = "Карты"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="maps"]
light_mask = 3
position = Vector2(47.9999, -4)
scale = Vector2(2.6, 2.6)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="trassa" type="TextureRect" parent="."]
editor_description = "Кнопка для отображения внешних соединений."
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
layout_mode = 0
offset_left = 1472.0
offset_top = 1021.0
offset_right = 1728.0
offset_bottom = 1277.0
scale = Vector2(0.25, 0.25)
size_flags_horizontal = 15
size_flags_vertical = 15
texture = ExtResource("2_oysma")
script = ExtResource("2_8r80x")
unit_name = &"уарэп-трасса"
[node name="label" type="Label" parent="trassa"]
layout_mode = 0
offset_left = 4.0
offset_top = -128.0
offset_right = 53.0
offset_bottom = -109.0
scale = Vector2(4, 4)
text = "Трасса"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="trassa"]
light_mask = 3
position = Vector2(47.9999, -4)
scale = Vector2(2.6, 2.6)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
@@ -95,9 +294,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_uf" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1150.0
offset_left = 1183.0
offset_top = 565.0
offset_right = 1261.0
offset_right = 1294.0
offset_bottom = 750.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -111,7 +310,6 @@ metadata/unit_name = ["уарэп-эмс"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_uf"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 15.0
offset_top = -34.0
@@ -123,7 +321,6 @@ vertical_alignment = 1
[node name="frame" type="NinePatchRect" parent="pribor_uf"]
visible = false
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
layout_mode = 0
offset_left = -14.0
offset_top = -30.0
@@ -137,7 +334,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_uf"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(52, -6)
scale = Vector2(0.625, 0.625)
@@ -148,9 +344,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_rtr" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1025.0
offset_left = 1058.0
offset_top = 595.0
offset_right = 1131.0
offset_right = 1164.0
offset_bottom = 751.0
pivot_offset = Vector2(-10, -65)
size_flags_horizontal = 15
@@ -162,6 +358,16 @@ stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
[node name="label" type="Label" parent="pribor_rtr"]
layout_mode = 0
offset_left = 12.0
offset_top = -54.0
offset_right = 95.0
offset_bottom = -35.0
text = "РТР"
horizontal_alignment = 1
vertical_alignment = 1
[node name="frame" type="NinePatchRect" parent="pribor_rtr"]
visible = false
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
@@ -177,8 +383,7 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label" type="Label" parent="pribor_rtr"]
self_modulate = Color(0, 0, 0, 0)
[node name="label2" type="Label" parent="pribor_rtr"]
layout_mode = 0
offset_left = 12.0
offset_top = -54.0
@@ -189,7 +394,6 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_rtr"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(55, -15)
scale = Vector2(0.625, 0.625)
@@ -200,10 +404,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_afsp_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1020.0
offset_top = 420.0
offset_right = 1853.0
offset_bottom = 1060.0
offset_left = 1053.0
offset_top = 432.0
offset_right = 1886.0
offset_bottom = 1072.0
scale = Vector2(0.2, 0.2)
pivot_offset = Vector2(-10, -65)
size_flags_horizontal = 15
@@ -215,6 +419,17 @@ stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
[node name="label" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
offset_left = 165.0
offset_top = -245.0
offset_right = 262.0
offset_bottom = -225.0
scale = Vector2(5, 5)
text = "АФСП 1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="frame" type="NinePatchRect" parent="pribor_afsp_1"]
visible = false
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
@@ -231,8 +446,7 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label" type="Label" parent="pribor_afsp_1"]
self_modulate = Color(0, 0, 0, 0)
[node name="label2" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
offset_left = 165.0
offset_top = -245.0
@@ -244,7 +458,6 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_1"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(415, -40)
scale = Vector2(3, 3)
@@ -255,10 +468,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_afsp_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1210.0
offset_top = 420.0
offset_right = 2043.0
offset_bottom = 1060.0
offset_left = 1243.0
offset_top = 432.0
offset_right = 2076.0
offset_bottom = 1072.0
scale = Vector2(0.2, 0.2)
pivot_offset = Vector2(-10, -65)
size_flags_horizontal = 15
@@ -271,6 +484,17 @@ flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
[node name="label" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
offset_left = 200.0
offset_top = -240.0
offset_right = 297.0
offset_bottom = -220.0
scale = Vector2(5, 5)
text = "АФСП 2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="frame" type="NinePatchRect" parent="pribor_afsp_2"]
visible = false
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
@@ -287,8 +511,7 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label" type="Label" parent="pribor_afsp_2"]
self_modulate = Color(0, 0, 0, 0)
[node name="label2" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
offset_left = 200.0
offset_top = -240.0
@@ -300,7 +523,6 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_2"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(425, -40)
scale = Vector2(3, 3)
@@ -311,9 +533,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_uyep" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1280.0
offset_left = 1313.0
offset_top = 565.0
offset_right = 1374.0
offset_right = 1407.0
offset_bottom = 751.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -327,7 +549,6 @@ metadata/unit_name = ["уарэп-щ3", "уарэп-спт25-1", "уарэп-с
metadata/online_proc = "online_change_arr"
[node name="label" type="Label" parent="pribor_uyep"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 26.8566
offset_top = -38.3276
@@ -353,7 +574,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_uyep"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(45, -10)
scale = Vector2(0.625, 0.625)
@@ -364,9 +584,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_v_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1435.0
offset_left = 1440.0
offset_top = 680.0
offset_right = 1512.0
offset_right = 1517.0
offset_bottom = 796.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -381,7 +601,6 @@ metadata/unit_name = ["уарэп-яу07-2в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_2"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 14.0
offset_top = -38.0
@@ -407,7 +626,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_2"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(40, -10)
scale = Vector2(0.625, 0.625)
@@ -418,9 +636,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_n_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1435.0
offset_left = 1440.0
offset_top = 345.0
offset_right = 1512.0
offset_right = 1517.0
offset_bottom = 461.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -435,7 +653,6 @@ metadata/unit_name = ["уарэп-яу07-2н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_2"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 15.0
offset_top = -38.0
@@ -463,7 +680,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_2"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(40, -10)
scale = Vector2(0.625, 0.625)
@@ -474,9 +690,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_k_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1435.0
offset_left = 1440.0
offset_top = 515.0
offset_right = 1512.0
offset_right = 1517.0
offset_bottom = 631.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -491,7 +707,6 @@ metadata/unit_name = ["уарэп-яу07-2к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_2"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 17.0
offset_top = -38.0
@@ -517,7 +732,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_2"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(43, -10)
scale = Vector2(0.625, 0.625)
@@ -528,10 +742,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_v_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1015.0
offset_top = 865.0
offset_right = 1092.0
offset_bottom = 981.0
offset_left = 1048.0
offset_top = 802.0
offset_right = 1125.0
offset_bottom = 918.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -545,7 +759,6 @@ metadata/unit_name = ["уарэп-яу07-3в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_3"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 9.0
offset_top = -38.0
@@ -571,7 +784,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_3"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(34, -10)
scale = Vector2(0.625, 0.625)
@@ -582,10 +794,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_n_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1290.0
offset_top = 865.0
offset_right = 1367.0
offset_bottom = 981.0
offset_left = 1323.0
offset_top = 802.0
offset_right = 1400.0
offset_bottom = 918.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -599,7 +811,6 @@ metadata/unit_name = ["уарэп-яу07-3н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_3"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 8.0
offset_top = -38.0
@@ -625,7 +836,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_3"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(33, -10)
scale = Vector2(0.625, 0.625)
@@ -636,10 +846,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_k_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1155.0
offset_top = 865.0
offset_right = 1232.0
offset_bottom = 981.0
offset_left = 1188.0
offset_top = 802.0
offset_right = 1265.0
offset_bottom = 918.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -653,7 +863,6 @@ metadata/unit_name = ["уарэп-яу07-3к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_3"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 9.0
offset_top = -38.0
@@ -679,7 +888,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_3"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
@@ -690,10 +898,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_v_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1295.0
offset_top = 180.0
offset_right = 1372.0
offset_bottom = 296.0
offset_left = 1328.0
offset_top = 198.0
offset_right = 1405.0
offset_bottom = 314.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -707,7 +915,6 @@ metadata/unit_name = ["уарэп-яу07-1в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_1"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 8.0
offset_top = -38.0
@@ -733,7 +940,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_1"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(34, -10)
scale = Vector2(0.625, 0.625)
@@ -744,10 +950,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_n_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1015.0
offset_top = 175.0
offset_right = 1092.0
offset_bottom = 291.0
offset_left = 1048.0
offset_top = 193.0
offset_right = 1125.0
offset_bottom = 309.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -761,7 +967,6 @@ metadata/online_proc = "on_line_changed"
metadata/unit_name = ["уарэп-яу07-1н"]
[node name="label" type="Label" parent="pribor_prd_n_1"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 8.0
offset_top = -38.0
@@ -787,7 +992,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_1"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
@@ -798,10 +1002,10 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_k_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1150.0
offset_top = 175.0
offset_right = 1227.0
offset_bottom = 291.0
offset_left = 1183.0
offset_top = 193.0
offset_right = 1260.0
offset_bottom = 309.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -815,7 +1019,6 @@ metadata/unit_name = ["уарэп-яу07-1к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_1"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 9.0
offset_top = -38.0
@@ -841,7 +1044,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_1"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
@@ -852,9 +1054,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_v_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 890.0
offset_left = 946.0
offset_top = 345.0
offset_right = 967.0
offset_right = 1023.0
offset_bottom = 461.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -868,7 +1070,6 @@ metadata/unit_name = ["уарэп-яу07-4в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_4"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 17.0
offset_top = -38.0
@@ -894,7 +1095,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_4"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(41, -10)
scale = Vector2(0.625, 0.625)
@@ -905,9 +1105,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_n_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 885.0
offset_left = 941.0
offset_top = 685.0
offset_right = 962.0
offset_right = 1018.0
offset_bottom = 801.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -921,7 +1121,6 @@ metadata/unit_name = ["уарэп-яу07-4н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_4"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 14.0
offset_top = -38.0
@@ -947,7 +1146,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_4"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(40, -10)
scale = Vector2(0.625, 0.625)
@@ -958,9 +1156,9 @@ script = ExtResource("11_u7tym")
[node name="pribor_prd_k_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 890.0
offset_left = 946.0
offset_top = 515.0
offset_right = 967.0
offset_right = 1023.0
offset_bottom = 631.0
size_flags_horizontal = 15
size_flags_vertical = 15
@@ -974,7 +1172,6 @@ metadata/unit_name = ["уарэп-яу07-4к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_4"]
self_modulate = Color(0, 0, 0, 0)
layout_mode = 0
offset_left = 17.0
offset_top = -38.0
@@ -1000,7 +1197,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_4"]
modulate = Color(0.498039, 0.498039, 0.498039, 1)
light_mask = 3
position = Vector2(42, -10)
scale = Vector2(0.625, 0.625)
@@ -1011,9 +1207,9 @@ script = ExtResource("11_u7tym")
[node name="txr_legend0" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 219.0
offset_top = 1135.0
offset_top = 1141.0
offset_right = 443.0
offset_bottom = 1359.0
offset_bottom = 1365.0
scale = Vector2(0.1, 0.1)
texture = ExtResource("7_6j01w")
@@ -1021,9 +1217,9 @@ texture = ExtResource("7_6j01w")
self_modulate = Color(1, 1, 1, 0.627451)
layout_mode = 0
offset_left = 247.0
offset_top = 1136.0
offset_top = 1142.0
offset_right = 403.0
offset_bottom = 1156.0
offset_bottom = 1162.0
theme_override_font_sizes/font_size = 17
text = "Ожидание результата"
@@ -1031,27 +1227,27 @@ text = "Ожидание результата"
self_modulate = Color(1, 1, 1, 0.627451)
layout_mode = 0
offset_left = 52.0
offset_top = 1136.0
offset_top = 1142.0
offset_right = 125.0
offset_bottom = 1156.0
offset_bottom = 1162.0
theme_override_font_sizes/font_size = 17
text = "Исправно"
[node name="txr_legend1" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 26.0001
offset_top = 1135.0
offset_top = 1141.0
offset_right = 250.0
offset_bottom = 1359.0
offset_bottom = 1365.0
scale = Vector2(0.1, 0.1)
texture = ExtResource("8_isjua")
[node name="txr_legend2" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 476.0
offset_top = 1135.0
offset_top = 1141.0
offset_right = 700.0
offset_bottom = 1359.0
offset_bottom = 1365.0
scale = Vector2(0.1, 0.1)
texture = ExtResource("9_ll0vs")
@@ -1059,24 +1255,76 @@ texture = ExtResource("9_ll0vs")
self_modulate = Color(1, 1, 1, 0.627451)
layout_mode = 0
offset_left = 504.0
offset_top = 1136.0
offset_top = 1142.0
offset_right = 548.0
offset_bottom = 1156.0
offset_bottom = 1162.0
theme_override_font_sizes/font_size = 17
text = "Сбой"
[node name="lbl_header" type="Label" parent="."]
layout_mode = 0
offset_left = 75.0
offset_top = 15.0
offset_right = 653.0
offset_bottom = 43.0
offset_left = 78.0
offset_top = 27.0
offset_right = 656.0
offset_bottom = 58.0
theme_override_font_sizes/font_size = 22
text = "Контроль исправности прибора"
horizontal_alignment = 1
vertical_alignment = 1
[connection signal="toggled" from="externals" to="externals" method="_on_toggled"]
[node name="connect_legend0" type="AnimatedSprite2D" parent="."]
light_mask = 3
position = Vector2(1219, 1151)
scale = Vector2(0.65, 0.65)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="Label" type="Label" parent="connect_legend0"]
offset_left = 36.9231
offset_top = -15.3846
offset_right = 103.923
offset_bottom = 3.61538
scale = Vector2(1.54, 1.54)
text = "Отключен"
metadata/_edit_use_anchors_ = true
[node name="connect_legend1" type="AnimatedSprite2D" parent="."]
self_modulate = Color(0, 1, 0, 1)
light_mask = 3
position = Vector2(975, 1152)
scale = Vector2(0.65, 0.65)
sprite_frames = SubResource("SpriteFrames_foasq")
frame = 1
script = ExtResource("11_u7tym")
[node name="Label" type="Label" parent="connect_legend1"]
offset_left = 36.9231
offset_top = -13.8462
offset_right = 99.9231
offset_bottom = 5.15385
scale = Vector2(1.54, 1.54)
text = "На связи"
metadata/_edit_use_anchors_ = true
[node name="line0" type="Line2D" parent="."]
position = Vector2(936, 950)
points = PackedVector2Array(-8, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
[node name="line1" type="Line2D" parent="."]
position = Vector2(936, 1128)
points = PackedVector2Array(-8, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
[node name="line2" type="Line2D" parent="."]
position = Vector2(32, 1128)
points = PackedVector2Array(-8, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
[connection signal="toggled" from="pribor_uf" to="pribor_uf" method="_on_toggled"]
[connection signal="toggled" from="pribor_rtr" to="pribor_rtr" method="_on_toggled"]
[connection signal="toggled" from="pribor_afsp_1" to="pribor_afsp_1" method="_on_toggled"]

View File

@@ -1 +1 @@
uid://cwurf51vh7ylm
uid://blnakmwyvinxm

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=12 format=3 uid="uid://btpc78gucr57f"]
[ext_resource type="Script" uid="uid://cwurf51vh7ylm" path="res://scenes/контроль/элемент-я.gd" id="1_fwxi0"]
[ext_resource type="Script" uid="uid://blnakmwyvinxm" path="res://scenes/контроль/элемент-я.gd" id="1_ajips"]
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="3_dktys"]
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="3_t4y6r"]
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="4_bdhnj"]
@@ -48,7 +48,7 @@ layout_mode = 3
anchors_preset = 0
offset_right = 180.0
offset_bottom = 155.0
script = ExtResource("1_fwxi0")
script = ExtResource("1_ajips")
textures = [ExtResource("3_dktys"), ExtResource("3_t4y6r"), ExtResource("4_bdhnj")]
[node name="rect" type="NinePatchRect" parent="."]

View File

@@ -1,269 +0,0 @@
class_name setting extends Panel
const TableHeader = preload('res://table/header.tscn')
const TableToggle = preload('res://table/settings-toggle.tscn')
const TableEdit = preload('res://table/ячейка-2.tscn')
const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER]
const HEADER_ROW = [TableHeader, TableHeader]
const HEADER_ROW_TEXT = ['Параметр', 'Значение']
const SETTING_TABLE = [
['Ограниченный режим', TableEdit, TableToggle, 'Ограничть возможности по постановке помех'],
['Кнопка «ПД-М', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-М', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОЗП-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «МЧМ-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН-И1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН-М', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ЛЧМ-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-М4С»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-ЧМ»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «СВ-И1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «К', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «СВ-М', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «JTIDS»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «КУПД»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Внешнее управление', TableEdit, TableToggle, 'Передать управление в 5П28'],
['Кнопка «Подавление»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Виртуальная клавиатура', TableEdit, TableToggle, 'Включить отображение экранной клавиатуры'],
['Скрыть вкладку ЭМС 2', TableEdit, TableToggle, 'Отображать вкладку \"ЭМС-2\"'],
['Текущая версия ПО УАРЭП', TableEdit, TableEdit, 'Время сборки, версия и номер фиксации'],
['уарэп-яу07-частный', TableEdit, TableEdit, 'IP-адрес для получения частных сообщений от ЯУ-07'],
['уарэп-яу07-общий', TableEdit, TableEdit, 'IP-адрес для получения широковещательных сообщений от ЯУ-07'],
['уарэп-капсрпб', TableEdit, TableEdit, 'IP-адрес для связи с КАПС-РПБ'],
['уарэп-эмс', TableEdit, TableEdit, 'IP-адрес для связи с ЭМС'],
['уарэп-яу07-2в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 2'],
['уарэп-яу07-2н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 2'],
['уарэп-яу07-2к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 2'],
['уарэп-яу07-4в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 4'],
['уарэп-яу07-4н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 4'],
['уарэп-яу07-4к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 4'],
['уарэп-яу07-1в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 1'],
['уарэп-яу07-1н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 1'],
['уарэп-яу07-1к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 1'],
['уарэп-яу07-3в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 3'],
['уарэп-яу07-3н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 3'],
['уарэп-яу07-3к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 3'],
['уарэп-5п28', TableEdit, TableEdit, 'IP-адрес для связи с 5П28'],
['навигация', TableEdit, TableEdit, 'Порт назначения для получения данных от АКНГ'],
['уарэп-щ3', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором Щ3'],
['уарэп-спт25-1', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором СПТ-25 1'],
['уарэп-спт25-2', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором СПТ-25 2'],
['Шаблон адреса сервера карт', TableEdit, TableEdit, 'Шаблон URL-адреса сервера карт, должен содержать поля \"{x}\", \"{y}\", \"{z}\" для подстановки индекса плитки'],
['Адрес АФСП левого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора АФСП'],
['Адрес АФСП правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора АФСП'],
['Адрес БПО левого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'],
['Адрес БПО правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'] ]
const EXTERNAL_CU = 16 ## Внешнее целееуказание
const SUPPRESS = 17 ## Строка - Подавление
const KEYBOARD = 18 ## Строка - Виртуальная клавиатура
const HIDE_EMS2 = 19 ## Строка - Скрыть вкладку ЭМС 2
const COMMIT = 20 ## Строка - Версия УАРЭП
var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки
func on_checkbutton_pressed(i_row: int): on_row_pressed(i_row)
## Вызывается, когда узел впервые попадает в дерево сцены.
func _ready() -> void:
setting_tab()
if not OS.get_cmdline_args().has('++ограниченный'):
return
$Label2.text = 'Текущий режим доступа: ограниченный'
for node in $GridContainer.get_children().filter(func(b): return b is Button):
node.disabled = true
func on_external_cu_btn_pressed(btn) -> void:
var state = btn.button_pressed
ProjectSettings.set_setting('application/config/Внешнее управление', state)
if state:
signaller.emit_signal('interfer_off_all')
func on_vk_pressed(btn) -> void:
var state = btn.button_pressed
signaller.emit_signal('kb_pressed', state)
func on_ems2_pressed(btn) -> void:
var state = btn.button_pressed
signaller.emit_signal('ems2_hide_pressed', state)
func on_row_pressed(i_row: int):
$scroll_set/table.clear_rows_selected()
$scroll_set/table.set_row_selected(i_row, true)
func parse_cmd_line_args(settings_data: Dictionary):
var args = OS.get_cmdline_args()
for i in range(0, args.size(), 2):
var key: String = args[i]
key = key.lstrip('\'\" ').rstrip('\'\" ').strip_edges().strip_escapes()
if not settings_data.has(key):
continue
if not ((i + 1) < args.size()):
push_error('для аргумента \"%s\" не указано значение.' % key)
break
var val0 = args[i + 1]
var val1 = settings_data[key]
val0 = val0.lstrip('\'\" ').rstrip('\'\" ').strip_edges().strip_escapes()
if typeof(val1) == TYPE_BOOL:
if val0 not in ['yes', 'true', 'да', 'no', 'false', 'нет']:
push_error('для аргумента \"%s\" указано неверное значение \"%s\".' % [key, val0])
break
settings_data[key] = true if val0 in ['yes', 'true', 'да'] else false
elif typeof(val1) == TYPE_ARRAY:
var val0s = val0.split(',')
if val0s.size() != val1.size():
push_error('для аргумента \"%s\" указано неверное значение \"%s\" (исходное: \"%s\").' % [key, val0, val1])
break
for j in val0s.size():
var val: String = val0s[j]
val = val.lstrip('\'\" ').rstrip('\'\" ').strip_edges().strip_escapes()
if tools.type_is_num(val):
val0s[j] = int(val)
elif val in ['true', 'false']:
val0s[j] = true if val == 'true' else false
else:
val0s[j] = val
elif typeof(val1) == TYPE_STRING:
settings_data[key] = val0
## Загружает настройки из файла
func load_settings(settings_data: Dictionary):
var settings_file = settings.get_settings_file_path()
var file = FileAccess.open(settings_file, FileAccess.READ)
var abs_path = ProjectSettings.globalize_path(settings_file)
if file:
var read = file.get_as_text()
file.close()
var json_conv = JSON.new()
if json_conv.parse(read) == OK:
settings_data.merge(json_conv.get_data())
else:
log.warning('Не удалось разобрать \"%s\", будут использованы настройки по умолчанию' % abs_path)
else:
log.warning('Файл \"%s\" не найден, будут использованы настройки по умолчанию' % abs_path)
func setting_tab():
$heard_table.set_header(HEADER_ROW)
$heard_table.set_header_text(HEADER_ROW_TEXT)
$heard_table.set_columns_min_size([600, 950])
$heard_table.set_columns_alignments(ALIGNMENT)
var settings_data = {}
load_settings(settings_data)
parse_cmd_line_args(settings_data)
for key in settings_data:
ProjectSettings.set_setting('application/config/%s' % key, settings_data[key])
for i in SETTING_TABLE.size():
var tbl_row = SETTING_TABLE[i]
var param_name = tbl_row[0]
var node_label = tbl_row[1]
var node_value = tbl_row[2]
var tootip_text = tbl_row[3]
name_to_line_index[param_name] = i
$scroll_set/table.add_row([node_label, node_value])
var label_instance = $scroll_set/table.get_node2(0, i)
label_instance.text = param_name
label_instance.tooltip_text = tootip_text
$scroll_set/table.set_node_editable(0, i, false)
var node_values = $scroll_set/table.get_node2(1, i).get_children()
var edit_node = $scroll_set/table.get_node2(1, i)
if node_values.size():
var child = node_values[0]
if child is CheckButton:
child.connect('pressed', Callable(self, 'on_checkbutton_pressed').bind(i))
var val = settings_data[param_name] if settings_data.has(param_name) else false
child.set_pressed(val)
else:
if settings_data.has(param_name):
var val = settings_data[param_name]
if typeof(val) == TYPE_STRING:
$scroll_set/table.get_node2(1, i).text = settings_data[param_name]
if edit_node:
if edit_node is LineEdit:
$scroll_set/table.set_node_control(1, i, true)
$scroll_set/table.set_node_editable(1, COMMIT, false)
$scroll_set/table.set_columns_min_size([600, 950])
$scroll_set/table.set_columns_alignments(ALIGNMENT)
$scroll_set/table.connect('row_pressed', Callable(self, 'on_row_pressed'))
var commit_instance = $scroll_set/table.get_node2(1, COMMIT)
commit_instance.text = '%s' % commit.VCS_HEAD
for i in SETTING_TABLE.size():
var param_name = SETTING_TABLE[i][0]
if not settings.UnitProfiles.has(param_name):
continue
var unit_data = settings.UnitProfiles[param_name]
var profile = $scroll_set/table.get_node2(1, i)
var joined_data = ''
for j in unit_data[2].size():
joined_data += str(unit_data[2][j])
if j < unit_data[2].size() - 1:
joined_data += ','
profile.text = '%s : %s' % [str(unit_data[1]), joined_data]
button_settings()
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)
var vk_node = $scroll_set/table.get_node2(1, KEYBOARD).get_children()[0]
vk_node.connect('pressed', on_vk_pressed.bind(vk_node))
var ems2_hide_node = $scroll_set/table.get_node2(1, HIDE_EMS2).get_children()[0]
ems2_hide_node.connect('pressed', on_ems2_pressed.bind(ems2_hide_node))
ems2_hide_node.set_pressed(true)
on_ems2_pressed(ems2_hide_node)
func _on_btn_save_settings_pressed():
var json_data = {}
for i in SETTING_TABLE.size():
var parameter = SETTING_TABLE[i][0]
if parameter in settings.UnitProfiles:
var profiles = $scroll_set/table.get_node2(1, i)
var value = profiles.get_text()
if parameter not in json_data:
json_data[parameter] = []
if value.find(':') != -1:
var parts = value.split(':')
var ip = parts[0].strip_edges()
var ports = parts[1].split(',')
json_data[parameter].append(ip)
for port in ports:
if port == 'true':
json_data[parameter].append(true)
elif port == 'false':
json_data[parameter].append(false)
else:
port = port.strip_edges()
if port.is_valid_int():
port = int(port)
json_data[parameter].append(port)
else:
var children = $scroll_set/table.get_node2(1, i).get_children()
if len(children):
var child = children[0]
json_data[parameter] = child.is_pressed()
else:
var row = $scroll_set/table.get_row(i)
json_data[parameter] = row[1].text
for key in json_data:
ProjectSettings.set_setting('application/config/%s' % key, json_data[key])
var settings_file = settings.get_settings_file_path()
var file = FileAccess.open(settings_file, FileAccess.WRITE)
var abs_path = ProjectSettings.globalize_path(settings_file)
if not file:
log.error('Не удалось открыть файл для записи \"%s\"' % abs_path)
return
var json_string = JSON.stringify(json_data, ' ', true)
if file.store_string(json_string):
log.info('Настройки сохранены в файл \"%s\"' % abs_path)
file.close()

View File

@@ -1 +0,0 @@
uid://deq4pmm4iy6ip

View File

@@ -1,9 +1,266 @@
[gd_scene load_steps=7 format=3 uid="uid://bnptm4rlp60dq"]
[ext_resource type="Script" uid="uid://deq4pmm4iy6ip" path="res://scenes/настройки/настройки.gd" id="1_2l3rd"]
[ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="2_6sx73"]
[ext_resource type="Texture2D" uid="uid://csnts8f155sf7" path="res://data/save1.png" id="3_dbpks"]
[sub_resource type="GDScript" id="GDScript_fc87o"]
script/source = "class_name configure extends Panel
const TableHeader = preload('res://table/header.tscn')
const TableToggle = preload('res://table/settings-toggle.tscn')
const TableEdit = preload('res://table/ячейка-2.tscn')
const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER]
const HEADER_ROW = [TableHeader, TableHeader]
const HEADER_ROW_TEXT = ['Параметр', 'Значение']
const SETTING_TABLE = [
['Ограниченный режим', TableEdit, TableToggle, 'Ограничть возможности по постановке помех'],
['Кнопка «ПД-М4»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-М2»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОЗП-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «МЧМ-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН-И1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН-М2»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ЛЧМ-1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-М4С»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ПД-ЧМ»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «СВ-И1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «К1»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «СВ-М2»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «ОРН»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «JTIDS»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Кнопка «КУПД»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Внешнее управление', TableEdit, TableToggle, 'Передать управление в 5П28'],
['Кнопка «Подавление»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Виртуальная клавиатура', TableEdit, TableToggle, 'Включить отображение экранной клавиатуры'],
['Скрыть вкладку ЭМС 2', TableEdit, TableToggle, 'Отображать вкладку \\\"ЭМС-2\\\"'],
['Текущая версия ПО УАРЭП', TableEdit, TableEdit, 'Время сборки, версия и номер фиксации'],
['уарэп-яу07-частный', TableEdit, TableEdit, 'IP-адрес для получения частных сообщений от ЯУ-07'],
['уарэп-яу07-общий', TableEdit, TableEdit, 'IP-адрес для получения широковещательных сообщений от ЯУ-07'],
['уарэп-капсрпб', TableEdit, TableEdit, 'IP-адрес для связи с КАПС-РПБ'],
['уарэп-эмс', TableEdit, TableEdit, 'IP-адрес для связи с ЭМС'],
['уарэп-яу07-2в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 2'],
['уарэп-яу07-2н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 2'],
['уарэп-яу07-2к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 2'],
['уарэп-яу07-4в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 4'],
['уарэп-яу07-4н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 4'],
['уарэп-яу07-4к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 4'],
['уарэп-яу07-1в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 1'],
['уарэп-яу07-1н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 1'],
['уарэп-яу07-1к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 1'],
['уарэп-яу07-3в', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-В 3'],
['уарэп-яу07-3н', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-Н 3'],
['уарэп-яу07-3к', TableEdit, TableEdit, 'IP-адрес для связи с прибором ПРД-К 3'],
['уарэп-5п28', TableEdit, TableEdit, 'IP-адрес для связи с 5П28'],
['навигация', TableEdit, TableEdit, 'Порт назначения для получения данных от АКНГ'],
['уарэп-щ3', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором Щ3'],
['уарэп-спт25-1', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором СПТ-25 1'],
['уарэп-спт25-2', TableEdit, TableEdit, 'Путь к UART-устройству для связи с прибором СПТ-25 2'],
['Шаблон адреса сервера карт', TableEdit, TableEdit, 'Шаблон URL-адреса сервера карт, должен содержать поля \\\"{x}\\\", \\\"{y}\\\", \\\"{z}\\\" для подстановки индекса плитки'],
['Адрес АФСП левого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора АФСП'],
['Адрес АФСП правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора АФСП'],
['Адрес БПО левого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'],
['Адрес БПО правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'] ]
const EXTERNAL_CU = 16 ## Внешнее целеуказание
const SUPPRESS = 17 ## Строка - Подавление
const KEYBOARD = 18 ## Строка - Виртуальная клавиатура
const HIDE_EMS2 = 19 ## Строка - Скрыть вкладку ЭМС 2
const COMMIT = 20 ## Строка - Версия УАРЭП
var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки
func on_checkbutton_pressed(i_row: int): on_row_pressed(i_row)
## Вызывается, когда узел впервые попадает в дерево сцены.
func _ready() -> void:
setting_tab()
if not OS.get_cmdline_args().has('++ограниченный'):
return
$Label2.text = 'Текущий режим доступа: ограниченный'
for node in $GridContainer.get_children().filter(func(b): return b is Button):
node.disabled = true
func on_external_cu_btn_pressed(btn) -> void:
var state = btn.button_pressed
ProjectSettings.set_setting('application/config/Внешнее управление', state)
if state:
signaller.emit_signal('interfer_off_all')
func on_vk_pressed(btn) -> void:
var state = btn.button_pressed
signaller.emit_signal('kb_pressed', state)
func on_ems2_pressed(btn) -> void:
var state = btn.button_pressed
signaller.emit_signal('ems2_hide_pressed', state)
func on_row_pressed(i_row: int):
$scroll_set/table.clear_rows_selected()
$scroll_set/table.set_row_selected(i_row, true)
func parse_cmd_line_args(settings_data: Dictionary):
var args = OS.get_cmdline_args()
for i in range(0, args.size(), 2):
var key: String = args[i]
key = key.lstrip('\\'\\\" ').rstrip('\\'\\\" ').strip_edges().strip_escapes()
if not settings_data.has(key):
continue
if not ((i + 1) < args.size()):
push_error('для аргумента \\\"%s\\\" не указано значение.' % key)
break
var val0 = args[i + 1]
var val1 = settings_data[key]
val0 = val0.lstrip('\\'\\\" ').rstrip('\\'\\\" ').strip_edges().strip_escapes()
if typeof(val1) == TYPE_BOOL:
if val0 not in ['yes', 'true', 'да', 'no', 'false', 'нет']:
push_error('для аргумента \\\"%s\\\" указано неверное значение \\\"%s\\\".' % [key, val0])
break
settings_data[key] = true if val0 in ['yes', 'true', 'да'] else false
elif typeof(val1) == TYPE_ARRAY:
var val0s = val0.split(',')
if val0s.size() != val1.size():
push_error('для аргумента \\\"%s\\\" указано неверное значение \\\"%s\\\" (исходное: \\\"%s\\\").' % [key, val0, val1])
break
for j in val0s.size():
var val: String = val0s[j]
val = val.lstrip('\\'\\\" ').rstrip('\\'\\\" ').strip_edges().strip_escapes()
if tools.type_is_num(val):
val0s[j] = int(val)
elif val in ['true', 'false']:
val0s[j] = true if val == 'true' else false
else:
val0s[j] = val
elif typeof(val1) == TYPE_STRING:
settings_data[key] = val0
func setting_tab():
$heard_table.set_header(HEADER_ROW)
$heard_table.set_header_text(HEADER_ROW_TEXT)
$heard_table.set_columns_min_size([600, 950])
$heard_table.set_columns_alignments(ALIGNMENT)
var settings_data = {}
parse_cmd_line_args(settings_data)
for key in settings_data:
ProjectSettings.set_setting('application/config/%s' % key, settings_data[key])
for i in SETTING_TABLE.size():
var tbl_row = SETTING_TABLE[i]
var param_name = tbl_row[0]
var node_label = tbl_row[1]
var node_value = tbl_row[2]
var tootip_text = tbl_row[3]
name_to_line_index[param_name] = i
$scroll_set/table.add_row([node_label, node_value])
var label_instance = $scroll_set/table.get_node2(0, i)
label_instance.text = param_name
label_instance.tooltip_text = tootip_text
$scroll_set/table.set_node_editable(0, i, false)
var node_values = $scroll_set/table.get_node2(1, i).get_children()
var edit_node = $scroll_set/table.get_node2(1, i)
if node_values.size():
var child = node_values[0]
if child is CheckButton:
child.connect('pressed', Callable(self, 'on_checkbutton_pressed').bind(i))
var val = settings_data[param_name] if settings_data.has(param_name) else false
child.set_pressed(val)
else:
if settings_data.has(param_name):
var val = settings_data[param_name]
if typeof(val) == TYPE_STRING:
$scroll_set/table.get_node2(1, i).text = settings_data[param_name]
if edit_node:
if edit_node is LineEdit:
$scroll_set/table.set_node_control(1, i, true)
$scroll_set/table.set_node_editable(1, COMMIT, false)
$scroll_set/table.set_columns_min_size([600, 950])
$scroll_set/table.set_columns_alignments(ALIGNMENT)
$scroll_set/table.connect('row_pressed', Callable(self, 'on_row_pressed'))
var commit_instance = $scroll_set/table.get_node2(1, COMMIT)
commit_instance.text = '%s' % commit.VCS_HEAD
for i in SETTING_TABLE.size():
var param_name = SETTING_TABLE[i][0]
var profile = $scroll_set/table.get_node2(1, i)
if settings.UnitProfiles.has(param_name):
var unit_data = settings.UnitProfiles[param_name][1]
profile.text = ''
for val in unit_data:
profile.text += str(val) + ','
profile.text = profile.text.trim_suffix(',')
continue
var psk = 'application/config/%s' % param_name
if ProjectSettings.has_setting(psk):
var unit_data = ProjectSettings.get_setting(psk)
if is_instance_of(unit_data, TYPE_STRING):
profile.text = unit_data
button_settings()
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)
var vk_node = $scroll_set/table.get_node2(1, KEYBOARD).get_children()[0]
vk_node.connect('pressed', on_vk_pressed.bind(vk_node))
var ems2_hide_node = $scroll_set/table.get_node2(1, HIDE_EMS2).get_children()[0]
ems2_hide_node.connect('pressed', on_ems2_pressed.bind(ems2_hide_node))
ems2_hide_node.set_pressed(true)
on_ems2_pressed(ems2_hide_node)
func _on_btn_save_settings_pressed():
var json_data = {}
for i in SETTING_TABLE.size():
var parameter = SETTING_TABLE[i][0]
if parameter in settings.UnitProfiles:
var ref_profile = settings.UnitProfiles[parameter][1]
var profiles = $scroll_set/table.get_node2(1, i)
var value = profiles.get_text()
if parameter not in json_data:
var row: = []
for token in value.split(','):
var j: = row.size()
if token.is_valid_int():
token = int(token)
elif token == 'false':
token = false
elif token == 'true':
token = true
if typeof(ref_profile[j]) == typeof(token):
row.append(token)
else:
# TODO: Это надо вывести на экран пользователю
push_error([parameter, j, type_string(typeof(ref_profile[j])), type_string(typeof(token))])
row.append(ref_profile[j])
json_data[parameter] = row
else:
var children = $scroll_set/table.get_node2(1, i).get_children()
if len(children):
var child = children[0]
json_data[parameter] = child.is_pressed()
else:
var row = $scroll_set/table.get_row(i)
json_data[parameter] = row[1].text
for key in json_data:
ProjectSettings.set_setting('application/config/%s' % key, json_data[key])
var settings_file: = settings.get_settings_file_path()
var file: = FileAccess.open(settings_file, FileAccess.WRITE)
var abs_path: = ProjectSettings.globalize_path(settings_file)
if not file:
log.error('Не удалось открыть файл для записи \\\"%s\\\"' % abs_path)
return
var json_string: = JSON.stringify(json_data, ' ', true)
if file.store_string(json_string):
log.info('Настройки сохранены в файл \\\"%s\\\"' % abs_path)
file.close()
"
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_pyq6h"]
texture = ExtResource("3_dbpks")
modulate_color = Color(0.8, 0.533333, 0.27451, 1)
@@ -18,7 +275,7 @@ modulate_color = Color(0.8, 0.533333, 0.27451, 1)
texture = ExtResource("3_dbpks")
[node name="Настройки" type="Panel"]
script = ExtResource("1_2l3rd")
script = SubResource("GDScript_fc87o")
[node name="heard_table" type="GridContainer" parent="."]
layout_mode = 0
@@ -39,7 +296,7 @@ offset_bottom = 988.0
layout_mode = 2
script = ExtResource("2_6sx73")
[node name="btn_save_settings" type="Button" parent="."]
[node name="btn_save" type="Button" parent="."]
layout_mode = 0
offset_left = 1523.0
offset_top = 1057.0
@@ -55,4 +312,4 @@ theme_override_styles/hover = SubResource("StyleBoxTexture_pyq6h")
theme_override_styles/pressed = SubResource("StyleBoxTexture_l5g3r")
theme_override_styles/normal = SubResource("StyleBoxTexture_tbxk6")
[connection signal="pressed" from="btn_save_settings" to="." method="_on_btn_save_settings_pressed"]
[connection signal="pressed" from="btn_save" to="." method="_on_btn_save_settings_pressed"]