From 7bc5aa8e3d93bdb1e2be0662db21f4570e503336 Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 13 Dec 2024 06:45:07 +0300 Subject: [PATCH] add shader --- PRD_MP550.tscn | 65 +++++++-------- Shaders/shader_edu.tres | 159 +----------------------------------- ems_g.gd | 39 +++++++++ scripts/PRD.gd | 2 - scripts/constants.gd | 37 ++++++++- table/nine-patch.png | Bin 125 -> 0 bytes table/nine-patch.png.import | 34 -------- table/node.tscn | 18 ---- table/selector.tscn | 15 ---- table/switch.gdshader | 7 ++ table/switch.tscn | 27 ++++++ table/table.gd | 15 ++-- 12 files changed, 150 insertions(+), 268 deletions(-) create mode 100644 ems_g.gd delete mode 100644 table/nine-patch.png delete mode 100644 table/nine-patch.png.import delete mode 100644 table/selector.tscn create mode 100644 table/switch.gdshader create mode 100644 table/switch.tscn diff --git a/PRD_MP550.tscn b/PRD_MP550.tscn index 46fa920..3f375da 100644 --- a/PRD_MP550.tscn +++ b/PRD_MP550.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=41 format=3 uid="uid://cvor2jm4xk3ha"] +[gd_scene load_steps=43 format=3 uid="uid://cvor2jm4xk3ha"] [ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"] [ext_resource type="Script" path="res://table/table.gd" id="2_vmbyo"] @@ -7,40 +7,11 @@ [ext_resource type="Texture2D" uid="uid://62v0xejejuwj" path="res://Web.png" id="5_i3nvb"] [ext_resource type="Texture2D" uid="uid://dkef6xwxwdxi8" path="res://эмс-бланк.png" id="7_hdx0f"] [ext_resource type="Texture2D" uid="uid://b15flrfytxkop" path="res://эмс-бланк-пост.png" id="8_eaogg"] +[ext_resource type="Script" path="res://ems_g.gd" id="9_g1wia"] [ext_resource type="Texture2D" uid="uid://ijdfo2mml54" path="res://эмс-бланк-перем.png" id="9_nctgk"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ewq4n"] -content_margin_left = 6.0 -content_margin_top = 5.0 -content_margin_right = 6.0 -content_margin_bottom = 5.0 -bg_color = Color(0.189, 0.216, 0.261, 1) -border_color = Color(0.147, 0.168, 0.203, 1) -corner_radius_top_left = 3 -corner_radius_top_right = 3 -corner_radius_bottom_right = 3 -corner_radius_bottom_left = 3 -corner_detail = 3 -anti_aliasing = false - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wlyk3"] -content_margin_left = 6.0 -content_margin_top = 5.0 -content_margin_right = 6.0 -content_margin_bottom = 5.0 -bg_color = Color(0.147, 0.168, 0.203, 1) -draw_center = false -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color(0.44, 0.73, 0.98, 1) -corner_radius_top_left = 3 -corner_radius_top_right = 3 -corner_radius_bottom_right = 3 -corner_radius_bottom_left = 3 -corner_detail = 3 -anti_aliasing = false +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eib3t"] +bg_color = Color(0.356863, 0.278431, 0.356863, 1) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o0too"] bg_color = Color(0.223529, 0.168627, 0.223529, 1) @@ -62,6 +33,18 @@ corner_radius_bottom_left = 3 corner_detail = 3 anti_aliasing = false +[sub_resource type="Image" id="Image_ye5as"] +data = { +"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 100, 255, 255, 255, 156, 255, 255, 255, 183, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 183, 255, 255, 255, 156, 255, 255, 255, 99, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 65, 255, 255, 255, 183, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 182, 255, 255, 255, 63, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 65, 255, 255, 255, 191, 255, 255, 255, 191, 184, 184, 184, 207, 81, 81, 81, 237, 43, 43, 43, 249, 43, 43, 43, 249, 81, 81, 81, 236, 186, 186, 186, 207, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 63, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 183, 255, 255, 255, 191, 126, 126, 126, 223, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 129, 129, 129, 222, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 181, 255, 255, 255, 16, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 100, 255, 255, 255, 191, 184, 184, 184, 207, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 27, 27, 27, 255, 187, 187, 187, 206, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 97, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 156, 255, 255, 255, 191, 81, 81, 81, 237, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 82, 82, 82, 236, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 155, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 183, 255, 255, 255, 191, 43, 43, 43, 249, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 43, 43, 43, 249, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 182, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 183, 255, 255, 255, 191, 43, 43, 43, 249, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 44, 44, 44, 249, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 181, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 156, 255, 255, 255, 191, 81, 81, 81, 236, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 83, 83, 83, 236, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 154, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 99, 255, 255, 255, 191, 186, 186, 186, 207, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 27, 27, 27, 255, 188, 188, 188, 206, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 97, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 182, 255, 255, 255, 191, 129, 129, 129, 222, 27, 27, 27, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 26, 26, 26, 255, 27, 27, 27, 255, 130, 130, 130, 221, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 180, 255, 255, 255, 15, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 63, 255, 255, 255, 191, 255, 255, 255, 191, 187, 187, 187, 206, 82, 82, 82, 236, 43, 43, 43, 249, 44, 44, 44, 249, 83, 83, 83, 236, 188, 188, 188, 206, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 63, 255, 255, 255, 181, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 180, 255, 255, 255, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 97, 255, 255, 255, 155, 255, 255, 255, 182, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 181, 255, 255, 255, 154, 255, 255, 255, 97, 255, 255, 255, 15, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 32 +} + +[sub_resource type="ImageTexture" id="ImageTexture_7imsd"] +image = SubResource("Image_ye5as") + [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_h8aei"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_d322q"] @@ -71,11 +54,11 @@ anti_aliasing = false [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ls6vm"] [sub_resource type="Theme" id="Theme_k5ur4"] -Button/styles/disabled = SubResource("StyleBoxFlat_ewq4n") -Button/styles/focus = SubResource("StyleBoxFlat_wlyk3") +Button/styles/focus = SubResource("StyleBoxFlat_eib3t") Button/styles/hover = SubResource("StyleBoxFlat_o0too") Button/styles/normal = SubResource("StyleBoxFlat_dm3xa") Button/styles/pressed = SubResource("StyleBoxFlat_h7n4k") +CheckButton/icons/unchecked = SubResource("ImageTexture_7imsd") TabContainer/styles/panel = SubResource("StyleBoxTexture_h8aei") TabContainer/styles/tab_focus = SubResource("StyleBoxTexture_d322q") TabContainer/styles/tab_selected = SubResource("StyleBoxTexture_8j02b") @@ -500,9 +483,21 @@ metadata/_edit_lock_ = true visible = false layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxTexture_ooo4i") +script = ExtResource("9_g1wia") metadata/_tab_index = 2 metadata/_edit_lock_ = true +[node name="scroll1" type="ScrollContainer" parent="TabContainer/EMS_G"] +offset_left = 91.0 +offset_top = 156.0 +offset_right = 1505.0 +offset_bottom = 855.0 + +[node name="table1" type="GridContainer" parent="TabContainer/EMS_G/scroll1"] +layout_mode = 2 +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true + [connection signal="pressed" from="Background/side_panel/select_prd" to="." method="_on_prd_select"] [connection signal="pressed" from="Background/side_panel/select_control" to="." method="_on_control_button"] [connection signal="pressed" from="Background/side_panel/select_ems_g" to="." method="_on_emsg_select"] diff --git a/Shaders/shader_edu.tres b/Shaders/shader_edu.tres index 1fa072b..ceb45ae 100644 --- a/Shaders/shader_edu.tres +++ b/Shaders/shader_edu.tres @@ -1,159 +1,8 @@ [gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://s6xe8igevnv2"] -[sub_resource type="Shader" id="1"] -code = "shader_type canvas_item; - -uniform vec4 colore: source_color; -uniform vec2 pc0; /* Центр сетки антенн */ -uniform vec4 color0: source_color = vec4(0.38, 0.47, 0.51, 0.4); -uniform vec4 color1: source_color = vec4(0.39, 0.44, 0.50, 0.4); - -const float mask_grad = 0.75; -const float rotation = 135.0; -const float radius_inner = 200.0; /* Радиус внутренний. Должно быть равно ant_band_r0_0 */ -const float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */ - -const float ant_band_count_0 = 6.0; -const float ant_band_count_1 = 6.0; -const float ant_band_count_2 = 6.0; -const float ant_band_count_3 = 6.0; -const float ant_band_count_4 = 6.0; -const float ant_band_count_5 = 6.0; -const float ant_band_count_6 = 6.0; - -const float ant_band_r0_0 = 200.0; -const float ant_band_r0_1 = 250.0; -const float ant_band_r0_2 = 300.0; -const float ant_band_r0_3 = 350.0; -const float ant_band_r0_4 = 400.0; -const float ant_band_r0_5 = 450.0; -const float ant_band_r0_6 = 500.0; - -const float ant_band_r1_0 = 250.0; -const float ant_band_r1_1 = 300.0; -const float ant_band_r1_2 = 350.0; -const float ant_band_r1_3 = 400.0; -const float ant_band_r1_4 = 450.0; -const float ant_band_r1_5 = 500.0; -const float ant_band_r1_6 = 550.0; -const float d4 = 90.0; -const float ds = 1.0; - - -float SMOOTH(float r, float R, float d) -{ - return 1.0 - smoothstep(R - d, R + d, r); -} - - -float remap(float i_min, float i_max, float o_min, float o_max, float val) { - float t = (val - i_min) / (i_max - i_min); - return o_min + (o_max - o_min) * t; -} - - -float mask(vec2 uv, float value) -{ - float r = atan(uv.x, uv.y); - r = remap(-PI, PI, 0.0, 1.0, r); - r = step(r, value * 0.5); - - uv.x = uv.x + 1.0; - uv.x = uv.x * -1.0; - uv.x += 1.0; - float l = atan(uv.x, uv.y); - l = remap(-PI, PI, 0.0, 1.0, l); - l = step(l, value * 0.5); - - return r + l ; -} - - -void sector(inout vec4 c, vec2 uv, vec2 center, float a, float da, float r0, float r1, vec4 color) -{ - float l = distance(center, uv); - vec2 d = uv - center; - float sf = 500.0; - float theta = atan(d.x, d.y) * sf; - da /= 2.0; - float a0 = radians(a - da); - float a1 = radians(a + da); - float va = SMOOTH(a0 * sf, theta, ds) - SMOOTH(a1 * sf, theta, ds); - float vr = SMOOTH(r0, l, ds) - SMOOTH(r1, l, ds); - float rgb = sqrt(va * vr); - c.rgb += color.rgb * rgb * color.a; - c.a += rgb * color.a; -} - - -void antenas(inout vec4 c, vec2 uv, vec2 p0, float cnt, float r0, float r1, vec4 c0, vec4 c1) -{ - float da = 180.0f / float(cnt); - for (int i = int(-cnt); i <= int(cnt); i ++) - { - float v = float(i & 1); - vec4 col = v * c0 + (1.0f - v) * c1; - sector(c, uv, p0, float(i) * da, da, r0, r1, col); - } -} - - -void circle_thin(inout vec3 color, vec2 uv, vec2 p, float r, float w, vec3 c, float a) -{ - float d = distance(uv, p); - float v0 = r - w; - float v1 = r + w; - color += a * sqrt(smoothstep(v1, v0, d) * smoothstep(v0, v1, d) * c); -} - - -void line_r(inout vec4 color, vec2 uv, vec2 center, float theta0, float radius, vec4 c) -{ - vec2 d = uv - center; - vec2 p = radius * vec2(cos(theta0 * PI / 180.0), - sin(theta0 * PI / 180.0)); - float l = length(d - p * clamp(dot(d, p) / dot(p, p), 0.0, 1.0)); - color.rgb += c.rgb * SMOOTH(l, 1.0, ds) * c.a; -} - - -void rotate_vec2(inout vec2 vert, float a) -{ - float sin_a = sin(a); - float cos_a = cos(a); - vert *= mat2(vec2(cos_a, sin_a), vec2(-sin_a, cos_a)); -} - - -void vertex() -{ - VERTEX -= pc0; - rotate_vec2(VERTEX, radians(rotation)); - VERTEX += pc0; -} - - -void fragment() -{ - ivec2 isz = textureSize(TEXTURE, 0); - vec2 uv = UV * vec2(float(isz.x), float(isz.y)); // координаты текущей точки в пикселях - float mask = mask(uv, mask_grad); - COLOR = vec4(0.0, 0.0, 0.0, 0.0) - mask; //texture(TEXTURE, UV); // Цвет текущей точки - - // Сетка антенн - antenas(COLOR, uv, pc0, ant_band_count_0, ant_band_r0_0, ant_band_r1_0, color1, color0); - antenas(COLOR, uv, pc0, ant_band_count_1, ant_band_r0_1, ant_band_r1_1, color0, color1); - antenas(COLOR, uv, pc0, ant_band_count_2, ant_band_r0_2, ant_band_r1_2, color1, color0); - antenas(COLOR, uv, pc0, ant_band_count_3, ant_band_r0_3, ant_band_r1_3, color0, color1); - antenas(COLOR, uv, pc0, ant_band_count_4, ant_band_r0_4, ant_band_r1_4, color1, color0); - antenas(COLOR, uv, pc0, ant_band_count_5, ant_band_r0_5, ant_band_r1_5, color0, color1); - - -} -" +[ext_resource type="Shader" path="res://Shaders/ray.gdshader" id="1_mtift"] [resource] -shader = SubResource("1") -shader_parameter/colore = Color(0, 0, 0, 1) -shader_parameter/pc0 = Vector2(560.03, 560) -shader_parameter/color0 = Color(0.203922, 0.203922, 0.203922, 0.478431) -shader_parameter/color1 = Color(0.945098, 0.964706, 0.972549, 0.117647) +shader = ExtResource("1_mtift") +shader_parameter/color_signal = null +shader_parameter/turn = 0.785 diff --git a/ems_g.gd b/ems_g.gd new file mode 100644 index 0000000..5d184ce --- /dev/null +++ b/ems_g.gd @@ -0,0 +1,39 @@ +extends Panel + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var node_select1 = $scroll1/table1 + var EMS_G_TABLE: Array + for i_row in Constants.INPUT_EMS_G.size()+1: + var column: Array + for out_colum in Constants.OUT_EMS_G.size()+1: + if out_colum > 0 and i_row > 0: + column.append(Constants.Switch) + else: + column.append(Constants.TableNode) + EMS_G_TABLE.append(column) + + draw_tabl(node_select1, EMS_G_TABLE, EMS_G_TABLE.size()) + + node_select1.get_node2(0, 0).text = 'XЭ ТРИ' + for i in Constants.INPUT_EMS_G.size(): + node_select1.get_node2(0, i+1).text = Constants.INPUT_EMS_G[i] + + for i in Constants.OUT_EMS_G.size(): + node_select1.get_node2(i+1, 0).text = Constants.OUT_EMS_G[i] + + + var columns_min_size: Array + for i in EMS_G_TABLE.size(): + columns_min_size.append(70) + node_select1.set_columns_min_size(columns_min_size) + + +func draw_tabl(tbl, row: Array, count_row: int): + for i_row in count_row: + tbl.add_row(row[i_row]) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/scripts/PRD.gd b/scripts/PRD.gd index 15566f0..11431db 100644 --- a/scripts/PRD.gd +++ b/scripts/PRD.gd @@ -47,8 +47,6 @@ func _ready() -> void: node_control_device.get_node2(0, i).text = Constants.CONTROL_DEVICE[i] node_control_device.set_columns_min_size([300]) - - $TabContainer/PRD/Zapret.connect('toggled', Callable(self, '_on_zapret').bind($TabContainer/PRD/Zapret)) $TabContainer/PRD/Zapret2.connect('toggled', Callable(self, '_on_zapret').bind($TabContainer/PRD/Zapret2)) Network.connect('_yau_status_line', Callable(self, '_on_yau_status')) diff --git a/scripts/constants.gd b/scripts/constants.gd index f9aced0..b1da50a 100644 --- a/scripts/constants.gd +++ b/scripts/constants.gd @@ -10,6 +10,7 @@ const MINIMUM_CODE_AD: int = 2660 const TEMP: float = 115.0 / (MAXIMUM_CODE_ADC - MINIMUM_CODE_AD) const TableNode = preload("res://table/node.tscn") const TableList = preload("res://table/node_list.tscn") +const Switch = preload("res://table/switch.tscn") const SELECT_DEVICE: Array = [[TableNode, TableList]] const CONTROL_DEVICE: Array = ['ЯЧЕЙКА ЯУ-07Б', 'ФС', 'ЯЧЕЙКА ЭМС-Г', 'ЯЧЕЙКА УГ', 'ЯЧЕЙКА УКП №1', 'ЯЧЕЙКА УКП №2', 'ИП МАА №1', 'ИП МАА №2', 'ИП9-50 №1', 'ИП9-50 №2', 'ИП12-50 №1', '-', '-','ИП5-25', 'Х3:2(СЗИ2 от УФ)', 'Х3:19(СИ2 от ФС)', 'Х3:11(СИ2 в УФ)', 'Х3:14(Модуляция)', 'Х3:27(ФГОЗ)'] const ROWS_REGS_DATA: Array = [ @@ -59,12 +60,46 @@ var CONTROL_POWER_SUPPLY: Array = [ ['ИП9-50 №3', 'ОШИБКА. КОНТРОЛЬ ИП9-50 №3'], ['ИП12-50 №2', 'ОШИБКА. КОНТРОЛЬ ИП12-50 №2'], ['ИП5-25', 'ОШИБКА. КОНТРОЛЬ ИП5-25']] -const EMS_G = [ +const EMS_G: Array = [ ['Нет Х3:2(СЗИ2 от УФ)', 'Есть Х3:2(СЗИ2 от УФ)'], ['Нет Х3:19(СИ2 от ФС)', 'Есть Х3:19(СИ2 от ФС)'], ['Нет Х3:11(СИ2 в УФ)', 'Есть Х3:11(СИ2 в УФ)'], ['Нет Х3:14(Модуляция)', 'Есть Х3:14(Модуляция)'], ['Нет Х3:27(ФГОЗ)', 'Есть Х3:27(ФГОЗ)']] +const INPUT_EMS_G: Array = [ + '01/:34', + '02/:35', + '03/:36', + '04/:37', + '05/:38', + '06/:39', + '07/:40', + '08/:41', + '18/:42', + '19/:43', + '20/:44', + '21/:45', + '22/:46', + '23/:47', + '24/:48', + '25/:49',] +const OUT_EMS_G: Array = [ + '10/:34', + '11/:35', + '12/:36', + '13/:37', + '14/:38', + '15/:39', + '16/:40', + '17/:41', + '26/:42', + '27/:43', + '28/:44', + '29/:45', + '30/:46', + '31/:47', + '32/:48', + '33/:49',] enum MODE { PRD_K, PRD_B, diff --git a/table/nine-patch.png b/table/nine-patch.png deleted file mode 100644 index 1649a7f27bffc6bd73e480ab6979e43be73e8fbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1|+Qw)-3{3E}kxqAs)xyUf(Flpupo4_~A}{ zYL4x1kI#`0T0=TRx>Pki_bu8MzWQUG`phHm&R&yZh6DclSMBY)q8>-_nZDq$u-UlN Q9%vqer>mdKI;Vst0JilfxBvhE diff --git a/table/nine-patch.png.import b/table/nine-patch.png.import deleted file mode 100644 index 2d8c80a..0000000 --- a/table/nine-patch.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bw3yv3smvaxqn" -path="res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://table/nine-patch.png" -dest_files=["res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.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 diff --git a/table/node.tscn b/table/node.tscn index 7836d01..4fa8f81 100644 --- a/table/node.tscn +++ b/table/node.tscn @@ -31,21 +31,3 @@ alignment = 1 editable = false caret_blink = true caret_blink_interval = 0.5 - -[node name="Label" type="Label" parent="."] -visible = false -layout_mode = 0 -offset_right = 40.0 -offset_bottom = 23.0 - -[node name="Label" type="Label" parent="Label"] -visible = false -layout_mode = 0 -offset_right = 40.0 -offset_bottom = 23.0 - -[node name="CheckButton" type="CheckButton" parent="Label"] -visible = false -layout_mode = 0 -offset_right = 44.0 -offset_bottom = 24.0 diff --git a/table/selector.tscn b/table/selector.tscn deleted file mode 100644 index f522b3f..0000000 --- a/table/selector.tscn +++ /dev/null @@ -1,15 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://pd3fcx55duj2"] - -[ext_resource type="Texture2D" uid="uid://bw3yv3smvaxqn" path="res://table/nine-patch.png" id="1_jtmfn"] - -[node name="NinePatchRect" type="NinePatchRect"] -offset_right = 17.0 -offset_bottom = 16.0 -texture = ExtResource("1_jtmfn") -draw_center = false -patch_margin_left = 8 -patch_margin_top = 8 -patch_margin_right = 8 -patch_margin_bottom = 8 -axis_stretch_horizontal = 1 -axis_stretch_vertical = 1 diff --git a/table/switch.gdshader b/table/switch.gdshader new file mode 100644 index 0000000..b470eac --- /dev/null +++ b/table/switch.gdshader @@ -0,0 +1,7 @@ +shader_type canvas_item; + +void fragment() +{ + COLOR.rgb = vec3(1.0, 1.0, 1.0) - log(COLOR.rgb); +} + diff --git a/table/switch.tscn b/table/switch.tscn new file mode 100644 index 0000000..0d36949 --- /dev/null +++ b/table/switch.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=6 format=3 uid="uid://dhg1syshfaem2"] + +[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://Shaders/shader_edu.tres" id="1_nb5jm"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kwqxa"] +bg_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7vs72"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_houwj"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o2hja"] +bg_color = Color(0.6, 0.6, 0.6, 0) + +[node name="PanelContainer" type="PanelContainer"] +offset_right = 186.0 +offset_bottom = 40.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_kwqxa") + +[node name="CheckButton" type="CheckButton" parent="."] +material = ExtResource("1_nb5jm") +layout_mode = 2 +size_flags_horizontal = 4 +mouse_default_cursor_shape = 2 +theme_override_styles/disabled_mirrored = SubResource("StyleBoxTexture_7vs72") +theme_override_styles/hover = SubResource("StyleBoxTexture_houwj") +theme_override_styles/normal = SubResource("StyleBoxFlat_o2hja") diff --git a/table/table.gd b/table/table.gd index a2d0ff9..ddca4e8 100644 --- a/table/table.gd +++ b/table/table.gd @@ -7,7 +7,7 @@ class_name GDTable extends GridContainer @export var selector_key_down: Key = KEY_DOWN ## Клавиша увеличения индекса выбранного ряда @export var selector_key_up: Key = KEY_UP ## Клавиша уменьшения индекса выбранного ряда @export_file var node_type_file: = 'res://table/node.tscn': get = get_node_scene, set = load_node_scene ## Сцена ячейки устанавливаемая по умолчанию -@export_file var selector_type_file: = 'res://table/selector.tscn': set = load_selector_scene ## Сцена селектора для выбранного ряда +@export_file var switch_type_file: = 'res://table/switch.tscn': set = load_switch_scene ## Сцена селектора для выбранного ряда const HEAD_PREFIX = 'HEAD_' ## Префикс ключа заголовка таблицы const INDEX_FORMAT = '%02d_%02d' ## Формат индекса ключа @@ -28,6 +28,7 @@ var nodes: = {} ## Все ячейки таблицы и до var columns_min_size = [] ## Ширина каждой колонки var ScnNode: PackedScene ## Прототип ячейки таблицы var ScnSelector: PackedScene ## Прототип индикатора выбранного ряда +var ScnSwitch: PackedScene var selector_color_proc: Callable ## Ссылка на процедуру генератора цвета индикатора выбранного ряда var selector_size_proc: Callable ## Ссылка на процедуру генератора размера индикатора выбранного ряда @@ -121,11 +122,9 @@ func set_columns_alignments(alignments: Array): set_node_alligment(i_col, i_row, alignments[i_col]) -## -func load_selector_scene(file_name: String): - selector_type_file = file_name - ScnSelector = load(file_name) - +func load_switch_scene(file_name: String): + switch_type_file = file_name + ScnSwitch = load(file_name) ## func load_node_scene(file_name: String): @@ -135,10 +134,10 @@ func load_node_scene(file_name: String): ## func _ready(): - ScnSelector = load(selector_type_file) + ScnSwitch = load(switch_type_file) ScnNode = load(node_type_file) - assert(ScnSelector is PackedScene) assert(ScnNode is PackedScene) + assert(ScnSwitch is PackedScene) ## Выравнивает по нижнему левому углу. Используется для выравнивания по заголовку.