Доработка. Не работает. Открытие порта во время работы.

This commit is contained in:
sasha80
2024-10-25 14:28:17 +03:00
parent 4932f241d6
commit 659a62bcff
4 changed files with 9 additions and 9 deletions

View File

@@ -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

View File

@@ -2,6 +2,8 @@
extends "res://scenes/контроль/элемент-я.gd"
@export var unit_name: String = ''
enum STATE_VAL
{
NONE = 0,

View File

@@ -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:

View File

@@ -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')]])