отладка контроля

This commit is contained in:
2025-02-11 19:11:15 +03:00
parent bb50790ce8
commit cd83c97d6a
5 changed files with 46 additions and 32 deletions

View File

@@ -949,18 +949,6 @@ offset_bottom = 827.0
theme = SubResource("Theme_yblys")
text = "Сохранить все настройки"
[node name="can_macro" type="Label" parent="."]
offset_left = 226.0
offset_top = 876.0
offset_right = 1055.0
offset_bottom = 916.0
[node name="can" type="Label" parent="."]
offset_left = 224.0
offset_top = 844.0
offset_right = 959.0
offset_bottom = 889.0
[connection signal="pressed" from="Background/side_panel/select_prd" to="." method="_on_prd_select"]
[connection signal="pressed" from="Background/side_panel/select_control" to="." method="_on_control_button"]
[connection signal="pressed" from="Background/side_panel/select_ems_g" to="." method="_on_emsg_select"]

View File

@@ -139,7 +139,17 @@ func _ready() -> void:
for key in Constants.ATT_DICT:
node_select_yau_07b.get_node2(1, 4).add_item(key)
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 48)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 49)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 51)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 52)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 56)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
Network.connect('yau_receive', Callable(self, '_on_data_received'))
@@ -207,25 +217,43 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
$ISA.text = 'ISA: ' + str(len(Constants.EMS_G_PORT_DATA_HOLDER))
if isa_data.has(Constants.BASE_PORTS.UG+6):
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 3).select(isa_data[Constants.BASE_PORTS.UG+6] & 0x7)
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+6] & 0x38)>> 3)
if (isa_data[Constants.BASE_PORTS.UG+6] & 0x7) < 7:
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 3).select(isa_data[Constants.BASE_PORTS.UG+6] & 0x7)
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+6] & 0x38)>> 3)
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[Constants.BASE_PORTS.UG+6] & 0x7))
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[Constants.BASE_PORTS.UG+6] & 0x38))
if isa_data.has(Constants.BASE_PORTS.UG+8):
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 3).select(isa_data[Constants.BASE_PORTS.UG+8] & 0x7)
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+8] & 0x38)>>3)
if (isa_data[Constants.BASE_PORTS.UG+8] & 0x7) < 7:
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 3).select(isa_data[Constants.BASE_PORTS.UG+8] & 0x7)
$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))
if isa_data.has(Constants.BASE_PORTS.EMS_G+2):
print(isa_data[Constants.BASE_PORTS.EMS_G+2])
if (isa_data[Constants.BASE_PORTS.EMS_G+2]== 48):
if (isa_data[Constants.BASE_PORTS.EMS_G+8]>>14):
print(isa_data)
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,1).get_child(1).button_pressed = true
else:
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,1).get_child(1).button_pressed = false
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:
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,1).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 14
if tmp_device_mode == 49:
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,1).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 14
if tmp_device_mode == 51:
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
var select = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 if data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 < 3 else 3
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,2).select(select)
if tmp_device_mode == 52:
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
var select = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 if data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 < 3 else 3
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,2).select(select)
if tmp_device_mode == 56:
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,5).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13
func _on_data_fs_1(fs_1_data):
var node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
@@ -252,8 +280,6 @@ func _on_data_fs_1(fs_1_data):
Constants.CMD.BASE_CAN_MACRO_READ:
if GRP == Constants.GROUP.BASE:
node_select_fs_1.set_node_text(2, 7, str(fs_1_data.decode_u16(0x20)) + ' МГц')
$can.text = str(fs_1_data)
$can_macro.text = str(fs_1_data.decode_u32(0x04))
func _on_data_fs_2(fs_2_data):

View File

@@ -1,6 +1,6 @@
extends Node
const UNICAST_PORT: int = 50014
const UNICAST_ADDRESS: String = '10.1.1.14'
const UNICAST_PORT: int = 50003
const UNICAST_ADDRESS: String = '10.1.1.3'
const BROADCAST_PORT: int = 50000
const DEFAULT_ADDRESS: String = '10.1.1.11'
const DEFAULT_PORT: String = '50011'

View File

@@ -67,7 +67,7 @@ func _status_cell(status):
node_cell_ind[i].state = Constants.STATE_VAL.NONE
func _status_prd():
var status: int
var status: int = 0
for i in range(count_cell-3):
status += 1 if (node_cell_ind[i].state == Constants.STATE_VAL.GOOD) else 0
status += 1 if (node_cell_ind[count_cell-1].state == Constants.STATE_VAL.GOOD) else 0

View File

@@ -109,7 +109,7 @@ func _ready() -> void:
soc_unicast = Socket.new()
rc = soc_unicast.bind(Constants.UNICAST_PORT, Constants.UNICAST_ADDRESS)
if rc != OK:
print_debug('Ошибка: неудачная привязка адреса: ', ip_address_yau)
print_debug('Ошибка: неудачная привязка адреса: ', Constants.UNICAST_ADDRESS)
unit.connect('line_changed', Callable(self, 'on_line_changed'))
unit.connect('command_fail', Callable(self, 'on_command_fail'))