отладка мощности

This commit is contained in:
2025-02-12 09:19:28 +03:00
parent 54ff1757b2
commit d583c544fb
8 changed files with 140 additions and 67 deletions

View File

@@ -229,7 +229,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+8] & 0x38)>>3)
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x7))
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x38))
for index in Constants.EMS_G_PORT_DATA_HOLDER.size():
var tmp_device_mode = Constants.EMS_G_PORT_DATA_HOLDER[index][0]
if tmp_device_mode == 48:
@@ -266,15 +266,19 @@ func _on_data_fs_1(fs_1_data):
node_select_fs_1.set_node_text(2, 2, str(fs_1_data.decode_u64(0xC) / 1_000_000) + ' МГц')
Constants.CMD.READ_ATT:
if GRP == Constants.GROUP.RF:
node_select_fs_1.set_node_text(2, 3, '-' + str(fs_1_data.decode_float(0x18)) + ' dB')
node_select_fs_1.set_node_text(2, 3, str(fs_1_data.decode_float(0x18)) + ' dB')
Constants.CMD.READ_GEN_STATUS:
if GRP == Constants.GROUP.GENERATOR:
if fs_1_data.decode_u32(0xC) == 0:
node_select_fs_1.set_node_text(2, 5, 'Включен')
node_select_fs_1.get_node2(2, 5).modulate = Color.AQUAMARINE
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/speed', 2.5)
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1, 5).get_child(1).button_pressed = true
else:
node_select_fs_1.set_node_text(2, 5, 'Отключен')
node_select_fs_1.get_node2(2, 5).modulate = Color.CRIMSON
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/speed', 0.0)
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1, 5).get_child(1).button_pressed = false
Constants.CMD.BASE_GET_CURRENT_TEMP:
if GRP == Constants.GROUP.BASE:
node_select_fs_1.set_node_text(2, 0, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
@@ -293,15 +297,19 @@ func _on_data_fs_2(fs_2_data):
node_select_fs_2.set_node_text(2, 2, str(fs_2_data.decode_u64(0xC) / 1_000_000) + ' МГц')
Constants.CMD.READ_ATT:
if GRP == Constants.GROUP.RF:
node_select_fs_2.set_node_text(2, 3, '-' + str(fs_2_data.decode_float(0x18)) + ' dB')
node_select_fs_2.set_node_text(2, 3, str(fs_2_data.decode_float(0x18)) + ' dB')
Constants.CMD.READ_GEN_STATUS:
if GRP == Constants.GROUP.GENERATOR:
if fs_2_data.decode_u32(0xC) == 0:
node_select_fs_2.set_node_text(2, 4, 'Включен')
node_select_fs_2.get_node2(2, 4).modulate = Color.AQUAMARINE
node_select_fs_2.set_node_text(2, 5, 'Включен')
node_select_fs_2.get_node2(2, 5).modulate = Color.AQUAMARINE
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 2.5)
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 5).get_child(1).button_pressed = true
else:
node_select_fs_2.set_node_text(2, 4, 'Отключен')
node_select_fs_2.get_node2(2, 4).modulate = Color.CRIMSON
node_select_fs_2.set_node_text(2, 5, 'Отключен')
node_select_fs_2.get_node2(2, 5).modulate = Color.CRIMSON
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 0.0)
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 5).get_child(1).button_pressed = false
Constants.CMD.BASE_GET_CURRENT_TEMP:
if GRP == Constants.GROUP.BASE:
node_select_fs_2.set_node_text(2, 0, '%.2f' % fs_2_data.decode_float(0xC) + ' °C')
@@ -649,11 +657,3 @@ func _on_modul_fs_2(modulation_select_2) -> void:
Network.set_configure_gen_const_2()
elif modulation_select_2 == 1:
Network.set_configure_gen_msk_2()
func _on_fs_mod_pressed() -> void:
Network.set_configure_gen_msk()
func _on_fs_mod_const() -> void:
Network.set_configure_gen_const()

View File

@@ -5,7 +5,15 @@ var node_cell_ind: Array
var count_cell: int
var past_pribor: int
func _ready() -> void:
Network.connect('port_fs_opened_1', _on_fs_status_1.bind(Constants.STATE_VAL.GOOD))
Network.connect('port_fs_closed_1', _on_fs_status_1.bind(Constants.STATE_VAL.ERROR))
Network.connect('port_fs_opened_2', _on_fs_status_2.bind(Constants.STATE_VAL.GOOD))
Network.connect('port_fs_closed_2', _on_fs_status_2.bind(Constants.STATE_VAL.ERROR))
self.add_child(timer)
timer.connect('timeout', Callable(self, '_on_timer').bind(Network.unit))
timer.start(1)
@@ -79,6 +87,7 @@ func _status_cell(status):
for i in range(5, count_cell):
node_cell_ind[i].state = Constants.STATE_VAL.NONE
func _status_prd():
var status: int = 0
for i in range(count_cell-3):
@@ -199,3 +208,12 @@ func _draw_control_panel_prd(pribor):
$soc_P1/MAA_2.rname = 'А28'
# Кассета П-2
$soc_P2.visible = true
func _on_fs_status_1(_name_port, status_fs_1):
$Kasseta_FS/ref_A1.state = status_fs_1
func _on_fs_status_2(_name_port, status_fs_2):
$Kasseta_FS/ref_A2.state = status_fs_2