Доработка. WIP Отображение кластеров на шкале
This commit is contained in:
@@ -49,6 +49,7 @@ var cnames_table: Dictionary[StringName, Dictionary]
|
||||
var pnames_scale: Dictionary[StringName, int]
|
||||
#endregion
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Инициализировать переменные
|
||||
for i in index_to_unit_names.size():
|
||||
@@ -70,7 +71,7 @@ func _ready() -> void:
|
||||
for cell_scn in table_cells:
|
||||
table_cell_row.append(load(cell_scn))
|
||||
|
||||
# Расскраска чётные-нечётные
|
||||
# Расскрасить чётные-нечётные
|
||||
for node in get_tree().get_nodes_in_group('нечётные'):
|
||||
node.get_node('panel_rx').back_color = color_odd
|
||||
node.get_node('panel_tx').back_color = color_odd
|
||||
@@ -78,7 +79,7 @@ func _ready() -> void:
|
||||
node.get_node('panel_rx').back_color = color_even
|
||||
node.get_node('panel_tx').back_color = color_even
|
||||
|
||||
# Настрить таблицу
|
||||
# Настроить таблицу
|
||||
var ctable: = $'таблица/сетка'
|
||||
ctable.set_header(header_row)
|
||||
ctable.set_header_text(table_header_text)
|
||||
@@ -90,18 +91,20 @@ func _ready() -> void:
|
||||
ctable.set_header_min_hight(table_rows_hight)
|
||||
ctable.pin_header2()
|
||||
|
||||
# Подключить обработчики
|
||||
for nm in yems_data_info.keys():
|
||||
# Подключить обработчик для приёма данных
|
||||
for nm in yems_data_info:
|
||||
var yems_unit = network.get_unit_instance(nm)
|
||||
yems_unit.connect('data_received', on_data_received.bind(nm))
|
||||
|
||||
|
||||
## Обрабатывает событие [b]data_received[/b]
|
||||
func on_data_received(data: Dictionary, nm: StringName):
|
||||
yems_data_info[nm].merge(data, true)
|
||||
map_yems_data_to_table(nm)
|
||||
map_yems_data_to_scale(nm)
|
||||
|
||||
|
||||
## Отображает кластеры в таблицу
|
||||
## [param nm] - имя устройства
|
||||
func map_yems_data_to_table(nm: StringName):
|
||||
var unit_data = yems_data_info.get(nm)
|
||||
@@ -128,6 +131,8 @@ func map_yems_data_to_table(nm: StringName):
|
||||
ctable.set_row_min_hight(i_row, table_rows_hight)
|
||||
|
||||
|
||||
## Отображает кластеры на шкале
|
||||
## [param nm] - имя устройства
|
||||
func map_yems_data_to_scale(nm: StringName):
|
||||
var unit_data = yems_data_info.get(nm)
|
||||
if not unit_data: return # Данных ещё нет
|
||||
|
||||
Reference in New Issue
Block a user