Доработка, добавлен обработчик кнопки отключить всё.
(cherry picked from commit 5740964d09)
This commit is contained in:
@@ -98,6 +98,7 @@ func _ready():
|
||||
unit.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(ecms))
|
||||
signaller.connect('interfer_create', Callable(self, 'on_interfer_create').bind(unit, ecms))
|
||||
signaller.connect('interfer_new', Callable(self, 'send_ecm').bind(unit))
|
||||
signaller.connect('interfer_off_all', Callable(self, 'on_interfer_off_all').bind(unit, ecms))
|
||||
|
||||
# Проверяет состояние отправки пакета и если не доставлен, повторяет отправку
|
||||
func on_timer_check_state(unit, ecms, resend_timeout):
|
||||
@@ -174,6 +175,7 @@ func on_interfer_create(btn, sel_threats, unit, ecms):
|
||||
if interfer_name == 'off':
|
||||
signaller.emit_signal('interfer_off', ecm, ecms, thrs)
|
||||
push_id(ecm.ispp)
|
||||
thrs.erase(ispp)
|
||||
ecm.tick_tx = Time.get_ticks_msec()
|
||||
|
||||
|
||||
@@ -182,6 +184,14 @@ func send_ecm(ecm, unit):
|
||||
unit.tx_stack.append(json_data)
|
||||
|
||||
|
||||
func on_interfer_off_all(unit, ecms):
|
||||
for ecm in ecms.values():
|
||||
ecm.krp = INTERFER_OFF
|
||||
push_id(ecm.ispp)
|
||||
send_ecm(ecm, unit)
|
||||
signaller.emit_signal('interfer_off',ecm, ecms, thrs)
|
||||
|
||||
|
||||
func pop_id():
|
||||
var id = 0
|
||||
if len(id_array):
|
||||
|
||||
Reference in New Issue
Block a user