modul fs 1
This commit is contained in:
@@ -2,7 +2,7 @@ extends Node2D
|
||||
|
||||
signal read_ems_g_start()
|
||||
signal read_ems_g_finish()
|
||||
var unit_fs_1 = Fs.FGOS.new()
|
||||
|
||||
var flag_mode = Constants.ADDRESSES[0][3]
|
||||
var broadcast_packet: PackedByteArray
|
||||
var node_select1: Node
|
||||
@@ -90,10 +90,11 @@ func _ready() -> void:
|
||||
node_select_fs_2.set_node_text(1, 0, 'Литера 3')
|
||||
node_select_fs_2.set_node_text(0, 1, 'Состояние')
|
||||
node_select_fs_2.set_node_text(0, 2, 'Частота')
|
||||
#node_select_fs_2.get_node2(1, 2).placeholder_text = '500'
|
||||
node_select_fs_2.get_node2(1, 2).placeholder_text = 'в МГц'
|
||||
node_select_fs_2.get_node2(1, 2).editable = true
|
||||
node_select_fs_2.set_node_text(0, 3, 'Аттенюатор')
|
||||
#node_select_fs_2.get_node2(1, 3).placeholder_text = '38.7'
|
||||
#node_select_fs_2.get_node2(1, 3).d = true
|
||||
node_select_fs_2.get_node2(1, 3).placeholder_text = 'в dB'
|
||||
node_select_fs_2.get_node2(1, 3).editable = true
|
||||
node_select_fs_2.set_node_text(0, 4, 'Генератор')
|
||||
node_select_fs_2.set_node_text(0, 5, 'fpga')
|
||||
node_select_fs_2.set_node_text(0, 6, 'СИ 3 от ФС')
|
||||
@@ -136,7 +137,8 @@ func _ready() -> void:
|
||||
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
|
||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
|
||||
Network.connect('data_from_fs_1', Callable(self, '_on_data_fs_1'))
|
||||
Network.connect('data_from_fs_1', _on_data_fs_1)
|
||||
Network.connect('data_from_fs_2', _on_data_fs_2)
|
||||
|
||||
node_select_yau_07b.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret1'))
|
||||
node_select_yau_07b.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_1'))
|
||||
@@ -150,9 +152,13 @@ func _ready() -> void:
|
||||
node_select_yau_07b_2.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_fgos_2'))
|
||||
|
||||
node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_1'))
|
||||
node_select_fs_1.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att'))
|
||||
node_select_fs_1.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq'))
|
||||
|
||||
node_select_fs_1.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_1'))
|
||||
node_select_fs_1.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_1'))
|
||||
|
||||
node_select_fs_2.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2'))
|
||||
node_select_fs_2.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_2'))
|
||||
node_select_fs_2.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_2'))
|
||||
|
||||
|
||||
func draw_control_panel_prd(mode) -> void:
|
||||
for node_path in Constants.NODE_MAP:
|
||||
@@ -223,7 +229,6 @@ func _on_data_fs_1(fs_1_data):
|
||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_1.set_node_text(1, 5, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
|
||||
#$read.text = str(fs_1_data.hex_encode())
|
||||
|
||||
|
||||
func _on_data_fs_2(fs_2_data):
|
||||
@@ -514,26 +519,37 @@ func _on_read_isa_pressed() -> void:
|
||||
func set_bits(v, a, m):
|
||||
return (~m) & v | a & m
|
||||
|
||||
|
||||
## 1 ФС
|
||||
func _on_start_fs_1():
|
||||
unit_fs_1.start_session()
|
||||
unit_fs_1.base_get_current_temp()
|
||||
Network.start_work_fs()
|
||||
|
||||
|
||||
func _on_get_status_1(toggled_btn):
|
||||
var inverted_state = not toggled_btn
|
||||
unit_fs_1.set_gen_state(inverted_state)
|
||||
unit_fs_1.get_gen_state()
|
||||
Network.get_fs_gen_status(inverted_state)
|
||||
|
||||
|
||||
func _on_set_ferq(freq):
|
||||
unit_fs_1.set_carrier(int(freq) * 1_000_000)
|
||||
unit_fs_1.base_get_current_temp()
|
||||
unit_fs_1.get_carrier()
|
||||
func _on_set_ferq_1(freq: String):
|
||||
Network.set_fs_ferq_carrier(int(freq) * 1_000_000)
|
||||
|
||||
|
||||
func _on_set_att(att):
|
||||
unit_fs_1.set_att_batch(float(att))
|
||||
unit_fs_1.base_get_current_temp()
|
||||
unit_fs_1.base_get_current_temp()
|
||||
unit_fs_1.get_att_batch()
|
||||
func _on_set_att_1(att: String):
|
||||
Network.set_fs_attenuation(float(att))
|
||||
|
||||
|
||||
## 2 ФС
|
||||
func _on_start_fs_2():
|
||||
Network.start_work_fs()
|
||||
|
||||
|
||||
func _on_get_status_2(toggled_btn):
|
||||
var inverted_state = not toggled_btn
|
||||
Network.get_fs_gen_status(inverted_state)
|
||||
|
||||
|
||||
func _on_set_ferq_2(freq: String):
|
||||
Network.set_fs_ferq_carrier(int(freq) * 1_000_000)
|
||||
|
||||
|
||||
func _on_set_att_2(att: String):
|
||||
Network.set_fs_attenuation(float(att))
|
||||
|
||||
Reference in New Issue
Block a user