добавка модуляции

This commit is contained in:
2025-02-12 02:47:18 +03:00
parent f682733cfd
commit 54ff1757b2
6 changed files with 132 additions and 31 deletions

View File

@@ -13,6 +13,7 @@ class FGOS:
SET_CARRIER = 0x1E, ## Команда установки несущей частоты
READ_ATT = 0x1A, ## Команда чтения аттенюации
SET_ATT = 0x1B, ## Команда установки аттенюации
SET_CONFIGURE = 0x01, ## Команда для записи регистров а AXI
READ_GEN_STATUS = 0x05, ## Команда получения статуса генератора
SET_GEN_STATUS = 0x06, ## Команда установки статуса генератора
STATUS_CAN_MACRO = 0x31, ## Команда для чтения/записи статуса CAN
@@ -128,7 +129,32 @@ class FGOS:
var packet = _form_packet(GROUP.BASE, CmdCode.START_SESSION, INDEX_SIZE, counter)
send_packet_to(packet, client)
## MSK
func set_configure_state_msk_modul_1(counter: int, client: StreamPeer):
var index_size = 0x20
var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_CONFIGURE, index_size, counter)
packet.encode_u8(0x3, 0x09)
packet.encode_u16(0x8, 0x0014)
send_packet_to(packet, client)
func set_configure_state_msk_modul_2(counter: int, client: StreamPeer):
var index_size = 0x20
var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_CONFIGURE, index_size, counter)
packet.encode_u8(0x3, 0x0d)
packet.encode_u16(0x8, 0x0014)
send_packet_to(packet, client)
## Constant
func set_configure_state_msk_const_1(counter: int, client: StreamPeer):
var index_size = 0x20
var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_CONFIGURE, index_size, counter)
packet.encode_u8(0x3, 0x09)
packet.encode_u16(0x8, 0x0014)
packet.encode_u8(0x1C, 0x0f)
send_packet_to(packet, client)
func set_gen_state(button_state: bool, counter: int, client: StreamPeer):
var index_size = 0x1C
var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_GEN_STATUS, index_size, counter)

View File

@@ -80,8 +80,10 @@ 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, 5, 'fpga')
node_select_fs_1.set_node_text(0, 4, 'Модуляция')
node_select_fs_1.get_node2(1, 4).add_item('Const')
node_select_fs_1.get_node2(1, 4).add_item('MSK')
node_select_fs_1.set_node_text(0, 5, 'Генератор ФС')
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 = 'в МГц'
@@ -100,8 +102,10 @@ func _ready() -> void:
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, 5, 'fpga')
node_select_fs_2.set_node_text(0, 4, 'Модуляция')
node_select_fs_2.get_node2(1, 4).add_item('Const')
node_select_fs_2.get_node2(1, 4).add_item('MSK')
node_select_fs_2.set_node_text(0, 5, 'Генератор ФС')
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 = 'в МГц'
@@ -164,18 +168,20 @@ func _ready() -> void:
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, 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, 4).connect('item_selected', Callable(self, '_on_modul_fs_1'))
node_select_fs_1.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_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, 4).connect('item_selected', Callable(self, '_on_modul_fs_2'))
node_select_fs_2.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_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'))
func on_device_selected(selected_index: int) -> void:
var get_select_device = $TabContainer/PRD/select_dev.get_node2(1, 0)
@@ -264,14 +270,14 @@ func _on_data_fs_1(fs_1_data):
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
node_select_fs_1.set_node_text(2, 5, 'Включен')
node_select_fs_1.get_node2(2, 5).modulate = Color.AQUAMARINE
else:
node_select_fs_1.set_node_text(2, 4, 'Отключен')
node_select_fs_1.get_node2(2, 4).modulate = Color.CRIMSON
node_select_fs_1.set_node_text(2, 5, 'Отключен')
node_select_fs_1.get_node2(2, 5).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')
node_select_fs_1.set_node_text(2, 0, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
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)) + ' МГц')
@@ -298,7 +304,7 @@ func _on_data_fs_2(fs_2_data):
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')
node_select_fs_2.set_node_text(2, 0, '%.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)) + ' МГц')
@@ -579,6 +585,13 @@ func _on_start_fs_1():
Network.start_work_fs()
func _on_modul_fs_1(modulation_select_1) -> void:
if modulation_select_1 == 0:
Network.set_configure_gen_const_1()
elif modulation_select_1 == 1:
Network.set_configure_gen_msk_1()
func _on_get_status_1(toggled_btn):
var inverted_state = not toggled_btn
Network.get_fs_gen_status(inverted_state)
@@ -629,3 +642,18 @@ func _on_set_base_can_macro_2(can_freq: String):
func _on_status_can_macro_2(toggled_btn: bool):
Network.status_can_macro_2(toggled_btn)
func _on_modul_fs_2(modulation_select_2) -> void:
if modulation_select_2 == 0:
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

@@ -40,14 +40,14 @@ const ROWS_YAU_07B_2: Array = [
[TableNode, SocketStatus]]
const ROWS_FS: Array = [
[Header, Header, Header],
[TableNode, TableNode, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, Switch, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, SocketStatus, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, Switch, TableNode],]
[TableNode, TableNode, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, TableNode, TableNode],
[TableNode, TableList, TableNode],
[TableNode, Switch, TableNode],
[TableNode, SocketStatus, 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

@@ -58,7 +58,7 @@ func _status_cell(status):
#dkm
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
$soc_DKM/DKM_2.state = (dkm >> 1) & 0x1
$soc_DKM/DKM_2.state = 1 if (dkm >> 1) & 0x1 else 3
$soc_DKM/DKM_3.state = (dkm >> 2) & 0x1
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
$soc_DKM/DKM_2.state = (dkm >> 3) & 0x1

View File

@@ -304,6 +304,18 @@ func status_can_macro_1(state_can: bool):
counter_fs_1 += 1
func set_configure_gen_msk_1():
unit_fs.set_configure_state_msk_modul_1(counter_fs_1, client_fs_1)
counter_fs_1 += 1
unit_fs.set_configure_state_msk_modul_2(counter_fs_1, client_fs_1)
counter_fs_1 += 1
func set_configure_gen_const_1():
unit_fs.set_configure_state_msk_const_1(counter_fs_1, client_fs_1)
counter_fs_1 += 1
## 2 ФС коннект
func connect_fs_2():
if client_fs_2:
@@ -382,3 +394,14 @@ func status_can_macro_2(state_can: bool):
counter_fs_2 += 1
unit_fs.get_base_can_macro(counter_fs_2, client_fs_2)
counter_fs_2 += 1
func set_configure_gen_msk_2():
unit_fs.set_configure_state_msk_modul_1(counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.set_configure_state_msk_modul_2(counter_fs_2, client_fs_2)
counter_fs_2 += 1
func set_configure_gen_const_2():
unit_fs.set_configure_state_msk_const_1(counter_fs_2, client_fs_2)
counter_fs_2 += 1