Усилитель на контроле

This commit is contained in:
danil_tim
2025-02-26 10:20:27 +03:00
parent c2845f59bd
commit 01c2072bdb
11 changed files with 620 additions and 74 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=55 format=3 uid="uid://cvor2jm4xk3ha"]
[gd_scene load_steps=56 format=3 uid="uid://cvor2jm4xk3ha"]
[ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"]
[ext_resource type="Texture2D" uid="uid://cdxdluvyb5uei" path="res://table/on.png" id="2_dv7xx"]
@@ -15,6 +15,7 @@
[ext_resource type="Shader" path="res://Shaders/load.gdshader" id="10_lf1xh"]
[ext_resource type="PackedScene" uid="uid://bdb0bhfu7366l" path="res://kasseta-fs-kd.tscn" id="10_tdh2s"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://table/элемент-в.tscn" id="11_fg7ul"]
[ext_resource type="PackedScene" uid="uid://bkxblfoj7ejv0" path="res://table/блок-а.tscn" id="11_k47r2"]
[ext_resource type="Script" path="res://scripts/modul_fs.gd" id="15_b4pr1"]
[ext_resource type="Shader" path="res://Shaders/loadead.gdshader" id="16_4osrw"]
@@ -207,8 +208,8 @@ CheckBox/font_sizes/font_size = 14
script = ExtResource("1_v273n")
[node name="Background" type="ColorRect" parent="."]
offset_right = 3025.0
offset_bottom = 1060.0
offset_right = 3012.0
offset_bottom = 1080.0
theme = SubResource("Theme_k5ur4")
color = Color(0.356863, 0.278431, 0.356863, 1)
metadata/_edit_lock_ = true
@@ -332,11 +333,12 @@ theme_override_styles/tab_selected = SubResource("StyleBoxTexture_k08q3")
theme_override_styles/tab_hovered = SubResource("StyleBoxTexture_dklg6")
theme_override_styles/tab_unselected = SubResource("StyleBoxTexture_17le6")
tab_alignment = 2
current_tab = 0
current_tab = 1
tab_focus_mode = 0
metadata/_edit_lock_ = true
[node name="PRD" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxTexture_7u7p7")
metadata/_tab_index = 0
@@ -480,7 +482,6 @@ script = ExtResource("2_vmbyo")
node_gap = Vector2(100, 50)
[node name="ControlPanel" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxTexture_tn8m6")
script = ExtResource("9_akagi")
@@ -490,22 +491,144 @@ metadata/_edit_lock_ = true
[node name="lbl_control" type="Label" parent="TabContainer/ControlPanel"]
modulate = Color(1, 0, 0, 1)
layout_mode = 0
offset_left = 45.0
offset_top = -37.0
offset_right = 665.0
offset_bottom = -6.0
offset_left = 103.0
offset_top = -56.0
offset_right = 723.0
offset_bottom = -25.0
theme_override_font_sizes/font_size = 22
text = "Прибор не исправен"
horizontal_alignment = 1
vertical_alignment = 1
metadata/_edit_lock_ = true
[node name="socket_ym_lb2" type="NinePatchRect" parent="TabContainer/ControlPanel"]
offset_left = 15.0
offset_top = -24.0
offset_right = 240.0
offset_bottom = 759.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
metadata/_edit_lock_ = true
[node name="blok_ym_1" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
layout_mode = 2
offset_left = 20.0
offset_top = 40.0
offset_right = 201.0
offset_bottom = 149.0
[node name="blok_ym_2" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
layout_mode = 2
offset_left = 20.0
offset_top = 160.0
offset_right = 201.0
offset_bottom = 269.0
[node name="blok_ym_3" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 280.0
offset_right = 201.0
offset_bottom = 389.0
[node name="blok_ym_4" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 408.0
offset_right = 201.0
offset_bottom = 517.0
[node name="blok_ym_5" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 528.0
offset_right = 201.0
offset_bottom = 637.0
[node name="blok_ym_6" parent="TabContainer/ControlPanel/socket_ym_lb2" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 656.0
offset_right = 201.0
offset_bottom = 765.0
[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/socket_ym_lb2"]
self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0
offset_left = 7.0
offset_top = 8.0
offset_right = 229.0
offset_bottom = 33.0
text = "Младшая литера"
horizontal_alignment = 1
vertical_alignment = 1
[node name="socket_ym_pb" type="NinePatchRect" parent="TabContainer/ControlPanel"]
offset_left = 591.0
offset_top = -24.0
offset_right = 816.0
offset_bottom = 759.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
metadata/_edit_lock_ = true
[node name="blok_ym_1" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
layout_mode = 2
offset_left = 20.0
offset_top = 40.0
offset_right = 201.0
offset_bottom = 149.0
[node name="blok_ym_2" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
layout_mode = 2
offset_left = 20.0
offset_top = 160.0
offset_right = 201.0
offset_bottom = 269.0
[node name="blok_ym_3" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 280.0
offset_right = 201.0
offset_bottom = 389.0
[node name="blok_ym_4" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 408.0
offset_right = 201.0
offset_bottom = 517.0
[node name="blok_ym_5" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 528.0
offset_right = 201.0
offset_bottom = 637.0
[node name="blok_ym_6" parent="TabContainer/ControlPanel/socket_ym_pb" instance=ExtResource("11_k47r2")]
offset_left = 20.0
offset_top = 656.0
offset_right = 201.0
offset_bottom = 765.0
[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/socket_ym_pb"]
self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0
offset_left = 7.0
offset_top = 8.0
offset_right = 229.0
offset_bottom = 33.0
text = "Старшая литера"
horizontal_alignment = 1
vertical_alignment = 1
[node name="soc_y5" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 199.0
offset_top = 10.0
offset_right = 516.0
offset_bottom = 200.0
offset_left = 255.0
offset_top = -24.0
offset_right = 572.0
offset_bottom = 166.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -574,10 +697,10 @@ vertical_alignment = 1
[node name="Kasseta_FS" parent="TabContainer/ControlPanel" instance=ExtResource("10_tdh2s")]
layout_mode = 0
offset_left = 200.0
offset_top = 201.0
offset_right = 518.0
offset_bottom = 420.0
offset_left = 254.0
offset_top = 167.0
offset_right = 572.0
offset_bottom = 386.0
script = null
metadata/_edit_lock_ = true
@@ -648,10 +771,10 @@ rname = "A1"
[node name="soc_P1" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 259.0
offset_top = 427.0
offset_right = 447.0
offset_bottom = 643.0
offset_left = 317.0
offset_top = 389.0
offset_right = 505.0
offset_bottom = 584.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -674,8 +797,7 @@ vertical_alignment = 1
offset_left = -64.0
offset_top = 37.0
offset_right = -14.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
offset_bottom = 187.0
fname = "МАА2000"
rname = "А22"
@@ -683,8 +805,7 @@ rname = "А22"
offset_left = 203.0
offset_top = 36.0
offset_right = 253.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
offset_bottom = 186.0
fname = "МАА2000"
rname = "А23"
@@ -692,8 +813,7 @@ rname = "А23"
offset_left = 129.0
offset_top = 37.0
offset_right = 179.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
offset_bottom = 187.0
fname = "ИП9-50"
rname = "А19"
@@ -701,8 +821,7 @@ rname = "А19"
offset_left = 73.0
offset_top = 37.0
offset_right = 123.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
offset_bottom = 187.0
fname = "ИП9-50"
rname = "А20"
@@ -710,23 +829,21 @@ rname = "А20"
offset_left = 16.0
offset_top = 36.0
offset_right = 66.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
offset_bottom = 186.0
fname = "ИП12-50"
rname = "А21"
[node name="soc_DKM" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 574.0
offset_top = 201.0
offset_right = 762.0
offset_bottom = 417.0
offset_left = 317.0
offset_top = 584.0
offset_right = 505.0
offset_bottom = 778.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
metadata/_edit_lock_ = true
[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/soc_DKM"]
self_modulate = Color(1, 1, 1, 0.62)
@@ -738,13 +855,13 @@ offset_bottom = 33.0
text = "ДКМ"
horizontal_alignment = 1
vertical_alignment = 1
metadata/_edit_lock_ = true
[node name="DKM_3" parent="TabContainer/ControlPanel/soc_DKM" instance=ExtResource("11_fg7ul")]
offset_left = 129.0
offset_top = 37.0
offset_right = 179.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
offset_bottom = 187.0
fname = "ДКМ3"
rname = " "
@@ -752,8 +869,7 @@ rname = " "
offset_left = 73.0
offset_top = 37.0
offset_right = 123.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
offset_bottom = 187.0
fname = "ДКМ2"
rname = " "
@@ -761,17 +877,16 @@ rname = " "
offset_left = 16.0
offset_top = 36.0
offset_right = 66.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
offset_bottom = 186.0
fname = "ДКМ-1"
rname = " "
[node name="soc_P2" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 278.0
offset_top = 645.0
offset_right = 432.0
offset_bottom = 861.0
offset_left = 333.0
offset_top = 777.0
offset_right = 487.0
offset_bottom = 979.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -794,8 +909,8 @@ vertical_alignment = 1
offset_left = 81.0
offset_top = 36.0
offset_right = 131.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
offset_bottom = 196.0
self_size = Vector2i(50, 160)
fname = "ИП12-50"
rname = "A25"
@@ -803,8 +918,8 @@ rname = "A25"
offset_left = 24.0
offset_top = 36.0
offset_right = 74.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
offset_bottom = 196.0
self_size = Vector2i(50, 160)
fname = "ИП9-50"
rname = "A22"
@@ -818,13 +933,12 @@ metadata/_edit_lock_ = true
[node name="log_array" type="TextEdit" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 786.0
offset_top = 22.0
offset_right = 1639.0
offset_bottom = 837.0
offset_left = 846.0
offset_top = -21.0
offset_right = 1630.0
offset_bottom = 525.0
theme_override_styles/normal = SubResource("StyleBoxFlat_13x31")
placeholder_text = "Ожидание контроля ..."
metadata/_edit_lock_ = true
[node name="await" type="ColorRect" parent="TabContainer/ControlPanel/log_array"]
material = SubResource("ShaderMaterial_07wue")

Binary file not shown.

View File

@@ -0,0 +1,34 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://bxq4fvfeecmia"
path="res://.godot/imported/DSEG7Classic-Regular.ttf-6498a95ef47a83f694a2c28b2a7beb94.fontdata"
[deps]
source_file="res://pictures/DSEG7Classic-Regular.ttf"
dest_files=["res://.godot/imported/DSEG7Classic-Regular.ttf-6498a95ef47a83f694a2c28b2a7beb94.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bnviii2u0ls78"
path="res://.godot/imported/прогресс-заполнение-1.png-5e3fb8124573a5f7b26733dc40547dda.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://pictures/прогресс-заполнение-1.png"
dest_files=["res://.godot/imported/прогресс-заполнение-1.png-5e3fb8124573a5f7b26733dc40547dda.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cdhpvkivmjkje"
path="res://.godot/imported/прогресс-фон-1.png-284fb2835c6268a0bbcffd70bec7e7d9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://pictures/прогресс-фон-1.png"
dest_files=["res://.godot/imported/прогресс-фон-1.png-284fb2835c6268a0bbcffd70bec7e7d9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -28,8 +28,8 @@ gdscript/warnings/unused_signal=0
[display]
window/size/viewport_width=1900
window/size/viewport_height=940
window/size/viewport_width=1920
window/size/viewport_height=1080
[editor]

View File

@@ -26,37 +26,37 @@ func _ready() -> void:
if args[i] == "testsave-path" and i + 1 < args.size():
save_path = args[i + 1]
break
# Таблица УКП-1 (Температура, Мощность)
node_select1 = $TabContainer/PRD/body_grid/litera_2_4_6/table_ukp_1
draw_tabl(node_select1, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size())
node_select1.set_columns_min_size([120, 120])
# Таблица УКП-2 (Температура, Мощность)
node_select2 = $TabContainer/PRD/body_grid/litera_3_5_7/table_ukp_2
draw_tabl(node_select2, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size())
node_select2.set_columns_min_size([120, 120])
# Таблица ЯУ-07б-1
node_select_yau_07b = $TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control
draw_tabl(node_select_yau_07b, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b.set_columns_min_size([160, 120])
# Таблица ЯУ-07б-2
node_select_yau_07b_2 = $TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control
draw_tabl(node_select_yau_07b_2, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b_2.set_columns_min_size([160, 120])
#Таблица ФС-2
node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
draw_tabl(node_select_fs_1, Constants.ROWS_FS, Constants.ROWS_FS.size())
node_select_fs_1.set_columns_min_size([150, 120, 150])
#Таблица ФС-2
node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
draw_tabl(node_select_fs_2, Constants.ROWS_FS, Constants.ROWS_FS.size())
node_select_fs_2.set_columns_min_size([150, 120, 150])
# Выбор прибора для подключения
var node_select_device = $TabContainer/PRD/select_dev
draw_tabl(node_select_device, Constants.SELECT_DEVICE, Constants.SELECT_DEVICE.size())
@@ -74,7 +74,7 @@ func _ready() -> void:
status_pribor = Constants.CURRENT_MODE
add_signs_scene()
## Заполненение списка модуляции УМ
for key in Constants.OUT_x128:
node_select_yau_07b.get_node2(1, 2).add_item(key)
@@ -89,7 +89,7 @@ func _ready() -> void:
for key in Constants.ATT_DICT:
node_select_yau_07b.get_node2(1, 4).add_item(key)
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
## Yau-07b 1
node_select_yau_07b.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret_2'))
node_select_yau_07b.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_2'))
@@ -116,7 +116,7 @@ func _ready() -> void:
node_select_fs_2.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2'))
node_select_fs_2.get_node2(1, 7).connect('text_submitted', Callable(self, '_on_set_base_can_macro_2'))
node_select_fs_2.get_node2(1, 8).get_child(1, false).connect('toggled', Callable(self, '_on_status_can_macro_2'))
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
Network.connect('yau_receive', Callable(self, '_on_data_received'))
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
@@ -136,7 +136,7 @@ func add_signs_scene():
# Таблица УКП-2
node_select2.set_node_text(0, 0, 'Мощность')
node_select2.set_node_text(1, 0, 'Температура')
var item_place_yau_07: int = 9
var item_place_fs_1: int = 18
var item_place_fs_2: int = 28
@@ -167,7 +167,7 @@ func add_signs_scene():
#Таблица ФС-1
node_select_fs_1.set_node_text(0, 0, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_1+0]) # 'Модуль ФС'
node_select_fs_1.set_node_text(1, 0, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_1+1]) # 'Литера 2'
node_select_fs_1.set_node_text(0, 1, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_1+2]) # 'Состояние'
node_select_fs_1.set_node_text(0, 2, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_1+3]) # 'Частота'
node_select_fs_1.get_node2(1, 2).placeholder_text = 'в МГц'
@@ -204,7 +204,7 @@ func add_signs_scene():
node_select_fs_2.get_node2(1, 7).placeholder_text = 'в МГц'
node_select_fs_2.get_node2(1, 7).editable = true
node_select_fs_2.set_node_text(0, 8, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_2+9]) # 'Статус CAN')
func _on_read_isa(unit_isa_ports: Dictionary) -> void:
isa_from_yau07b = unit_isa_ports
@@ -355,7 +355,7 @@ func _process(_delta: float) -> void:
else:
node_freq_fs_1_mod.modulate = Color(1, 1, 0.941, 1)
node_freq_fs_1_mod.text = 'Аттенюатор'
# FS 2
var node_freq_fs_2 = node_select_fs_2.get_node2(1, 2)
var node_freq_fs_2_mod = node_select_fs_2.get_node2(0, 2)
@@ -373,7 +373,7 @@ func _process(_delta: float) -> void:
else:
node_freq_fs_2_mod.modulate = Color(1, 1, 0.941, 1)
node_freq_fs_2_mod.text = 'Аттенюатор'
## Рисует таблицу
func draw_tabl(tbl: Node, row: Array, count_row: int):
@@ -538,7 +538,7 @@ func _on_zapret_1(toggled_on: bool) -> void:
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta)
var zapret_mode = 0x4000 if toggled_on else 0x0
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, zapret_mode)
func _on_zapret_2(toggled_on: bool) -> void:
var meta = Constants.META.CI_2_B_UF
@@ -606,7 +606,7 @@ func _on_fgos_2(toggled_on: bool):
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta)
var modul_um = 0x8000 if toggled_on else 0x0
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um)
## Регулировка положением луча 1
func _on_btn_ray_1(item_from_ray_1: int) -> void:

247
table/блок-а.tscn Normal file
View File

@@ -0,0 +1,247 @@
[gd_scene load_steps=14 format=3 uid="uid://bkxblfoj7ejv0"]
[ext_resource type="Texture2D" uid="uid://ce3qpf070wgd2" path="res://pictures/состояние-исправности-0.png" id="1_xcvfs"]
[ext_resource type="Texture2D" uid="uid://byweg7pgt8o4h" path="res://pictures/состояние-исправности-1.png" id="2_ad1dj"]
[ext_resource type="Texture2D" uid="uid://bvikuv0lbvou8" path="res://pictures/состояние-исправности-2.png" id="3_vxg7f"]
[ext_resource type="Texture2D" uid="uid://cgtg4gbqnuxrc" path="res://pictures/nine-patch-round.png" id="4_1bnn6"]
[ext_resource type="PackedScene" uid="uid://dyjtmfm4u58mu" path="res://table/уровень.tscn" id="5_3i5am"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
[sub_resource type="GDScript" id="GDScript_oj3k3"]
script/source = "@tool
extends PanelContainer
@export var textures: Array
signal pressed(control: PanelContainer)
@export var value0: float:
set(v):
value0 = v
$margin/vbox/grid1/indicator0.value = v
@export var value1: float:
set(v):
value1 = v
$margin/vbox/grid1/indicator1.value = v
@export var min_value0: float:
set(v):
min_value0 = v
$margin/vbox/grid1/indicator0.min_value = v
@export var min_value1: float:
set(v):
min_value1 = v
$margin/vbox/grid1/indicator1.min_value = v
@export var max_value0: float:
set(v):
max_value0 = v
$margin/vbox/grid1/indicator0.max_value = v
@export var max_value1: float:
set(v):
max_value1 = v
$margin/vbox/grid1/indicator1.max_value = v
@export var step0: float:
set(v):
step0 = v
$margin/vbox/grid1/indicator0.step = v
@export var step1: float:
set(v):
step1 = v
$margin/vbox/grid1/indicator1.step = v
@export var value_name0: String:
set(v):
value_name0 = v
$margin/vbox/grid1/indicator0.value_name = v
@export var value_name1: String:
set(v):
value_name1 = v
$margin/vbox/grid1/indicator1.value_name = v
@export var name_min_size0: Vector2i:
set(v):
name_min_size0 = v
$margin/vbox/grid1/indicator0.name_min_size = v
@export var name_min_size1: Vector2i:
set(v):
name_min_size1 = v
$margin/vbox/grid1/indicator1.name_min_size = v
@export var fname: String:
set(v):
fname = v
$margin/vbox/grid0/fname.text = v
@export var rname: String:
set(v):
rname = v
$margin/vbox/grid0/rname.text = v
@export var state: int:
set(v):
state = clip_value(v, 0, textures.size() - 1)
$margin/vbox/grid0/state.texture = textures[state]
@export var alignment: int:
set(v):
alignment = v
$margin/vbox.alignment = v
func _on_button_pressed():
emit_signal('pressed', self)
## Отсекает значение до заданного диапазона.
func clip_value(val, val_min, val_max):
if val < val_min: val = val_min
if val > val_max: val = val_max
return val
"
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rceim"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8yvwo"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6qu57"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mlxje"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3dspb"]
[sub_resource type="GDScript" id="GDScript_45hqb"]
script/source = "@tool
extends MarginContainer
func _enter_tree() -> void:
margins = [8, 8, 8, 8]
@export var margins: Array:
set(vals):
add_theme_constant_override('margin_top', vals[0])
add_theme_constant_override('margin_left', vals[1])
add_theme_constant_override('margin_bottom', vals[2])
add_theme_constant_override('margin_right', vals[3])
get:
var vals = [0, 0, 0, 0]
vals[0] = get_theme_constant('margin_top')
vals[1] = get_theme_constant('margin_left')
vals[2] = get_theme_constant('margin_bottom')
vals[3] = get_theme_constant('margin_right')
return vals
"
[node name="blok_a" type="PanelContainer"]
editor_description = "Элемент замены из ЗИП"
offset_right = 160.0
offset_bottom = 88.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
script = SubResource("GDScript_oj3k3")
textures = [ExtResource("1_xcvfs"), ExtResource("2_ad1dj"), ExtResource("3_vxg7f")]
[node name="button" type="Button" parent="."]
layout_mode = 2
theme_override_styles/focus = SubResource("StyleBoxEmpty_rceim")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_8yvwo")
theme_override_styles/hover = SubResource("StyleBoxEmpty_6qu57")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_mlxje")
theme_override_styles/normal = SubResource("StyleBoxEmpty_3dspb")
[node name="rect" type="NinePatchRect" parent="."]
layout_mode = 2
texture = ExtResource("4_1bnn6")
draw_center = false
region_rect = Rect2(0, 0, 63, 63)
patch_margin_left = 17
patch_margin_top = 17
patch_margin_right = 17
patch_margin_bottom = 15
[node name="margin" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8
script = SubResource("GDScript_45hqb")
margins = [8, 8, 8, 8]
[node name="vbox" type="VBoxContainer" parent="margin"]
layout_mode = 2
[node name="grid0" type="GridContainer" parent="margin/vbox"]
layout_mode = 2
columns = 3
[node name="state" type="TextureRect" parent="margin/vbox/grid0"]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
size_flags_horizontal = 2
size_flags_vertical = 6
texture = ExtResource("1_xcvfs")
expand_mode = 1
[node name="fname" type="Label" parent="margin/vbox/grid0"]
self_modulate = Color(1, 1, 1, 0.627451)
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_font_sizes/font_size = 17
horizontal_alignment = 1
vertical_alignment = 1
[node name="rname" type="Label" parent="margin/vbox/grid0"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 6
theme_override_font_sizes/font_size = 22
horizontal_alignment = 2
vertical_alignment = 1
[node name="grid1" type="GridContainer" parent="margin/vbox"]
layout_mode = 2
size_flags_vertical = 6
[node name="indicator0" parent="margin/vbox/grid1" instance=ExtResource("5_3i5am")]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="indicator1" parent="margin/vbox/grid1" instance=ExtResource("5_3i5am")]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[connection signal="pressed" from="button" to="." method="_on_button_pressed"]

83
table/уровень.tscn Normal file
View File

@@ -0,0 +1,83 @@
[gd_scene load_steps=5 format=3 uid="uid://dyjtmfm4u58mu"]
[ext_resource type="Texture2D" uid="uid://cdhpvkivmjkje" path="res://pictures/прогресс-фон-1.png" id="1_n4uxh"]
[ext_resource type="Texture2D" uid="uid://bnviii2u0ls78" path="res://pictures/прогресс-заполнение-1.png" id="2_os1gp"]
[ext_resource type="FontFile" uid="uid://bxq4fvfeecmia" path="res://pictures/DSEG7Classic-Regular.ttf" id="3_px0hn"]
[sub_resource type="GDScript" id="GDScript_eyk47"]
script/source = "@tool
extends GridContainer
@export var min_value: float:
set(v):
min_value = v
$indicator_h.min_value = v
@export var max_value: float:
set(v):
max_value = v
$indicator_h.max_value = v
@export var step: float:
set(v):
step = v
$indicator_h.step = v
@export var value: float:
set(v):
value = v
$indicator_h.value = v
$lbl_val.text = '%02d' % int(v)
@export var value_name: String:
set(v):
value_name = v
$lbl_name.text = v
@export var name_min_size: Vector2i:
set(v):
name_min_size = v
$lbl_name.custom_minimum_size = v
"
[node name="grid" type="GridContainer"]
offset_right = 95.0
offset_bottom = 19.0
columns = 3
script = SubResource("GDScript_eyk47")
[node name="lbl_name" type="Label" parent="."]
custom_minimum_size = Vector2(30, 20)
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 1
[node name="indicator_h" type="TextureProgressBar" parent="."]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
value = 50.0
nine_patch_stretch = true
stretch_margin_left = 8
stretch_margin_top = 8
stretch_margin_right = 8
stretch_margin_bottom = 8
texture_under = ExtResource("1_n4uxh")
texture_progress = ExtResource("2_os1gp")
tint_under = Color(1, 1, 1, 0.419608)
tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
[node name="lbl_val" type="Label" parent="."]
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/font_color = Color(0.890196, 0.486275, 0.196078, 1)
theme_override_fonts/font = ExtResource("3_px0hn")
text = "00"
horizontal_alignment = 1
vertical_alignment = 1