ready for kira

This commit is contained in:
2025-01-31 16:51:07 +03:00
parent 4620fc6984
commit 35196b731f
3 changed files with 210 additions and 58 deletions

View File

@@ -21,7 +21,7 @@ func _ready() -> void:
node_select1.set_node_text(1, 0, 'Температура')
# Таблица УКП_2
node_select2 = $TabContainer/PRD/body_grid/litera_3_5_7_1/table_ukp_2
node_select2 = $TabContainer/PRD/body_grid/litera_3_5_7/table_ukp_2
draw_tabl(node_select2, Constants.ROWS_UKP2_DATA, Constants.ROWS_UKP2_DATA.size())
node_select2.set_columns_min_size([120, 120])
node_select2.set_node_text(0, 0, 'Мощность')
@@ -43,12 +43,12 @@ func _ready() -> void:
## Заполненение списка направления луча
for key in Constants.RAY_DICT:
$TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Ray_set_1.add_item(key)
$TabContainer/PRD/body_grid/litera_3_5_7_1/yau_07b/Ray_set_2.add_item(key)
$TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Ray_set_2.add_item(key)
## Заполненение списка аттенюатора
for key in Constants.ATT_DICT:
$TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/att_set_1.add_item(key)
$TabContainer/PRD/body_grid/litera_3_5_7_1/yau_07b/att_set_2.add_item(key)
$TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/att_set_2.add_item(key)
draw_control_panel_prd(Constants.ADDRESSES[0][3])
@@ -99,7 +99,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
if isa_data.has(Constants.BASE_PORTS.UG+6):
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[0x106] & 0x7))
if isa_data.has(Constants.BASE_PORTS.UG+8):
$TabContainer/PRD/body_grid/litera_3_5_7_1/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/turn', 0.735 + 0.025 * (isa_data[0x108] & 0x7))
## Рисует таблицу
@@ -165,6 +165,15 @@ func _on_mfs_select() -> void:
set_tab_and_buttons(3, 'select_fs')
func _on_save_config():
print('Тебе сюда')
func _on_load_config():
print('тебе сюда')
func set_tab_and_buttons(tab_index: int, button_name: String) -> void:
$TabContainer.current_tab = tab_index
var side_panel = $Background/side_panel
@@ -200,7 +209,7 @@ func _on_zapret1(toggled_on: bool) -> void:
func _on_zapret2(toggled_on: bool) -> void:
var meta = $TabContainer/PRD/body_grid/litera_3_5_7_1/yau_07b/Zapret2.get_meta('dev_num')
var meta = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Zapret2.get_meta('dev_num')
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta)
var zapret_mode = 0x4000 if toggled_on else 0x0
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, zapret_mode)
@@ -214,14 +223,14 @@ func _on_modul_um_1(toggled_on: bool):
func _on_modul_um_2(toggled_on: bool):
var meta = $TabContainer/PRD/body_grid/litera_3_5_7_1/yau_07b/Modul_um_2.get_meta('dev_num')
var meta = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Modul_um_2.get_meta('dev_num')
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta)
var modul_um = 0x2000 if toggled_on else 0x0
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um)
func _on_fgos_2(toggled_on: bool):
var meta = $TabContainer/PRD/body_grid/litera_3_5_7_1/yau_07b/fgos_2.get_meta('dev_num')
var meta = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/fgos_2.get_meta('dev_num')
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta)
var modul_um = 0x2000 if toggled_on else 0x0
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um)
@@ -236,25 +245,35 @@ func _on_fgos_2(toggled_on: bool):
## Регулировка положением луча 1
func _on_btn_ray_1(item_from_ray_1: int) -> void:
Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_ray_1, 7))
Network.read_port_isa([Constants.BASE_PORTS.UG+6])
if isa_from_yau07b.has(Constants.BASE_PORTS.UG+6):
Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_ray_1, 7))
Network.read_port_isa([Constants.BASE_PORTS.UG+6])
else:
print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x6))
## Регулировка положением луча 2
func _on_btn_ray_2(item_from_ray_2: int) -> void:
Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_ray_2, 7))
Network.read_port_isa([Constants.BASE_PORTS.UG+8])
if isa_from_yau07b.has(Constants.BASE_PORTS.UG+8):
Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_ray_2, 7))
Network.read_port_isa([Constants.BASE_PORTS.UG+8])
else:
print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x8))
func _on_attenuator_1(item_from_att_1: int) -> void:
Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_att_1 << 3, 0x38))
Network.read_port_isa([Constants.BASE_PORTS.UG+6])
if isa_from_yau07b.has(Constants.BASE_PORTS.UG+6):
Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_att_1 << 3, 0x38))
Network.read_port_isa([Constants.BASE_PORTS.UG+6])
else:
print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x6))
func _on_attenuator_2(item_from_att_1: int) -> void:
Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_att_1 << 3, 0x38))
Network.read_port_isa([Constants.BASE_PORTS.UG+8])
if isa_from_yau07b.has(Constants.BASE_PORTS.UG+8):
Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_att_1 << 3, 0x38))
Network.read_port_isa([Constants.BASE_PORTS.UG+8])
else:
print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x8))
func _on_read_isa_pressed() -> void:
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+2, Constants.BASE_PORTS.EMS_G+4, Constants.BASE_PORTS.EMS_G+8])