add command
This commit is contained in:
@@ -83,6 +83,9 @@ func _ready() -> void:
|
||||
node_select_fs_1.set_node_text(0, 4, 'Генератор')
|
||||
node_select_fs_1.set_node_text(0, 5, 'fpga')
|
||||
node_select_fs_1.set_node_text(0, 6, 'СИ 2 от ФС')
|
||||
node_select_fs_1.set_node_text(0, 7, 'Фильтр CAN')
|
||||
node_select_fs_1.get_node2(1, 7).placeholder_text = 'в МГц'
|
||||
node_select_fs_1.get_node2(1, 7).editable = true
|
||||
|
||||
var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
|
||||
draw_tabl(node_select_fs_2, Constants.ROWS_FS, Constants.ROWS_FS.size())
|
||||
@@ -99,6 +102,9 @@ func _ready() -> void:
|
||||
node_select_fs_2.set_node_text(0, 4, 'Генератор')
|
||||
node_select_fs_2.set_node_text(0, 5, 'fpga')
|
||||
node_select_fs_2.set_node_text(0, 6, 'СИ 3 от ФС')
|
||||
node_select_fs_2.set_node_text(0, 7, 'Фильтр CAN')
|
||||
node_select_fs_2.get_node2(1, 7).placeholder_text = 'в МГц'
|
||||
node_select_fs_2.get_node2(1, 7).editable = true
|
||||
|
||||
# Выбор прибора для подключения
|
||||
var node_select_device = $TabContainer/PRD/select_dev
|
||||
@@ -144,25 +150,27 @@ func _ready() -> void:
|
||||
Network.connect('port_fs_closed_2', _on_port_changed_fs_2.bind(Color.CRIMSON))
|
||||
Network.connect('data_from_fs_1', _on_data_fs_1)
|
||||
Network.connect('data_from_fs_2', _on_data_fs_2)
|
||||
|
||||
## Yau-07b 1
|
||||
node_select_yau_07b.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret1'))
|
||||
node_select_yau_07b.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_1'))
|
||||
node_select_yau_07b.get_node2(1, 3).connect('item_selected', Callable(self, '_on_btn_ray_1'))
|
||||
node_select_yau_07b.get_node2(1, 4).connect('item_selected', Callable(self, '_on_attenuator_1'))
|
||||
|
||||
## Yau-07b 2
|
||||
node_select_yau_07b_2.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret2'))
|
||||
node_select_yau_07b_2.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_2'))
|
||||
node_select_yau_07b_2.get_node2(1, 3).connect('item_selected', Callable(self, '_on_btn_ray_2'))
|
||||
node_select_yau_07b_2.get_node2(1, 4).connect('item_selected', Callable(self, '_on_attenuator_2'))
|
||||
node_select_yau_07b_2.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_fgos_2'))
|
||||
|
||||
## FS 1
|
||||
node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_1'))
|
||||
node_select_fs_1.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_1'))
|
||||
node_select_fs_1.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_1'))
|
||||
|
||||
node_select_fs_1.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_1'))
|
||||
node_select_fs_1.get_node2(1, 7).connect('text_submitted', Callable(self, '_on_set_base_can_macro'))
|
||||
## FS 2
|
||||
node_select_fs_2.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2'))
|
||||
node_select_fs_2.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_2'))
|
||||
node_select_fs_2.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_2'))
|
||||
node_select_fs_2.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_2'))
|
||||
node_select_fs_2.get_node2(1, 7).connect('text_submitted', Callable(self, '_on_set_base_can_macro_2'))
|
||||
|
||||
|
||||
func draw_control_panel_prd(pribor) -> void:
|
||||
@@ -286,15 +294,24 @@ 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[0x106] & 0x7)
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 4).select((isa_data[0x106] & 0x38)>> 3)
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[0x106] & 0x7))
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[0x106] & 0x38))
|
||||
$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[0x108] & 0x7)
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 4).select((isa_data[0x108] & 0x38)>>3)
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[0x108] & 0x7))
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[0x108] & 0x38))
|
||||
$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
|
||||
|
||||
|
||||
func _on_data_fs_1(fs_1_data):
|
||||
@@ -304,22 +321,26 @@ func _on_data_fs_1(fs_1_data):
|
||||
match CMD:
|
||||
Constants.CMD.READ_CARRIER:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_1.set_node_text(2, 2, str(fs_1_data.decode_u64(0xC)) + ' Гц')
|
||||
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(0x14)) + ' 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, 4, 'Включен')
|
||||
node_select_fs_1.get_node2(2, 4).modulate = Color.AQUAMARINE
|
||||
else:
|
||||
node_select_fs_1.set_node_text(2, 4, 'Выключен')
|
||||
node_select_fs_1.set_node_text(2, 4, 'Отключен')
|
||||
node_select_fs_1.get_node2(2, 4).modulate = Color.CRIMSON
|
||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_1.set_node_text(1, 5, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
|
||||
#$read.text = str(fs_1_data.hex_encode())
|
||||
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):
|
||||
@@ -329,7 +350,7 @@ func _on_data_fs_2(fs_2_data):
|
||||
match CMD:
|
||||
Constants.CMD.READ_CARRIER:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_2.set_node_text(2, 2, str(fs_2_data.decode_u64(0xC)) + ' Гц')
|
||||
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')
|
||||
@@ -339,12 +360,15 @@ func _on_data_fs_2(fs_2_data):
|
||||
node_select_fs_2.set_node_text(2, 4, 'Включен')
|
||||
node_select_fs_2.get_node2(2, 4).modulate = Color.AQUAMARINE
|
||||
else:
|
||||
node_select_fs_2.set_node_text(2, 4, 'Выключен')
|
||||
node_select_fs_2.set_node_text(2, 4, 'Отключен')
|
||||
node_select_fs_2.get_node2(2, 4).modulate = Color.CRIMSON
|
||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_2.set_node_text(1, 5, '%.2f' % fs_2_data.decode_float(0xC) + ' °C')
|
||||
|
||||
Constants.CMD.BASE_CAN_MACRO_READ:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_2.set_node_text(2, 7, str(fs_2_data.decode_u16(0x20)) + ' МГц')
|
||||
|
||||
|
||||
## Рисует таблицу
|
||||
func draw_tabl(tbl: Node, row: Array, count_row: int):
|
||||
@@ -635,6 +659,10 @@ func _on_set_att_1(att: String):
|
||||
Network.set_fs_attenuation(float(att))
|
||||
|
||||
|
||||
func _on_set_base_can_macro(can_freq: String):
|
||||
Network.set_can_macro(int(can_freq))
|
||||
|
||||
|
||||
## 2 ФС
|
||||
func _on_port_changed_fs_2(port_name: String, color: Color) -> void:
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.set_node_text(1, 1, port_name)
|
||||
@@ -656,3 +684,7 @@ func _on_set_ferq_2(freq: String):
|
||||
|
||||
func _on_set_att_2(att: String):
|
||||
Network.set_fs_attenuation_2(float(att))
|
||||
|
||||
|
||||
func _on_set_base_can_macro_2(can_freq: String):
|
||||
Network.set_can_macro_2(int(can_freq))
|
||||
|
||||
Reference in New Issue
Block a user