commit before merge
This commit is contained in:
@@ -62,8 +62,21 @@ func _ready() -> void:
|
||||
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, 6, 'ВЧ тракт')
|
||||
node_select_fs_1.set_node_text(0, 7, 'Пр. питания')
|
||||
node_select_fs_1.set_node_text(0, 6, 'СИ 2 ОТ ФС')
|
||||
|
||||
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_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.get_node2(1, 2).placeholder_text = '500'
|
||||
node_select_fs_2.set_node_text(0, 3, 'Аттенюатор')
|
||||
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, 6, 'СИ 3 ОТ ФС')
|
||||
|
||||
# Выбор прибора для подключения
|
||||
var node_select_device = $TabContainer/PRD/select_dev
|
||||
@@ -99,6 +112,7 @@ func _ready() -> void:
|
||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
|
||||
Network.connect('data_from_fs_1', Callable(self, '_on_data_fs_1'))
|
||||
Network.connect('data_from_fs_2', Callable(self, '_on_data_fs_2'))
|
||||
|
||||
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'))
|
||||
@@ -111,7 +125,8 @@ 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'))
|
||||
|
||||
node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status'))
|
||||
node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_1'))
|
||||
node_select_fs_2.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2'))
|
||||
|
||||
func draw_control_panel_prd(mode) -> void:
|
||||
for node_path in Constants.NODE_MAP:
|
||||
@@ -182,11 +197,34 @@ func _on_data_fs_1(fs_1_data):
|
||||
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(1, 6, str(fs_1_data.decode_float(0x10)) + ' °C')
|
||||
node_select_fs_1.set_node_text(1, 7, str(fs_1_data.decode_float(0x14)) + ' °C')
|
||||
#$read.text = str(fs_1_data.hex_encode())
|
||||
|
||||
|
||||
|
||||
func _on_data_fs_2(fs_2_data):
|
||||
var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
|
||||
var GRP = fs_2_data.decode_u8(0x0)
|
||||
var CMD = fs_2_data.decode_u8(0x1)
|
||||
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)) + ' Гц')
|
||||
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')
|
||||
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
|
||||
else:
|
||||
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')
|
||||
|
||||
|
||||
## Рисует таблицу
|
||||
func draw_tabl(tbl: Node, row: Array, count_row: int):
|
||||
for i_row in count_row:
|
||||
@@ -209,21 +247,21 @@ func _on_data_received(data_from_yau_07):
|
||||
|
||||
|
||||
## УКП
|
||||
for i in range(8): ## Мощность от УКП_1
|
||||
for i in range(6): ## Мощность от УКП_1
|
||||
var power_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_1 + 2 * i)
|
||||
node_select1.set_node_text(0, i+1, '%d' % power_ukp_1)
|
||||
|
||||
for i in range(8): ## Температура от УКП_1
|
||||
for i in range(6): ## Температура от УКП_1
|
||||
var temperature_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.TEMPERATURE_UKP_1 + 2 * i)
|
||||
var TMP = Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * Constants.TEMP
|
||||
node_select1.set_node_text(1, i+1, '%d °С' % TMP)
|
||||
|
||||
for i_pow in range(8): ## Мощность от УКП_2
|
||||
for i_pow in range(6): ## Мощность от УКП_2
|
||||
if len(data_from_yau_07) > Constants.DataIndices.POWER_UKP_2 + 2 * i_pow:
|
||||
var power_ukp_2 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_2 + 2 * i_pow)
|
||||
node_select2.set_node_text(0, i_pow+1, '%d' % power_ukp_2)
|
||||
|
||||
for row in range(8): ## Температура от УКП_2
|
||||
for row in range(6): ## Температура от УКП_2
|
||||
if len(data_from_yau_07) > Constants.DataIndices.TEMPERATURE_UKP_2 + 2 * row:
|
||||
var temperature_ukp_2 = data_from_yau_07.decode_u16(Constants.DataIndices.TEMPERATURE_UKP_2 + 2 * row)
|
||||
var TMP = Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_2) * Constants.TEMP
|
||||
@@ -275,7 +313,8 @@ func on_btn_select(intem_from_sector: int) -> void:
|
||||
Network.on_command_change_device(meta)
|
||||
flag_mode = meta[2]
|
||||
draw_control_panel_prd(flag_mode)
|
||||
_on_start_fs()
|
||||
_on_start_fs_1()
|
||||
_on_start_fs_2()
|
||||
|
||||
|
||||
func fill_item(node: Node, i_column: int, i_row: int, arr: Dictionary, select: int = 0) -> void:
|
||||
@@ -382,12 +421,23 @@ func set_bits(v, a, m):
|
||||
return (~m) & v | a & m
|
||||
|
||||
|
||||
func _on_start_fs():
|
||||
func _on_start_fs_1():
|
||||
unit_fs.start_session()
|
||||
unit_fs.base_get_current_temp()
|
||||
|
||||
|
||||
func _on_get_status(toggled_btn):
|
||||
func _on_start_fs_2():
|
||||
unit_fs.start_session()
|
||||
unit_fs.base_get_current_temp()
|
||||
|
||||
|
||||
func _on_get_status_1(toggled_btn):
|
||||
var inverted_state = not toggled_btn
|
||||
unit_fs.set_gen_state(inverted_state)
|
||||
unit_fs.get_gen_state()
|
||||
|
||||
|
||||
func _on_get_status_2(toggled_btn):
|
||||
var inverted_state = not toggled_btn
|
||||
unit_fs.set_gen_state(inverted_state)
|
||||
unit_fs.get_gen_state()
|
||||
|
||||
Reference in New Issue
Block a user