Распаковка пакета тип-7

This commit is contained in:
Maxim Name
2025-06-27 07:49:04 +03:00
parent 36a502c0fd
commit 06458c3da8
2 changed files with 9 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ var timer_03: Timer = Timer.new()
func _ready() -> void:
signaller.conn(signaller.fs_update_state, Callable(self, 'on_fs_update_state'))
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
var unit_prd = network.units[unit_key]
unit_prd.connect('data_received', Callable(self, 'on_data_received'))
@@ -34,7 +35,7 @@ func _ready() -> void:
self.add_child(timer_03)
timer_03.connect('timeout', Callable(self, 'on_timer_03'))
timer_03.one_shot = true
timer_03.wait_time = 4.0
timer_03.wait_time = 5.0
_on_control_fs(true)
timer_03.start()
@@ -221,4 +222,9 @@ func _on_control_fs(mode: bool) -> void:
func on_timer_03() -> void:
_on_control_fs(false)
print('stop timer')
pass
func on_fs_update_state(packet_type_7: Dictionary):
for fs in packet_type_7:
if packet_type_7[fs].isg == 1:
print([packet_type_7[fs].index, packet_type_7[fs].isg])

View File

@@ -347,7 +347,7 @@ func on_data_capsrpb_received(unit0: capsrpb.CapsRpb):
if not unit0.json_dic.has('ts'): return
if unit0.json_dic['ts'] != 7: return
if not unit0.json_dic.has('msfs'): return
var msfs = unit0.json_dic['msfs']
for fs in msfs:
if fs is Dictionary: