на исправление контроля
This commit is contained in:
@@ -7,7 +7,6 @@ var flag_mode = Constants.ADDRESSES[0][3]
|
|||||||
var broadcast_packet: PackedByteArray
|
var broadcast_packet: PackedByteArray
|
||||||
var node_select1: Node
|
var node_select1: Node
|
||||||
var node_select2: Node
|
var node_select2: Node
|
||||||
var flag_yau_control: bool
|
|
||||||
var CONTROL_TABLE: Array
|
var CONTROL_TABLE: Array
|
||||||
var isa_from_yau07b: Dictionary = {}
|
var isa_from_yau07b: Dictionary = {}
|
||||||
var JSOON = JSON.new()
|
var JSOON = JSON.new()
|
||||||
@@ -147,7 +146,7 @@ func _ready() -> void:
|
|||||||
for key in Constants.ATT_DICT:
|
for key in Constants.ATT_DICT:
|
||||||
node_select_yau_07b.get_node2(1, 4).add_item(key)
|
node_select_yau_07b.get_node2(1, 4).add_item(key)
|
||||||
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
|
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
|
||||||
|
|
||||||
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
|
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
|
||||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||||
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
|
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
|
||||||
@@ -190,11 +189,6 @@ func on_device_selected(selected_index: int) -> void:
|
|||||||
status_pribor = get_select_device.get_item_text(selected_index).strip_edges().substr(4)
|
status_pribor = get_select_device.get_item_text(selected_index).strip_edges().substr(4)
|
||||||
|
|
||||||
|
|
||||||
## From Network status about yau-07
|
|
||||||
func _on_yau_status(yau_status: bool) -> void:
|
|
||||||
flag_yau_control = yau_status
|
|
||||||
|
|
||||||
|
|
||||||
func _on_read_isa(unit_isa_ports: Dictionary) -> void:
|
func _on_read_isa(unit_isa_ports: Dictionary) -> void:
|
||||||
isa_from_yau07b = unit_isa_ports
|
isa_from_yau07b = unit_isa_ports
|
||||||
var isa_data: Dictionary = {}
|
var isa_data: Dictionary = {}
|
||||||
@@ -259,7 +253,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_data_fs_1(fs_1_data):
|
func _on_data_fs_1(fs_1_data):
|
||||||
var node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
|
var node_select_fs_1: GDTable = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control
|
||||||
var GRP = fs_1_data.decode_u8(0x0)
|
var GRP = fs_1_data.decode_u8(0x0)
|
||||||
var CMD = fs_1_data.decode_u8(0x1)
|
var CMD = fs_1_data.decode_u8(0x1)
|
||||||
match CMD:
|
match CMD:
|
||||||
@@ -290,7 +284,7 @@ func _on_data_fs_1(fs_1_data):
|
|||||||
|
|
||||||
|
|
||||||
func _on_data_fs_2(fs_2_data):
|
func _on_data_fs_2(fs_2_data):
|
||||||
var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
|
var node_select_fs_2: GDTable = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
|
||||||
var GRP = fs_2_data.decode_u8(0x0)
|
var GRP = fs_2_data.decode_u8(0x0)
|
||||||
var CMD = fs_2_data.decode_u8(0x1)
|
var CMD = fs_2_data.decode_u8(0x1)
|
||||||
match CMD:
|
match CMD:
|
||||||
@@ -324,23 +318,9 @@ func _on_data_fs_2(fs_2_data):
|
|||||||
func draw_tabl(tbl: Node, row: Array, count_row: int):
|
func draw_tabl(tbl: Node, row: Array, count_row: int):
|
||||||
for i_row in count_row:
|
for i_row in count_row:
|
||||||
tbl.add_row(row[i_row])
|
tbl.add_row(row[i_row])
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
func _on_data_received(data_from_yau_07):
|
func _on_data_received(data_from_yau_07):
|
||||||
if not flag_yau_control:
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
## УГ
|
|
||||||
var _DKM: int = data_from_yau_07.decode_u16(Constants.DataIndices.DKM) # ДКМ от УГ
|
|
||||||
#node_select1.set_node_text(2, 0, '%d' % dry_contact)
|
|
||||||
#node_select1.set_node_text(3, 0, '%d' % DKM)
|
|
||||||
|
|
||||||
|
|
||||||
## УКП
|
## УКП
|
||||||
for i in range(6): ## Мощность от УКП_1
|
for i in range(6): ## Мощность от УКП_1
|
||||||
var power_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_1 + 2 * i)
|
var power_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_1 + 2 * i)
|
||||||
@@ -477,11 +457,13 @@ func set_tab_and_buttons(tab_index: int, button_name: String) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func on_btn_select(intem_from_sector: int) -> void:
|
func on_btn_select(intem_from_sector: int) -> void:
|
||||||
var node_select_device = $TabContainer/PRD/select_dev
|
Network.send_array = []
|
||||||
|
var node_select_device: GDTable = $TabContainer/PRD/select_dev
|
||||||
var get_select_device = node_select_device.get_node2(1, 0)
|
var get_select_device = node_select_device.get_node2(1, 0)
|
||||||
var meta = get_select_device.get_item_metadata(intem_from_sector)
|
var meta = get_select_device.get_item_metadata(intem_from_sector)
|
||||||
Network.on_command_change_device(meta)
|
|
||||||
Constants.CURRENT_MODE = meta[2]
|
Constants.CURRENT_MODE = meta[2]
|
||||||
|
Network.on_command_change_device(meta)
|
||||||
|
Network.read_port_isa([Constants.BASE_PORTS.UG+8, Constants.BASE_PORTS.UG+6])
|
||||||
_on_start_fs_1()
|
_on_start_fs_1()
|
||||||
_on_start_fs_2()
|
_on_start_fs_2()
|
||||||
|
|
||||||
@@ -608,7 +590,21 @@ func _on_get_status_1(toggled_btn):
|
|||||||
|
|
||||||
|
|
||||||
func _on_set_ferq_1(freq: String):
|
func _on_set_ferq_1(freq: String):
|
||||||
Network.set_fs_ferq_carrier(int(freq) * 1_000_000)
|
# Проверка на наличие символов в строке freq
|
||||||
|
var regex = RegEx.new()
|
||||||
|
regex.compile("^[0-9]+$")
|
||||||
|
if not regex.search(freq):
|
||||||
|
print_debug('Ошибка: частота должна быть числом без букв')
|
||||||
|
return
|
||||||
|
# Преобразование строки в число
|
||||||
|
var freq_int = int(freq) * 1_000_000
|
||||||
|
|
||||||
|
# Проверка на диапазон
|
||||||
|
if freq_int < 370 * 1_000_000 or freq_int > 6100 * 1_000_000:
|
||||||
|
print_debug('Некорректная частота')
|
||||||
|
return
|
||||||
|
|
||||||
|
Network.set_fs_ferq_carrier(freq_int)
|
||||||
|
|
||||||
|
|
||||||
func _on_set_att_1(att: String):
|
func _on_set_att_1(att: String):
|
||||||
@@ -639,7 +635,20 @@ func _on_get_status_2(toggled_btn):
|
|||||||
|
|
||||||
|
|
||||||
func _on_set_ferq_2(freq: String):
|
func _on_set_ferq_2(freq: String):
|
||||||
Network.set_fs_ferq_carrier_2(int(freq) * 1_000_000)
|
# Проверка на наличие символов в строке freq
|
||||||
|
var regex = RegEx.new()
|
||||||
|
regex.compile("^[0-9]+$")
|
||||||
|
if not regex.search(freq):
|
||||||
|
print_debug('Ошибка: частота должна быть числом без букв')
|
||||||
|
return
|
||||||
|
# Преобразование строки в число
|
||||||
|
var freq_int = int(freq) * 1_000_000
|
||||||
|
|
||||||
|
# Проверка на диапазон
|
||||||
|
if freq_int < 370 * 1_000_000 or freq_int > 6100 * 1_000_000:
|
||||||
|
print_debug('Некорректная частота')
|
||||||
|
return
|
||||||
|
Network.set_fs_ferq_carrier_2(freq_int)
|
||||||
|
|
||||||
|
|
||||||
func _on_set_att_2(att: String):
|
func _on_set_att_2(att: String):
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ const OUT_EMS_G: Array = [
|
|||||||
const OUT_x128: Array = [
|
const OUT_x128: Array = [
|
||||||
'Р',
|
'Р',
|
||||||
'К',
|
'К',
|
||||||
'Откл.',
|
'Откл',
|
||||||
'1'
|
'1'
|
||||||
]
|
]
|
||||||
const RAY_DICT: Array = [
|
const RAY_DICT: Array = [
|
||||||
|
|||||||
@@ -249,6 +249,8 @@ func start_work_fs():
|
|||||||
counter_fs_1 = 0
|
counter_fs_1 = 0
|
||||||
unit_fs.start_session(counter_fs_1, client_fs_1)
|
unit_fs.start_session(counter_fs_1, client_fs_1)
|
||||||
counter_fs_1 += 1
|
counter_fs_1 += 1
|
||||||
|
unit_fs.set_att_batch(19.0, counter_fs_1, client_fs_1)
|
||||||
|
counter_fs_1 += 1
|
||||||
unit_fs.get_gen_state(counter_fs_1, client_fs_1)
|
unit_fs.get_gen_state(counter_fs_1, client_fs_1)
|
||||||
counter_fs_1 += 1
|
counter_fs_1 += 1
|
||||||
unit_fs.get_att_batch(counter_fs_1, client_fs_1)
|
unit_fs.get_att_batch(counter_fs_1, client_fs_1)
|
||||||
@@ -341,6 +343,8 @@ func start_work_fs_2():
|
|||||||
counter_fs_2 = 0
|
counter_fs_2 = 0
|
||||||
unit_fs.start_session(counter_fs_2, client_fs_2)
|
unit_fs.start_session(counter_fs_2, client_fs_2)
|
||||||
counter_fs_2 += 1
|
counter_fs_2 += 1
|
||||||
|
unit_fs.set_att_batch(19.0, counter_fs_2, client_fs_2)
|
||||||
|
counter_fs_2 += 1
|
||||||
unit_fs.get_gen_state(counter_fs_2, client_fs_2)
|
unit_fs.get_gen_state(counter_fs_2, client_fs_2)
|
||||||
counter_fs_2 += 1
|
counter_fs_2 += 1
|
||||||
unit_fs.get_att_batch(counter_fs_2, client_fs_2)
|
unit_fs.get_att_batch(counter_fs_2, client_fs_2)
|
||||||
|
|||||||
Reference in New Issue
Block a user