Доработка. Теперь пути загрузки сцен управляются редактором

This commit is contained in:
sasha80
2026-01-28 12:03:43 +03:00
parent 3c0fa8be82
commit 23acb2703e
2 changed files with 33 additions and 13 deletions

View File

@@ -1,24 +1,24 @@
class_name ems extends Panel
## Предзагрузка ячеек таблиц.
const TableHeader = preload('res://table/header.tscn')
const TableLabel = preload('res://table/lable.tscn')
const CellYemsButton = preload('res://scenes/эмс/кнопка-эмс.tscn')
const CellLineEdit = preload('res://table/ячейка-2.tscn')
const CellState = preload('res://scenes/эмс/состояния-эмс.tscn')
const CellOptBtn = preload('res://scenes/эмс/кнопка-5.tscn')
const CellLEEmpty = preload('res://scenes/эмс/line-edit-empty.tscn')
const CellFront = preload('res://scenes/cell/cell-front.tscn')
const CellFrontRear = preload('res://scenes/cell/cell-front-rear.tscn')
@export var TableHeader: PackedScene
@export var TableLabel: PackedScene
@export var CellYemsButton: PackedScene
@export var CellLineEdit: PackedScene
@export var CellState: PackedScene
@export var CellOptBtn: PackedScene
@export var CellLEEmpty: PackedScene
@export var CellFront: PackedScene
@export var CellFrontRear: PackedScene
## Режимы работы выходов.
const OUT_MODE: Array = ['Работа', 'Контроль', '0', '1'] #
const COLUMN_OPTS_BTN: Array = [5]
const TABLE_ENTRY_COLUMNS: Array = [2,3]
const OUT_SET_ROW: Array = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty]
const IN_SET_ROW: Array = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty]
var OUT_SET_ROW: Array
var IN_SET_ROW: Array
var FILES_ROWS_TYPES = [CellLineEdit, CellLineEdit, CellLineEdit ]
var FILES_ROWS_TYPES: Array
var g_boards: Dictionary ## Словарь плат ЭМС.
var active_board = null ## Активная плата ЭМС
@@ -32,6 +32,9 @@ func _ready() -> void:
## Инициализация основных элементов экрана ЭМС.
func init_boards():
OUT_SET_ROW = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty]
IN_SET_ROW = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty]
FILES_ROWS_TYPES = [CellLineEdit, CellLineEdit, CellLineEdit ]
var unit_ems = network.get_unit_instance('уарэп-эмс')
# Выставление позиций элементов ЭМС на экране

View File

@@ -1,12 +1,20 @@
[gd_scene load_steps=20 format=3 uid="uid://dab6loryocc73"]
[gd_scene load_steps=28 format=3 uid="uid://dab6loryocc73"]
[ext_resource type="Script" uid="uid://do1s7qg4bmxqy" path="res://scenes/эмс/эмс.gd" id="1_mk57x"]
[ext_resource type="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_1fbmy"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="2_eju8r"]
[ext_resource type="PackedScene" uid="uid://dwphmxstaxn4v" path="res://table/lable.tscn" id="3_31xk8"]
[ext_resource type="Texture2D" uid="uid://csnts8f155sf7" path="res://data/save1.png" id="3_onafb"]
[ext_resource type="Texture2D" uid="uid://o8mam0a060d8" path="res://data/load1.png" id="4_afjfs"]
[ext_resource type="PackedScene" uid="uid://dspa16ufrpanp" path="res://table/ячейка-2.tscn" id="4_o3av6"]
[ext_resource type="PackedScene" uid="uid://by22sta8tt8dn" path="res://scenes/эмс/состояния-эмс.tscn" id="5_owc4r"]
[ext_resource type="Texture2D" uid="uid://bdlbqs88bki8x" path="res://data/connect-a.png" id="5_wk8og"]
[ext_resource type="Texture2D" uid="uid://u3tnejvpm8it" path="res://data/disconnect-a.png" id="6_1fbmy"]
[ext_resource type="PackedScene" uid="uid://dwcol6jg2syof" path="res://scenes/эмс/кнопка-5.tscn" id="6_k0fjr"]
[ext_resource type="PackedScene" uid="uid://c480ipkjckkdn" path="res://scenes/эмс/line-edit-empty.tscn" id="7_k0fjr"]
[ext_resource type="PackedScene" uid="uid://bccr42bckei41" path="res://scenes/cell/cell-front.tscn" id="8_k30d1"]
[ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="8_qcl30"]
[ext_resource type="PackedScene" uid="uid://b8txs4xi722wt" path="res://scenes/cell/cell-front-rear.tscn" id="9_js36y"]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mu34x"]
texture = ExtResource("3_onafb")
@@ -64,6 +72,15 @@ texture = ExtResource("6_1fbmy")
offset_right = 1598.0
offset_bottom = 1201.0
script = ExtResource("1_mk57x")
TableHeader = ExtResource("2_1fbmy")
TableLabel = ExtResource("3_31xk8")
CellYemsButton = ExtResource("4_o3av6")
CellLineEdit = ExtResource("4_o3av6")
CellState = ExtResource("5_owc4r")
CellOptBtn = ExtResource("6_k0fjr")
CellLEEmpty = ExtResource("7_k0fjr")
CellFront = ExtResource("8_k30d1")
CellFrontRear = ExtResource("9_js36y")
[node name="lbl_online" type="Label" parent="."]
layout_mode = 0