Доработка, отладка Щ3, устранена проблема самоотключения при контрое
This commit is contained in:
@@ -84,6 +84,7 @@ gdscript/warnings/integer_division=0
|
||||
|
||||
window/size/viewport_width=1600
|
||||
window/size/viewport_height=1200
|
||||
window/size/mode=3
|
||||
window/subwindows/embed_subwindows=false
|
||||
window/stretch/mode="canvas_items"
|
||||
window/dpi/allow_hidpi=false
|
||||
|
||||
@@ -329,6 +329,7 @@ fname = "УМ1535А"
|
||||
rname = "A18"
|
||||
|
||||
[node name="Monitoring_panel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_vxfkm")
|
||||
|
||||
[node name="in_fs_1" type="AnimatedSprite2D" parent="Monitoring_panel"]
|
||||
|
||||
@@ -17,7 +17,7 @@ extends 'res://scenes/контроль/элемент-я.gd'
|
||||
var regs_input: = {} ## Регистры входные
|
||||
var regs_holding: = {} ## Регистры хранения
|
||||
var switches_sync: = false ## Флаг. Если установлен, то можно переключать
|
||||
|
||||
var external_ctl: = false ## Флаг внешнего управления
|
||||
|
||||
func on_error(msg, unit_sch3):
|
||||
if unit_sch3.online:
|
||||
@@ -42,7 +42,7 @@ func on_line_changed_sch3(unit_sch3):
|
||||
|
||||
|
||||
func on_settings_changed():
|
||||
var external_ctl = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
external_ctl = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
if not external_ctl:
|
||||
return
|
||||
var items = get_tree().get_nodes_in_group('bits_items_switch')
|
||||
@@ -100,6 +100,7 @@ func _exit_tree() -> void:
|
||||
var unit_sch3 = network.units[unit_key]
|
||||
unit_sch3.disconnect('read', on_read.bind(unit_sch3))
|
||||
unit_sch3.disconnect('read_input', on_input.bind(unit_sch3))
|
||||
external_ctl = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
unit_sch3.disconnect('error', on_error)
|
||||
unit_sch3.disconnect('line_changed', on_line_changed_sch3)
|
||||
|
||||
@@ -114,6 +115,10 @@ func on_read(base_addr: int, data: Array, unit_sch3):
|
||||
regs_holding[base_addr + i] = data[i]
|
||||
# Разрешить работу выключателей только когда прочитано их реальное состояние
|
||||
if not switches_sync:
|
||||
if not external_ctl:
|
||||
if regs_holding.has(0) and regs_holding.has(2):
|
||||
regs_holding[0] = regs_holding[0] | 1
|
||||
regs_holding[2] = regs_holding[2] & 0xffe
|
||||
switches_sync = true
|
||||
for item in get_tree().get_nodes_in_group('bits_items_switch'):
|
||||
var bits = item.get_meta('bits')
|
||||
|
||||
@@ -142,6 +142,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания УФ"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 0, 2, 0]
|
||||
@@ -171,6 +172,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания РТР"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 1, 2, 1]
|
||||
@@ -199,6 +201,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-Н.1"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 2, 2, 2]
|
||||
@@ -228,6 +231,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-Н.2"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 3, 2, 3]
|
||||
@@ -257,6 +261,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-Н.3"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 4, 2, 4]
|
||||
@@ -286,6 +291,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-Н.4"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 5, 2, 5]
|
||||
@@ -315,6 +321,7 @@ material = SubResource("ShaderMaterial_vdwfd")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-В.1"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 6, 2, 6]
|
||||
@@ -344,6 +351,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-В.2"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 7, 2, 7]
|
||||
@@ -373,6 +381,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-В.3"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 8, 2, 8]
|
||||
@@ -402,6 +411,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-В.4"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 9, 2, 9]
|
||||
@@ -431,6 +441,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-К.1"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 10, 2, 10]
|
||||
@@ -460,6 +471,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-К.2"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [0, 11, 2, 11]
|
||||
@@ -489,6 +501,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
tooltip_text = "Выключатель питания ПРД-К.3"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [1, 0, 3, 0]
|
||||
@@ -518,6 +531,7 @@ material = SubResource("ShaderMaterial_c1mqk")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
tooltip_text = "Выключатель питания ПРД-К.4"
|
||||
button_pressed = true
|
||||
action_mode = 0
|
||||
script = ExtResource("7_l6esm")
|
||||
metadata/bits = [1, 1, 3, 1]
|
||||
|
||||
@@ -78,7 +78,7 @@ class Sch3 extends unit.Unit:
|
||||
step_fsm = Sch3Fsm.WRITE
|
||||
elif step_fsm == Sch3Fsm.CONNECT:
|
||||
try_disconnect()
|
||||
#try_connect()
|
||||
try_connect()
|
||||
mbc.request_read_input(base_input_address, regs_input_count)
|
||||
cmd_state = CmdState.WAIT
|
||||
tx_tick = tick
|
||||
|
||||
Reference in New Issue
Block a user