Доработка. Отслеживание ошибок во входных пакетах

This commit is contained in:
sasha80
2023-08-25 14:34:39 +03:00
parent 8204ee9671
commit b7a41d3f95
2 changed files with 5 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ extends Control
func on_line_changed(unit, addr): Log.message(Logger.INFO, 'Состояние связи: %s %s' % [unit, addr])
func on_command_fail(unit, addr): Log.message(Logger.ERROR, 'Ошибка: команда не выполнена: %s %s' % [unit, addr])
func on_threats_changed(th: Object, msg: String): Log.message(Logger.INFO, '%s: %s' % [msg, th.to_string()])
func on_parse_error(unit, msg: String): Log.message(Logger.ERROR, '%s: %s' % [unit.to_string(), msg])
func _ready() -> void:

View File

@@ -68,8 +68,10 @@ func on_timer_check_lost(time_lost: int, threats: Dictionary):
## Производит приём целей
func on_data_capsrpb_received(unit: capsrpb.CapsRpb, threats: Dictionary):
if not unit.json_dic.has('mis'):
return
if not unit.json_dic.has('ts'): return
if unit.json_dic['ts'] != 5: return
if not unit.json_dic.has('mis'): return
var mis = unit.json_dic['mis']
var sz: = threats.size()
for dic_th in mis: