From 8a61e03fa21f87962646936b87aa6d3a214e0f1b Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 10:48:12 +0300 Subject: [PATCH 1/8] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=9E=D1=80=D0=B3=D0=B0=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=85=D0=B8=20=D0=B2=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=81=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=D0=B8=20=D0=BF=D1=80=D0=BE=D1=82=D0=BE=D0=BA?= =?UTF-8?q?=D0=BE=D0=BB=D0=B0=20=D1=81=20=D0=A1=D0=A2=D0=A6=20=D0=BE=D1=82?= =?UTF-8?q?=2008-08-2025.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/контроль/контроль.tscn | 21 ++++- scenes/работа/работа.gd | 8 +- scenes/работа/работа.tscn | 2 +- scripts/interfer.gd | 140 ++++++++++++++++++++++------------ 4 files changed, 115 insertions(+), 56 deletions(-) diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 8c151127..461f07c1 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -111,6 +111,7 @@ metadata/unit_name = ["уарэп-эмс"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_uf"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 15.0 offset_top = -34.0 @@ -177,6 +178,7 @@ patch_margin_right = 16 patch_margin_bottom = 16 [node name="label" type="Label" parent="pribor_rtr"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 12.0 offset_top = -54.0 @@ -230,6 +232,7 @@ patch_margin_right = 16 patch_margin_bottom = 16 [node name="label" type="Label" parent="pribor_afsp_1"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 165.0 offset_top = -245.0 @@ -244,7 +247,7 @@ vertical_alignment = 1 modulate = Color(0.498039, 0.498039, 0.498039, 1) light_mask = 3 position = Vector2(415, -40) -scale = Vector2(3.0, 3.0) +scale = Vector2(3, 3) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") @@ -285,6 +288,7 @@ patch_margin_right = 16 patch_margin_bottom = 16 [node name="label" type="Label" parent="pribor_afsp_2"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 200.0 offset_top = -240.0 @@ -299,7 +303,7 @@ vertical_alignment = 1 modulate = Color(0.498039, 0.498039, 0.498039, 1) light_mask = 3 position = Vector2(425, -40) -scale = Vector2(3.0, 3.0) +scale = Vector2(3, 3) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") @@ -323,6 +327,7 @@ metadata/unit_name = ["уарэп-щ3", "уарэп-спт25-1", "уарэп-с metadata/online_proc = "online_change_arr" [node name="label" type="Label" parent="pribor_uyep"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 26.8566 offset_top = -38.3276 @@ -376,6 +381,7 @@ metadata/unit_name = ["уарэп-яу07-2в"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_2"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 14.0 offset_top = -38.0 @@ -429,6 +435,7 @@ metadata/unit_name = ["уарэп-яу07-2н"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_n_2"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 15.0 offset_top = -38.0 @@ -484,6 +491,7 @@ metadata/unit_name = ["уарэп-яу07-2к"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_2"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 17.0 offset_top = -38.0 @@ -537,6 +545,7 @@ metadata/unit_name = ["уарэп-яу07-3в"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_3"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 9.0 offset_top = -38.0 @@ -590,6 +599,7 @@ metadata/unit_name = ["уарэп-яу07-3н"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_n_3"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 8.0 offset_top = -38.0 @@ -643,6 +653,7 @@ metadata/unit_name = ["уарэп-яу07-3к"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_3"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 9.0 offset_top = -38.0 @@ -696,6 +707,7 @@ metadata/unit_name = ["уарэп-яу07-1в"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_1"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 8.0 offset_top = -38.0 @@ -749,6 +761,7 @@ metadata/online_proc = "on_line_changed" metadata/unit_name = ["уарэп-яу07-1н"] [node name="label" type="Label" parent="pribor_prd_n_1"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 8.0 offset_top = -38.0 @@ -802,6 +815,7 @@ metadata/unit_name = ["уарэп-яу07-1к"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_1"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 9.0 offset_top = -38.0 @@ -854,6 +868,7 @@ metadata/unit_name = ["уарэп-яу07-4в"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_4"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 17.0 offset_top = -38.0 @@ -906,6 +921,7 @@ metadata/unit_name = ["уарэп-яу07-4н"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_n_4"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 14.0 offset_top = -38.0 @@ -958,6 +974,7 @@ metadata/unit_name = ["уарэп-яу07-4к"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_4"] +self_modulate = Color(0, 0, 0, 0) layout_mode = 0 offset_left = 17.0 offset_top = -38.0 diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 31db96ca..242edf4b 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -425,14 +425,10 @@ func sel_fs_sector(event): func set_fs_color(ecm): - var fs_index_arr: Array = [] - prd.get_fs_index(ecm, fs_index_arr) if ecm.krp != interfer.INTERFER_OFF: - for item in fs_index_arr: - fs_active[item] = null + fs_active[prd.fs_caps_id[ecm.nmfs]] = null else: - for item in fs_index_arr: - fs_active.erase(item) + fs_active.erase(prd.fs_caps_id[ecm.nmfs]) update_fs_colors() diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 64b1bbd5..6d645182 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -305,6 +305,6 @@ text = "Масштаб:" [connection signal="drag_continue" from="." to="." method="_on_drag_continue"] [connection signal="toggled" from="btn_view" to="." method="on_button_view_toggled"] [connection signal="toggled" from="chk_auto" to="." method="on_value_changed"] -[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] +[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] diff --git a/scripts/interfer.gd b/scripts/interfer.gd index f3c38ef9..b981e509 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -4,42 +4,60 @@ class_name Iterfer extends Node ## Режимы помехи. const ITERFER_MODE = { - 'off': ['Откл', {}, 0], - 'srni1': ['СРН-И1', {}, 1], - 'srnm2': ['СРН-М2', {}, 2], - 'srngps': ['СРН-GPS', {}, 3], - 'lchm1': ['ЛЧМ-1', {}, 10], - 'lchm2': ['ЛЧМ-2', {}, 16], - 'mchm1': ['МЧМ-1', {}, 11], - 'pdm2': ['ПД-М2', {}, 12], - 'pdm4': ['ПД-М4', {}, 13], - 'pdm4s': ['ПД-М4С', {}, 14], - 'pdchm': ['ПД-ЧМ', {}, 15], - 'svi1': ['СВ-И1', SVI1_PARAMS, 20], - 'svm2': ['СВ-М2', SVM2_PARAMS, 21], - 'k1': ['K1', K1_PARAMS, 50], - 'ozp1': ['ОЗП-1', OZP1_PARAMS, 51] } + INTERFER_OFF: ['Откл', {}, 0], + 'srni1': ['ПСП + ФМ-2', SRNI1_PARAMS, 1], + 'srnm2': ['Линейная ЧМ', SRNM2_PARAMS, 2], + 'srngps': [INTERFER_IQFILE, SRNGPS_PARAMS, 3], + 'lchm1': ['Линейная ЧМ', LCHM1_PARAMS, 10], + 'lchm2': ['Линейная ЧМ', LCHM2_PARAMS, 16], + 'mchm1': [INTERFER_IQFILE, MCHM1_PARAMS, 11], + 'pdm2': [INTERFER_IQFILE, PDM2_PARAMS, 12], + 'pdm4': [INTERFER_IQFILE, PDM4_PARAMS, 13], + 'pdm4s': [INTERFER_IQFILE, PDM4S_PARAMS, 14], + 'pdchm': [INTERFER_IQFILE, PDCHM_PARAMS, 15], + 'svi1': [INTERFER_IQFILE, SVI1_PARAMS, 20], + 'svm2': [INTERFER_IQFILE, SVM2_PARAMS, 21], + 'k1': [INTERFER_IQFILE, K1_PARAMS, 50], + 'ozp1': [INTERFER_IQFILE, OZP1_PARAMS, 51] } -const K1_PARAMS = {'files': ['K1'], - 'call_proc': 'call_all_diap'} -const OZP1_PARAMS = {'files': ['OZP1'], - 'call_proc': 'call_all_diap'} +const SRNI1_PARAMS = {'par_names' : ['freq', 'width']} +const SRNM2_PARAMS = {'par_names' : ['freq', 'width', 'period']} +const SRNGPS_PARAMS = {'par_names' : ['freq', 'filename']} +const LCHM1_PARAMS = {'par_names' : ['freq', 'width', 'period']} +const LCHM2_PARAMS = {'par_names' : ['freq', 'width', 'period']} +const MCHM1_PARAMS = {'par_names' : ['freq', 'filename']} +const PDM2_PARAMS = {'par_names' : ['freq', 'filename']} +const PDM4_PARAMS = {'par_names' : ['freq', 'filename']} +const PDM4S_PARAMS = {'par_names' : ['freq', 'filename']} +const PDCHM_PARAMS = {'par_names' : ['freq', 'filename']} +const K1_PARAMS = {'files' : 'K1', + 'call_proc' : 'call_all_diap', + 'par_names' : ['freq', 'filename']} +const OZP1_PARAMS = {'files': 'OZP1', + 'call_proc': 'call_all_diap', + 'par_names' : ['freq', 'filename']} # Файл : Диапазон: ['имя файла', частота] const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2', 1017], 2: ['SVI1_LIT3', 1156]}, - 'call_proc': 'call_diap'} + 'call_proc': 'call_diap', + 'par_names' : ['freq', 'filename']} const SVM2_PARAMS = {'files': {1: ['SVM2_LIT2', 1017], 2: ['SVM2_LIT3', 1156]}, - 'call_proc': 'call_diap'} + 'call_proc': 'call_diap', + 'par_names' : ['freq', 'filename']} +# Файл : Ключ: ['имя файла', ширина, использовать 2 ЛЧМ] const PD_CHM = {'files': { - - }, + 5 : ['1 FM 5', 5, false], + 11: ['1 FM 10', 10, false], + 12: ['2 FM 20', 10, true], + 20: ['2 FM 40', 20, false] }, 'call_proc': 'call_pd_chm'} const SOURCE_INTERFER = ['th','fs','cu'] const ID_INTERFERS_LEN = 63 ## Размер пула номеров целей. const INTERFER_OFF = 'off' +const INTERFER_IQFILE = 'IQ-файл' const POW_DEFAULT: float = 100.0 var msg6_num: int = 0 ## Счётчик сообщений "тип 6" var msg8_num: int = 0 ## Счётчик сообщений "тип 8" @@ -75,12 +93,15 @@ class Interfer: data_to_json['ts'] = 6 data_to_json['ss'] = msg_num data_to_json['ispp'] = ispp - data_to_json['krp'] = krp + data_to_json['krp'] = ITERFER_MODE[krp][0] data_to_json['nmfs'] = nmfs if krp != INTERFER_OFF: data_to_json['kni'] = kni data_to_json['powp'] = powp - data_to_json['params'] = params + data_to_json['params'] = {} + for key in ITERFER_MODE[krp][1]['par_names']: + if params.has(key): + data_to_json['params'][key] = params[key] data_to_json['get'] = get_params var pac = JSON.stringify(data_to_json).to_utf8_buffer() return pac @@ -148,7 +169,7 @@ func _ready() -> void: var unit_nav = network.get_unit_instance('навигация') unit_nav.connect('data_received', on_nav_data_received.bind(unit_caps)) threats.connect('threats_resized', Callable(self, 'on_threats_resized')) - threats.connect('threat_update', Callable(self, 'on_threats_update').bind(ecms)) + threats.connect('threat_update', Callable(self, 'on_threats_update').bind(ecms, unit_caps)) func on_nav_data_received(coords: Dictionary, unit_caps): @@ -401,38 +422,63 @@ func on_threats_resized(th_dic): thrs_dict = th_dic -func on_threats_update(threat, ecms): - if threat.tmod != 'fm': return +func on_threats_update(threat, ecms, unit_caps): + var th_id = threat.id + var ecm = null + for ecm_i in thrs.keys(): + if thrs[ecm_i] == th_id: + ecm = ecms[ecm_i] + ecm.params['freq'] = threat.freq + ecm.kni = threat.aoa + if threat.tmod != 'fm': + if ecm != null: + send_ecm(ecm, unit_caps) + return var th_fm_dict: Dictionary + var fs_index_arr: Array + prd.find_fs_index(threat.aoa, threat.freq, fs_index_arr) + if fs_index_arr.size() == 0: + if ecm != null: + send_ecm(ecm, unit_caps) + return + var fs_index = fs_index_arr[0] + var nmfs = prd.FS_PRD[fs_index][1] + if ecm == null: + for ecm_i in ecms.values(): + if nmfs != ecm_i.nmfs: continue + if ecm_i.svk != 1: continue + ecm = ecm_i + if ecm == null: return + for th_index in thrs_dict: if thrs_dict[th_index].tmod != 'fm': continue - var fs_index_arr: Array + fs_index_arr = [] prd.find_fs_index(thrs_dict[th_index].aoa, thrs_dict[th_index].freq, fs_index_arr) if fs_index_arr.size() == 0: continue - if th_fm_dict.has(fs_index_arr[0]): - th_fm_dict[fs_index_arr[0]][th_index] = thrs_dict[th_index] - else: - var th_dict: Dictionary - th_fm_dict[fs_index_arr[0]] = th_dict - th_fm_dict[fs_index_arr[0]][th_index] = thrs_dict[th_index] - for key in th_fm_dict: - if len(th_fm_dict[key]) < 2: continue - var nmfs = prd.FS_PRD[key][1] - for ecm in ecms.values(): - if nmfs != ecm.nmfs: continue - if ecm.krp != 'pdchm': continue + if fs_index_arr[0] != fs_index: continue + th_fm_dict[th_index] = thrs_dict[th_index] + if len(th_fm_dict) > 1: + pass + + send_ecm(ecm, unit_caps) func get_freq_range(freq_range_dict: Dictionary, th_dict: Dictionary): var min_range_abs: int = 6000 - var max_range_abs: int = 0 for key_i in th_dict: var min_range: int = 6000 - var max_range: int = 0 + var key_min = null for key_j in th_dict: if key_i == key_j: continue - var freq_range = abs(th_dict[key_i].freq - th_dict[key_j].freq) - if freq_range < min_range: min_range = freq_range - if freq_range > max_range: max_range = freq_range + var width = (th_dict[key_i].width / 2) + (th_dict[key_j].width / 2) + var freq_range = abs(th_dict[key_i].freq - th_dict[key_j].freq) + width + if freq_range < min_range: + key_min = key_j + min_range = freq_range + if min_range > PD_CHM['files'][20][1]: + th_dict.erase(key_i) + continue + else: + if key_min == null: continue + freq_range_dict[key_i] = [th_dict[key_i], th_dict[key_min], min_range] if min_range < min_range_abs: min_range_abs = min_range - if max_range > max_range_abs: max_range_abs = max_range From 422accf4c7d3c98485f30658d4a14a4911562631 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 13:14:41 +0300 Subject: [PATCH 2/8] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=BE=D0=B2=20=D0=B2=20=D0=BC=D0=BE=D0=B4=D1=83?= =?UTF-8?q?=D0=BB=D0=B5=20=D0=A4=D0=A1=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BC=D0=B5=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/interfer.gd | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/scripts/interfer.gd b/scripts/interfer.gd index 0b41ad37..4649d91d 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -22,27 +22,39 @@ const ITERFER_MODE = { const SRNI1_PARAMS = {'par_names' : ['freq', 'width']} const SRNM2_PARAMS = {'par_names' : ['freq', 'width', 'period']} -const SRNGPS_PARAMS = {'par_names' : ['freq', 'filename']} +const SRNGPS_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'SRNGPS.pcm', + 'call_proc': 'call_all_diap'} const LCHM1_PARAMS = {'par_names' : ['freq', 'width', 'period']} const LCHM2_PARAMS = {'par_names' : ['freq', 'width', 'period']} -const MCHM1_PARAMS = {'par_names' : ['freq', 'filename']} -const PDM2_PARAMS = {'par_names' : ['freq', 'filename']} -const PDM4_PARAMS = {'par_names' : ['freq', 'filename']} -const PDM4S_PARAMS = {'par_names' : ['freq', 'filename']} -const PDCHM_PARAMS = {'par_names' : ['freq', 'filename']} -const K1_PARAMS = {'files' : 'K1', +const MCHM1_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'MCHM1.pcm', + 'call_proc': 'call_all_diap'} +const PDM2_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'PDM2_20.pcm', + 'call_proc': 'call_all_diap'} +const PDM4_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'PDM4_20.pcm', + 'call_proc': 'call_all_diap'} +const PDM4S_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'PDM4S_5.pcm', + 'call_proc': 'call_all_diap'} +const PDCHM_PARAMS = {'par_names' : ['freq', 'filename'], + 'files': 'FM_5.pcm', + 'call_proc': 'call_all_diap'} +const K1_PARAMS = {'files' : 'K1.pcm', 'call_proc' : 'call_all_diap', 'par_names' : ['freq', 'filename']} -const OZP1_PARAMS = {'files': 'OZP1', +const OZP1_PARAMS = {'files': 'OZP1.pcm', 'call_proc': 'call_all_diap', 'par_names' : ['freq', 'filename']} # Файл : Диапазон: ['имя файла', частота] -const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2', 1017], - 2: ['SVI1_LIT3', 1156]}, +const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2.pcm', 1017], + 2: ['SVI1_LIT3.pcm', 1156]}, 'call_proc': 'call_diap', 'par_names' : ['freq', 'filename']} -const SVM2_PARAMS = {'files': {1: ['SVM2_LIT2', 1017], - 2: ['SVM2_LIT3', 1156]}, +const SVM2_PARAMS = {'files': {1: ['SVM2_LIT2.pcm', 1017], + 2: ['SVM2_LIT3.pcm', 1156]}, 'call_proc': 'call_diap', 'par_names' : ['freq', 'filename']} @@ -302,9 +314,8 @@ func on_interfer_rcv(interfer_params: Array, unit0, ecms) -> void: func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interfer, power) -> void: var sz = ecms.size() var ispp: int = 0 - if interfer_name == 'k1': - param['dur'] = 1.0 # Необходимо добавить параметры управления - param['period'] = 1.0 # Необходимо добавить параметры управления + param['dur'] = 1.0 # Необходимо добавить параметры управления + param['period'] = 1.0 # Необходимо добавить параметры управления var key = dict.find_key(id) if source_interfer != SOURCE_INTERFER[2]: if key != null: From 99e62036fd92bf0d7b5f4b5272ce374fea0591a2 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 13:37:45 +0300 Subject: [PATCH 3/8] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=B2=208=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=20=D0=B4=D0=BB=D1=8F=20=D0=9A?= =?UTF-8?q?=D0=90=D0=9F=D0=A1=20=D0=A0=D0=9F=D0=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/interfer.gd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/interfer.gd b/scripts/interfer.gd index 4649d91d..a9e7689c 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -185,6 +185,7 @@ func _ready() -> void: func on_nav_data_received(coords: Dictionary, unit_caps): + var ship_time = Time.get_datetime_dict_from_system() var data_to_json = { 'ts': 8, 'ss': msg8_num, @@ -193,7 +194,13 @@ func on_nav_data_received(coords: Dictionary, unit_caps): 'long': coords.get('longitude', 0), 'lat': coords.get('latitude', 0), 'course': coords.get('k', 0), - 'speed': coords.get('speed', 0) } + 'speed': coords.get('speed', 0), + 'year': ship_time['year'], + 'month': ship_time['month'], + 'day': ship_time['day'], + 'hour': ship_time['hour'], + 'minute': ship_time['minute'], + 'second': ship_time['second'],} var json_data = JSON.stringify(data_to_json).to_utf8_buffer() unit_caps.tx_stack.append(json_data) msg8_num += 1 From 1bef3546011a396df60e2a0569f0f3086cae9f58 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 13:53:30 +0300 Subject: [PATCH 4/8] gittest --- scripts/interfer.gd | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/interfer.gd b/scripts/interfer.gd index a9e7689c..d612e9e1 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -48,6 +48,7 @@ const K1_PARAMS = {'files' : 'K1.pcm', const OZP1_PARAMS = {'files': 'OZP1.pcm', 'call_proc': 'call_all_diap', 'par_names' : ['freq', 'filename']} + # Файл : Диапазон: ['имя файла', частота] const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2.pcm', 1017], 2: ['SVI1_LIT3.pcm', 1156]}, From 5898c564cf9f0d1f217b9a21be5557b76f4ef11a Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 13:55:23 +0300 Subject: [PATCH 5/8] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/interfer.gd | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/interfer.gd b/scripts/interfer.gd index d612e9e1..a9e7689c 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -48,7 +48,6 @@ const K1_PARAMS = {'files' : 'K1.pcm', const OZP1_PARAMS = {'files': 'OZP1.pcm', 'call_proc': 'call_all_diap', 'par_names' : ['freq', 'filename']} - # Файл : Диапазон: ['имя файла', частота] const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2.pcm', 1017], 2: ['SVI1_LIT3.pcm', 1156]}, From 38d2d0ff2100a15c2e879000fbe2e16d5bd31bfb Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 13:59:13 +0300 Subject: [PATCH 6/8] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-hook.sh | 2 +- scripts/interfer.gd | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/git-hook.sh b/git-hook.sh index e38d1643..338d1626 100644 --- a/git-hook.sh +++ b/git-hook.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#/usr/bin/env bash # Описание # diff --git a/scripts/interfer.gd b/scripts/interfer.gd index a9e7689c..d612e9e1 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -48,6 +48,7 @@ const K1_PARAMS = {'files' : 'K1.pcm', const OZP1_PARAMS = {'files': 'OZP1.pcm', 'call_proc': 'call_all_diap', 'par_names' : ['freq', 'filename']} + # Файл : Диапазон: ['имя файла', частота] const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2.pcm', 1017], 2: ['SVI1_LIT3.pcm', 1156]}, From 76362576280d541a8f415c2c484e8c8a4c8739c5 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 2 Sep 2025 14:01:19 +0300 Subject: [PATCH 7/8] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-hook.sh | 2 +- scripts/interfer.gd | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/git-hook.sh b/git-hook.sh index 338d1626..e38d1643 100644 --- a/git-hook.sh +++ b/git-hook.sh @@ -1,4 +1,4 @@ -#/usr/bin/env bash +#!/usr/bin/env bash # Описание # diff --git a/scripts/interfer.gd b/scripts/interfer.gd index d612e9e1..a9e7689c 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -48,7 +48,6 @@ const K1_PARAMS = {'files' : 'K1.pcm', const OZP1_PARAMS = {'files': 'OZP1.pcm', 'call_proc': 'call_all_diap', 'par_names' : ['freq', 'filename']} - # Файл : Диапазон: ['имя файла', частота] const SVI1_PARAMS = {'files': {1: ['SVI1_LIT2.pcm', 1017], 2: ['SVI1_LIT3.pcm', 1156]}, From 64d0580a3ec1087b9cfe8baa5135a76a3421f81c Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Fri, 5 Sep 2025 13:57:21 +0300 Subject: [PATCH 8/8] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=B0,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=85?= =?UTF-8?q?=D0=B8.=20=D0=9F=D0=BE=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=85=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=86=D0=B5=D0=BB=D1=8C,=20=D0=B5=D1=81=D0=BB=D0=B8?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20=D1=81=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=20=D1=81=20=D1=86=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D1=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/работа/работа.tscn | 2 +- scripts/interfer.gd | 73 +++++++++++++++++++++++++++++---------- scripts/prd.gd | 4 +-- 3 files changed, 57 insertions(+), 22 deletions(-) diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 6d645182..64b1bbd5 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -305,6 +305,6 @@ text = "Масштаб:" [connection signal="drag_continue" from="." to="." method="_on_drag_continue"] [connection signal="toggled" from="btn_view" to="." method="on_button_view_toggled"] [connection signal="toggled" from="chk_auto" to="." method="on_value_changed"] -[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] +[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] diff --git a/scripts/interfer.gd b/scripts/interfer.gd index a9e7689c..2b6b3110 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -4,7 +4,7 @@ class_name Iterfer extends Node ## Режимы помехи. const ITERFER_MODE = { - INTERFER_OFF: ['Откл', {}, 0], + INTERFER_OFF: [INTERFER_OFF, {}, 0], 'srni1': ['ПСП + ФМ-2', SRNI1_PARAMS, 1], 'srnm2': ['Линейная ЧМ', SRNM2_PARAMS, 2], 'srngps': [INTERFER_IQFILE, SRNGPS_PARAMS, 3], @@ -39,9 +39,6 @@ const PDM4_PARAMS = {'par_names' : ['freq', 'filename'], const PDM4S_PARAMS = {'par_names' : ['freq', 'filename'], 'files': 'PDM4S_5.pcm', 'call_proc': 'call_all_diap'} -const PDCHM_PARAMS = {'par_names' : ['freq', 'filename'], - 'files': 'FM_5.pcm', - 'call_proc': 'call_all_diap'} const K1_PARAMS = {'files' : 'K1.pcm', 'call_proc' : 'call_all_diap', 'par_names' : ['freq', 'filename']} @@ -58,15 +55,17 @@ const SVM2_PARAMS = {'files': {1: ['SVM2_LIT2.pcm', 1017], 'call_proc': 'call_diap', 'par_names' : ['freq', 'filename']} -# Файл : Ключ: ['имя файла', ширина, использовать 2 ЛЧМ] -const PD_CHM = {'files': { - 5 : ['1 FM 5', 5, false], - 11: ['1 FM 10', 10, false], - 12: ['2 FM 20', 10, true], - 20: ['2 FM 40', 20, false] }, - 'call_proc': 'call_pd_chm'} +# Файл : Ключ (ширина): ['имя файла'] +const PDCHM_PARAMS = {'files': { + 5 : 'pdchm_5.pcm', + 10: 'pdchm__0.pcm', + 20: 'pdchm_20.pcm', + 40: 'pdchm_40.pcm' }, + 'call_proc': 'call_pdchm', + 'par_names' : ['freq', 'filename'],} const SOURCE_INTERFER = ['th','fs','cu'] +const EXCLUDE_INTERFER = ['srni1', 'srnm2', 'srngps', 'svi1', 'svm2'] const ID_INTERFERS_LEN = 63 ## Размер пула номеров целей. const INTERFER_OFF = 'off' const INTERFER_IQFILE = 'IQ-файл' @@ -279,14 +278,24 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v var param: Dictionary = {} var kni: float = item[0] var id = item[3] - param['freq'] = item[1] - param['width'] = item[2] + var th = null + if not interfer_name in EXCLUDE_INTERFER: + th = find_threat(item[1], kni) + if th != null: + param['freq'] = th.freq + param['width'] = th.width + else: + param['freq'] = item[1] + param['width'] = item[2] if (param['width'] < settings.WIDTH_MIN): param['width'] = settings.WIDTH_MIN elif (param['width'] > settings.WIDTH_MAX): param['width'] = settings.WIDTH_MAX - interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power) - + if th == null: + interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power) + else: + id = th.id + interfer_create(u, interfer_name, ecms, param, kni, id, thrs, SOURCE_INTERFER[0], power) func on_interfer_rcv(interfer_params: Array, unit0, ecms) -> void: var err: bool = false @@ -426,6 +435,17 @@ func call_diap(ecm, ecm_params: Dictionary): ecm.params['freq'] = ecm_params['files'][band][1] +func call_pdchm(ecm, ecm_params: Dictionary): + var temp_key: float = settings.WIDTH_MIN + for key in ecm_params['files'].keys(): + if key > temp_key: temp_key = key + for key in ecm_params['files'].keys(): + if key < ecm.params['width']: continue + if key < temp_key: + temp_key = key + ecm.params['filename'] = ecm_params['files'][int(temp_key)] + + func set_nmfs(ecm): var fs_index_arr: Array prd.get_fs_index(ecm, fs_index_arr) @@ -448,6 +468,7 @@ func on_threats_update(threat, ecms, unit_caps): ecm = ecms[ecm_i] ecm.params['freq'] = threat.freq ecm.kni = threat.aoa + set_nmfs(ecm) if threat.tmod != 'fm': if ecm != null: send_ecm(ecm, unit_caps) @@ -477,12 +498,10 @@ func on_threats_update(threat, ecms, unit_caps): th_fm_dict[th_index] = thrs_dict[th_index] if len(th_fm_dict) > 1: pass - send_ecm(ecm, unit_caps) func get_freq_range(freq_range_dict: Dictionary, th_dict: Dictionary): - var min_range_abs: int = 6000 for key_i in th_dict: var min_range: int = 6000 var key_min = null @@ -493,10 +512,26 @@ func get_freq_range(freq_range_dict: Dictionary, th_dict: Dictionary): if freq_range < min_range: key_min = key_j min_range = freq_range - if min_range > PD_CHM['files'][20][1]: + var max_width = 0 + for key in PDCHM_PARAMS['files'].keys(): + if max_width < key: max_width = key + if min_range > max_width: th_dict.erase(key_i) continue else: if key_min == null: continue freq_range_dict[key_i] = [th_dict[key_i], th_dict[key_min], min_range] - if min_range < min_range_abs: min_range_abs = min_range + + +func find_threat(freq: int, aoa: float): + var fs_index_arr = [] + prd.find_fs_index(aoa, freq, fs_index_arr) + if not fs_index_arr.size(): return null + var fs_index = fs_index_arr[0] + for th in thrs_dict.values(): + fs_index_arr = [] + prd.find_fs_index(th.aoa, th.freq, fs_index_arr) + if not fs_index_arr.size(): continue + if fs_index_arr[0] == fs_index: + return th + return null diff --git a/scripts/prd.gd b/scripts/prd.gd index ebc97a37..30cfe54f 100644 --- a/scripts/prd.gd +++ b/scripts/prd.gd @@ -296,7 +296,7 @@ func get_fs_param(index: int) -> Array: ## Функция возвращает массив с индексами модулей ФС для выбранной помехи func get_fs_index(ecm, fs_index_arr): - var angle: float = ecm.kni + 45.0 + var angle: float = ecm.kni if ecm.params.has('freq'): find_fs_index(angle, ecm.params['freq'], fs_index_arr) @@ -304,7 +304,7 @@ func get_fs_index(ecm, fs_index_arr): func find_fs_index(aoa: float, freq: int, fs_index_arr: Array): var sector: int var band: Array - var angle = aoa + var angle = aoa + 45.0 if angle > 360.0: angle -= 360.0 for sec in FS_SECTORS.values():