отладка мощности
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=57 format=3 uid="uid://cvor2jm4xk3ha"]
|
[gd_scene load_steps=53 format=3 uid="uid://cvor2jm4xk3ha"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"]
|
[ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cdxdluvyb5uei" path="res://table/on.png" id="2_dv7xx"]
|
[ext_resource type="Texture2D" uid="uid://cdxdluvyb5uei" path="res://table/on.png" id="2_dv7xx"]
|
||||||
@@ -19,23 +19,24 @@
|
|||||||
[ext_resource type="Shader" path="res://Shaders/loadead.gdshader" id="16_4osrw"]
|
[ext_resource type="Shader" path="res://Shaders/loadead.gdshader" id="16_4osrw"]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o0too"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o0too"]
|
||||||
bg_color = Color(0.223529, 0.168627, 0.223529, 1)
|
bg_color = Color(0.447059, 0.0784314, 0.192157, 1)
|
||||||
border_width_bottom = 6
|
border_width_bottom = 6
|
||||||
border_color = Color(0.339047, 0.26316, 0.339004, 1)
|
border_color = Color(0.396649, 0.0647458, 0.167246, 1)
|
||||||
border_blend = true
|
border_blend = true
|
||||||
|
corner_radius_top_left = 10
|
||||||
|
corner_radius_bottom_left = 10
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eib3t"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eib3t"]
|
||||||
bg_color = Color(0.223529, 0.168627, 0.223529, 1)
|
bg_color = Color(0.252841, 0.19297, 0.252851, 1)
|
||||||
border_width_bottom = 6
|
border_width_bottom = 6
|
||||||
border_color = Color(0.228592, 0.173062, 0.22863, 1)
|
border_color = Color(0.228592, 0.173062, 0.22863, 1)
|
||||||
border_blend = true
|
border_blend = true
|
||||||
|
corner_radius_top_left = 10
|
||||||
|
corner_radius_bottom_left = 10
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gooip"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gooip"]
|
||||||
bg_color = Color(0.143, 0.103, 0.143, 0.799)
|
bg_color = Color(0.143, 0.103, 0.143, 0.799)
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lqhgx"]
|
|
||||||
bg_color = Color(0, 0, 0, 0.490196)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_148rs"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_148rs"]
|
||||||
bg_color = Color(0.141176, 0.101961, 0.141176, 0.8)
|
bg_color = Color(0.141176, 0.101961, 0.141176, 0.8)
|
||||||
border_width_bottom = 4
|
border_width_bottom = 4
|
||||||
@@ -58,13 +59,15 @@ bg_color = Color(0.141176, 0.101961, 0.141176, 0.8)
|
|||||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ls6vm"]
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ls6vm"]
|
||||||
|
|
||||||
[sub_resource type="Theme" id="Theme_k5ur4"]
|
[sub_resource type="Theme" id="Theme_k5ur4"]
|
||||||
|
Button/styles/focus = null
|
||||||
|
Button/styles/hover = SubResource("StyleBoxFlat_o0too")
|
||||||
Button/styles/normal = SubResource("StyleBoxFlat_o0too")
|
Button/styles/normal = SubResource("StyleBoxFlat_o0too")
|
||||||
Button/styles/pressed = SubResource("StyleBoxFlat_eib3t")
|
Button/styles/pressed = SubResource("StyleBoxFlat_eib3t")
|
||||||
CheckButton/icons/checked = ExtResource("2_dv7xx")
|
CheckButton/icons/checked = ExtResource("2_dv7xx")
|
||||||
CheckButton/icons/unchecked = ExtResource("3_qvuyu")
|
CheckButton/icons/unchecked = ExtResource("3_qvuyu")
|
||||||
OptionButton/font_sizes/font_size = 17
|
OptionButton/font_sizes/font_size = 17
|
||||||
OptionButton/styles/focus = SubResource("StyleBoxFlat_gooip")
|
OptionButton/styles/focus = SubResource("StyleBoxFlat_gooip")
|
||||||
OptionButton/styles/hover = SubResource("StyleBoxFlat_lqhgx")
|
OptionButton/styles/hover = SubResource("StyleBoxFlat_148rs")
|
||||||
OptionButton/styles/normal = SubResource("StyleBoxFlat_148rs")
|
OptionButton/styles/normal = SubResource("StyleBoxFlat_148rs")
|
||||||
OptionButton/styles/pressed = SubResource("StyleBoxFlat_ldbvf")
|
OptionButton/styles/pressed = SubResource("StyleBoxFlat_ldbvf")
|
||||||
TabContainer/styles/panel = SubResource("StyleBoxTexture_h8aei")
|
TabContainer/styles/panel = SubResource("StyleBoxTexture_h8aei")
|
||||||
@@ -77,11 +80,10 @@ shader = ExtResource("2_vn1it")
|
|||||||
shader_parameter/outerRadius = 4.0
|
shader_parameter/outerRadius = 4.0
|
||||||
shader_parameter/MainAlpha = 1.0
|
shader_parameter/MainAlpha = 1.0
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pxarn"]
|
|
||||||
bg_color = Color(0.356863, 0.278431, 0.356863, 1)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p247y"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p247y"]
|
||||||
bg_color = Color(0.356863, 0.278431, 0.356863, 1)
|
bg_color = Color(0.294118, 0.231373, 0.294118, 1)
|
||||||
|
corner_radius_top_left = 10
|
||||||
|
corner_radius_bottom_left = 10
|
||||||
|
|
||||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rh6pm"]
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rh6pm"]
|
||||||
|
|
||||||
@@ -116,6 +118,7 @@ shader = ExtResource("4_uy5o2")
|
|||||||
shader_parameter/color_signal = Color(0.588235, 0.466667, 0, 1)
|
shader_parameter/color_signal = Color(0.588235, 0.466667, 0, 1)
|
||||||
shader_parameter/turn = 0.785
|
shader_parameter/turn = 0.785
|
||||||
shader_parameter/inner_radius = 0.32
|
shader_parameter/inner_radius = 0.32
|
||||||
|
shader_parameter/speed = 0.0
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_ki0n7"]
|
[sub_resource type="Gradient" id="Gradient_ki0n7"]
|
||||||
|
|
||||||
@@ -129,11 +132,7 @@ shader = ExtResource("8_12mng")
|
|||||||
shader_parameter/color_signal = Color(0.588242, 0.466356, 0, 1)
|
shader_parameter/color_signal = Color(0.588242, 0.466356, 0, 1)
|
||||||
shader_parameter/turn = 0.785
|
shader_parameter/turn = 0.785
|
||||||
shader_parameter/inner_radius = 0.32
|
shader_parameter/inner_radius = 0.32
|
||||||
|
shader_parameter/speed = 0.0
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_45v75"]
|
|
||||||
bg_color = Color(0.6, 0.858824, 0.6, 1)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6s7bq"]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tn8m6"]
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tn8m6"]
|
||||||
|
|
||||||
@@ -218,7 +217,7 @@ offset_bottom = 156.0
|
|||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
theme_override_font_sizes/font_size = 14
|
theme_override_font_sizes/font_size = 14
|
||||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_pxarn")
|
theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
|
||||||
toggle_mode = true
|
toggle_mode = true
|
||||||
button_pressed = true
|
button_pressed = true
|
||||||
text = "ПРД"
|
text = "ПРД"
|
||||||
@@ -460,25 +459,6 @@ offset_bottom = 11.0
|
|||||||
script = ExtResource("2_vmbyo")
|
script = ExtResource("2_vmbyo")
|
||||||
node_gap = Vector2(100, 50)
|
node_gap = Vector2(100, 50)
|
||||||
|
|
||||||
[node name="FS_mod" type="Button" parent="TabContainer/PRD"]
|
|
||||||
layout_mode = 2
|
|
||||||
offset_left = 233.0
|
|
||||||
offset_top = 240.0
|
|
||||||
offset_right = 334.0
|
|
||||||
offset_bottom = 273.0
|
|
||||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_45v75")
|
|
||||||
theme_override_styles/normal = SubResource("StyleBoxFlat_6s7bq")
|
|
||||||
text = "MSK"
|
|
||||||
|
|
||||||
[node name="FS_mod_const" type="Button" parent="TabContainer/PRD"]
|
|
||||||
offset_left = 120.0
|
|
||||||
offset_top = 241.0
|
|
||||||
offset_right = 221.0
|
|
||||||
offset_bottom = 274.0
|
|
||||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_45v75")
|
|
||||||
theme_override_styles/normal = SubResource("StyleBoxFlat_6s7bq")
|
|
||||||
text = "Const"
|
|
||||||
|
|
||||||
[node name="ControlPanel" type="Panel" parent="TabContainer"]
|
[node name="ControlPanel" type="Panel" parent="TabContainer"]
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -825,13 +805,6 @@ self_size = Vector2i(50, 174)
|
|||||||
fname = "ИП9-50"
|
fname = "ИП9-50"
|
||||||
rname = "A22"
|
rname = "A22"
|
||||||
|
|
||||||
[node name="device" type="Label" parent="TabContainer/ControlPanel"]
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 1451.0
|
|
||||||
offset_top = 792.0
|
|
||||||
offset_right = 1616.0
|
|
||||||
offset_bottom = 847.0
|
|
||||||
|
|
||||||
[node name="DKM" type="Label" parent="TabContainer/ControlPanel"]
|
[node name="DKM" type="Label" parent="TabContainer/ControlPanel"]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 589.0
|
offset_left = 589.0
|
||||||
@@ -1052,8 +1025,6 @@ text = "Сохранить все настройки"
|
|||||||
[connection signal="pressed" from="Background/side_panel/save_config" to="." method="_on_save_config"]
|
[connection signal="pressed" from="Background/side_panel/save_config" to="." method="_on_save_config"]
|
||||||
[connection signal="pressed" from="Background/side_panel/load_config" to="." method="_on_load_config"]
|
[connection signal="pressed" from="Background/side_panel/load_config" to="." method="_on_load_config"]
|
||||||
[connection signal="pressed" from="read_isa" to="." method="_on_read_isa_pressed"]
|
[connection signal="pressed" from="read_isa" to="." method="_on_read_isa_pressed"]
|
||||||
[connection signal="pressed" from="TabContainer/PRD/FS_mod" to="." method="_on_fs_mod_pressed"]
|
|
||||||
[connection signal="pressed" from="TabContainer/PRD/FS_mod_const" to="." method="_on_fs_mod_const"]
|
|
||||||
[connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_ferq" to="TabContainer/Modul_fs" method="_on_set_ferq"]
|
[connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_ferq" to="TabContainer/Modul_fs" method="_on_set_ferq"]
|
||||||
[connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_att2" to="TabContainer/Modul_fs" method="_on_set_att"]
|
[connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_att2" to="TabContainer/Modul_fs" method="_on_set_att"]
|
||||||
[connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/con" to="TabContainer/Modul_fs" method="_on_start"]
|
[connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/con" to="TabContainer/Modul_fs" method="_on_start"]
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ shader_type canvas_item;
|
|||||||
uniform vec4 color_signal: source_color;
|
uniform vec4 color_signal: source_color;
|
||||||
uniform float turn = 0.785;
|
uniform float turn = 0.785;
|
||||||
uniform float inner_radius = 0.32;
|
uniform float inner_radius = 0.32;
|
||||||
|
uniform float speed = 0.0;
|
||||||
|
|
||||||
const float outer_radius = 0.109;
|
const float outer_radius = 0.109;
|
||||||
const float zoom = 100.0;
|
const float zoom = 50.0;
|
||||||
const float speed = 2.1;
|
const float size = 5.0;
|
||||||
const float size = 9.0;
|
|
||||||
const float blur = 0.000001;
|
const float blur = 0.000001;
|
||||||
const float fill_ratio = 0.03;
|
const float fill_ratio = 0.03;
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ shader_type canvas_item;
|
|||||||
uniform vec4 color_signal: source_color;
|
uniform vec4 color_signal: source_color;
|
||||||
uniform float turn = 0.785;
|
uniform float turn = 0.785;
|
||||||
uniform float inner_radius = 0.32;
|
uniform float inner_radius = 0.32;
|
||||||
|
uniform float speed = 0.0;
|
||||||
|
|
||||||
const float outer_radius = 0.109;
|
const float outer_radius = 0.109;
|
||||||
const float zoom = 100.0;
|
const float zoom = 50.0;
|
||||||
const float speed = 2.1;
|
const float size = 5.0;
|
||||||
const float size = 9.0;
|
|
||||||
const float blur = 0.000001;
|
const float blur = 0.000001;
|
||||||
const float fill_ratio = 0.03;
|
const float fill_ratio = 0.03;
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void:
|
|||||||
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+8] & 0x38)>>3)
|
$TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control.get_node2(1, 4).select((isa_data[Constants.BASE_PORTS.UG+8] & 0x38)>>3)
|
||||||
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x7))
|
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x7))
|
||||||
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x38))
|
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[Constants.BASE_PORTS.UG+8] & 0x38))
|
||||||
|
|
||||||
for index in Constants.EMS_G_PORT_DATA_HOLDER.size():
|
for index in Constants.EMS_G_PORT_DATA_HOLDER.size():
|
||||||
var tmp_device_mode = Constants.EMS_G_PORT_DATA_HOLDER[index][0]
|
var tmp_device_mode = Constants.EMS_G_PORT_DATA_HOLDER[index][0]
|
||||||
if tmp_device_mode == 48:
|
if tmp_device_mode == 48:
|
||||||
@@ -266,15 +266,19 @@ func _on_data_fs_1(fs_1_data):
|
|||||||
node_select_fs_1.set_node_text(2, 2, str(fs_1_data.decode_u64(0xC) / 1_000_000) + ' МГц')
|
node_select_fs_1.set_node_text(2, 2, str(fs_1_data.decode_u64(0xC) / 1_000_000) + ' МГц')
|
||||||
Constants.CMD.READ_ATT:
|
Constants.CMD.READ_ATT:
|
||||||
if GRP == Constants.GROUP.RF:
|
if GRP == Constants.GROUP.RF:
|
||||||
node_select_fs_1.set_node_text(2, 3, '-' + str(fs_1_data.decode_float(0x18)) + ' dB')
|
node_select_fs_1.set_node_text(2, 3, str(fs_1_data.decode_float(0x18)) + ' dB')
|
||||||
Constants.CMD.READ_GEN_STATUS:
|
Constants.CMD.READ_GEN_STATUS:
|
||||||
if GRP == Constants.GROUP.GENERATOR:
|
if GRP == Constants.GROUP.GENERATOR:
|
||||||
if fs_1_data.decode_u32(0xC) == 0:
|
if fs_1_data.decode_u32(0xC) == 0:
|
||||||
node_select_fs_1.set_node_text(2, 5, 'Включен')
|
node_select_fs_1.set_node_text(2, 5, 'Включен')
|
||||||
node_select_fs_1.get_node2(2, 5).modulate = Color.AQUAMARINE
|
node_select_fs_1.get_node2(2, 5).modulate = Color.AQUAMARINE
|
||||||
|
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/speed', 2.5)
|
||||||
|
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1, 5).get_child(1).button_pressed = true
|
||||||
else:
|
else:
|
||||||
node_select_fs_1.set_node_text(2, 5, 'Отключен')
|
node_select_fs_1.set_node_text(2, 5, 'Отключен')
|
||||||
node_select_fs_1.get_node2(2, 5).modulate = Color.CRIMSON
|
node_select_fs_1.get_node2(2, 5).modulate = Color.CRIMSON
|
||||||
|
$TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/speed', 0.0)
|
||||||
|
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1, 5).get_child(1).button_pressed = false
|
||||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||||
if GRP == Constants.GROUP.BASE:
|
if GRP == Constants.GROUP.BASE:
|
||||||
node_select_fs_1.set_node_text(2, 0, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
|
node_select_fs_1.set_node_text(2, 0, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
|
||||||
@@ -293,15 +297,19 @@ func _on_data_fs_2(fs_2_data):
|
|||||||
node_select_fs_2.set_node_text(2, 2, str(fs_2_data.decode_u64(0xC) / 1_000_000) + ' МГц')
|
node_select_fs_2.set_node_text(2, 2, str(fs_2_data.decode_u64(0xC) / 1_000_000) + ' МГц')
|
||||||
Constants.CMD.READ_ATT:
|
Constants.CMD.READ_ATT:
|
||||||
if GRP == Constants.GROUP.RF:
|
if GRP == Constants.GROUP.RF:
|
||||||
node_select_fs_2.set_node_text(2, 3, '-' + str(fs_2_data.decode_float(0x18)) + ' dB')
|
node_select_fs_2.set_node_text(2, 3, str(fs_2_data.decode_float(0x18)) + ' dB')
|
||||||
Constants.CMD.READ_GEN_STATUS:
|
Constants.CMD.READ_GEN_STATUS:
|
||||||
if GRP == Constants.GROUP.GENERATOR:
|
if GRP == Constants.GROUP.GENERATOR:
|
||||||
if fs_2_data.decode_u32(0xC) == 0:
|
if fs_2_data.decode_u32(0xC) == 0:
|
||||||
node_select_fs_2.set_node_text(2, 4, 'Включен')
|
node_select_fs_2.set_node_text(2, 5, 'Включен')
|
||||||
node_select_fs_2.get_node2(2, 4).modulate = Color.AQUAMARINE
|
node_select_fs_2.get_node2(2, 5).modulate = Color.AQUAMARINE
|
||||||
|
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 2.5)
|
||||||
|
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 5).get_child(1).button_pressed = true
|
||||||
else:
|
else:
|
||||||
node_select_fs_2.set_node_text(2, 4, 'Отключен')
|
node_select_fs_2.set_node_text(2, 5, 'Отключен')
|
||||||
node_select_fs_2.get_node2(2, 4).modulate = Color.CRIMSON
|
node_select_fs_2.get_node2(2, 5).modulate = Color.CRIMSON
|
||||||
|
$TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/speed', 0.0)
|
||||||
|
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 5).get_child(1).button_pressed = false
|
||||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||||
if GRP == Constants.GROUP.BASE:
|
if GRP == Constants.GROUP.BASE:
|
||||||
node_select_fs_2.set_node_text(2, 0, '%.2f' % fs_2_data.decode_float(0xC) + ' °C')
|
node_select_fs_2.set_node_text(2, 0, '%.2f' % fs_2_data.decode_float(0xC) + ' °C')
|
||||||
@@ -649,11 +657,3 @@ func _on_modul_fs_2(modulation_select_2) -> void:
|
|||||||
Network.set_configure_gen_const_2()
|
Network.set_configure_gen_const_2()
|
||||||
elif modulation_select_2 == 1:
|
elif modulation_select_2 == 1:
|
||||||
Network.set_configure_gen_msk_2()
|
Network.set_configure_gen_msk_2()
|
||||||
|
|
||||||
|
|
||||||
func _on_fs_mod_pressed() -> void:
|
|
||||||
Network.set_configure_gen_msk()
|
|
||||||
|
|
||||||
|
|
||||||
func _on_fs_mod_const() -> void:
|
|
||||||
Network.set_configure_gen_const()
|
|
||||||
|
|||||||
@@ -5,7 +5,15 @@ var node_cell_ind: Array
|
|||||||
var count_cell: int
|
var count_cell: int
|
||||||
var past_pribor: int
|
var past_pribor: int
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
||||||
|
Network.connect('port_fs_opened_1', _on_fs_status_1.bind(Constants.STATE_VAL.GOOD))
|
||||||
|
Network.connect('port_fs_closed_1', _on_fs_status_1.bind(Constants.STATE_VAL.ERROR))
|
||||||
|
|
||||||
|
Network.connect('port_fs_opened_2', _on_fs_status_2.bind(Constants.STATE_VAL.GOOD))
|
||||||
|
Network.connect('port_fs_closed_2', _on_fs_status_2.bind(Constants.STATE_VAL.ERROR))
|
||||||
|
|
||||||
self.add_child(timer)
|
self.add_child(timer)
|
||||||
timer.connect('timeout', Callable(self, '_on_timer').bind(Network.unit))
|
timer.connect('timeout', Callable(self, '_on_timer').bind(Network.unit))
|
||||||
timer.start(1)
|
timer.start(1)
|
||||||
@@ -79,6 +87,7 @@ func _status_cell(status):
|
|||||||
for i in range(5, count_cell):
|
for i in range(5, count_cell):
|
||||||
node_cell_ind[i].state = Constants.STATE_VAL.NONE
|
node_cell_ind[i].state = Constants.STATE_VAL.NONE
|
||||||
|
|
||||||
|
|
||||||
func _status_prd():
|
func _status_prd():
|
||||||
var status: int = 0
|
var status: int = 0
|
||||||
for i in range(count_cell-3):
|
for i in range(count_cell-3):
|
||||||
@@ -199,3 +208,12 @@ func _draw_control_panel_prd(pribor):
|
|||||||
$soc_P1/MAA_2.rname = 'А28'
|
$soc_P1/MAA_2.rname = 'А28'
|
||||||
# Кассета П-2
|
# Кассета П-2
|
||||||
$soc_P2.visible = true
|
$soc_P2.visible = true
|
||||||
|
|
||||||
|
|
||||||
|
func _on_fs_status_1(_name_port, status_fs_1):
|
||||||
|
$Kasseta_FS/ref_A1.state = status_fs_1
|
||||||
|
|
||||||
|
|
||||||
|
func _on_fs_status_2(_name_port, status_fs_2):
|
||||||
|
$Kasseta_FS/ref_A2.state = status_fs_2
|
||||||
|
|
||||||
|
|||||||
BIN
signals/FS_7.pcm
Normal file
BIN
signals/FS_7.pcm
Normal file
Binary file not shown.
84
signals/puls_1kHz.py
Normal file
84
signals/puls_1kHz.py
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
import numpy as np
|
||||||
|
from matplotlib import pyplot as plt
|
||||||
|
from scipy.io import wavfile
|
||||||
|
|
||||||
|
Fs = 120e6 # Частота дискретизации
|
||||||
|
A0 = 65535 # Амплитуда сигнала
|
||||||
|
tp = 100e-6 # Длина импульса
|
||||||
|
Tp = 1000e-6 + tp # Длина между импульсами
|
||||||
|
Np = 1 # Количество импульсов
|
||||||
|
|
||||||
|
Tr = Np*Tp
|
||||||
|
|
||||||
|
N_fft = 2**22
|
||||||
|
N=int(Tr*Fs)
|
||||||
|
nT=np.arange(N)/Fs
|
||||||
|
|
||||||
|
def signal(t):
|
||||||
|
s = np.zeros_like(t)
|
||||||
|
mask = (0 <= t) & (t <= tp)
|
||||||
|
s[mask] = A0
|
||||||
|
|
||||||
|
return s
|
||||||
|
|
||||||
|
def signal_pulse(t):
|
||||||
|
s = np.zeros_like(t)
|
||||||
|
for i in range(Np):
|
||||||
|
s += signal(t-i*Tp)
|
||||||
|
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def spectr(s, Fs, N_fft):
|
||||||
|
S = np.fft.fft(s, n=N_fft)
|
||||||
|
S_fft = S/Fs
|
||||||
|
S_Power = S**2/(N*Fs)
|
||||||
|
|
||||||
|
S_fft = np.abs(S_fft)
|
||||||
|
S_Power = np.abs(S_Power)
|
||||||
|
f_fft = np.fft.fftfreq(N_fft, d=1/Fs)
|
||||||
|
S_fft = np.fft.fftshift(S_fft)
|
||||||
|
S_Power = np.fft.fftshift(S_Power)
|
||||||
|
f_fft = np.fft.fftshift(f_fft)
|
||||||
|
return (S_fft, S_Power, f_fft)
|
||||||
|
|
||||||
|
|
||||||
|
S_sum = signal_pulse(nT)
|
||||||
|
S, Power, f = spectr(S_sum, Fs, N_fft)
|
||||||
|
|
||||||
|
S = 20*np.log(S)
|
||||||
|
Power = 10*np.log(Power)
|
||||||
|
|
||||||
|
S_sum_real = S_sum.real
|
||||||
|
S_sum_imag = S_sum.imag
|
||||||
|
|
||||||
|
S_complex = np.zeros(int(len(S_sum)*2))
|
||||||
|
S_complex [::2] = S_sum_real
|
||||||
|
S_complex [1::2] = S_sum_imag
|
||||||
|
S_complex = S_complex.astype('int16')
|
||||||
|
|
||||||
|
with open ('pulse.pcm', 'wb') as File:
|
||||||
|
File.write(S_complex)
|
||||||
|
|
||||||
|
plt.figure(1,figsize=(12, 8))
|
||||||
|
plt.subplot(3,1,1)
|
||||||
|
plt.plot(nT,S_sum)
|
||||||
|
plt.xlabel('nT, с')
|
||||||
|
plt.ylabel('S, В')
|
||||||
|
plt.grid()
|
||||||
|
|
||||||
|
plt.subplot(3,1,2)
|
||||||
|
plt.plot(f,S)
|
||||||
|
plt.xlabel('f, Гц')
|
||||||
|
plt.ylabel('$S_{dB}$, дБ')
|
||||||
|
plt.grid()
|
||||||
|
|
||||||
|
plt.subplot(3,1,3)
|
||||||
|
plt.plot(f,Power)
|
||||||
|
plt.xlabel('f, Гц')
|
||||||
|
plt.ylabel('$S_{dB}^{2}$, дБ')
|
||||||
|
plt.grid()
|
||||||
|
plt.tight_layout()
|
||||||
|
|
||||||
|
plt.show()
|
||||||
|
|
||||||
BIN
signals/pulse.pcm
Normal file
BIN
signals/pulse.pcm
Normal file
Binary file not shown.
Reference in New Issue
Block a user