Доработка. Добавление отображения сектора запрета от КАПСРПБ
This commit is contained in:
@@ -154,7 +154,6 @@ func on_full_auto() -> void: auto_enabled = true
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var ecms: Dictionary = {} ## Словарь помех.
|
||||
for i in ID_INTERFERS_LEN: # Заполняет массив ID целей
|
||||
id_array.append(i + 1)
|
||||
var unit_caps = network.get_unit_instance('уарэп-капсрпб')
|
||||
@@ -162,9 +161,11 @@ func _ready() -> void:
|
||||
var timer_check_state: = Timer.new()
|
||||
add_child(timer_check_state)
|
||||
var resend_timeout = ProjectSettings.get_setting('application/interfer/resend_timeout', 1000.0)
|
||||
var ecms: Dictionary = {} ## Словарь помех.
|
||||
var seczaps: Dictionary = {} ## Словарь секторов запрета
|
||||
timer_check_state.connect('timeout', Callable(self, 'on_timer_check_state').bind(unit_caps, ecms, resend_timeout))
|
||||
timer_check_state.start(resend_timeout / 1000.0)
|
||||
unit_caps.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(ecms))
|
||||
unit_caps.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(ecms, seczaps))
|
||||
unit_5p28.connect('get_interfers', Callable(self, 'on_get_interfers').bind(unit_5p28, ecms))
|
||||
signaller.connect('interfer_create', Callable(self, 'on_interfer_create').bind(unit_caps, ecms))
|
||||
signaller.connect('interfer_rcv', Callable(self, 'on_interfer_rcv').bind(unit_5p28, ecms))
|
||||
@@ -238,12 +239,12 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
|
||||
|
||||
|
||||
## Производит приём состояния помех. [param unit] -> [param ecms].
|
||||
func on_data_capsrpb_received(unit_instance: capsrpb.CapsRpb, ecms: Dictionary) -> void:
|
||||
if not unit_instance.json_dic.has('ts'): return
|
||||
if not (unit_instance.json_dic['ts'] is float): return
|
||||
if unit_instance.json_dic['ts'] != 5: return
|
||||
func on_data_capsrpb_received(unit_instance: capsrpb.CapsRpb, ecms: Dictionary, seczaps: Dictionary) -> void:
|
||||
if not unit_instance.json_dic.has('ts'): return
|
||||
if not tools.type_is_num(unit_instance.json_dic['ts']): return
|
||||
if unit_instance.json_dic['ts'] != 5: return
|
||||
map_msvk_to_ecms(unit_instance, ecms)
|
||||
map_mpchf_to_view(unit_instance)
|
||||
map_mpchf_to_seczaps(unit_instance, seczaps)
|
||||
|
||||
|
||||
## Извлекает массив состояний выполнения команды
|
||||
@@ -270,11 +271,16 @@ func map_msvk_to_ecms(unit_instance: unit.Unit, ecms: Dictionary):
|
||||
|
||||
|
||||
## Извлекает массив пространственно-частотных фильтров
|
||||
func map_mpchf_to_view(unit_instance: unit.Unit):
|
||||
var json_dic = unit_instance.json_dic
|
||||
if not json_dic.has('mpchf'): return
|
||||
var mpchf = json_dic['mpchf']
|
||||
func map_mpchf_to_seczaps(unit_instance: unit.Unit, seczaps: Dictionary):
|
||||
var json_dic: = unit_instance.json_dic as Dictionary
|
||||
var mpchf = json_dic.get('mpchf', [])
|
||||
if mpchf is not Array: return
|
||||
for item in mpchf:
|
||||
if item is not Dictionary: continue
|
||||
var id = item.get('index', -1)
|
||||
if id < 0: continue
|
||||
var freq = item.get('freq', 0)
|
||||
if freq == 0: continue
|
||||
|
||||
|
||||
## Вызыватся, когда пользователь выбрал помеху и выбраны цели.
|
||||
|
||||
Reference in New Issue
Block a user