Merge remote-tracking branch 'MaD_CaT/master'

# Conflicts:
#	scenes/header.tscn
#	scenes/tab_switch.gd
#	scenes/журнал.gd
#	scenes/работа.gd
#	scripts/capsrpb.gd
#	scripts/repnetwork.gd
#	scripts/repsettings.gd
#	scripts/threats.gd
#	scripts/tools.gd
#	table/table.gd
This commit is contained in:
sasha80
2023-07-25 15:47:55 +03:00
40 changed files with 959 additions and 58 deletions

BIN
data/document-new-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dd60btbqnpiqw"
path="res://.godot/imported/document-new-0.png-4076926ba4469926b76b7d685aad96aa.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/document-new-0.png"
dest_files=["res://.godot/imported/document-new-0.png-4076926ba4469926b76b7d685aad96aa.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
data/document-save-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://coqg6wsftvtxr"
path="res://.godot/imported/document-save-0.png-beb8a5dba6cf2046205d50b7f2a0303a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/document-save-0.png"
dest_files=["res://.godot/imported/document-save-0.png-beb8a5dba6cf2046205d50b7f2a0303a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
data/edit-copy-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cywuevvpkxl7v"
path="res://.godot/imported/edit-copy-0.png-669a30c517f56dcd05ee05650e14794f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/edit-copy-0.png"
dest_files=["res://.godot/imported/edit-copy-0.png-669a30c517f56dcd05ee05650e14794f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bvxv33noium2h"
path="res://.godot/imported/кнопка-эмс-0.png-55c9c814b93a55a54b5133cafc1cc584.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/кнопка-эмс-0.png"
dest_files=["res://.godot/imported/кнопка-эмс-0.png-55c9c814b93a55a54b5133cafc1cc584.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://nfpish471rjj"
path="res://.godot/imported/кнопка-эмс-1.png-5000e69bb949ac3e094bd419f59b8ee8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/кнопка-эмс-1.png"
dest_files=["res://.godot/imported/кнопка-эмс-1.png-5000e69bb949ac3e094bd419f59b8ee8.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dvl3sq036gn75"
path="res://.godot/imported/эмс-бланк-замыкание.png-4318b52796ef34b4e1884210148903b1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/эмс-бланк-замыкание.png"
dest_files=["res://.godot/imported/эмс-бланк-замыкание.png-4318b52796ef34b4e1884210148903b1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://pfoscstbm025"
path="res://.godot/imported/эмс-бланк-перем.png-46e3d2ae09c41e17eda0c5c975f3d6f1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/эмс-бланк-перем.png"
dest_files=["res://.godot/imported/эмс-бланк-перем.png-46e3d2ae09c41e17eda0c5c975f3d6f1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bwddxs24es81u"
path="res://.godot/imported/эмс-бланк-пост.png-26bac763879d76be257d6217d43b0164.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/эмс-бланк-пост.png"
dest_files=["res://.godot/imported/эмс-бланк-пост.png-26bac763879d76be257d6217d43b0164.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
data/эмс-бланк.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://belwchvdktrw0"
path="res://.godot/imported/эмс-бланк.png-da5900abaf207dcfac692be656729ba5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/эмс-бланк.png"
dest_files=["res://.godot/imported/эмс-бланк.png-da5900abaf207dcfac692be656729ba5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dahjma3aqkfc0"
path="res://.godot/imported/эмс-указатель.png-35341c0a7eb002ba8773df81a1ebc5f8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/эмс-указатель.png"
dest_files=["res://.godot/imported/эмс-указатель.png-35341c0a7eb002ba8773df81a1ebc5f8.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -30,6 +30,7 @@ yau07="*res://scripts/yau07.gd"
capsrpb="*res://scripts/capsrpb.gd"
Table="*res://table/table.gd"
Threats="*res://scripts/threats.gd"
YemsDevs="*res://scripts/yems_devs.gd"
[debug]
@@ -49,7 +50,6 @@ gdscript/warnings/integer_division=0
window/size/viewport_width=1600
window/size/viewport_height=1200
window/size/mode=3
window/subwindows/embed_subwindows=false
window/stretch/mode="viewport"
window/vsync/vsync_mode=false

0
scenes/header.tscn Normal file
View File

View File

@@ -4,28 +4,28 @@ extends PanelContainer
@export var texture_state0: Texture2D = preload('res://data/кнопка-квадрат-0.png'):
set(val): $state.set_texture(val)
set(val): $state.set_texture(val)
@export var texture_state1: Texture2D = preload('res://data/кнопка-квадрат-1.png'):
set(val): $state.set_texture(val)
set(val): $state.set_texture(val)
@export var text: String = '':
set(val): $button.set_text(val)
get: return $button.get_text()
set(val): $button.set_text(val)
get: return $button.get_text()
@export var pressed: bool = false:
set(val): $button.set_pressed(val)
get: return $button.is_pressed()
set(val): $button.set_pressed(val)
get: return $button.is_pressed()
@export var toggle_mode: bool = false:
set(val):
if is_inside_tree():
$button.set_toggle_mode(val)
get: return $button.is_toggle_mode()
set(val):
if is_inside_tree():
$button.set_toggle_mode(val)
get: return $button.is_toggle_mode()
func set_text (val: String): $button.set_text(val)
@@ -33,8 +33,8 @@ func set_pressed (val: bool): $button.set_pressed(val)
func set_toggle_mode (val: bool):
if is_inside_tree():
$button.set_toggle_mode(val)
if is_inside_tree():
$button.set_toggle_mode(val)
func get_text(): return $button.get_text()
@@ -43,9 +43,9 @@ func is_toggle_mode(): return $button.is_toggle_mode()
func _on_button_toggled(val: bool):
if val: $state.set_texture(texture_state1)
else: $state.set_texture(texture_state0)
if val: $state.set_texture(texture_state1)
else: $state.set_texture(texture_state0)
func button_connect(button_signal: String, proc: Callable):
$button.connect(button_signal, proc)
$button.connect(button_signal, proc)

View File

@@ -4,6 +4,7 @@
[ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа.tscn" id="1_uow82"]
[ext_resource type="PackedScene" uid="uid://lwmw4egynmd1" path="res://scenes/контроль.tscn" id="2_83m7a"]
[ext_resource type="PackedScene" uid="uid://trt0q8th3bn2" path="res://scenes/журнал.tscn" id="3_hgnup"]
[ext_resource type="PackedScene" uid="uid://c6uls7q4e2m4h" path="res://scenes/ЭМС.tscn" id="4_2bmbm"]
[node name="tab_switch" type="TabContainer"]
offset_right = 1600.0
@@ -20,3 +21,7 @@ layout_mode = 2
[node name="журнал" parent="." instance=ExtResource("3_hgnup")]
visible = false
layout_mode = 2
[node name="ЭМС" parent="." instance=ExtResource("4_2bmbm")]
visible = false
layout_mode = 2

190
scenes/ЭМС.gd Normal file
View File

@@ -0,0 +1,190 @@
extends Panel
var TableHeader = preload('res://table/header.tscn')
var TableNode = preload('res://scenes/ячейка-1.tscn')
var CellYemsButton = preload('res://scenes/кнопка-эмс.tscn')
var CellLineEdit = preload('res://scenes/ячейка-2.tscn')
var CellState = preload('res://scenes/состояния-эмс.tscn')
var CellOptBtn = preload('res://scenes/кнопка-5.tscn')
# Таблица с данными для входов, первое значение - индекс устройства в ячейке КЭМС
const INPUT_ROWS = [
[1,['НРЛС МР-231S, УИЗП', 'X31', '0', '0']],
[2,['НРЛС МР-231S, Строб ЭМС', 'X32', '0', '0']],
[3,['НРЛС МР-231-3, УИЗП', 'X34', '0', '0']],
[4,['НРЛС МР-231-3, Строб ЭМС', 'X35', '0', '0']],
[5,['ЦИСВС-1010, УИЗП', 'X43', '0', '0']],
[8,['4302-01, 4302-04, УИЗП', 'X46', '0', '0']],
[11,['НРЛС МР-231S, УИЗП', 'X51', '0', '0']],
[12,['НРЛС МР-231S, Строб ЭМС', 'X52', '0', '0']],
[13,['НРЛС МР-231-3, УИЗП', 'X54', '0', '0']],
[14,['НРЛС МР-231-3, Строб ЭМС', 'X55', '0', '0']],
[15,['ЦИСВС-1010, УИЗП', 'X23', '0', '0']],
[21,['НРЛС МР-231S, УИЗП', 'X21', '0', '0']],
[22,['НРЛС МР-231S, Строб ЭМС', 'X22', '0', '0']],
[23,['НРЛС МР-231-3, УИЗП', 'X24', '0', '0']],
[24,['НРЛС МР-231-3, Строб ЭМС', 'X25', '0', '0']],
[25,['ЦИСВС-1010, УИЗП', 'X23', '0', '0']]]
# Таблица с данными для выходов, первое значение - индекс устройства в ячейке КЭМС
const OUTPUT_ROWS = [
[41,['НРЛС МР-231S, БИ', 'X61', '0', '0']],
[42,['НРЛС МР-231S', 'X62', '0', '0']],
[43,['НРЛС МР-231-3, БИ', 'X64', '0', '0']],
[44,['НРЛС МР-231-3', 'X65', '0', '0']],
[45,['ЦИСВС-1010, БИ', 'X63', '0', '0']],
[46,['4302-01, 4302-04, БИ', 'X66', '0', '0']],
[48,['НРЛС 11111111', 'X69', '0', '0']],
[49,['НРЛС-222222, БИ', 'X62', '0', '0']]]
# Режимы работы выходов
const OUT_MODE: Array = ['Работа', 'Контроль', '1', '0']
const COLUMN_OPTS_BTN: Array = [6]
const TABLE_ENTRY_COLUMNS: Array = [2,3,5]
var g_in_devices : Dictionary # Словарь с входными устройствами КЭМС
var g_out_devices : Dictionary # Словарь с выходными устройствами КЭМС
var posx: int = 50 # Позиция элементов по x
var posy: int = 80 # Позиция элементов по y
func _ready() -> void:
$tbl_in.set_position(Vector2(posx,posy))
$tbl_out.set_position(Vector2(posx,len(INPUT_ROWS)*33+posy+10))
$tbl_files.set_position(Vector2(posx + 890,len(INPUT_ROWS)*33+posy+300))
$btn_new.set_position(Vector2(posx + 1270,len(INPUT_ROWS)*33+posy+294))
$btn_save.set_position(Vector2(posx + 1270,len(INPUT_ROWS)*33+posy+344))
$btn_edit.set_position(Vector2(posx + 1270,len(INPUT_ROWS)*33+posy+394))
$lbl_online.set_position(Vector2(posx,posy-40))
$marker_in.set_position(Vector2(posx-15,posy+35))
$marker_out.set_position(Vector2(posx-15,len(INPUT_ROWS)*33+posy+45))
$btn_flash_read.set_position(Vector2(posx+1400,posy))
$btn_flash_write.set_position(Vector2(posx+1400,posy+35))
call_deferred('init_tbl_out')
call_deferred('init_tbl_in')
call_deferred('init_tbl_files')
$btn_flash_read.button_connect('pressed', Callable(self, 'on_btn_flash_read').bind($btn_flash_read))
$btn_flash_write.button_connect('pressed', Callable(self, 'on_btn_flash_write').bind($btn_flash_write))
$tbl_in.connect('row_pressed', Callable(self, 'on_row_pressed'))
$tbl_out.connect('row_pressed', Callable(self, 'on_row_pressed'))
func on_btn_flash_read(btn):
await get_tree().create_timer(0.1).timeout
btn.pressed = false
func on_btn_flash_write(btn):
await get_tree().create_timer(0.1).timeout
btn.pressed = false
func on_row_pressed(i_row: int):
$tbl_in.set_row_selected(i_row, false)
func init_tbl_files():
$tbl_files.set_header([TableHeader, TableHeader, TableHeader])
$tbl_files.set_header_text(['Имя файла', 'Размер', 'Дата'])
$tbl_files.set_columns_min_size([200, 70, 100])
func init_tbl_out():
var header_text = ['Выходы', 'Разъём', 'мкс', 'мкс', 'Состояние', 'Частота, Мгц', 'Режим']
$tbl_out.set_header([TableHeader, TableHeader, TableHeader, TableHeader, TableHeader, TableHeader, TableHeader])
$tbl_out.set_header_text(header_text)
for item in OUTPUT_ROWS:
$tbl_out.add_row([TableNode, TableNode, CellLineEdit, CellLineEdit, CellState, CellLineEdit, CellOptBtn])
var row_index : int = $tbl_out.get_rows_count() - 1
var params : Array = item[1]
var out_dev = YemsDevs.OutDev.new(item[0], params, row_index)
g_out_devices[item[0]] = out_dev
for i in range(len(header_text)):
if i < len(params):
var cell = $tbl_out.get_node2(i, row_index)
cell.text = params[i]
$tbl_out.set_node_user_data(i, row_index, out_dev)
if i in COLUMN_OPTS_BTN:
var cell = $tbl_out.get_node2(i, row_index)
for opt in OUT_MODE:
cell.add_item(opt)
cell.select(0)
$tbl_out.set_columns_min_size([270, 100, 70, 70, 100, 100, 100])
$tbl_out.set_callbacks(self, 'text_submitted', 'on_edit_entry_in', TABLE_ENTRY_COLUMNS, [])
$tbl_out.set_callbacks(self, 'item_selected', 'on_item_selected', COLUMN_OPTS_BTN, [])
func init_tbl_in():
var header_type: Array = [TableHeader, TableHeader, TableHeader, TableHeader, TableHeader, TableHeader, TableHeader]
var header_text: Array = ['Входы', 'Разъём', 'мкс', 'мкс', 'Состояние', 'Частота, Мгц',' ']
var row_type: Array = [TableNode, TableNode, CellLineEdit, CellLineEdit, CellState, CellLineEdit, TableNode]
var yams_alligment_in: Array = [ HORIZONTAL_ALIGNMENT_LEFT, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER]
var column_size: Array = [270, 100, 70, 70, 100, 100, 300]
var dot_collums: Array
var column_offset: int = 7
for i in range(len(OUTPUT_ROWS)):
header_type.append(TableHeader)
header_text.append('...')
row_type.append(CellYemsButton)
yams_alligment_in.append(HORIZONTAL_ALIGNMENT_LEFT)
column_size.append(25)
dot_collums.append(column_offset+i)
$tbl_in.set_header(header_type)
$tbl_in.set_header_text(header_text)
$tbl_in.set_columns_alignments(yams_alligment_in)
for item in INPUT_ROWS:
$tbl_in.add_row(row_type)
var row_index : int = $tbl_in.get_rows_count() - 1
var params : Array = item[1]
var in_dev: YemsDevs.InDev = YemsDevs.InDev.new(item[0], params, row_index)
g_in_devices[item[0]] = in_dev
for i in range(len(row_type)):
if i < len(params):
var node = $tbl_in.get_node2(i, row_index)
node.text = params[i]
if i in dot_collums:
var btn = $tbl_in.get_node2(i, row_index)
var out_dev = g_out_devices[OUTPUT_ROWS[i-column_offset][0]]
in_dev.out_dots = [btn, out_dev]
btn.button_connect('pressed', Callable(self, 'on_dot_button').bind(btn, i, row_index))
btn.connect('mouse_entered', Callable(self, 'on_mouse_entered').bind(btn, i - dot_collums[0], row_index))
$tbl_in.set_node_user_data(i, row_index, in_dev)
$tbl_in.set_columns_min_size(column_size)
$tbl_in.set_callbacks(self, 'text_submitted', 'on_edit_entry_in', TABLE_ENTRY_COLUMNS, [])
func on_dot_button(btn, i: int, j: int):
""" Вызывается при нажатии на кнопку-точку (соединение)
i - индекс входа, j - индекс выхода """
print('on_dot_button(%d, %d)' % [i, j])
func on_edit_entry_in(text : String, entry):
var indexis = $tbl_in.get_key_indexes(entry[0].name)
var row_i = indexis[1]
var col_i = indexis[0]
print('ЭМС.gd -> on_edit_entry_in', text, row_i, col_i)
func on_edit_entry_out(text : String, entry):
var indexis = $tbl_out.get_key_indexes(entry[0].name)
var row_i = indexis[1]
var col_i = indexis[0]
print('ЭМС.gd -> on_edit_entry_out', text, row_i, col_i)
func on_item_selected(item_num, node):
var optbtn_text = node[0].text
var indexis = $tbl_out.get_key_indexes(node[0].name)
var row_i = indexis[1]
var col_i = indexis[0]
print('ЭМС.gd -> on_item_selected row: %d col: %d text: %s' %[row_i, col_i, optbtn_text])
func on_mouse_entered(btn, i, j):
$marker_in.position.y = $tbl_in.position.y + btn.position.y + btn.size.y / 2
$marker_out.position.y = $tbl_out.position.y + (btn.size.y + 4) * i + btn.size.y / 2
func _process(delta):
pass

102
scenes/ЭМС.tscn Normal file
View File

@@ -0,0 +1,102 @@
[gd_scene load_steps=8 format=3 uid="uid://c6uls7q4e2m4h"]
[ext_resource type="Script" path="res://scenes/ЭМС.gd" id="1_t1s35"]
[ext_resource type="Script" path="res://table/table.gd" id="2_6x8yw"]
[ext_resource type="Texture2D" uid="uid://dahjma3aqkfc0" path="res://data/эмс-указатель.png" id="3_j3w75"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button_flat.tscn" id="4_v64lt"]
[ext_resource type="Texture2D" uid="uid://dd60btbqnpiqw" path="res://data/document-new-0.png" id="5_osu07"]
[ext_resource type="Texture2D" uid="uid://coqg6wsftvtxr" path="res://data/document-save-0.png" id="6_8684b"]
[ext_resource type="Texture2D" uid="uid://cywuevvpkxl7v" path="res://data/edit-copy-0.png" id="7_85ydm"]
[node name="ЭМС" type="Panel"]
offset_right = 1598.0
offset_bottom = 1201.0
script = ExtResource("1_t1s35")
[node name="lbl_online" type="Label" parent="."]
layout_mode = 0
offset_left = 30.0
offset_top = 4.0
offset_right = 166.0
offset_bottom = 30.0
theme_override_colors/font_color = Color(1, 0, 0, 1)
text = "Ячейка не на связи"
[node name="tbl_in" type="GridContainer" parent="."]
layout_mode = 0
offset_left = 30.0
offset_top = 46.0
offset_right = 825.0
offset_bottom = 182.0
script = ExtResource("2_6x8yw")
[node name="tbl_out" type="GridContainer" parent="."]
layout_mode = 0
offset_left = 46.0
offset_top = 588.0
offset_right = 598.0
offset_bottom = 688.0
script = ExtResource("2_6x8yw")
[node name="tbl_files" type="GridContainer" parent="."]
layout_mode = 0
offset_left = 1050.0
offset_top = 993.0
offset_right = 1602.0
offset_bottom = 1093.0
script = ExtResource("2_6x8yw")
[node name="marker_in" type="Sprite2D" parent="."]
modulate = Color(0.964706, 0.490196, 0, 1)
position = Vector2(19, 37)
texture = ExtResource("3_j3w75")
[node name="marker_out" type="Sprite2D" parent="."]
modulate = Color(0.964706, 0.490196, 0, 1)
position = Vector2(19, 77)
texture = ExtResource("3_j3w75")
[node name="btn_flash_read" parent="." instance=ExtResource("4_v64lt")]
layout_mode = 0
offset_left = 1446.0
offset_top = 55.0
offset_right = 1583.0
offset_bottom = 85.0
text = "Прочитать"
[node name="btn_flash_write" parent="." instance=ExtResource("4_v64lt")]
layout_mode = 0
offset_left = 1446.0
offset_top = 99.0
offset_right = 1583.0
offset_bottom = 129.0
text = "Записать"
[node name="btn_new" type="Button" parent="."]
layout_mode = 0
offset_left = 1453.0
offset_top = 960.0
offset_right = 1509.0
offset_bottom = 1016.0
focus_mode = 0
shortcut_feedback = false
shortcut_in_tooltip = false
icon = ExtResource("5_osu07")
[node name="btn_save" type="Button" parent="."]
layout_mode = 0
offset_left = 1453.0
offset_top = 1017.0
offset_right = 1509.0
offset_bottom = 1073.0
focus_mode = 0
icon = ExtResource("6_8684b")
[node name="btn_edit" type="Button" parent="."]
layout_mode = 0
offset_left = 1454.0
offset_top = 1074.0
offset_right = 1510.0
offset_bottom = 1130.0
focus_mode = 0
icon = ExtResource("7_85ydm")

View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://b37dpuas0emkc"]
[ext_resource type="Texture2D" uid="uid://bgekehgbqyddu" path="res://кнопка-3-1.png" id="1"]
[ext_resource type="Texture2D" uid="uid://caj3qxh8fo025" path="res://кнопка-3-0.png" id="2"]
[node name="TextureButton" type="TextureButton"]
modulate = Color(1.5, 1.5, 1.5, 1)
offset_right = 140.0
offset_bottom = 34.0
toggle_mode = true
action_mode = 0
texture_normal = ExtResource("2")
texture_pressed = ExtResource("1")

View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://bsafiravyb8yf"]
[ext_resource type="Texture2D" uid="uid://c2tdcajjqjxa0" path="res://индикатор-1-1.png" id="1"]
[ext_resource type="Texture2D" uid="uid://c0hlip7h568qk" path="res://индикатор-1-0.png" id="2"]
[node name="indicator_1" type="TextureButton"]
modulate = Color(1, 0.596078, 0.4, 1)
offset_right = 35.0
offset_bottom = 29.0
toggle_mode = true
button_mask = 0
texture_normal = ExtResource("2")
texture_pressed = ExtResource("1")

View File

@@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://dwcol6jg2syof"]
[node name="OptionButton" type="OptionButton"]

View File

@@ -0,0 +1,56 @@
@tool
extends PanelContainer
@export var texture_state0: Texture2D = preload('res://data/кнопка-эмс-1.png'):
set(val): $state.set_texture(val)
@export var texture_state1: Texture2D = preload('res://data/кнопка-эмс-0.png'):
set(val): $state.set_texture(val)
@export var text: String = '':
set(val): $button.set_text(val)
get: return $button.get_text()
@export var pressed: bool = false:
set(val): $button.set_pressed(val)
get: return $button.is_pressed()
@export var toggle_mode: bool = false:
set(val):
if is_inside_tree():
$button.set_toggle_mode(val)
get: return $button.is_toggle_mode()
func set_text (val: String): $button.set_text(val)
func set_pressed (val: bool): $button.set_pressed(val)
func set_toggle_mode (val: bool):
if is_inside_tree():
$button.set_toggle_mode(val)
func get_text(): return $button.get_text()
func is_pressed(): return $button.is_pressed()
func is_toggle_mode(): return $button.is_toggle_mode()
func _on_button_toggled(val: bool):
if val: $state.set_texture(texture_state1)
else: $state.set_texture(texture_state0)
func button_connect(button_signal: String, proc: Callable):
$button.connect(button_signal, proc)
func _on_button_mouse_entered():
emit_signal("mouse_entered")

View File

@@ -0,0 +1,51 @@
[gd_scene load_steps=9 format=3 uid="uid://gh3wqymu7cub"]
[ext_resource type="Script" path="res://scenes/кнопка-эмс.gd" id="1_pmsh3"]
[ext_resource type="Texture2D" uid="uid://nfpish471rjj" path="res://data/кнопка-эмс-1.png" id="2_0o537"]
[sub_resource type="StyleBoxEmpty" id="1"]
[sub_resource type="StyleBoxEmpty" id="6"]
[sub_resource type="StyleBoxEmpty" id="2"]
[sub_resource type="StyleBoxEmpty" id="3"]
[sub_resource type="StyleBoxEmpty" id="5"]
[sub_resource type="StyleBoxEmpty" id="4"]
[node name="container" type="PanelContainer"]
offset_right = 30.0
offset_bottom = 30.0
theme_override_styles/panel = SubResource("1")
script = ExtResource("1_pmsh3")
toggle_mode = true
[node name="state" type="NinePatchRect" parent="."]
show_behind_parent = true
layout_mode = 2
texture = ExtResource("2_0o537")
region_rect = Rect2(-1.60803, -1.94625, 31.9305, 25.9868)
patch_margin_left = 6
patch_margin_top = 5
patch_margin_right = 7
patch_margin_bottom = 5
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
[node name="button" type="Button" parent="."]
layout_mode = 2
theme_override_styles/normal = SubResource("6")
theme_override_styles/hover = SubResource("2")
theme_override_styles/pressed = SubResource("3")
theme_override_styles/disabled = SubResource("5")
theme_override_styles/focus = SubResource("4")
toggle_mode = true
clip_text = true
[node name="label" type="Label" parent="."]
layout_mode = 2
[connection signal="mouse_entered" from="button" to="." method="_on_button_mouse_entered"]
[connection signal="toggled" from="button" to="." method="_on_button_toggled"]

View File

@@ -2,41 +2,41 @@ extends Panel
const PRIBORS_RES = \
[['pribor_uf', 'res://scenes/pribor_uf.tscn'],
['pribor_rtr', 'res://scenes/pribor_rtr.tscn'],
['pribor_afsp_l', 'res://scenes/pribor_afsp_l.tscn'],
['pribor_afsp_r', 'res://scenes/pribor_afsp_r.tscn'],
['pribor_sch3', 'res://scenes/pribor_sch3.tscn'],
['pribor_spt_l', 'res://scenes/pribor_spt_l.tscn'],
['pribor_spt_r', 'res://scenes/pribor_spt_r.tscn'],
['pribor_prd_v_1', 'res://scenes/pribor_prd_v_1.tscn'],
['pribor_prd_n_1', 'res://scenes/pribor_prd_n_1.tscn'],
['pribor_prd_k_1', 'res://scenes/pribor_prd_k_1.tscn'],
['pribor_prd_v_2', 'res://scenes/pribor_prd_v_2.tscn'],
['pribor_prd_n_2', 'res://scenes/pribor_prd_n_2.tscn'],
['pribor_prd_k_2', 'res://scenes/pribor_prd_k_2.tscn'],
['pribor_prd_v_3', 'res://scenes/pribor_prd_v_3.tscn'],
['pribor_prd_n_3', 'res://scenes/pribor_prd_n_3.tscn'],
['pribor_prd_k_3', 'res://scenes/pribor_prd_k_3.tscn'],
['pribor_prd_v_4', 'res://scenes/pribor_prd_v_4.tscn'],
['pribor_prd_n_4', 'res://scenes/pribor_prd_n_4.tscn'],
['pribor_prd_k_4', 'res://scenes/pribor_prd_k_4.tscn']]
['pribor_rtr', 'res://scenes/pribor_rtr.tscn'],
['pribor_afsp_l', 'res://scenes/pribor_afsp_l.tscn'],
['pribor_afsp_r', 'res://scenes/pribor_afsp_r.tscn'],
['pribor_sch3', 'res://scenes/pribor_sch3.tscn'],
['pribor_spt_l', 'res://scenes/pribor_spt_l.tscn'],
['pribor_spt_r', 'res://scenes/pribor_spt_r.tscn'],
['pribor_prd_v_1', 'res://scenes/pribor_prd_v_1.tscn'],
['pribor_prd_n_1', 'res://scenes/pribor_prd_n_1.tscn'],
['pribor_prd_k_1', 'res://scenes/pribor_prd_k_1.tscn'],
['pribor_prd_v_2', 'res://scenes/pribor_prd_v_2.tscn'],
['pribor_prd_n_2', 'res://scenes/pribor_prd_n_2.tscn'],
['pribor_prd_k_2', 'res://scenes/pribor_prd_k_2.tscn'],
['pribor_prd_v_3', 'res://scenes/pribor_prd_v_3.tscn'],
['pribor_prd_n_3', 'res://scenes/pribor_prd_n_3.tscn'],
['pribor_prd_k_3', 'res://scenes/pribor_prd_k_3.tscn'],
['pribor_prd_v_4', 'res://scenes/pribor_prd_v_4.tscn'],
['pribor_prd_n_4', 'res://scenes/pribor_prd_n_4.tscn'],
['pribor_prd_k_4', 'res://scenes/pribor_prd_k_4.tscn']]
func _ready():
for item in PRIBORS_RES:
var pribor_node = get_node(item[0])
var pribor_sch_path = item[1]
pribor_node.connect('button_up', Callable(self, 'on_pribor_press').bind(pribor_sch_path))
for item in PRIBORS_RES:
var pribor_node = get_node(item[0])
var pribor_sch_path = item[1]
pribor_node.connect('button_up', Callable(self, 'on_pribor_press').bind(pribor_sch_path))
func on_pribor_press(pribor_sch_path):
clear_obj($pribor_sch)
var pribor_sch = load(pribor_sch_path).instantiate()
$pribor_sch.add_child(pribor_sch)
clear_obj($pribor_sch)
var pribor_sch = load(pribor_sch_path).instantiate()
$pribor_sch.add_child(pribor_sch)
func clear_obj(obj: Object):
var items = obj.get_children()
for item in items:
obj.remove_child(item)
item.free()
var items = obj.get_children()
for item in items:
obj.remove_child(item)
item.free()

View File

@@ -0,0 +1,24 @@
[gd_scene load_steps=6 format=2]
[sub_resource type="StyleBoxEmpty" id=1]
[sub_resource type="StyleBoxEmpty" id=2]
[sub_resource type="StyleBoxEmpty" id=3]
[sub_resource type="StyleBoxEmpty" id=4]
[sub_resource type="StyleBoxEmpty" id=5]
[node name="Node2D" type="OptionButton"]
self_modulate = Color( 1, 0.596078, 0.4, 1 )
offset_right = 70.0
offset_bottom = 23.0
custom_minimum_size = Vector2( 60, 0 )
size_flags_horizontal = 15
size_flags_vertical = 15
theme_override_styles/hover = SubResource( 1 )
theme_override_styles/pressed = SubResource( 2 )
theme_override_styles/focus = SubResource( 3 )
theme_override_styles/disabled = SubResource( 4 )
theme_override_styles/normal = SubResource( 5 )

View File

@@ -4,15 +4,15 @@ extends NinePatchRect
@export var horizontal_alignment: HorizontalAlignment = HorizontalAlignment.HORIZONTAL_ALIGNMENT_CENTER:
get: return $header.horizontal_alignment
set(val): $header.horizontal_alignment = val
get: return $header.horizontal_alignment
set(val): $header.horizontal_alignment = val
@export var vertical_alignment: VerticalAlignment = VerticalAlignment.VERTICAL_ALIGNMENT_CENTER:
get: return $header.vertical_alignment
set(val): $header.vertical_alignment = val
get: return $header.vertical_alignment
set(val): $header.vertical_alignment = val
@export var text: String = 'caption text':
get: return $header.text
set(val): $header.text = val
get: return $header.text
set(val): $header.text = val

View File

@@ -0,0 +1,5 @@
extends Control
var align : get = get_align, set = set_align
var _align: int = 0
func set_align(align: int): _align = align
func get_align(): return _align

View File

@@ -0,0 +1,40 @@
[gd_scene load_steps=7 format=3 uid="uid://by22sta8tt8dn"]
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="1_0wisd"]
[ext_resource type="Script" path="res://scenes/состояния-эмс.gd" id="1_vw38j"]
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="2_nbah5"]
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="3_vsgfs"]
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="4_qu3c5"]
[sub_resource type="SpriteFrames" id="SpriteFrames_ow7xh"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_0wisd")
}, {
"duration": 1.0,
"texture": ExtResource("2_nbah5")
}, {
"duration": 1.0,
"texture": ExtResource("3_vsgfs")
}, {
"duration": 1.0,
"texture": ExtResource("4_qu3c5")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_vw38j")
[node name="sprite" type="AnimatedSprite2D" parent="."]
position = Vector2(14, 9)
sprite_frames = SubResource("SpriteFrames_ow7xh")

View File

@@ -0,0 +1,7 @@
[gd_scene format=3 uid="uid://dqcfr20vovhq5"]
[node name="Label" type="Label"]
offset_right = 122.0
offset_bottom = 34.0
theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1)
clip_text = true

View File

@@ -0,0 +1,11 @@
[gd_scene format=3 uid="uid://dspa16ufrpanp"]
[node name="LineEdit" type="LineEdit"]
offset_right = 58.0
offset_bottom = 33.0
theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1)
context_menu_enabled = false
shortcut_keys_enabled = false
middle_mouse_paste_enabled = false
caret_blink = true
caret_blink_interval = 0.13

View File

@@ -28,13 +28,10 @@ func create_socket(nm) -> Socket:
func _ready() -> void:
Log.info('Сетевой модуль готов')
poll_sockets.append(create_socket('уарэп-яу07-частный'))
poll_sockets.append(create_socket('уарэп-яу07-общий'))
poll_sockets.append(create_socket('уарэп-капсрпб-пол'))
sock_unicast = poll_sockets[0]
var addr = REPSettings.addr['уарэп-яу07-частный'][1]
var port = REPSettings.addr['уарэп-яу07-частный'][2]
sock_unicast = PacketPeerUDP.new()
sock_unicast.bind(port, addr)
for key in REPSettings.addr:
var setting = REPSettings.addr[key]
var proto = setting[0]

44
scripts/yems_devs.gd Normal file
View File

@@ -0,0 +1,44 @@
extends Node
class InDev:
var id: int # Идентификатор индекс устройства
var dev_name: String # Имя подключаемого комплекса
var connector: String # Номер разъёма в приборе
var delay: float # Задержка фронта импульса
var offset: float # Смещение фронта импульса
var state: int # Состояние входа
var freq: int # Предполагаемая частота на которой работает комплекс
var ports_data: Dictionary # Словарь состояния портов устройства
var tbl_row_id: int # Индекс устройства в таблице входов
var out_dots: Array # Список выходных устройств в порядке, как в таблице и точки матрицы
func _init(dev_id : int, params : Array, row_id : int):
id = dev_id
dev_name = String(params[0])
connector = String(params[1])
delay = float(params[2])
offset = float(params[3])
tbl_row_id = row_id
class OutDev:
var id: int # Идентификатор индекс устройства
var dev_name: String # Имя подключаемого комплекса
var connector: String # Номер разъёма в приборе
var delay: float # Задержка фронта импульса
var offset: float # Смещение фронта импульса
var state: int # Состояние входа
var freq: int # Предполагаемая частота на которой работает комплекс
var ports_data: Dictionary # Словарь состояния портов устройства
var tbl_row_id: int # Индекс устройства в таблице выходов
var mode: int # Режим работы выхода
func _init(dev_id : int, params : Array, row_id : int):
id = dev_id
dev_name = String(params[0])
connector = String(params[1])
delay = float(params[2])
offset = float(params[3])
tbl_row_id = row_id
mode = 0