Необходима доработка с ПРД-К
This commit is contained in:
@@ -153,6 +153,7 @@ func _on_connect_change(unit_state_connect) -> void:
|
||||
|
||||
|
||||
func on_command_change_device(meta_device):
|
||||
print(meta_device)
|
||||
send_array = []
|
||||
ip_address_yau = meta_device[0]
|
||||
ip_port_yau = meta_device[1]
|
||||
@@ -164,17 +165,40 @@ func on_command_change_device(meta_device):
|
||||
unit_fs_2.disconnect_fs()
|
||||
unit_fs_2.connect_to_host(meta_device[4], Constants.PORT_FS)
|
||||
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
if unit_fs_1.online:
|
||||
unit_fs_1.get_carrier()
|
||||
unit_fs_1.get_att_batch()
|
||||
unit_fs_1.get_gen_state()
|
||||
unit_fs_1.get_base_current_temp()
|
||||
unit_fs_1.get_base_can_macro()
|
||||
if unit_fs_2.online:
|
||||
unit_fs_2.get_carrier()
|
||||
unit_fs_2.get_att_batch()
|
||||
unit_fs_2.get_gen_state()
|
||||
unit_fs_2.get_base_current_temp()
|
||||
unit_fs_2.get_base_can_macro()
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
setup_fs(unit_fs_1, meta_device[2])
|
||||
setup_fs(unit_fs_2, meta_device[2])
|
||||
#ip_fs_3 = meta_device[5]
|
||||
|
||||
|
||||
func setup_fs(unit_fs: Node, mode_prd: int) -> void:
|
||||
var freq: int
|
||||
var att: float
|
||||
|
||||
if mode_prd == Constants.MODE.PRD_H:
|
||||
freq = Constants.FS_FREQ.f2 if unit_fs == Network.unit_fs_1 else Constants.FS_FREQ.f3
|
||||
att = Constants.FS_ATT['ПРД-Н1'][0] if unit_fs == Network.unit_fs_1 else Constants.FS_ATT['ПРД-Н1'][1]
|
||||
|
||||
elif mode_prd == Constants.MODE.PRD_B:
|
||||
freq = Constants.FS_FREQ.f4 if unit_fs == Network.unit_fs_1 else Constants.FS_FREQ.f5
|
||||
att = Constants.FS_ATT['ПРД-В1'][0] if unit_fs == Network.unit_fs_1 else Constants.FS_ATT['ПРД-В1'][1]
|
||||
|
||||
elif mode_prd == Constants.MODE.PRD_K:
|
||||
freq = Constants.FS_FREQ.f6 if unit_fs == Network.unit_fs_1 else Constants.FS_FREQ.f7
|
||||
att = Constants.FS_ATT['ПРД-К1'][0] if unit_fs == Network.unit_fs_1 else Constants.FS_ATT['ПРД-К1'][1]
|
||||
#var freq = Constants.FS_FREQ.f1 if unit_fs = Network.unit_fs_1 else
|
||||
|
||||
if unit_fs.online:
|
||||
unit_fs.set_gen_state(false)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
unit_fs.get_gen_state()
|
||||
unit_fs.set_gen_state(true)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
unit_fs.set_carrier(freq * 1_000_000)
|
||||
unit_fs.set_att_batch(att)
|
||||
|
||||
unit_fs.get_carrier()
|
||||
unit_fs.get_att_batch()
|
||||
unit_fs.get_base_current_temp()
|
||||
unit_fs.get_base_can_macro()
|
||||
unit_fs.get_gen_state()
|
||||
|
||||
Reference in New Issue
Block a user