отладка ДКМ

This commit is contained in:
2025-02-12 00:31:25 +03:00
parent ba047d4c71
commit f682733cfd
11 changed files with 152 additions and 39 deletions

View File

@@ -76,8 +76,8 @@ TabContainer/styles/tabbar_background = SubResource("StyleBoxTexture_ls6vm")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3q35w"]
shader = ExtResource("2_vn1it")
shader_parameter/outerRadius = 8.258
shader_parameter/MainAlpha = 0.653
shader_parameter/outerRadius = 4.0
shader_parameter/MainAlpha = 1.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pxarn"]
bg_color = Color(0.356863, 0.278431, 0.356863, 1)
@@ -322,10 +322,10 @@ metadata/_edit_lock_ = true
[node name="body_grid" type="GridContainer" parent="TabContainer/PRD"]
layout_mode = 0
offset_left = 376.0
offset_top = -4.0
offset_right = 1648.0
offset_bottom = 718.0
offset_left = 360.0
offset_top = 12.0
offset_right = 1632.0
offset_bottom = 734.0
[node name="litera_2_4_6" type="GridContainer" parent="TabContainer/PRD/body_grid"]
clip_contents = true
@@ -363,7 +363,7 @@ metadata/_edit_lock_ = true
[node name="PSK" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_2_4_6"]
modulate = Color(1, 1, 0.941176, 0.733333)
material = ExtResource("3_3syd3")
position = Vector2(955, 5)
position = Vector2(970, 20)
scale = Vector2(0.23, 0.217)
texture = SubResource("PlaceholderTexture2D_723du")
offset = Vector2(800, 600)
@@ -422,7 +422,7 @@ metadata/_edit_lock_ = true
[node name="PSK2" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_3_5_7"]
modulate = Color(1, 1, 0.941176, 0.733333)
material = ExtResource("3_3syd3")
position = Vector2(955, -6)
position = Vector2(970, 14)
scale = Vector2(0.23, 0.217)
texture = SubResource("PlaceholderTexture2D_723du")
offset = Vector2(800, 600)
@@ -712,6 +712,56 @@ self_size = Vector2i(50, 174)
fname = "ИП12-50"
rname = "А21"
[node name="soc_DKM" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 574.0
offset_top = 201.0
offset_right = 762.0
offset_bottom = 417.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/soc_DKM"]
self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0
offset_left = 7.0
offset_top = 8.0
offset_right = 181.0
offset_bottom = 33.0
text = "ДКМ"
horizontal_alignment = 1
vertical_alignment = 1
[node name="DKM_3" parent="TabContainer/ControlPanel/soc_DKM" instance=ExtResource("11_fg7ul")]
offset_left = 129.0
offset_top = 37.0
offset_right = 179.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
fname = "ДКМ3"
rname = " "
[node name="DKM_2" parent="TabContainer/ControlPanel/soc_DKM" instance=ExtResource("11_fg7ul")]
offset_left = 73.0
offset_top = 37.0
offset_right = 123.0
offset_bottom = 211.0
self_size = Vector2i(50, 174)
fname = "ДКМ2"
rname = " "
[node name="DKM_1" parent="TabContainer/ControlPanel/soc_DKM" instance=ExtResource("11_fg7ul")]
offset_left = 16.0
offset_top = 36.0
offset_right = 66.0
offset_bottom = 210.0
self_size = Vector2i(50, 174)
fname = "ДКМ1"
rname = " "
[node name="soc_P2" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 278.0
@@ -760,6 +810,14 @@ offset_top = 792.0
offset_right = 1616.0
offset_bottom = 847.0
[node name="DKM" type="Label" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 589.0
offset_top = 212.0
offset_right = 695.0
offset_bottom = 235.0
metadata/_edit_lock_ = true
[node name="EMS_G" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2

BIN
pictures/sreen_win.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dljbtryxjti6d"
path="res://.godot/imported/sreen_win.png-4a2865fc4d756c215a29baa4edb7108c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://pictures/sreen_win.png"
dest_files=["res://.godot/imported/sreen_win.png-4a2865fc4d756c215a29baa4edb7108c.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.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -86,6 +86,7 @@ func _ready() -> void:
node_select_fs_1.set_node_text(0, 7, 'Фильтр CAN')
node_select_fs_1.get_node2(1, 7).placeholder_text = 'в МГц'
node_select_fs_1.get_node2(1, 7).editable = true
node_select_fs_1.set_node_text(0, 8, 'Статус CAN')
var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control
draw_tabl(node_select_fs_2, Constants.ROWS_FS, Constants.ROWS_FS.size())
@@ -105,6 +106,7 @@ func _ready() -> void:
node_select_fs_2.set_node_text(0, 7, 'Фильтр CAN')
node_select_fs_2.get_node2(1, 7).placeholder_text = 'в МГц'
node_select_fs_2.get_node2(1, 7).editable = true
node_select_fs_2.set_node_text(0, 8, 'Статус CAN')
# Выбор прибора для подключения
var node_select_device = $TabContainer/PRD/select_dev
@@ -140,17 +142,6 @@ func _ready() -> void:
node_select_yau_07b.get_node2(1, 4).add_item(key)
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 48)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 49)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 51)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 52)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 56)
Network.read_port_isa([Constants.BASE_PORTS.EMS_G+8])
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'))
@@ -185,9 +176,6 @@ func _ready() -> void:
node_select_fs_2.get_node2(1, 7).connect('text_submitted', Callable(self, '_on_set_base_can_macro_2'))
node_select_fs_2.get_node2(1, 8).get_child(1, false).connect('toggled', Callable(self, '_on_status_can_macro_2'))
Network.connect_fs_1()
Network.connect_fs_2()
func on_device_selected(selected_index: int) -> void:
var get_select_device = $TabContainer/PRD/select_dev.get_node2(1, 0)

View File

@@ -147,7 +147,7 @@ enum DataIndices {
OUT_BLANK_PRD = 13,
OUT_IMPULS_PRD = 19,
DRY_CONTACT = 27,
DKM = 29,
DKM = 28,
POWER_UKP_1 = 31,
TEMPERATURE_UKP_1 = 47,
POWER_UKP_2 = 63,

View File

@@ -47,7 +47,8 @@ func _on_timer(pribor_prd):
func _status_cell(status):
var status_board: int = status.decode_u8(Constants.DataIndices.STATUS_BOARD)
var dry_contact: int = status.decode_u8(Constants.DataIndices.DRY_CONTACT)
var dkm: int = status.decode_u8(Constants.DataIndices.DKM)
$DKM.text = str(dkm)
# status_board
for i in range(1, count_cell-8):
if ((status_board >> (i-1)) & 0x1) == 1:
@@ -55,6 +56,18 @@ func _status_cell(status):
else:
node_cell_ind[i].state = Constants.STATE_VAL.ERROR
#dkm
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
$soc_DKM/DKM_2.state = (dkm >> 1) & 0x1
$soc_DKM/DKM_3.state = (dkm >> 2) & 0x1
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
$soc_DKM/DKM_2.state = (dkm >> 3) & 0x1
$soc_DKM/DKM_3.state = (dkm >> 4) & 0x1
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
$soc_DKM/DKM_1.state = (dkm >> 0) & 0x1
$soc_DKM/DKM_2.state = (dkm >> 5) & 0x1
$soc_DKM/DKM_3.state = (dkm >> 6) & 0x1
#dry_contact
if (node_cell_ind[2].state == Constants.STATE_VAL.GOOD):
for i in range(5, count_cell):
@@ -77,17 +90,18 @@ func _status_prd():
status += 1 if (node_cell_ind[count_cell-2].state == Constants.STATE_VAL.GOOD) else 0
if (status == count_cell):
$lbl_control.text = 'Прибор исправен'
$lbl_control.modulate = Color(0,1,0,1)
$lbl_control.modulate = Color.AQUAMARINE
else:
$lbl_control.text = 'Прибор не исправен'
$lbl_control.modulate = Color(1,0,0,1)
$lbl_control.modulate = Color.CRIMSON
else:
if (status == count_cell-2):
$lbl_control.text = 'Прибор исправен'
$lbl_control.modulate = Color(0,1,0,1)
$lbl_control.modulate = Color.AQUAMARINE
else:
$lbl_control.text = 'Прибор не исправен'
$lbl_control.modulate = Color(1,0,0,1)
$lbl_control.modulate = Color.CRIMSON
func _draw_control_panel_prd(pribor):
if pribor == Constants.MODE.PRD_H:
@@ -119,6 +133,11 @@ func _draw_control_panel_prd(pribor):
# Кассета П-2
$soc_P2.visible = false
# ДКМ
$soc_DKM/DKM_1.visible = false
$soc_DKM/DKM_2.fname = 'ДКМ2'
$soc_DKM/DKM_3.fname = 'ДКМ3'
elif pribor == Constants.MODE.PRD_B:
# Кассета У5
$soc_y5/IP5_25.rname = 'А24'

View File

@@ -114,7 +114,20 @@ func _ready() -> void:
unit.connect('line_changed', Callable(self, 'on_line_changed'))
unit.connect('command_fail', Callable(self, 'on_command_fail'))
read_port_isa([Constants.BASE_PORTS.UG+6, Constants.BASE_PORTS.UG+8, Constants.BASE_PORTS.EMS_G+8])
write_port_isa(Constants.BASE_PORTS.EMS_G+2, 48)
read_port_isa([Constants.BASE_PORTS.EMS_G+8])
write_port_isa(Constants.BASE_PORTS.EMS_G+2, 49)
read_port_isa([Constants.BASE_PORTS.EMS_G+8])
write_port_isa(Constants.BASE_PORTS.EMS_G+2, 51)
read_port_isa([Constants.BASE_PORTS.EMS_G+8])
write_port_isa(Constants.BASE_PORTS.EMS_G+2, 52)
read_port_isa([Constants.BASE_PORTS.EMS_G+8])
write_port_isa(Constants.BASE_PORTS.EMS_G+2, 56)
read_port_isa([Constants.BASE_PORTS.EMS_G+8, Constants.BASE_PORTS.UG+6, Constants.BASE_PORTS.UG+8])
connect_fs_1()
start_work_fs()
connect_fs_2()
start_work_fs_2()
func _process(delta: float) -> void:
@@ -300,8 +313,7 @@ func connect_fs_2():
peerstream_fs_2 = PacketPeerStream.new()
var rc = client_fs_2.connect_to_host(ip_fs_2, Constants.PORT_FS)
if rc!= Error.OK:
print_debug('Port error %s' % ip_fs_2)
#emit_signal("port_error", ip_fs_2)
emit_signal("port_error", ip_fs_2)
else:
peerstream_fs_2.set_stream_peer(client_fs_2)

View File

@@ -14,7 +14,7 @@ script/source = "@tool
extends Control
@export var margins: Array[int] = [8, 8, 8, 8] # top, left, bottom, right
@export var margins: Array[int] = [8, 8, 5, 8] # top, left, bottom, right
@export var textures: Array[Texture]
@@ -101,6 +101,7 @@ anchors_preset = 0
offset_right = 50.0
offset_bottom = 150.0
script = SubResource("GDScript_fbktk")
margins = Array[int]([8, 8, 8, 8])
textures = Array[Texture]([ExtResource("1_2n7he"), ExtResource("2_38t58"), ExtResource("3_i2t3v")])
metadata/ref_des = ""
metadata/dec_num = ""
@@ -129,16 +130,17 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="txr_state" type="TextureRect" parent="."]
modulate = Color(1, 1, 1, 0.462)
material = SubResource("ShaderMaterial_45ast")
layout_mode = 0
offset_left = 14.0
offset_top = 114.0
offset_right = 238.0
offset_bottom = 338.0
offset_top = 110.0
offset_right = 256.0
offset_bottom = 352.0
scale = Vector2(0.1, 0.1)
size_flags_vertical = 6
texture = ExtResource("1_2n7he")
stretch_mode = 2
metadata/_edit_lock_ = true
[node name="np_rect" type="NinePatchRect" parent="."]
layout_mode = 0