From 659a62bcffb6e9b44f1a286e1b9a2ff55362ca72 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Fri, 25 Oct 2024 14:28:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=9D=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D0=B5=D1=82.=20=D0=9E=D1=82=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D1=80=D1=82=D0=B0=20=D0=B2=D0=BE=20?= =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/pribor-uyep/pribor-uyep.tscn | 8 ++++---- scenes/pribor-uyep/spt25_view.gd | 2 ++ scenes/контроль/элемент-я.gd | 3 --- scripts/network.gd | 5 +++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scenes/pribor-uyep/pribor-uyep.tscn b/scenes/pribor-uyep/pribor-uyep.tscn index ffa096e..e6c36c5 100644 --- a/scenes/pribor-uyep/pribor-uyep.tscn +++ b/scenes/pribor-uyep/pribor-uyep.tscn @@ -39,9 +39,9 @@ vertical_alignment = 1 [node name="Label" type="Label" parent="."] self_modulate = Color(0.835294, 0.141176, 0.286275, 1) layout_mode = 0 -offset_left = 225.0 +offset_left = 135.0 offset_top = 990.0 -offset_right = 600.0 +offset_right = 665.0 offset_bottom = 1009.0 text = "** Позиционные обозначения требуют уточнения **" horizontal_alignment = 1 @@ -54,9 +54,9 @@ offset_top = 485.0 offset_right = 375.0 offset_bottom = 895.0 script = ExtResource("4_v0lil") +unit_name = "уарэп-спт25-1" fname = "СПТ-25-230-400" rname = "A1" -unit_name = "уарэп-спт25-1" [node name="block_input1" parent="spt25_A1" instance=ExtResource("4_mrvir")] layout_mode = 0 @@ -88,9 +88,9 @@ offset_top = 485.0 offset_right = 675.0 offset_bottom = 895.0 script = ExtResource("4_v0lil") +unit_name = "уарэп-спт25-2" fname = "СПТ-25-230-400" rname = "A2" -unit_name = "уарэп-спт25-2" [node name="block_input1" parent="spt25_A2" instance=ExtResource("4_mrvir")] layout_mode = 0 diff --git a/scenes/pribor-uyep/spt25_view.gd b/scenes/pribor-uyep/spt25_view.gd index e332583..e64ea12 100644 --- a/scenes/pribor-uyep/spt25_view.gd +++ b/scenes/pribor-uyep/spt25_view.gd @@ -2,6 +2,8 @@ extends "res://scenes/контроль/элемент-я.gd" +@export var unit_name: String = '' + enum STATE_VAL { NONE = 0, diff --git a/scenes/контроль/элемент-я.gd b/scenes/контроль/элемент-я.gd index 759ec17..6062db6 100644 --- a/scenes/контроль/элемент-я.gd +++ b/scenes/контроль/элемент-я.gd @@ -26,9 +26,6 @@ func _on_button_pressed(): $margin/vbox.alignment = v -@export var unit_name: String = '' - - func _enter_tree() -> void: _on_resized() func _on_resized() -> void: diff --git a/scripts/network.gd b/scripts/network.gd index 90bad02..cdcacc8 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -87,7 +87,8 @@ func create_serial(nm) -> Serial: var rc = sp.open(port) if rc != Error.OK: log.message(log.ERROR, 'Невозможно открыть порт \"%s\" для \"%s\"' % [port, nm]) - log.message(log.INFO, 'Последовательный порт \"%s\"@%d открыт для \"%s\"' % [port, baud, nm]) + else: + log.message(log.INFO, 'Последовательный порт \"%s\"@%d открыт для \"%s\"' % [port, baud, nm]) return sp @@ -134,7 +135,7 @@ func _ready() -> void: units_serial[unit_key] = unit units[unit_key] = unit serials[unit_key] = serial - + serial.try_open(unit.parse) tcp_sockets.append([create_tcpsocket('уарэп-5п28'), units_tcp[repsettings.get_unit_key('уарэп-5п28')]])