Merge branch 'refs/heads/master' into sasha
# Conflicts: # project.godot # scenes/frame-ecm-list/scroll-ecm-list.gd # scenes/работа/работа.gd # scripts/signaller.gd # scripts/threats.gd
This commit is contained in:
@@ -28,7 +28,7 @@ interfer/center_offset=Vector2(200, 225)
|
||||
interfer/default_color0=Color(0.38, 0.47, 0.51, 1)
|
||||
interfer/default_color1=Color(0.39, 0.44, 0.5, 1)
|
||||
interfer/select_color=Color(1, 1, 1, 1)
|
||||
interfer/interfer_color=Color(0.92379, 0.0965192, 0.249261, 1)
|
||||
interfer/interfer_color=Color(0.9, 0.1, 0.25, 0.9)
|
||||
interfer/resend_timeout=1000.0
|
||||
config/external_cu=false
|
||||
config/unit_rr_request_period=20.0
|
||||
@@ -36,7 +36,7 @@ config/kems_files_path="user://kems/"
|
||||
config/emsg_files_path="user://emsg/"
|
||||
config/settings_path="user://settings.json"
|
||||
config/unit_bpo_request_period=20.0
|
||||
interfer/emit_color=Color(0.92549, 0.0980392, 0.25098, 0.509804)
|
||||
interfer/emit_color=Color(0.9, 0.1, 0.25, 0.5)
|
||||
interfer/closed_sectors=Color(0, 0, 0, 1)
|
||||
|
||||
[autoload]
|
||||
|
||||
@@ -8,7 +8,7 @@ const TableHeader = preload('res://table/header.tscn') ## Ячейка за
|
||||
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
|
||||
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit ] ## Описание ряда.
|
||||
const TABLE_HEADERS_TEXT = ['№', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы.
|
||||
const TABLE_COLUMN_SIZE = [ 65, 100, 90, 195 ] ## Ширины колонок.
|
||||
const TABLE_COLUMN_SIZE = [ 65, 100, 90, 170 ] ## Ширины колонок.
|
||||
|
||||
## Состояние выполнения сеанса помехи
|
||||
const INTERFER_STATE = {
|
||||
@@ -122,7 +122,8 @@ func on_interfer_new(ecm, table_index):
|
||||
# Будем надеяться, что отложенные вызовы производятся в том же порядке
|
||||
$table.call_deferred('clear_rows_selected')
|
||||
$table.call_deferred('set_row_selected', i_row, true)
|
||||
signaller.emit_signal('interfer_selected', ecm)
|
||||
if not interfer.auto_enabled:
|
||||
signaller.emit_signal('interfer_selected', ecm)
|
||||
|
||||
|
||||
func on_interfer_off(ecm, table_index):
|
||||
|
||||
@@ -64,7 +64,7 @@ const SETTING_TABLE = [
|
||||
['Адрес БПО правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'],
|
||||
['Период опроса состояния БПО, секунды', TableEdit, TableEdit, 'Время в секундах' ],
|
||||
['Период опроса состояния АФСП, секунды', TableEdit, TableEdit, 'Время в секундах' ],
|
||||
['уареп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
|
||||
['уарэп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
|
||||
['Включить работу по своим целям', TableEdit, TableToggle, 'Разрешает работу в секторе со своей целью'],
|
||||
['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ]
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ var strob_band_begin: float ## Ширина строба в моме
|
||||
var strob_dir_begin: float ## Направление антенны в момент начала перетаскивания.
|
||||
var strob_width_begin: float ## Ширина строба по углу в момент начала перетаскивания.
|
||||
var view_mode: MapViewMode ## Режим отображения карты
|
||||
var thrs_dict: Dictionary ## Ссылка на словарь целей
|
||||
var thrs_dict: Dictionary ## Ссылка на словарь целей
|
||||
var gos_flag = true ## Флаг работать по своим целям
|
||||
var color_ecm: Color
|
||||
var color_select: Color
|
||||
var color_emit: Color
|
||||
@@ -92,13 +93,14 @@ func on_enter_tree() -> void: call_deferred('on_button_strobe_pressed')
|
||||
|
||||
|
||||
func on_settings_changed():
|
||||
gos_flag = ProjectSettings.get_setting('application/config/Включить работу по своим целям', true)
|
||||
color_emit = ProjectSettings.get_setting('application/interfer/emit_color', Color(0.58, 0.47, 0.51, 1.0))
|
||||
color_ecm = ProjectSettings.get_setting('application/interfer/interfer_color', Color(0.58, 0.47, 0.51, 1.0))
|
||||
color_select = ProjectSettings.get_setting('application/interfer/select_color', Color(1.0, 1.0, 1.0, 1.0))
|
||||
color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0))
|
||||
color_emit_sel = color_select
|
||||
color_closed_emit = color_closed
|
||||
|
||||
|
||||
color_select *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color_ecm *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color_emit_sel *= Color(1.0, 1.0, 1.0, 0.2)
|
||||
@@ -109,9 +111,7 @@ func on_settings_changed():
|
||||
|
||||
## Обработчик сигнала изменения списка целей.
|
||||
func on_threats_resized(ths: Dictionary):
|
||||
$count_all_pad/count_all.text = '%02d' % ths.size()
|
||||
var c: int = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
|
||||
$count_danger_pad/count_danger.text = '%02d' % c
|
||||
count_threats(ths)
|
||||
thrs_dict = ths
|
||||
|
||||
|
||||
@@ -529,7 +529,6 @@ func update_fs_colors():
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
else:
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
|
||||
|
||||
|
||||
func unsel_fs_all(need_btns_off: bool):
|
||||
@@ -625,6 +624,14 @@ func _on_btn_all_work_pressed() -> void:
|
||||
|
||||
|
||||
func on_th_aoa_update(ths):
|
||||
count_threats(ths)
|
||||
|
||||
|
||||
func count_threats(ths):
|
||||
$count_all_pad/count_all.text = '%02d' % ths.size()
|
||||
var c: int = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
|
||||
var c: int = 0
|
||||
if gos_flag:
|
||||
c = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
|
||||
else:
|
||||
c = ths.values().filter(func(th: threats.Threat): return ((th.proto != '') and th.proto not in interfer.gos_protocols)).size()
|
||||
$count_danger_pad/count_danger.text = '%02d' % c
|
||||
|
||||
@@ -379,8 +379,8 @@ texture_normal = ExtResource("14_ggrwd")
|
||||
[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"]
|
||||
[connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"]
|
||||
|
||||
@@ -125,6 +125,7 @@ class Interfer:
|
||||
var modulation: bool ## Модуляция для включения усилителей
|
||||
var um: float ## Угол места для помехи.
|
||||
var nmfs: int = 0 ## Номер модуля ФС в нумерации СТЦ
|
||||
var priority: int = 0 ## Приоритет помехи
|
||||
|
||||
func _to_string() -> String:
|
||||
return 'номер: %d название: %s частота: %0.1f МГц пеленг: %0.1f гр.' % [ispp, ITERFER_MODE[krp][0], params['freq'], kni]
|
||||
@@ -366,13 +367,23 @@ func map_mpchf_to_seczaps(unit_instance: unit.Unit, _seczaps: Dictionary):
|
||||
## Вызыватся, когда пользователь выбрал помеху и выбраны цели.
|
||||
func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> void:
|
||||
for item in sel_threats:
|
||||
if auto_enabled:
|
||||
var need_continue = false
|
||||
for ecm in ecms.values():
|
||||
if ecm.nmfs == item.nmfs:
|
||||
if item.priority > ecm.priority:
|
||||
interfer_off(ecm, u)
|
||||
elif item.priority < ecm.priority:
|
||||
need_continue = true
|
||||
break
|
||||
if need_continue: continue
|
||||
var param: Dictionary = {}
|
||||
var kni: float = item.aoa - course
|
||||
if kni < 0:
|
||||
kni += 360.0
|
||||
var id = item.id
|
||||
param['freq'] = item.freq
|
||||
param['width'] = item.width
|
||||
param['width'] = item.width * 1.5
|
||||
if (item.rkrp != '') and item.fflags.rkrp and auto_enabled:
|
||||
var krp = get_krp(item)
|
||||
if krp != '':
|
||||
@@ -454,13 +465,16 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
|
||||
ecm = Interfer.new()
|
||||
ecm.ispp = ispp
|
||||
ecms[ispp] = ecm
|
||||
ecm.modulation = emit_enable
|
||||
ecm.kni = kni
|
||||
ecm.krp = interfer_name
|
||||
ecm.params = param
|
||||
ecm.powp = power
|
||||
ecm.source_interfer = source_interfer
|
||||
ecm.modulation = emit_enable
|
||||
ecm.um = param.get('um', 15.0) # Значение по умолчанию
|
||||
if source_interfer == SOURCE_INTERFER[0]:
|
||||
if thrs_dict.has(dict[ispp]):
|
||||
ecm.priority = thrs_dict[dict[ispp]].priority
|
||||
call_ecm_proc(ecm)
|
||||
var set_nmfs_ok = set_nmfs(ecm)
|
||||
if set_nmfs_ok != Error.OK:
|
||||
@@ -477,7 +491,7 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
|
||||
|
||||
func send_ecm(ecm, unit0) -> void:
|
||||
if ecm.krp != INTERFER_OFF:
|
||||
if not emit_enable:
|
||||
if not ecm.modulation:
|
||||
ecm.svk = 0
|
||||
call_deferred('emit_signal', 'interfer_update', ecm)
|
||||
return
|
||||
@@ -512,8 +526,10 @@ func push_id(id: int) -> void:
|
||||
id_array.sort()
|
||||
|
||||
|
||||
func on_emit_changed(state, _ecms) -> void:
|
||||
func on_emit_changed(state, ecms) -> void:
|
||||
emit_enable = state
|
||||
for ecm in ecms.values():
|
||||
ecm.modulation = state
|
||||
|
||||
|
||||
func call_all_diap(ecm, ecm_params: Dictionary):
|
||||
@@ -561,8 +577,12 @@ func on_threats_update(threat, ecms, unit_caps):
|
||||
for ecm_i in thrs.keys():
|
||||
if thrs[ecm_i] == th_id:
|
||||
ecm = ecms[ecm_i]
|
||||
ecm.priority = threat.priority
|
||||
ecm.params['freq'] = threat.freq
|
||||
ecm.params['width'] = threat.width
|
||||
var width = threat.width * 1.5
|
||||
if width < settings.WIDTH_MIN:
|
||||
width = settings.WIDTH_MIN
|
||||
ecm.params['width'] = width
|
||||
if (threat.rkrp != '') and threat.fflags.rkrp and auto_enabled:
|
||||
var krp = get_krp(threat)
|
||||
if krp != '':
|
||||
@@ -604,7 +624,7 @@ func set_rparams(threat: threats.Threat, params: Dictionary):
|
||||
if threat.rparams.has('width'):
|
||||
params['width'] = threat.rparams['width']
|
||||
else:
|
||||
params['width'] = threat.width
|
||||
params['width'] = threat.width * 1.5
|
||||
if threat.rparams.has('filename'):
|
||||
params['filename'] = threat.rparams['filename']
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ var UnitProfiles: Dictionary[StringName, Array] = { \
|
||||
const FREQ_MAX: = 6000.0
|
||||
const FREQ_MIN: = 400.0
|
||||
const WIDTH_MAX: = 120.0
|
||||
const WIDTH_MIN: = 0.0
|
||||
const WIDTH_MIN: = 5.0
|
||||
const DUR_MAX: = 1000000.0
|
||||
const PERIOD_MAX: = 1000000.0
|
||||
const UM_MIN: = -5.0
|
||||
|
||||
@@ -216,10 +216,6 @@ signal sector_klaster (new_sector_data)
|
||||
signal clear_klaster ()
|
||||
|
||||
|
||||
## Вызывается при нажатии на кнопку "Запуск контроля".[br]
|
||||
signal start_contol_device()
|
||||
|
||||
|
||||
## Вызывается при программном отключении помехи.[br]
|
||||
## [param ecm] - выключаемая помеха ([b]true[/b]
|
||||
signal on_prog_ecm_off(ecm: interfer.Interfer)
|
||||
|
||||
@@ -29,7 +29,8 @@ class Threat:
|
||||
var selected: bool ## Флаг, что цель выбрана.
|
||||
var auto_selected: bool = false ## Флаг автомата для целей
|
||||
var emit_state: int = 0 ## 0 - подавление не назначено, 1 - назначено, 2 - выполняется
|
||||
var nmfs:int ## Индекс модуля ФС, в зону действия которого попала цель
|
||||
var nmfs: int ## Индекс модуля ФС, в зону действия которого попала цель
|
||||
var priority: int ## Приоритет опасности цели
|
||||
|
||||
func _init(): clear_fflags()
|
||||
func _to_string() -> String: return 'номер: %d пеленг: %0.1f частота: %0.1f МГц' % [id, aoa, freq]
|
||||
@@ -142,6 +143,10 @@ func on_data_capsrpb_received(unit: capsrpb.CapsRpb, threats: Dictionary):
|
||||
th.clear_fflags()
|
||||
th.set_from_dic(dic_th)
|
||||
th.tick_rx = unit.tick
|
||||
if th.fflags.proto and th.proto != '':
|
||||
th.priority = 1
|
||||
else:
|
||||
th.priority = 0
|
||||
call_deferred('emit_signal', 'threat_update', th)
|
||||
else:
|
||||
var th: = Threat.new()
|
||||
|
||||
Reference in New Issue
Block a user