Добавление сцен контроля приборов

This commit is contained in:
MaD_CaT
2023-01-25 08:44:12 +03:00
parent f8f328a1cb
commit 9fbdc4aaa7
24 changed files with 465 additions and 23 deletions

View File

@@ -1,9 +1,13 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://data/СПТ.png" type="Texture" id=1]
[ext_resource path="res://data/мп550-работа-эскиз.png" type="Texture" id=2]
[ext_resource path="res://main.gd" type="Script" id=3]
[ext_resource path="res://data/УФ.png" type="Texture" id=4]
[ext_resource path="res://Контроль.gd" type="Script" id=5]
[ext_resource path="res://data/Грани22.png" type="Texture" id=6]
[ext_resource path="res://data/Щ3.png" type="Texture" id=7]
[ext_resource path="res://data/ПРД.png" type="Texture" id=8]
[sub_resource type="DynamicFont" id=2]
@@ -12,8 +16,8 @@ resource_local_to_scene = true
default_font = SubResource( 2 )
[node name="TabContainer" type="TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 1600.0
margin_bottom = 1200.0
rect_pivot_offset = Vector2( 800, 600 )
tab_align = 0
script = ExtResource( 3 )
@@ -45,20 +49,221 @@ margin_right = -4.0
margin_bottom = -4.0
script = ExtResource( 5 )
[node name="pribor_UF" type="TextureButton" parent="Контроль"]
margin_left = 1048.0
margin_top = 542.0
margin_right = 1100.0
margin_bottom = 658.0
[node name="pribor_uf" type="TextureButton" parent="Контроль"]
margin_left = 1077.0
margin_top = 411.0
margin_right = 1129.0
margin_bottom = 527.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 4 )
expand = true
stretch_mode = 4
[node name="Button" type="Button" parent="Контроль"]
margin_left = 480.0
margin_top = 440.0
[node name="pribor_rtr" type="TextureButton" parent="Контроль"]
margin_left = 1065.0
margin_top = 113.0
margin_right = 1117.0
margin_bottom = 200.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 1 )
expand = true
stretch_mode = 4
[node name="pribor_afsp_l" type="TextureButton" parent="Контроль"]
margin_left = 877.0
margin_top = 112.0
margin_right = 994.0
margin_bottom = 199.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 6 )
expand = true
stretch_mode = 4
[node name="pribor_afsp_r" type="TextureButton" parent="Контроль"]
margin_left = 1187.0
margin_top = 116.0
margin_right = 1304.0
margin_bottom = 203.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 6 )
expand = true
stretch_mode = 4
[node name="pribor_sch3" type="TextureButton" parent="Контроль"]
margin_left = 1068.0
margin_top = 760.0
margin_right = 1124.0
margin_bottom = 869.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 7 )
expand = true
stretch_mode = 4
[node name="pribor_spt_l" type="TextureButton" parent="Контроль"]
margin_left = 923.0
margin_top = 774.0
margin_right = 975.0
margin_bottom = 620.0
text = "ЖЫШЦЙБЮ"
margin_bottom = 861.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 1 )
expand = true
stretch_mode = 4
[node name="pribor_spt_r" type="TextureButton" parent="Контроль"]
margin_left = 1214.0
margin_top = 774.0
margin_right = 1266.0
margin_bottom = 861.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 1 )
expand = true
stretch_mode = 4
[node name="pribor_prd_v_2" type="TextureButton" parent="Контроль"]
margin_left = 784.0
margin_top = 155.0
margin_right = 845.0
margin_bottom = 246.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="pribor_prd_n_2" type="TextureButton" parent="Контроль"]
margin_left = 782.0
margin_top = 256.0
margin_right = 843.0
margin_bottom = 347.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="pribor_prd_k_2" type="TextureButton" parent="Контроль"]
margin_left = 781.0
margin_top = 356.0
margin_right = 842.0
margin_bottom = 447.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="pribor_prd_v_3" type="TextureButton" parent="Контроль"]
margin_left = 1342.0
margin_top = 494.0
margin_right = 1403.0
margin_bottom = 585.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_n_3" type="TextureButton" parent="Контроль"]
margin_left = 1340.0
margin_top = 595.0
margin_right = 1401.0
margin_bottom = 686.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_k_3" type="TextureButton" parent="Контроль"]
margin_left = 1342.0
margin_top = 705.0
margin_right = 1403.0
margin_bottom = 796.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_v_1" type="TextureButton" parent="Контроль"]
margin_left = 1342.0
margin_top = 149.0
margin_right = 1403.0
margin_bottom = 240.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_n_1" type="TextureButton" parent="Контроль"]
margin_left = 1340.0
margin_top = 250.0
margin_right = 1401.0
margin_bottom = 341.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_k_1" type="TextureButton" parent="Контроль"]
margin_left = 1339.0
margin_top = 350.0
margin_right = 1400.0
margin_bottom = 441.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
flip_h = true
[node name="pribor_prd_v_4" type="TextureButton" parent="Контроль"]
margin_left = 784.0
margin_top = 511.0
margin_right = 845.0
margin_bottom = 602.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="pribor_prd_n_4" type="TextureButton" parent="Контроль"]
margin_left = 782.0
margin_top = 612.0
margin_right = 843.0
margin_bottom = 703.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="pribor_prd_k_4" type="TextureButton" parent="Контроль"]
margin_left = 781.0
margin_top = 712.0
margin_right = 842.0
margin_bottom = 803.0
size_flags_horizontal = 15
size_flags_vertical = 15
texture_normal = ExtResource( 8 )
expand = true
stretch_mode = 4
[node name="scene" type="Panel" parent="Контроль"]
margin_right = 533.0
margin_bottom = 781.0

21
consts.gd Normal file
View File

@@ -0,0 +1,21 @@
extends Node
const PRIBOR_UF = 'res://pribor_uf.tscn'
const PRIBOR_RTR = 'res://pribor_rtr.tscn'
const PRIBOR_AFSP_L = 'res://pribor_afsp_l.tscn'
const PRIBOR_AFSP_R = 'res://pribor_afsp_r.tscn'
const PRIBOR_SCH3 = 'res://pribor_sch3.tscn'
const PRIBOR_SPT_L = 'res://pribor_spt_l.tscn'
const PRIBOR_SPT_R = 'res://pribor_spt_r.tscn'
const PRIBOR_PRD_V_1 = 'res://pribor_prd_v_1.tscn'
const PRIBOR_PRD_N_1 = 'res://pribor_prd_n_1.tscn'
const PRIBOR_PRD_K_1 = 'res://pribor_prd_k_1.tscn'
const PRIBOR_PRD_V_2 = 'res://pribor_prd_v_2.tscn'
const PRIBOR_PRD_N_2 = 'res://pribor_prd_n_2.tscn'
const PRIBOR_PRD_K_2 = 'res://pribor_prd_k_2.tscn'
const PRIBOR_PRD_V_3 = 'res://pribor_prd_v_3.tscn'
const PRIBOR_PRD_N_3 = 'res://pribor_prd_n_3.tscn'
const PRIBOR_PRD_K_3 = 'res://pribor_prd_k_3.tscn'
const PRIBOR_PRD_V_4 = 'res://pribor_prd_v_4.tscn'
const PRIBOR_PRD_N_4 = 'res://pribor_prd_n_4.tscn'
const PRIBOR_PRD_K_4 = 'res://pribor_prd_k_4.tscn'

10
pribor_afsp_l.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора АФСП Левый"

10
pribor_afsp_r.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора АФСП Правый"

View File

@@ -7,4 +7,4 @@ margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Тестовый lbl1"
text = "Здесь будет схема прибора Щ3"

10
pribor_prd_k_1.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-К 1"

10
pribor_prd_k_2.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-К 2"

10
pribor_prd_k_3.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-К 3"

10
pribor_prd_k_4.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-К 4"

10
pribor_prd_n_1.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-Н 1"

10
pribor_prd_n_2.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-Н 2"

10
pribor_prd_n_3.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-Н 3"

10
pribor_prd_n_4.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-Н 4"

10
pribor_prd_v_1.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-В 1"

10
pribor_prd_v_2.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-В 2"

10
pribor_prd_v_3.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-В 3"

10
pribor_prd_v_4.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора ПРД-В 1"

10
pribor_rtr.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора РТР"

10
pribor_sch3.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора Щ3"

10
pribor_spt_l.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора СПТ Левый"

10
pribor_spt_r.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора СПТ Правый"

10
pribor_uf.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene format=2]
[node name="pribor_UF" type="Node2D"]
[node name="test_label" type="Label" parent="."]
margin_left = 12.0
margin_top = 8.0
margin_right = 154.0
margin_bottom = 22.0
text = "Здесь будет схема прибора УФ"

View File

@@ -14,6 +14,10 @@ config/name="uarep-ctl"
run/main_scene="res://Control.tscn"
config/icon="res://data/icon.png"
[autoload]
Consts="*res://consts.gd"
[display]
window/size/width=1600

View File

@@ -1,20 +1,42 @@
extends Panel
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
$pribor_UF.connect('button_up', self, 'on_pribor_press', ['111'])
$pribor_uf.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_UF])
$pribor_rtr.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_RTR])
$pribor_afsp_l.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_AFSP_L])
$pribor_afsp_r.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_AFSP_R])
$pribor_sch3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SCH3])
$pribor_spt_l.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SPT_L])
$pribor_spt_r.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SPT_R])
$pribor_prd_v_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_1])
$pribor_prd_n_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_1])
$pribor_prd_k_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_1])
$pribor_prd_v_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_2])
$pribor_prd_n_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_2])
$pribor_prd_k_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_2])
$pribor_prd_v_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_3])
$pribor_prd_n_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_3])
$pribor_prd_k_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_3])
$pribor_prd_v_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_4])
$pribor_prd_n_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_4])
$pribor_prd_k_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_4])
func on_pribor_press(text: String):
prints(text)
func on_pribor_press(text):
clear_obj($scene)
var scen = load(text).instance()
$scene.add_child(scen)
func clear_obj(obj : Object):
var items = $scene.get_children()
for item in items:
$scene.remove_child(item)
item.free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass