Настройки редактора

This commit is contained in:
Maxim
2025-04-15 23:39:01 +03:00
parent f7e083d175
commit 6e777338de
10 changed files with 99 additions and 99 deletions

View File

@@ -4,7 +4,7 @@ const ONLINE_TIMEOUT = 5.0 ## Время ожидания пакета от я
const RETRY_COUNT = 5 ## Количество повторных отправок
## Блок управления ФС
## Блок управления ФС
class FGOS:
## Коды выполняемых команд
enum CmdCode {
@@ -21,13 +21,13 @@ class FGOS:
BASE_CAN_MACRO_READ = 0x33, ## Команда для чтения последовательности CAN-команд
BASE_GET_CURRENT_TEMP = 0x36, ## Команда получения температуры
}
enum GROUP {
BASE = 0x00,
GENERATOR = 0x03,
RF = 0x06,
}
## Состояние автомата выполнения команды
enum CmdState {
UNCK, ## Номер команды не ининциирован
@@ -36,7 +36,7 @@ class FGOS:
DONE, ## Команда выполнена
FAIL ## Команда не выполнена
}
const CRC32_TABLE: Array = [
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
@@ -70,7 +70,7 @@ class FGOS:
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D]
const INDEX_SIZE: int = 0xC
const GROUP_OFFSET: int = 0x0
const CMD_OFFSET: int = 0x1
@@ -78,14 +78,14 @@ class FGOS:
const PAYLOAD_OFFSET: int = 0x8
const INIT: int = 0xFFFFFFFF
const FINAL_XOR_VALUE: int = 0x00000000
signal line_changed(unit: FGOS) ## Вызывается когда меняется состояние связи с ячейкой
var online: bool = false ## Состояние связи с ячейкой
var status: = PackedByteArray() ## Поле "состояние прибора"
#var fgos_data = {} ## Результат выполнения команды "читать порт"
func crc32(data: PackedByteArray) -> int:
var crc = INIT
for byte in data:
@@ -94,8 +94,8 @@ class FGOS:
# Возвращаем только последние 4 байта в обратном порядке
var final_crc = crc ^ FINAL_XOR_VALUE
return final_crc
func _form_packet(group: int, cmd: int, index_size: int, counter: int, data = null):
var packet = PackedByteArray()
packet.resize(index_size)
@@ -119,14 +119,14 @@ class FGOS:
elif client == Network.client_fs_3:
Network.command_stack_3.append(packet)
online = true
func send_fs_data(data_to_sand: PackedByteArray, client_fs: StreamPeer, peerstream_fs: PacketPeer):
if client_fs.get_status() == 2:
var peer = peerstream_fs.get_stream_peer()
if peer:
peer.put_data(data_to_sand)
func start_session(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.START_SESSION, INDEX_SIZE, counter)
@@ -139,8 +139,8 @@ class FGOS:
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)
@@ -157,7 +157,7 @@ class FGOS:
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)
@@ -165,15 +165,15 @@ class FGOS:
packet.encode_u32(0xC, button_state) ## MODE GEN STATUS
send_packet_to(packet, client)
func status_can_macro_exec(button_state: bool, counter: int, client: StreamPeer):
var index_size = 0x1C
var packet = _form_packet(GROUP.BASE, CmdCode.STATUS_CAN_MACRO, index_size, counter)
packet.encode_u16(0x8, 0x0010)
packet.encode_u32(0xC, button_state) ## mode can status
send_packet_to(packet, client)
func set_carrier(installation_frequency: int, counter: int, client: StreamPeer):
var index_size = 0x1C
var packet = _form_packet(GROUP.BASE, CmdCode.SET_CARRIER, index_size, counter)
@@ -189,7 +189,7 @@ class FGOS:
packet.encode_float(0x18, attenuation)
send_packet_to(packet, client)
func set_base_can_macro(installation_can_frequency: int, counter: int, client: StreamPeer):
var index_size = 0x34
var packet = _form_packet(GROUP.BASE, CmdCode.BASE_CAN_MACRO_WRITE, index_size, counter)
@@ -201,8 +201,8 @@ class FGOS:
packet.encode_u16(0x28, 0x2aff)
packet.encode_u8(0x2B, 0x04)
send_packet_to(packet, client)
func get_carrier(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.READ_CARRIER, INDEX_SIZE, counter)
send_packet_to(packet, client)
@@ -211,7 +211,7 @@ class FGOS:
func get_att_batch(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.RF, CmdCode.READ_ATT, INDEX_SIZE, counter)
send_packet_to(packet, client)
func get_gen_state(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.GENERATOR, CmdCode.READ_GEN_STATUS, INDEX_SIZE, counter)
@@ -221,13 +221,13 @@ class FGOS:
func get_base_current_temp(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.BASE_GET_CURRENT_TEMP, INDEX_SIZE, counter)
send_packet_to(packet, client)
func get_base_can_macro(counter: int, client: StreamPeer):
var packet = _form_packet(GROUP.BASE, CmdCode.BASE_CAN_MACRO_READ, INDEX_SIZE, counter)
send_packet_to(packet, client)
# Разорвать соединение с ФС
func disconnect_fs(client_for_leave: StreamPeer):
client_for_leave.disconnect_from_host()

View File

@@ -31,7 +31,7 @@ var modul_um: Array = [0, 0, 0, 0]
func _ready() -> void:
$Background/notice/lbl_commit.text = commit.VCS_HEAD
$Background/notice/bind_addr.text = '/Базовый адрес: %s' % Constants.UNICAST_ADDRESS
# Таблица 1 УКП-1 (Температура, Мощность)
node_select1 = $TabContainer/PRD/body_grid/litera_2_4_6/table_ukp_1
draw_tabl(node_select1, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size())
@@ -41,7 +41,7 @@ func _ready() -> void:
node_select2 = $TabContainer/PRD/body_grid/litera_3_5_7/table_ukp_2
draw_tabl(node_select2, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size())
node_select2.set_columns_min_size([120, 120])
# Таблица 3 УКП-1 (Температура, Мощность)
node_select3 = $TabContainer/PRD/body_grid/litera_1/table_ukp_1
draw_tabl(node_select3, [[preload("res://table/header.tscn"), preload("res://table/header.tscn")], [preload("res://table/node.tscn"), preload("res://table/node.tscn")]], [[preload("res://table/header.tscn"), preload("res://table/header.tscn")], [preload("res://table/node.tscn"), preload("res://table/node.tscn")]].size())
@@ -53,19 +53,19 @@ func _ready() -> void:
node_select_yau_07b.set_columns_min_size([160, 120])
node_select_yau_07b.get_node2(1, 1).get_child(1).tooltip_text = 'Переключение запрета си в уф'
node_select_yau_07b.get_node2(1, 5).get_child(1).tooltip_text = 'Переключение сигнала ФГОЗ'
# Таблица ЯУ-07б-2
node_select_yau_07b_2 = $TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control
draw_tabl(node_select_yau_07b_2, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b_2.set_columns_min_size([160, 120])
node_select_yau_07b_2.get_node2(1, 1).get_child(1).tooltip_text = 'Переключение запрета си в уф'
node_select_yau_07b_2.get_node2(1, 5).get_child(1).tooltip_text = 'Переключение сигнала ФГОЗ'
# Таблица ЯУ-07б-3
var node_select_yau_07b_3: Node = $TabContainer/PRD/body_grid/litera_1/yau07b_control
draw_tabl(node_select_yau_07b_3, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b_3.set_columns_min_size([160, 120])
#Таблица ФС-1
node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
draw_tabl(node_select_fs_1, Constants.ROWS_FS, Constants.ROWS_FS.size())
@@ -84,7 +84,7 @@ func _ready() -> void:
node_select_fs_3 = $TabContainer/PRD/body_grid/litera_1/fs_control
draw_tabl(node_select_fs_3, Constants.ROWS_FS, Constants.ROWS_FS.size())
node_select_fs_3.set_columns_min_size([150, 120, 150])
# Таблица ЯУ-07б-3
var item_place_yau_07_3: int = 38
node_select_yau_07b_3.set_node_text(0, 0, Constants.SIGNS[Constants.MODE.PRD_K][item_place_yau_07_3+0]) # 'ПРД-Н'
@@ -97,7 +97,7 @@ func _ready() -> void:
node_select_yau_07b_3.set_node_text(0, 5, Constants.SIGNS[Constants.MODE.PRD_K][item_place_yau_07_3+6]) # 'ФГОЗ'
node_select_yau_07b_3.set_node_text(0, 6, Constants.SIGNS[Constants.MODE.PRD_K][item_place_yau_07_3+7]) # 'СИ 1 в УФ'
node_select_yau_07b_3.set_node_text(0, 7, Constants.SIGNS[Constants.MODE.PRD_K][item_place_yau_07_3+8]) # 'СЗИ 1 от УФ'
#Таблица ФС-3
var item_place_fs_3: int = 47
node_select_fs_3.set_node_text(0, 0, Constants.SIGNS[Constants.MODE.PRD_K][item_place_fs_3+0]) # 'Модуль ФС 1'
@@ -118,7 +118,7 @@ func _ready() -> void:
node_select_fs_3.get_node2(1, 7).placeholder_text = 'в МГц'
node_select_fs_3.get_node2(1, 7).editable = true
node_select_fs_3.set_node_text(0, 8, Constants.SIGNS[Constants.MODE.PRD_K][item_place_fs_3+9]) # 'Статус CAN')
# Выбор прибора для подключения
var node_select_device: Node = $TabContainer/PRD/select_dev
draw_tabl(node_select_device, Constants.SELECT_DEVICE, Constants.SELECT_DEVICE.size())
@@ -130,7 +130,7 @@ func _ready() -> void:
node_select_device.set_columns_min_size([100, 100])
# Получение выбранного прибора при загрузке
status_pribor = Constants.CURRENT_MODE
status_pribor = Constants.CURRENT_MODE
add_signs_scene()
@@ -139,26 +139,26 @@ func _ready() -> void:
node_select_yau_07b.get_node2(1, 2).add_item(key)
node_select_yau_07b_2.get_node2(1, 2).add_item(key)
node_select_yau_07b_3.get_node2(1, 2).add_item(key)
node_select_yau_07b.get_node2(1, 2).set_meta('meta_um', Constants.META.MODUL_UM_2)
node_select_yau_07b_2.get_node2(1, 2).set_meta('meta_um', Constants.META.MODUL_UM_3)
node_select_yau_07b_3.get_node2(1, 2).set_meta('meta_um', Constants.META.MODUL_UM_1)
node_select_yau_07b_3.get_node2(1, 2).set_meta('meta_um', Constants.META.MODUL_UM_1)
## Заполненение списка направления луча
for key in Constants.RAY_DICT:
node_select_yau_07b.get_node2(1, 3).add_item(key)
node_select_yau_07b_2.get_node2(1, 3).add_item(key)
node_select_yau_07b_3.get_node2(1, 3).add_item(' 15°')
## Заполненение списка аттенюатора
for key in Constants.ATT_DICT:
node_select_yau_07b.get_node2(1, 4).add_item(key)
## Заполненение списка аттенюатора
for key in Constants.ATT_DICT_correct:
node_select_yau_07b_3.get_node2(1, 4).add_item(key)
## EMS статус сокета
$TabContainer/EMS_G.CI_1_UF = $TabContainer/PRD/body_grid/litera_1/yau07b_control.get_node2(1, 6).get_child(1)
$TabContainer/EMS_G.CI_2_UF = $TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control.get_node2(1, 6).get_child(1)
@@ -177,9 +177,9 @@ func _ready() -> void:
$TabContainer/EMS_G.CI_1_FS = $TabContainer/PRD/body_grid/litera_1/fs_control.get_node2(1, 6).get_child(1)
$TabContainer/EMS_G.CI_6_FS = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1, 6).get_child(1)
$TabContainer/EMS_G.CI_7_FS = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 6).get_child(1)
get_select_device.connect('item_selected', Callable(self, 'on_mode_select'))
## Yau-07b 1
node_select_yau_07b.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret_2'))
node_select_yau_07b.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um').bind(node_select_yau_07b.get_node2(1, 2)))
@@ -196,7 +196,7 @@ func _ready() -> void:
node_select_yau_07b_3.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret_1'))
node_select_yau_07b_3.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um').bind(node_select_yau_07b_3.get_node2(1, 2)))
node_select_yau_07b_3.get_node2(1, 4).connect('item_selected', Callable(self, '_on_attenuator_3'))
## FS 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'))
@@ -227,7 +227,7 @@ 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)
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)
@@ -242,7 +242,7 @@ func add_signs_scene():
# Таблица УКП-2
node_select2.set_node_text(0, 0, 'Мощность')
node_select2.set_node_text(1, 0, 'Температура')
# Таблица УКП-1
node_select3.set_node_text(0, 0, 'Мощность')
node_select3.set_node_text(1, 0, 'Температура')
@@ -310,7 +310,7 @@ func add_signs_scene():
node_select_fs_2.get_node2(1, 7).placeholder_text = 'в МГц'
node_select_fs_2.get_node2(1, 7).editable = true
node_select_fs_2.set_node_text(0, 8, Constants.SIGNS[Constants.CURRENT_MODE][item_place_fs_2+9]) # 'Статус CAN')
$TabContainer/PRD/body_grid/litera_1.visible = Constants.CURRENT_MODE ==Constants.MODE.PRD_K
node_select_yau_07b_2.get_node2(1, 4).clear()
if Constants.CURRENT_MODE ==Constants.MODE.PRD_K:
@@ -351,7 +351,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
break
if not found:
Constants.EMS_G_PORT_DATA_HOLDER.append([tmp, isa_data])
$load_status_yau.value += 1
if len(Constants.EMS_G_PORT_DATA_HOLDER) == 32:
emit_signal('read_ems_g_finish')
@@ -375,7 +375,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
if (isa_data[Constants.BASE_PORTS.UG+0xA] & 0x7) < 8:
$TabContainer/PRD/body_grid/litera_1/PSK3/ray_litera_1.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * ((isa_data[Constants.BASE_PORTS.UG+0xA] & 0x7) * (isa_data[Constants.BASE_PORTS.UG+0xA] & 0x7)) )
$TabContainer/PRD/body_grid/litera_1/yau07b_control.get_node2(1, 4).select(isa_data[Constants.BASE_PORTS.UG+0xA])
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 == Constants.META.CI_1_B_UF:
@@ -588,7 +588,7 @@ func _on_data_received(data_from_yau_07):
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 + 3
node_select2.set_node_text(1, row+1, '%d °С' % TMP)
if len(data_from_yau_07) > Constants.DataIndices.TEMPERATURE_UKP_1 + 2 * 7:
var power_ukp_3 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_1 + 2 * 7)
var temperature_ukp_3 = data_from_yau_07.decode_u16(Constants.DataIndices.TEMPERATURE_UKP_1 + 2 * 7)
@@ -640,7 +640,7 @@ func _on_load_config():
file_dialog.set_title("Выберите файл")
file_dialog.set_size(Vector2(600, 400))
file_dialog.mode = FileDialog.FILE_MODE_OPEN_FILE
file_dialog.current_dir = 'user://saves'
file_dialog.connect("file_selected", Callable(self, "_load_selected_file"))
add_child(file_dialog)
@@ -654,7 +654,7 @@ func _load_selected_file(file_path: String):
return
var file_content: String = file.get_as_text()
file.close()
var json: JSON = JSON.new()
var error = json.parse(file_content)
if error == OK:
@@ -735,11 +735,11 @@ func _on_modul_um(item_from_ray_1: int, node: Node):
}
var meta_key = node.get_meta('meta_um')
var index = meta_mapping.get(meta_key, -1)
if index != -1:
current_meta[index] = meta_key
modul_um[index] = modul_um_values.get(item_from_ray_1, 0)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G + 2, current_meta[index])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G + 8, modul_um[index])
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
@@ -761,7 +761,7 @@ func _on_timer_modul_um():
elif modul_um[i] == 0x2000:
Network.write_port_isa(Constants.BASE_PORTS.EMS_G + 2, current_meta[i])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G + 8, modul_um[i])
if current_meta[i] == Constants.META.MODUL_UM_1:
modul_um[3] = modul_um[i]
Network.write_port_isa(Constants.BASE_PORTS.EMS_G + 2, Constants.META.MODUL_UM_28)
@@ -769,7 +769,7 @@ func _on_timer_modul_um():
else:
timer_modul_um.stop()
## Включение/отключение сигнала ФГОЗ
func _on_fgos_1(toggled_on: bool):
var meta = Constants.META.FGOZ_4
@@ -1032,7 +1032,7 @@ func _on_burger_button(toggled_on: bool) -> void:
temp = select_grp
else:
tween.tween_property($Background/switch_panel/burgerButton/block, "global_position", Vector2(10, $Background/switch_panel/burgerButton/block.global_position.y), 0.1).set_trans(Tween.TRANS_LINEAR).set_ease(Tween.EASE_OUT)
for btn in temp:
tween.tween_property(btn, "global_position", Vector2(pos_off, btn.global_position.y), 0.1).set_trans(Tween.TRANS_QUINT).set_ease(Tween.EASE_OUT)
@@ -1042,13 +1042,13 @@ func _on_burger_button(toggled_on: bool) -> void:
else:
# Анимация влево
tween.tween_property(panel, "global_position", Vector2(0, panel.global_position.y), 0.3).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
temp = txt_grp if toggled_on else select_grp
tmp_pos = pos_on_txt if toggled_on else pos_on_select
for btn in temp:
tween.tween_property(btn, "global_position", Vector2(tmp_pos, btn.global_position.y), 0.1).set_trans(Tween.TRANS_QUINT).set_ease(Tween.EASE_OUT)
tween.tween_property($Background/switch_panel/burgerButton/block, "global_position", Vector2(-90, $Background/switch_panel/burgerButton/block.global_position.y), 0.1).set_trans(Tween.TRANS_LINEAR).set_ease(Tween.EASE_OUT)
@@ -1083,5 +1083,5 @@ func save_settings(to_att_change: float, mode: int):
if file:
file.store_var(Constants.FS_ATT)
file.close()
Constants.read_file()

View File

@@ -149,7 +149,7 @@ const SIGNS: Dictionary = {
'',
'СИ 2 в УФ',
'СЗИ 2 от УФ',
# ЯУ-07б-2
'ПРД-Н',
'Литера 3',
@@ -160,7 +160,7 @@ const SIGNS: Dictionary = {
'ФГОЗ 3',
'СИ 3 в УФ',
'СЗИ 3 от УФ',
# ФС-1
'Модуль ФС',
'Литера 2',
@@ -172,7 +172,7 @@ const SIGNS: Dictionary = {
'СИ 2 от ФС',
'Фильтр CAN',
'Статус CAN',
# ФС-2
'Модуль ФС',
'Литера 3',
@@ -196,7 +196,7 @@ const SIGNS: Dictionary = {
'ФГОЗ 4',
'СИ 4 в УФ',
'СЗИ 4 от УФ',
# ЯУ-07б-2
'ПРД-В',
'Литера 5',
@@ -207,7 +207,7 @@ const SIGNS: Dictionary = {
'ФГОЗ 5',
'СИ 5 в УФ',
'СЗИ 5 от УФ',
# ФС-1
'Модуль ФС',
'Литера 4',
@@ -219,7 +219,7 @@ const SIGNS: Dictionary = {
'СИ 4 от ФС',
'Фильтр CAN',
'Статус CAN',
# ФС-2
'Модуль ФС',
'Литера 5',
@@ -243,7 +243,7 @@ const SIGNS: Dictionary = {
'ФРЛС 6',
'СИ 6 в УФ',
'СЗИ 6 от УФ',
# ЯУ-07б-2
'ПРД-К',
'Литера 7',
@@ -254,7 +254,7 @@ const SIGNS: Dictionary = {
'',
'СИ 7 в УФ',
'СЗИ 7 от УФ',
# ФС-1
'Модуль ФС',
'Литера 6',
@@ -266,7 +266,7 @@ const SIGNS: Dictionary = {
'СИ 6 от ФС',
'Фильтр CAN',
'Статус CAN',
# ФС-2
'Модуль ФС',
'Литера 7',
@@ -278,7 +278,7 @@ const SIGNS: Dictionary = {
'СИ 7 от ФС',
'Фильтр CAN',
'Статус CAN',
# ЯУ-07б-2
'ПРД-К',
'Литера 1',
@@ -289,7 +289,7 @@ const SIGNS: Dictionary = {
'',
'СИ 1 в УФ',
'СЗИ 1 от УФ',
# ФС-3
'Модуль ФС',
'Литера 1',
@@ -432,17 +432,17 @@ func _ready() -> void:
UNICAST_PORT = 50000 + int(args[i + 1])
UNICAST_ADDRESS = '10.1.1.%s' % args[i + 1]
read_file()
func read_file():
var file_path = "user://saves/fs_setting"
var dir_path = "user://saves"
# Проверяем и создаем папку, если она не существует
var dir = DirAccess.open(dir_path)
if not dir:
create_dir(dir_path)
var file = FileAccess.open(file_path, FileAccess.READ)
if file:
# Файл существует, читаем его содержимое

View File

@@ -103,7 +103,7 @@ func _ready() -> void:
var parrent_NODE2 = get_parent().get_parent()
parrent_NODE2.connect('read_ems_g_start', Callable(self, '_on_read_ems_g'))
parrent_NODE2.connect('read_ems_g_finish', Callable(self, '_on_sync'))
Network.connect('yau_receive', Callable(self, '_on_data_received'))
create_link_button(node_select1, shift+1, 16+shift+1, shift, 16+shift)
@@ -176,7 +176,7 @@ func process_sockets_vert(blank: int, imp: int, count: int, col: int):
set_frame(CZI_6_FS, frame_type)
if i == 6: # СЗИ_7_от_УФ
set_frame(CZI_7_FS, frame_type)
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
if i == 9: # СИ_2_от_ФС
set_frame(CI_2_FS, frame_type)

View File

@@ -67,7 +67,7 @@ func poll_receive_fs(client: StreamPeerTCP, peerstream: PacketPeer, ip_fs: Strin
emit_signal("data_from_fs_1", rx_data)
emit_signal("port_fs_opened_1", ip_fs)
if state_fs == Constants.STATE.SEND:
state_fs = Constants.STATE.DONE
state_fs = Constants.STATE.DONE
func _enter_tree() -> void:

View File

@@ -88,12 +88,12 @@ func poll_receive_fs(client: StreamPeerTCP, peerstream: PacketPeer, ip_fs: Strin
if not peer:
emit_signal("port_error", ip_fs)
return
# Проверяем состояние подключения
if client.get_status() != StreamPeerTCP.STATUS_CONNECTED:
emit_signal("port_fs_closed", ip_fs)
return
while peer.get_available_bytes() > 0:
var rx_data: PackedByteArray
rx_data.append_array(peer.get_data(peer.get_available_bytes())[1])
@@ -278,7 +278,7 @@ func start_work_fs_1(currecnt_mode_att):
counter_fs_1 += 1
unit_fs.get_gen_state(counter_fs_1, client_fs_1)
counter_fs_1 += 1
var set_freq = Constants.FS_FREQ.f2 if Constants.CURRENT_MODE == Constants.MODE.PRD_H else Constants.FS_FREQ.f4 if Constants.CURRENT_MODE == Constants.MODE.PRD_B else Constants.FS_FREQ.f6
unit_fs.set_carrier(set_freq * 1_000_000, counter_fs_1, client_fs_1)
counter_fs_1 += 1
@@ -287,8 +287,8 @@ func start_work_fs_1(currecnt_mode_att):
counter_fs_1 += 1
unit_fs.set_base_can_macro(set_freq, counter_fs_1, client_fs_1)
counter_fs_1 += 1
unit_fs.get_att_batch(counter_fs_1, client_fs_1)
counter_fs_1 += 1
unit_fs.get_carrier(counter_fs_1, client_fs_1)
@@ -341,7 +341,7 @@ func set_can_macro(can_frequency: int):
func status_can_macro_1(state_can: bool):
unit_fs.status_can_macro_exec(state_can, counter_fs_1, client_fs_1)
counter_fs_1 += 1
func set_configure_gen_msk_1():
unit_fs.set_configure_state_msk_modul_1(counter_fs_1, client_fs_1)
@@ -383,16 +383,16 @@ func start_work_fs_2(currecnt_mode_att):
counter_fs_2 += 1
unit_fs.get_gen_state(counter_fs_2, client_fs_2)
counter_fs_2 += 1
var set_freq = Constants.FS_FREQ.f3 if Constants.CURRENT_MODE == Constants.MODE.PRD_H else Constants.FS_FREQ.f5 if Constants.CURRENT_MODE == Constants.MODE.PRD_B else Constants.FS_FREQ.f7
unit_fs.set_carrier(set_freq * 1_000_000, counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.set_att_batch(Constants.FS_ATT[currecnt_mode_att][1], counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.set_base_can_macro(set_freq, counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.get_att_batch(counter_fs_2, client_fs_2)
counter_fs_2 += 1
unit_fs.get_carrier(counter_fs_2, client_fs_2)
@@ -489,17 +489,17 @@ func start_work_fs_3(currecnt_mode_att):
counter_fs_3 += 1
unit_fs.get_gen_state(counter_fs_3, client_fs_3)
counter_fs_3 += 1
var set_freq = Constants.FS_FREQ.f1
unit_fs.set_carrier(set_freq * 1_000_000, counter_fs_3, client_fs_3)
counter_fs_3 += 1
unit_fs.set_att_batch(Constants.FS_ATT[currecnt_mode_att][2], counter_fs_3, client_fs_3)
counter_fs_3 += 1
unit_fs.set_base_can_macro(set_freq, counter_fs_3, client_fs_3)
counter_fs_3 += 1
unit_fs.get_att_batch(counter_fs_3, client_fs_3)
counter_fs_3 += 1
unit_fs.get_carrier(counter_fs_3, client_fs_3)
@@ -508,7 +508,7 @@ func start_work_fs_3(currecnt_mode_att):
counter_fs_3 += 1
unit_fs.get_base_can_macro(counter_fs_3, client_fs_3)
counter_fs_3 += 1
func set_fs_gen_status_3(state_gen: bool):
unit_fs.set_gen_state(state_gen, counter_fs_3, client_fs_3)

View File

@@ -5,7 +5,7 @@ func _ready() -> void:
var style = get('theme_override_styles/panel')
style.bg_color = Color(0, 0, 0, 0.5)
set('theme_override_styles/panel', style)
#func _process(_delta: float) -> void:
#pass

View File

@@ -241,7 +241,7 @@ class YaU07:
if not online:
online = true
emit_signal('line_changed', self)
var rx_data_len = rx_data.size()
if rx_data_len < 10:
return false