New fs class for prd

This commit is contained in:
Maxim
2025-07-09 11:37:32 +03:00
parent 1982125fc7
commit 3242b70078
3 changed files with 95 additions and 307 deletions

View File

@@ -228,8 +228,6 @@ func _ready() -> void:
#Network.connect('data_from_fs_1', _on_data_fs_1)
#Network.connect('data_from_fs_2', _on_data_fs_2)
#Network.connect('data_from_fs_3', _on_data_fs_3)
Network.unit_fs_1.connect("connected", Callable(self, "_on_port_changed").bind(Network.unit_fs_1, Constants.STATE_VAL.GOOD))
Network.unit_fs_1.connect("disconnected", Callable(self, "_on_port_changed").bind(Network.unit_fs_1, Constants.STATE_VAL.NONE))
Network.unit_fs_1.connect("error_connect", Callable(self, "_on_port_changed").bind(Network.unit_fs_1, Constants.STATE_VAL.ERROR))
@@ -240,7 +238,6 @@ func _ready() -> void:
Network.unit_fs_2.connect("error_connect", Callable(self, "_on_port_changed").bind(Network.unit_fs_2, Constants.STATE_VAL.ERROR))
Network.unit_fs_2.connect("data_fs", Callable(self, "_on_data_fs").bind(Network.unit_fs_2))
self.add_child(timer_modul_um)
timer_modul_um.connect('timeout', Callable(self, '_on_timer_modul_um'))
self.connect('write_ems_g_start', _on_write_ems_g)
@@ -518,70 +515,6 @@ func _on_data_fs(fs_data: PackedByteArray, unit_fs_client: Node):
node_select.set_node_text(2, 7, str(fs_data.decode_u16(0x20)) + ' МГц')
#func _on_data_fs_2(fs_2_data):
#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:
#freq_fs_2 = fs_2_data.decode_u64(0xC) / 1_000_000.0
#node_select_fs_2.set_node_text(2, 2, str(freq_fs_2) + ' МГц')
#Constants.CMD.READ_ATT:
#if GRP == Constants.GROUP.RF:
#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:
#node_select_fs_2.set_node_text(2, 5, 'Включен')
#node_select_fs_2.get_node2(2, 5).modulate = Color.AQUAMARINE
#node_select_fs_2.get_node2(1, 5).get_child(1).set_pressed_no_signal(true)
#$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 2.5)
#else:
#node_select_fs_2.set_node_text(2, 5, 'Отключен')
#node_select_fs_2.get_node2(2, 5).modulate = Color.CRIMSON
#node_select_fs_2.get_node2(1, 5).get_child(1).set_pressed_no_signal(false)
#$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 0.0)
#Constants.CMD.BASE_GET_CURRENT_TEMP:
#if GRP == Constants.GROUP.BASE:
#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)) + ' МГц')
#
#
#func _on_data_fs_3(fs_3_data):
#var GRP = fs_3_data.decode_u8(0x0)
#var CMD = fs_3_data.decode_u8(0x1)
#match CMD:
#Constants.CMD.READ_CARRIER:
#if GRP == Constants.GROUP.BASE:
#freq_fs_3 = fs_3_data.decode_u64(0xC) / 1_000_000
#node_select_fs_3.set_node_text(2, 2, str(freq_fs_3) + ' МГц')
#Constants.CMD.READ_ATT:
#if GRP == Constants.GROUP.RF:
#att_fs_3 = fs_3_data.decode_float(0x18)
#node_select_fs_3.set_node_text(2, 3, str(att_fs_3) + ' dB')
#Constants.CMD.READ_GEN_STATUS:
#if GRP == Constants.GROUP.GENERATOR:
#if fs_3_data.decode_u32(0xC) == 0:
#node_select_fs_3.set_node_text(2, 5, 'Включен')
#node_select_fs_3.get_node2(2, 5).modulate = Color.AQUAMARINE
#node_select_fs_3.get_node2(1, 5).get_child(1).set_pressed_no_signal(true)
#$TabContainer/PRD/body_grid/litera_1/PSK3/ray_litera_1.material.set('shader_parameter/speed', 2.5)
#else:
#node_select_fs_3.set_node_text(2, 5, 'Отключен')
#node_select_fs_3.get_node2(2, 5).modulate = Color.CRIMSON
#node_select_fs_3.get_node2(1, 5).get_child(1).set_pressed_no_signal(false)
#$TabContainer/PRD/body_grid/litera_1/PSK3/ray_litera_1.material.set('shader_parameter/speed', 0.0)
#Constants.CMD.BASE_GET_CURRENT_TEMP:
#if GRP == Constants.GROUP.BASE:
#node_select_fs_3.set_node_text(2, 0, '%.2f' % fs_3_data.decode_float(0xC) + ' °C')
#Constants.CMD.BASE_CAN_MACRO_READ:
#if GRP == Constants.GROUP.BASE:
#node_select_fs_3.set_node_text(2, 7, str(fs_3_data.decode_u16(0x20)) + ' МГц')
func _process(_delta: float) -> void:
# FS 1
var node_freq_fs_1 = node_select_fs_1.get_node2(1, 2).get_text()
@@ -750,10 +683,6 @@ func on_mode_select(intem_from_sector: int) -> void:
add_signs_scene()
Network.on_command_change_device(meta)
Network.read_port_isa([Constants.BASE_PORTS.UG+8, Constants.BASE_PORTS.UG+6, Constants.BASE_PORTS.UG+0xA])
#Network.start_work_fs_1(pribor_selec)
#Network.start_work_fs_2(pribor_selec)
#if meta[2] == Constants.MODE.PRD_K:
#Network.start_work_fs_3(pribor_selec)
$load_status_yau.value = 0
emit_signal('read_ems_g_start')
$load_status_yau.visible = true
@@ -960,7 +889,12 @@ func _on_set_ferq(freq: String, unit_fs_client: Node):
func _on_set_att(att: String, unit_fs_client: Node):
unit_fs_client.set_att_batch(float(att))
if unit_fs_client == Network.unit_fs_1:
save_settings(float(att), 0)
elif unit_fs_client == Network.unit_fs_2:
save_settings(float(att), 1)
elif unit_fs_client == Network.unit_fs_3:
save_settings(float(att), 2)
unit_fs_client.get_att_batch()
@@ -973,96 +907,6 @@ func _on_status_can_macro(toggled_btn: bool, unit_fs_client: Node):
unit_fs_client.status_can_macro_exec(toggled_btn)
### 2 ФС
#func _on_get_status_2(toggled_btn):
#if $Background/switch_panel/select_prd.is_pressed() or $Background/switch_panel/texture_prd.is_pressed():
#var inverted_state = not toggled_btn
#Network.unit_fs_2.set_gen_state(inverted_state)
#Network.unit_fs_2.get_gen_state()
#func _on_set_ferq_2(freq: String):
## Проверка на наличие символов в строке freq
#var regex = RegEx.new()
#regex.compile("^[0-9]+$")
#if not regex.search(freq):
#print_debug('Ошибка: частота должна быть числом без букв')
#return
## Преобразование строки в число
#var freq_int = int(freq) * 1_000_000
#
## Проверка на диапазон
#if freq_int < 370 * 1_000_000 or freq_int > 6100 * 1_000_000:
#print_debug('Некорректная частота')
#return
#Network.set_fs_ferq_carrier_2(freq_int)
#
#
#func _on_set_att_2(att: String):
#Network.set_fs_attenuation_2(float(att))
#save_settings(float(att), 1)
#
#
#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)
#
#
#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()
### ФС 3
#func _on_get_status_3(toggled_btn):
#if $Background/switch_panel/select_prd.is_pressed() or $Background/switch_panel/texture_prd.is_pressed():
#var inverted_state = not toggled_btn
#Network.set_fs_gen_status_3(inverted_state)
#Network.get_gen_state_3()
#
#
#func _on_set_ferq_3(freq: String):
## Проверка на наличие символов в строке freq
#var regex = RegEx.new()
#regex.compile("^[0-9]+$")
#if not regex.search(freq):
#print_debug('Ошибка: частота должна быть числом без букв')
#return
## Преобразование строки в число
#var freq_int = int(freq) * 1_000_000
#
## Проверка на диапазон
#if freq_int < 370 * 1_000_000 or freq_int > 6100 * 1_000_000:
#print_debug('Некорректная частота')
#return
#Network.set_fs_ferq_carrier_3(freq_int)
#
#
#func _on_set_att_3(att: String):
#Network.set_fs_attenuation_3(float(att))
#save_settings(float(att), 2)
#
#
#func _on_set_base_can_macro_3(can_freq: String):
#Network.set_can_macro_3(int(can_freq))
#
#
#func _on_status_can_macro_3(toggled_btn: bool):
#Network.status_can_macro_3(toggled_btn)
#
#
#func _on_modul_fs_3(modulation_select_3) -> void:
#if modulation_select_3 == 0:
#Network.set_configure_gen_const_3()
#elif modulation_select_3 == 1:
#Network.set_configure_gen_msk_3()
## Switch panel
func _on_prd_select() -> void:
$load_status_yau.value = 0

View File

@@ -58,9 +58,9 @@ class Logger extends Node:
func _ready() -> void:
Network.connect('data_from_fs_1', _on_data_fs.bind('ФС-1'))
Network.connect('data_from_fs_2', _on_data_fs.bind('ФС-2'))
Network.connect('data_from_fs_3', _on_data_fs.bind('ФС-3'))
Network.unit_fs_1.connect("data_fs", Callable(self, "_on_data_fs").bind('ФС-1'))
Network.unit_fs_2.connect("data_fs", Callable(self, "_on_data_fs").bind('ФС-2'))
Network.unit_fs_3.connect("data_fs", Callable(self, "_on_data_fs").bind('ФС-3'))
self.add_child(timer)
self.add_child(timer_03)
@@ -286,58 +286,23 @@ func _draw_control_panel_prd(pribor):
$socket_ym_lb/blok_ym_litera_1.visible = true
func fs_1_setup(freq: int, att: float):
func fs_setup(unit_fs: Node, freq: int, att: float):
if not flag_continue_control:
return
command_fs_off(unit_fs)
await get_tree().create_timer(0.1).timeout
Network.set_fs_gen_status(true) ## отключен на true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_1()
Network.status_can_macro_1(false)
Network.set_fs_ferq_carrier(freq * 1_000_000)
Network.set_fs_attenuation(att) # Для литеры 2, 4, 6
Network.set_can_macro(freq)
Network.status_can_macro_1(true)
await get_tree().create_timer(0.1).timeout
Network.set_fs_gen_status(false) ## отключен на true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_1()
unit_fs.status_can_macro_exec(false)
unit_fs.set_carrier(freq * 1_000_000)
unit_fs.set_att_batch(att) # Для литеры 2, 4, 6
unit_fs.set_base_can_macro(freq)
unit_fs.status_can_macro_exec(true)
unit_fs.set_gen_state(false) ## отключен на true
unit_fs.get_gen_state()
func fs_2_setup(freq: int, att: float):
if not flag_continue_control:
return
await get_tree().create_timer(0.8).timeout
Network.set_fs_gen_status_2(true) ## отключен = true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_2()
Network.status_can_macro_2(false)
Network.set_fs_ferq_carrier_2(freq * 1_000_000)
Network.set_fs_attenuation_2(float(att)) # Для литеры 3, 5, 7
Network.set_can_macro_2(freq)
Network.status_can_macro_2(true)
await get_tree().create_timer(0.1).timeout
Network.set_fs_gen_status_2(false) ## отключен = true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_2()
func fs_3_setup(freq: int, att: float):
if not flag_continue_control:
return
await get_tree().create_timer(1.8).timeout
Network.set_fs_gen_status_3(true) ## отключен = true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_3()
Network.status_can_macro_3(false)
Network.set_fs_ferq_carrier_3(freq * 1_000_000)
Network.set_fs_attenuation_3(float(att)) # Для литеры 1
Network.set_can_macro_3(freq)
Network.status_can_macro_3(true)
await get_tree().create_timer(0.2).timeout
Network.set_fs_gen_status_3(false) ## отключен = true
await get_tree().create_timer(0.1).timeout
Network.get_gen_state_3()
func command_fs_off(unit_fs: Node) -> void:
unit_fs.set_gen_state(true)
unit_fs.get_gen_state()
func yau_07b_setup(angle_and_att: int):
@@ -345,16 +310,8 @@ func yau_07b_setup(angle_and_att: int):
return
Network.write_port_isa(Constants.BASE_PORTS.UG+0x6, angle_and_att)
Network.write_port_isa(Constants.BASE_PORTS.UG+0x8, angle_and_att)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_2)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000) ## Отключить модуляцию (литера 2)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_3)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000) ## Отключить модуляцию (литера 3)
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
Network.write_port_isa(Constants.BASE_PORTS.UG+0xA, 0)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_1)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x2000) ## Включить (Контроль) модуляцию (литера 1)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_28)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x2000)
func _on_data_fs(fs_data:PackedByteArray, fs_name: String):
@@ -429,7 +386,7 @@ func _on_yau_received(status_yau):
count_packet += 1
func _on_yau_feedback_receive(_status_yau):
func _on_yau_feedback_receive(status_yau):
if logger and flag_continue_control:
## Флаг для проверки настройки угла и аттенюации на двух литерах
if Network.unit.isa_ports.has(Constants.BASE_PORTS.UG+6) and Network.unit.isa_ports.has(Constants.BASE_PORTS.UG+8):
@@ -445,19 +402,17 @@ func _on_yau_feedback_receive(_status_yau):
flag_ug = false
$soc_y5/ug.state = Constants.STATE_VAL.NONE
## Флаг для проверки модуяции на высоком
if Network.unit.isa_ports.has(Constants.BASE_PORTS.EMS_G+8) and Network.unit.isa_ports.has(Constants.BASE_PORTS.EMS_G+2):
if Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+2] == Constants.META.MODUL_UM_2:
if Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+8] == 0x8000 and (not flag_modul_on_1):
if (status_yau.decode_u16(13) >> 1) & 1 and (not flag_modul_on_1):
flag_modul_on_1 = true
logger.info('✅ Модуляция УМ (2, 4, 6) включена!')
elif Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+8] == 0x4000 and (flag_modul_on_1):
elif (status_yau.decode_u16(13) >> 1) & 1 == 0 and (flag_modul_on_1):
flag_modul_on_1 = false
logger.info('🛈 Модуляция УМ (2, 4, 6) отключена!')
if Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+2] == Constants.META.MODUL_UM_3:
if Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+8] == 0x8000 and (not flag_modul_on_2):
if (status_yau.decode_u16(13) >> 2) & 1 and (not flag_modul_on_2):
flag_modul_on_2 = true
logger.info('✅ Модуляция УМ (3, 5, 7) включена!')
elif Network.unit.isa_ports[Constants.BASE_PORTS.EMS_G+8] == 0x4000 and (flag_modul_on_2):
elif (status_yau.decode_u16(13) >> 2) & 1 == 0 and (flag_modul_on_2):
flag_modul_on_2 = false
logger.info('🛈 Модуляция УМ (3, 5, 7) отключена!')
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
@@ -537,35 +492,58 @@ func _on_start_super_control():
flag_fs_1_ready = false
flag_fs_2_ready = false
flag_fs_3_ready = false
if Network.unit_fs.online:
var fs_freq: Array
if Network.unit_fs_1.online:
var fs_att_1: float
var fs_att_2: float
var fs_att_3: float
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
fs_freq.append(Constants.FS_FREQ.f2)
fs_att_1 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][0]
fs_freq.append(Constants.FS_FREQ.f3)
fs_att_2 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
fs_freq.append(Constants.FS_FREQ.f4)
fs_att_1 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][0]
fs_freq.append(Constants.FS_FREQ.f5)
fs_att_2 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
fs_freq.append(Constants.FS_FREQ.f6)
fs_att_1 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][0]
fs_freq.append(Constants.FS_FREQ.f1)
logger.info('🛈 Настройка модуля ФС %s Гц, [%s] АТТ' % [str(fs_freq[0]), str(fs_att_1)])
fs_setup(Network.unit_fs_1, fs_freq[0], fs_att_1) # Гц
else:
logger.info('❌ Модуль ФС-1: нет связи')
_on_contol_err()
return
if Network.unit_fs_2.online:
var fs_att_2: float
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
fs_freq.append(Constants.FS_FREQ.f3)
fs_att_2 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
fs_freq.append(Constants.FS_FREQ.f5)
fs_att_2 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
fs_freq.append(Constants.FS_FREQ.f7)
fs_att_2 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][1]
fs_freq.append(Constants.FS_FREQ.f1)
fs_att_3 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][2]
fs_3_setup(fs_freq[2], fs_att_3)
logger.info('🛈 Настройка модулей ФС %s Гц, [%s / %s / %s] АТТ' % [str(fs_freq), str(fs_att_1), str(fs_att_2), str(fs_att_3)])
fs_1_setup(fs_freq[0], fs_att_1) # Гц
fs_2_setup(fs_freq[1], fs_att_2) # Гц
logger.info('🛈 Настройка модуля ФС %s Гц, [%s] АТТ' % [str(fs_freq[1]), str(fs_att_2)])
await get_tree().create_timer(1.0).timeout
fs_setup(Network.unit_fs_2, fs_freq[1], fs_att_2) # Гц
else:
logger.info('Настройка модулей ФС')
logger.info('Модуль ФС-2: нет связи')
_on_contol_err()
return
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
if Network.unit_fs_3.online:
var fs_att_3: float
fs_att_3 = Constants.FS_ATT[Constants.ADDRESSES[self.get_parent().get_child(0).get_child(1).get_node2(1, 0).get_selected_id()][0]][2]
logger.info('🛈 Настройка модуля ФС %s Гц, [%s] АТТ' % [str(fs_freq[2]), str(fs_att_3)])
await get_tree().create_timer(1.0).timeout
fs_setup(Network.unit_fs_3, fs_freq[2], fs_att_3)
else:
logger.info('❌ Модуль ФС-3: нет связи')
_on_contol_err()
return
timer.set_one_shot(true)
timer.set_wait_time(10)
@@ -640,6 +618,7 @@ func set_bits(v, a, m):
func _on_fs_status(META:int):
await get_tree().create_timer(1.0).timeout
var control_button: Node = self.get_parent().get_parent().get_child(0).get_child(1).get_child(1)
var texture_control_button: Node = self.get_parent().get_parent().get_child(0).get_child(1).get_child(8)
if control_button.button_pressed or texture_control_button.button_pressed:
@@ -652,7 +631,6 @@ func _on_fs_status(META:int):
elif META == Constants.META.CI_1_OT_FS:
logger.info('✅ СИ от ФС-3: Включен')
if not flag_fs_1_ready:
return
@@ -686,18 +664,9 @@ func _on_fs_status(META:int):
if (dkm >> 1) & 0x1 == 1 and (dkm >> 2) & 0x1 == 1: # Следующий шаг ->
flag_dkm = true
timer.stop()
else:
#flag_dkm = true
#timer.stop()
Network.set_fs_gen_status(true) ## отключен = true
Network.get_gen_state_1()
Network.set_fs_gen_status_2(true) ## отключен = true
Network.get_gen_state_2()
_on_contol_err()
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
if 1 == 1:#if (dkm >> 3) & 0x1 == 1:
if (dkm >> 3) & 0x1 == 1:
logger.info('%s: %s' % [$Kasseta_FS/ref_A3.fname, 'Включено'])
$soc_DKM/DKM_2.state = Constants.STATE_VAL.GOOD
$Kasseta_FS/ref_A3.state = $soc_DKM/DKM_2.state
@@ -705,7 +674,7 @@ func _on_fs_status(META:int):
logger.info('%s: %s' % [$Kasseta_FS/ref_A3.fname, 'Нет связи'])
$soc_DKM/DKM_2.state = Constants.STATE_VAL.ERROR
$Kasseta_FS/ref_A3.state = $soc_DKM/DKM_2.state
if 1 == 1:#(dkm >> 4) & 0x1 == 1:
if (dkm >> 4) & 0x1 == 1:
logger.info('%s: %s' % [$Kasseta_FS/ref_A4.fname, 'Включено'])
$soc_DKM/DKM_3.state = Constants.STATE_VAL.GOOD
$Kasseta_FS/ref_A4.state = $soc_DKM/DKM_3.state
@@ -716,15 +685,6 @@ func _on_fs_status(META:int):
if (dkm >> 3) & 0x1 == 1 and (dkm >> 4) & 0x1 == 1: # Следующий шаг ->
flag_dkm = true
timer.stop()
else:
#flag_dkm = true
#timer.stop()
Network.set_fs_gen_status(true) ## отключен = true
Network.get_gen_state_1()
Network.set_fs_gen_status_2(true) ## отключен = true
Network.get_gen_state_2()
_on_contol_err()
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
if (dkm >> 0) & 0x1 == 1:
@@ -754,30 +714,13 @@ func _on_fs_status(META:int):
if (dkm >> 5) & 0x1 and (dkm >> 6) & 0x1 and (dkm >> 0) & 0x1: # Следующий шаг ->
flag_dkm = true
timer.stop()
else:
Network.set_fs_gen_status(true) ## отключен = true
Network.get_gen_state_1()
Network.set_fs_gen_status_2(true) ## отключен = true
Network.get_gen_state_2()
Network.set_fs_gen_status_3(true) ## отключен = true
Network.get_gen_state_3()
_on_contol_err()
logger.info('🛈 ДКМ: %s ' % dkm)
func _on_modul_um():
if not flag_continue_control:
return
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_2)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x8000)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_3)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x8000)
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_1)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x8000)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_28)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x2000)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G, 6666)
flag_dkm = false
flag_start = true
@@ -793,22 +736,10 @@ func _on_start_timer_03():
func _on_timer_03():
flag_control_add = false
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_2)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_3)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000)
Network.set_fs_gen_status(true) ## отключен = true
Network.get_gen_state_1()
Network.set_fs_gen_status_2(true) ## отключен = true
Network.get_gen_state_2()
command_fs_off(Network.unit_fs_1)
command_fs_off(Network.unit_fs_2)
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_1)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, Constants.META.MODUL_UM_28)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, 0x4000)
Network.set_fs_gen_status_3(true) ## отключен = true
Network.get_gen_state_3()
command_fs_off(Network.unit_fs_3)
await get_tree().create_timer(1.0).timeout
logger.info('🛈 Количество принятых пакетов от ЯУ-07Б: %s пкт.' % count_packet)
logger.info('🛈 Максимальные значения мощностей от УКП-1: %s ' % str(array_pow_1))
@@ -867,7 +798,7 @@ func _status_prd():
status += 1 if (node_cell_ind[18].state == Constants.STATE_VAL.GOOD) else 0
var pribor_ispraven: bool = false
var min_dopusk: int = 10
var min_dopusk: int = 40
var status_need = count_cell-7 if Constants.CURRENT_MODE != Constants.MODE.PRD_K else count_cell+1
if (status == status_need):
pribor_ispraven = true

View File

@@ -163,5 +163,18 @@ func on_command_change_device(meta_device):
if unit_fs_2._stream:
unit_fs_2.disconnect_fs()
unit_fs_2.connect_to_host(meta_device[4], Constants.PORT_FS)
#ip_fs_2 = meta_device[4]
await get_tree().create_timer(0.5).timeout
if unit_fs_1.online:
unit_fs_1.get_carrier()
unit_fs_1.get_att_batch()
unit_fs_1.get_gen_state()
unit_fs_1.get_base_current_temp()
unit_fs_1.get_base_can_macro()
if unit_fs_2.online:
unit_fs_2.get_carrier()
unit_fs_2.get_att_batch()
unit_fs_2.get_gen_state()
unit_fs_2.get_base_current_temp()
unit_fs_2.get_base_can_macro()
#ip_fs_3 = meta_device[5]