настройка мимикрии
This commit is contained in:
@@ -10,16 +10,14 @@ var node_select_yau_07b_2: Node
|
||||
var node_select_fs_1: Node
|
||||
var node_select_fs_2: Node
|
||||
var isa_from_yau07b: Dictionary = {}
|
||||
var JSOON = JSON.new()
|
||||
var freq_fs_1: int
|
||||
var freq_fs_2: int
|
||||
var att_fs_1: float
|
||||
var att_fs_2: float
|
||||
var status_pribor = null
|
||||
var save_path = "D://PRD-TU-MP550//"
|
||||
var need_port: Array = [
|
||||
0x122,
|
||||
0x124,
|
||||
0x126,
|
||||
0x128,
|
||||
0x12A
|
||||
]
|
||||
const need_port: Array = [0x122, 0x124, 0x126, 0x128, 0x12A]
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Считывание аргументов с консоли (путь сохранения)
|
||||
@@ -239,25 +237,25 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
|
||||
|
||||
for index in Constants.EMS_G_PORT_DATA_HOLDER.size():
|
||||
var tmp_device_mode = Constants.EMS_G_PORT_DATA_HOLDER[index][0]
|
||||
if tmp_device_mode == 48:
|
||||
if tmp_device_mode == Constants.META.CI_2_B_UF:
|
||||
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
|
||||
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,1).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 14
|
||||
if tmp_device_mode == 49:
|
||||
if tmp_device_mode == Constants.META.CI_3_B_UF:
|
||||
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
|
||||
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,1).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 14
|
||||
if tmp_device_mode == 51:
|
||||
if tmp_device_mode == Constants.META.MODUL_UM_2:
|
||||
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
|
||||
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
|
||||
var select = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 if data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 < 3 else 3
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1,2).select(select)
|
||||
if tmp_device_mode == 52:
|
||||
if tmp_device_mode == Constants.META.MODUL_UM_3:
|
||||
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
|
||||
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
|
||||
var select = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 if data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13 < 3 else 3
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,2).select(select)
|
||||
if tmp_device_mode == 56:
|
||||
if tmp_device_mode == Constants.META.FGOZ_3:
|
||||
var data_dict = Constants.EMS_G_PORT_DATA_HOLDER[index][1]
|
||||
if Constants.BASE_PORTS.EMS_G+8 in data_dict:
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1,5).get_child(1).button_pressed = data_dict[Constants.BASE_PORTS.EMS_G+8] >> 13
|
||||
@@ -269,10 +267,12 @@ 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) / 1_000_000) + ' МГц')
|
||||
freq_fs_1 = fs_1_data.decode_u64(0xC) / 1_000_000
|
||||
node_select_fs_1.set_node_text(2, 2, str(freq_fs_1) + ' МГц')
|
||||
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')
|
||||
att_fs_1 = fs_1_data.decode_float(0x18)
|
||||
node_select_fs_1.set_node_text(2, 3, str(att_fs_1) + ' dB')
|
||||
Constants.CMD.READ_GEN_STATUS:
|
||||
if GRP == Constants.GROUP.GENERATOR:
|
||||
if fs_1_data.decode_u32(0xC) == 0:
|
||||
@@ -299,10 +299,12 @@ 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) / 1_000_000) + ' МГц')
|
||||
freq_fs_2 = fs_2_data.decode_u64(0xC) / 1_000_000
|
||||
node_select_fs_2.set_node_text(2, 2, str(freq_fs_2) + ' МГц')
|
||||
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')
|
||||
att_fs_2 = fs_2_data.decode_float(0x18)
|
||||
node_select_fs_2.set_node_text(2, 3, str(att_fs_2) + ' dB')
|
||||
Constants.CMD.READ_GEN_STATUS:
|
||||
if GRP == Constants.GROUP.GENERATOR:
|
||||
if fs_2_data.decode_u32(0xC) == 0:
|
||||
@@ -323,6 +325,44 @@ func _on_data_fs_2(fs_2_data):
|
||||
node_select_fs_2.set_node_text(2, 7, str(fs_2_data.decode_u16(0x20)) + ' МГц')
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
# FS 1
|
||||
var node_freq_fs_1 = node_select_fs_1.get_node2(1, 2)
|
||||
var node_freq_fs_1_mod = node_select_fs_1.get_node2(0, 2)
|
||||
if (int(node_freq_fs_1.get_text()) != freq_fs_1) and node_freq_fs_1.get_text() != '':
|
||||
node_freq_fs_1_mod.modulate = Color.AQUAMARINE
|
||||
node_freq_fs_1_mod.text = 'Частота*'
|
||||
else:
|
||||
node_freq_fs_1_mod.modulate = Color(1, 1, 0.941, 1)
|
||||
node_freq_fs_1_mod.text = 'Частота'
|
||||
node_freq_fs_1 = node_select_fs_1.get_node2(1, 3)
|
||||
node_freq_fs_1_mod = node_select_fs_1.get_node2(0, 3)
|
||||
if (int(node_freq_fs_1.get_text()) != att_fs_1) and node_freq_fs_1.get_text() != '':
|
||||
node_freq_fs_1_mod.modulate = Color.AQUAMARINE
|
||||
node_freq_fs_1_mod.text = 'Аттенюатор*'
|
||||
else:
|
||||
node_freq_fs_1_mod.modulate = Color(1, 1, 0.941, 1)
|
||||
node_freq_fs_1_mod.text = 'Аттенюатор'
|
||||
|
||||
# FS 2
|
||||
var node_freq_fs_2 = node_select_fs_2.get_node2(1, 2)
|
||||
var node_freq_fs_2_mod = node_select_fs_2.get_node2(0, 2)
|
||||
if int(node_freq_fs_2.get_text()) != freq_fs_2 and node_freq_fs_2.get_text() != '':
|
||||
node_freq_fs_2_mod.modulate = Color.AQUAMARINE
|
||||
node_freq_fs_2_mod.text = 'Частота*'
|
||||
else:
|
||||
node_freq_fs_2_mod.modulate = Color(1, 1, 0.941, 1)
|
||||
node_freq_fs_2_mod.text = 'Частота'
|
||||
node_freq_fs_2 = node_select_fs_2.get_node2(1, 3)
|
||||
node_freq_fs_2_mod = node_select_fs_2.get_node2(0, 3)
|
||||
if int(node_freq_fs_2.get_text()) != freq_fs_2 and node_freq_fs_2.get_text() != '':
|
||||
node_freq_fs_2_mod.modulate = Color.AQUAMARINE
|
||||
node_freq_fs_2_mod.text = 'Аттенюатор*'
|
||||
else:
|
||||
node_freq_fs_2_mod.modulate = Color(1, 1, 0.941, 1)
|
||||
node_freq_fs_2_mod.text = 'Аттенюатор'
|
||||
|
||||
|
||||
## Рисует таблицу
|
||||
func draw_tabl(tbl: Node, row: Array, count_row: int):
|
||||
for i_row in count_row:
|
||||
@@ -356,6 +396,7 @@ func set_frame(node: Node, val: int): node.set_frame(val)
|
||||
|
||||
|
||||
func _on_prd_select() -> void:
|
||||
emit_signal('read_ems_g_start')
|
||||
set_tab_and_buttons(0, 'select_prd')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user