исправление после мерджа

This commit is contained in:
2025-02-11 22:30:32 +03:00
parent 4ec99ce481
commit ba047d4c71
9 changed files with 57 additions and 47 deletions

View File

@@ -15,9 +15,10 @@ class FGOS:
SET_ATT = 0x1B, ## Команда установки аттенюации
READ_GEN_STATUS = 0x05, ## Команда получения статуса генератора
SET_GEN_STATUS = 0x06, ## Команда установки статуса генератора
BASE_GET_CURRENT_TEMP = 0x36, ## Команда получения температуры
STATUS_CAN_MACRO = 0x31, ## Команда для чтения/записи статуса CAN
BASE_CAN_MACRO_WRITE = 0x30, ## Команда для записи последовательности CAN-команд
BASE_CAN_MACRO_READ = 0x33, ## Команда для чтения последовательности CAN-команд
BASE_GET_CURRENT_TEMP = 0x36, ## Команда получения температуры
}
enum GROUP {
@@ -122,24 +123,6 @@ class FGOS:
if peer:
peer.put_data(data_to_sand)
#func _parse(rx_data: PackedByteArray):
#if not online:
#online = true
#emit_signal('line_changed', self)
#
#var status_len = rx_data.decode_u16(6) # Длина массива байтового "состояние прибора"
#
#var i: = 0
#var len_rx_data: = rx_data.size()
#status.resize(status_len)
#while i < status_len:
#var byte_i = i + 8
#if byte_i < len_rx_data:
#status[i] = rx_data[byte_i] # Массив байтовый "состояние прибора"
#i += 1
#emit_signal('data_received', self)
func start_session(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.START_SESSION, INDEX_SIZE, counter)
@@ -153,7 +136,15 @@ class FGOS:
packet.encode_u32(0xC, button_state) ## MODE GEN STATUS
send_packet_to(packet, client)
func status_can_macro_exec(button_state: bool, counter: int, client: StreamPeer):
var index_size = 0x1C
var packet = _form_packet(GROUP.BASE, CmdCode.STATUS_CAN_MACRO, index_size, counter)
packet.encode_u16(0x8, 0x0010)
packet.encode_u32(0xC, button_state) ## mode can status
send_packet_to(packet, client)
func set_carrier(installation_frequency: int, counter: int, client: StreamPeer):
var index_size = 0x1C
var packet = _form_packet(GROUP.BASE, CmdCode.SET_CARRIER, index_size, counter)
@@ -166,7 +157,7 @@ class FGOS:
var index_size = 0x1C
var packet = _form_packet(GROUP.RF, CmdCode.SET_ATT, index_size, counter)
packet.encode_u16(0x8, 0x10)
packet.encode_float(0x14, attenuation)
packet.encode_float(0x18, attenuation)
send_packet_to(packet, client)
@@ -206,4 +197,3 @@ class FGOS:
func get_base_can_macro(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.BASE_CAN_MACRO_READ, INDEX_SIZE, counter)
send_packet_to(packet, client)

View File

@@ -50,9 +50,9 @@ func _ready() -> void:
node_select_yau_07b.set_node_text(0, 0, 'ПРД-Н')
node_select_yau_07b.set_node_text(1, 0, 'Литера 2')
node_select_yau_07b.set_node_text(0, 1, 'Запрет СИ 2')
node_select_yau_07b.set_node_text(0, 2, 'Модуляция УМ 2')
node_select_yau_07b.set_node_text(0, 2, 'Модуляция УМ')
node_select_yau_07b.set_node_text(0, 3, 'Положение луча')
node_select_yau_07b.set_node_text(0, 4, 'Аттенюатор')
node_select_yau_07b.set_node_text(0, 4, 'Аттенюатор УМ')
node_select_yau_07b.set_node_text(0, 6, 'СИ 2 в УФ')
var node_select_yau_07b_2 = $TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control
@@ -61,16 +61,16 @@ func _ready() -> void:
node_select_yau_07b_2.set_node_text(0, 0, 'ПРД-Н')
node_select_yau_07b_2.set_node_text(1, 0, 'Литера 3')
node_select_yau_07b_2.set_node_text(0, 1, 'Запрет СИ 3')
node_select_yau_07b_2.set_node_text(0, 2, 'Модуляция УМ 3')
node_select_yau_07b_2.set_node_text(0, 2, 'Модуляция УМ')
node_select_yau_07b_2.set_node_text(0, 3, 'Положение луча')
node_select_yau_07b_2.set_node_text(0, 4, 'Аттенюатор')
node_select_yau_07b_2.set_node_text(0, 4, 'Аттенюатор УМ')
node_select_yau_07b_2.set_node_text(0, 5, 'ФГОЗ 3')
node_select_yau_07b_2.set_node_text(0, 6, 'СИ 3 в УФ')
#Таблица ФС
var node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
draw_tabl(node_select_fs_1, Constants.ROWS_FS, Constants.ROWS_FS.size())
node_select_fs_1.set_columns_min_size([120, 120, 150])
node_select_fs_1.set_columns_min_size([150, 120, 150])
node_select_fs_1.set_node_text(0, 0, 'Модуль ФС')
node_select_fs_1.set_node_text(1, 0, 'Литера 2')
node_select_fs_1.set_node_text(0, 1, 'Состояние')
@@ -80,7 +80,7 @@ func _ready() -> void:
node_select_fs_1.set_node_text(0, 3, 'Аттенюатор')
node_select_fs_1.get_node2(1, 3).placeholder_text = 'в dB'
node_select_fs_1.get_node2(1, 3).editable = true
node_select_fs_1.set_node_text(0, 4, 'Генератор')
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')
@@ -89,17 +89,17 @@ func _ready() -> void:
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())
node_select_fs_2.set_columns_min_size([120, 120, 150])
node_select_fs_2.set_columns_min_size([150, 120, 150])
node_select_fs_2.set_node_text(0, 0, 'Модуль ФС')
node_select_fs_2.set_node_text(1, 0, 'Литера 3')
node_select_fs_2.set_node_text(0, 1, 'Состояние')
node_select_fs_2.set_node_text(0, 2, 'Частота')
node_select_fs_2.set_node_text(0, 2, 'Частота ФС')
node_select_fs_2.get_node2(1, 2).placeholder_text = 'в МГц'
node_select_fs_2.get_node2(1, 2).editable = true
node_select_fs_2.set_node_text(0, 3, 'Аттенюатор')
node_select_fs_2.set_node_text(0, 3, 'Аттенюатор ФС')
node_select_fs_2.get_node2(1, 3).placeholder_text = 'в dB'
node_select_fs_2.get_node2(1, 3).editable = true
node_select_fs_2.set_node_text(0, 4, 'Генератор')
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')
@@ -139,7 +139,7 @@ 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)
@@ -177,11 +177,16 @@ func _ready() -> void:
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'))
node_select_fs_1.get_node2(1, 8).get_child(1, false).connect('toggled', Callable(self, '_on_status_can_macro_1'))
## 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, 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'))
node_select_fs_2.get_node2(1, 8).get_child(1, false).connect('toggled', Callable(self, '_on_status_can_macro_2'))
Network.connect_fs_1()
Network.connect_fs_2()
func on_device_selected(selected_index: int) -> void:
@@ -267,7 +272,7 @@ 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(0x14)) + ' 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:
@@ -603,6 +608,10 @@ func _on_set_base_can_macro(can_freq: String):
Network.set_can_macro(int(can_freq))
func _on_status_can_macro_1(toggled_btn: bool):
Network.status_can_macro_1(toggled_btn)
## 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)
@@ -628,3 +637,7 @@ func _on_set_att_2(att: String):
func _on_set_base_can_macro_2(can_freq: String):
Network.set_can_macro_2(int(can_freq))
func _on_status_can_macro_2(toggled_btn: bool):
Network.status_can_macro_2(toggled_btn)

View File

@@ -46,7 +46,8 @@ const ROWS_FS: Array = [
[TableNode, Switch, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, SocketStatus, TableNode],
[TableNode, TableNode, TableNode],]
[TableNode, TableNode, TableNode],
[TableNode, Switch, TableNode],]
const ADDRESSES: Array = [
['ПРД-Н1', '10.1.1.11', 50011, MODE.PRD_H, '10.1.2.18', '10.1.2.19', ''],
['ПРД-Н2', '10.1.1.21', 50021, MODE.PRD_H, '10.1.2.34', '10.1.2.35', ''],

View File

@@ -113,8 +113,7 @@ func _ready() -> void:
unit.connect('line_changed', Callable(self, 'on_line_changed'))
unit.connect('command_fail', Callable(self, 'on_command_fail'))
connect_fs_1()
connect_fs_2()
read_port_isa([Constants.BASE_PORTS.UG+6, Constants.BASE_PORTS.UG+8, Constants.BASE_PORTS.EMS_G+8])
@@ -285,6 +284,13 @@ func set_can_macro(can_frequency: int):
counter_fs_1 += 1
func status_can_macro_1(state_can: bool):
unit_fs.status_can_macro_exec(state_can, counter_fs_1, client_fs_1)
counter_fs_1 += 1
unit_fs.get_base_can_macro(counter_fs_1, client_fs_1)
counter_fs_1 += 1
## 2 ФС коннект
func connect_fs_2():
if client_fs_2:
@@ -359,6 +365,8 @@ func set_can_macro_2(can_frequency: int):
counter_fs_2 += 1
func can_macro_exec_2(state_can: bool):
unit_fs.set_state_base_can_macro(state_can, counter_fs_2, client_fs_2)
func status_can_macro_2(state_can: bool):
unit_fs.status_can_macro_exec(state_can, counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.get_base_can_macro(counter_fs_2, client_fs_2)
counter_fs_2 += 1