Доработка. В Журнале добавлена дата.

This commit is contained in:
MaD_CaT
2023-09-19 09:52:11 +03:00
parent 7cab218edb
commit 4c5e46a289
7 changed files with 128 additions and 73 deletions

View File

@@ -49,8 +49,8 @@ func _enter_tree() -> void:
set_file_path(ProjectSettings.get_setting("plugins/logger/file/file_path", "user://uarep-ctl.log"))
set_file_write_enabled(ProjectSettings.get_setting("plugins/logger/file/log_file_write", true))
_format_default_output = ProjectSettings.get_setting("plugins/logger/default_output_format", "[{hour}:{minute}:{second}][{level}]{text}")
_format_file = ProjectSettings.get_setting("plugins/logger/file_format", "[{hour}:{minute}:{second}][{level}]{text}")
_format_default_output = ProjectSettings.get_setting("plugins/logger/default_output_format", "[{year}-{month}-{day} {hour}:{minute}:{second}][{level}]{text}")
_format_file = ProjectSettings.get_setting("plugins/logger/file_format", "[{year}-{month}-{day} {hour}:{minute}:{second}][{level}]{text}")
func _exit_tree() -> void:
@@ -158,6 +158,9 @@ func fatal(text: String) -> void:
func format_file(msg: Dictionary) -> String:
return _format_file.format(
{
"year": "%02d" % msg["year"],
"month": "%02d" % msg["month"],
"day": "%02d" % msg["day"],
"hour": "%02d" % msg["hour"],
"minute":"%02d" % msg["minute"],
"second":"%02d" % msg["second"],
@@ -170,6 +173,9 @@ func format_file(msg: Dictionary) -> String:
func format_stdout(msg: Dictionary) -> String:
return _format_default_output.format(
{
"year": "%02d" % msg["year"],
"month": "%02d" % msg["month"],
"day": "%02d" % msg["day"],
"hour": "%02d" % msg["hour"],
"minute":"%02d" % msg["minute"],
"second":"%02d" % msg["second"],
@@ -184,7 +190,7 @@ func message(level: int, text: String) -> void:
assert(text, "Invalid message text.")
if _log_enabled and _level & level:
var msg : Dictionary = Time.get_time_dict_from_system()
var msg : Dictionary = Time.get_datetime_dict_from_system()
msg["level"] = level
msg["level_name"] = _names[level]
msg["text"] = " " + text

View File

@@ -10,7 +10,7 @@ extends RichTextLabel
signal handled()
@export var format_text : String = "[{hour}:{minute}:{second}][{level}]{text}"
@export var format_text : String = "[{year}-{month}-{day} {hour}:{minute}:{second}][{level}]{text}"
@export var colors : Dictionary = {
Logger.INFO: Color.WHITE,
Logger.DEBUG: Color.GRAY,
@@ -59,6 +59,9 @@ func get_logger() -> Logger:
func format(message: Dictionary) -> String:
return format_text.format(
{
"year": "%02d" % message["year"],
"month": "%02d" % message["month"],
"day": "%02d" % message["day"],
"hour": "%02d" % message["hour"],
"minute": "%02d" % message["minute"],
"second": "%02d" % message["second"],
@@ -72,5 +75,4 @@ func handle_message(message: Dictionary) -> void:
push_color(get_color(message["level"]))
append_text(format(message) + "\n")
pop()
handled.emit()

View File

@@ -34,6 +34,7 @@ Threats="*res://scripts/threats.gd"
YemsDevs="*res://scripts/yems-devs.gd"
Yemsboards="*res://scripts/yemsboards.gd"
YemsConsts="*res://scripts/yems-consts.gd"
interfer="*res://scripts/interfer.gd"
[debug]

View File

@@ -1,18 +1,18 @@
[gd_scene load_steps=9 format=3 uid="uid://dab6loryocc73"]
[ext_resource type="Script" path="res://scenes/ЭМС.gd" id="1_7ip0t"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="2_85cl8"]
[ext_resource type="Texture2D" uid="uid://dd60btbqnpiqw" path="res://data/document-new-0.png" id="3_mtj4x"]
[ext_resource type="Texture2D" uid="uid://coqg6wsftvtxr" path="res://data/document-save-0.png" id="4_m4ucm"]
[ext_resource type="Texture2D" uid="uid://cywuevvpkxl7v" path="res://data/edit-copy-0.png" id="5_eeb4o"]
[ext_resource type="Texture2D" uid="uid://7h55yvh84cve" path="res://data/connect.png" id="6_kacis"]
[ext_resource type="Texture2D" uid="uid://cjsr544qccftu" path="res://data/disconnect.png" id="7_2f7bd"]
[ext_resource type="Script" path="res://table/table.gd" id="8_1mtjm"]
[ext_resource type="Script" path="res://scenes/ЭМС.gd" id="1_pviu7"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="2_1ax2t"]
[ext_resource type="Texture2D" uid="uid://dd60btbqnpiqw" path="res://data/document-new-0.png" id="3_r066l"]
[ext_resource type="Texture2D" uid="uid://coqg6wsftvtxr" path="res://data/document-save-0.png" id="4_acavs"]
[ext_resource type="Texture2D" uid="uid://cywuevvpkxl7v" path="res://data/edit-copy-0.png" id="5_m3d6g"]
[ext_resource type="Texture2D" uid="uid://7h55yvh84cve" path="res://data/connect.png" id="6_bj72w"]
[ext_resource type="Texture2D" uid="uid://cjsr544qccftu" path="res://data/disconnect.png" id="7_f177o"]
[ext_resource type="Script" path="res://table/table.gd" id="8_6w7lj"]
[node name="ЭМС" type="Panel"]
offset_right = 1598.0
offset_bottom = 1201.0
script = ExtResource("1_7ip0t")
script = ExtResource("1_pviu7")
[node name="lbl_online" type="Label" parent="."]
layout_mode = 0
@@ -23,7 +23,7 @@ offset_bottom = 30.0
theme_override_colors/font_color = Color(0, 0.647059, 0.184314, 1)
text = "Ячейка на связи"
[node name="btn_flash_read" parent="." instance=ExtResource("2_85cl8")]
[node name="btn_flash_read" parent="." instance=ExtResource("2_1ax2t")]
layout_mode = 0
offset_left = 1446.0
offset_top = 55.0
@@ -31,7 +31,7 @@ offset_right = 1583.0
offset_bottom = 85.0
text = "Прочитать"
[node name="btn_flash_write" parent="." instance=ExtResource("2_85cl8")]
[node name="btn_flash_write" parent="." instance=ExtResource("2_1ax2t")]
layout_mode = 0
offset_left = 1446.0
offset_top = 99.0
@@ -48,7 +48,7 @@ offset_bottom = 1016.0
focus_mode = 0
shortcut_feedback = false
shortcut_in_tooltip = false
icon = ExtResource("3_mtj4x")
icon = ExtResource("3_r066l")
[node name="btn_save" type="Button" parent="."]
layout_mode = 0
@@ -57,7 +57,7 @@ offset_top = 1017.0
offset_right = 1509.0
offset_bottom = 1073.0
focus_mode = 0
icon = ExtResource("4_m4ucm")
icon = ExtResource("4_acavs")
[node name="btn_copy" type="Button" parent="."]
layout_mode = 0
@@ -66,7 +66,7 @@ offset_top = 1074.0
offset_right = 1510.0
offset_bottom = 1130.0
focus_mode = 0
icon = ExtResource("5_eeb4o")
icon = ExtResource("5_m3d6g")
[node name="btn_connect" type="Button" parent="."]
layout_mode = 0
@@ -76,7 +76,7 @@ offset_right = 683.0
offset_bottom = 111.0
focus_mode = 0
theme_override_colors/icon_normal_color = Color(1, 1, 1, 1)
icon = ExtResource("6_kacis")
icon = ExtResource("6_bj72w")
[node name="btn_disconnect" type="Button" parent="."]
layout_mode = 0
@@ -86,7 +86,7 @@ offset_right = 770.0
offset_bottom = 815.0
focus_mode = 0
theme_override_colors/icon_normal_color = Color(1, 1, 1, 1)
icon = ExtResource("7_2f7bd")
icon = ExtResource("7_f177o")
[node name="scrollin" type="ScrollContainer" parent="."]
layout_mode = 0
@@ -97,7 +97,7 @@ offset_bottom = 679.0
[node name="tbl_in" type="GridContainer" parent="scrollin"]
layout_mode = 2
script = ExtResource("8_1mtjm")
script = ExtResource("8_6w7lj")
[node name="scrl_files" type="ScrollContainer" parent="."]
layout_mode = 0
@@ -108,7 +108,7 @@ offset_bottom = 1166.0
[node name="tbl_files" type="GridContainer" parent="scrl_files"]
layout_mode = 2
script = ExtResource("8_1mtjm")
script = ExtResource("8_6w7lj")
[node name="scrollout" type="ScrollContainer" parent="."]
layout_mode = 0
@@ -119,7 +119,7 @@ offset_bottom = 679.0
[node name="tbl_out" type="GridContainer" parent="scrollout"]
layout_mode = 2
script = ExtResource("8_1mtjm")
script = ExtResource("8_6w7lj")
[node name="scrl_in_set" type="ScrollContainer" parent="."]
layout_mode = 0
@@ -130,7 +130,7 @@ offset_bottom = 942.0
[node name="tbl_in_set" type="GridContainer" parent="scrl_in_set"]
layout_mode = 2
script = ExtResource("8_1mtjm")
script = ExtResource("8_6w7lj")
[node name="scrl_out_set" type="ScrollContainer" parent="."]
layout_mode = 0
@@ -141,4 +141,4 @@ offset_bottom = 924.0
[node name="tbl_out_set" type="GridContainer" parent="scrl_out_set"]
layout_mode = 2
script = ExtResource("8_1mtjm")
script = ExtResource("8_6w7lj")

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://trt0q8th3bn2"]
[ext_resource type="Script" path="res://scenes/журнал.gd" id="1_3f1mv"]
[ext_resource type="Script" path="res://addons/godot-logger/scripts/logger_output.gd" id="1_t5g4h"]
[ext_resource type="Script" path="res://scenes/журнал.gd" id="1_d0gme"]
[ext_resource type="Script" path="res://addons/godot-logger/scripts/logger_output.gd" id="2_2i2cr"]
[node name="журнал" type="Control"]
layout_mode = 3
@@ -10,7 +10,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_3f1mv")
script = ExtResource("1_d0gme")
[node name="content" type="RichTextLabel" parent="."]
layout_mode = 0
@@ -23,7 +23,7 @@ theme_override_colors/selection_color = Color(0.72549, 0.270588, 0.133333, 1)
threaded = true
selection_enabled = true
deselect_on_focus_loss_enabled = false
script = ExtResource("1_t5g4h")
script = ExtResource("2_2i2cr")
[node name="btn_save" type="Button" parent="."]
layout_mode = 0
@@ -43,8 +43,8 @@ text = "Очистить"
[node name="dlg_file" type="FileDialog" parent="."]
gui_embed_subwindows = true
title = "Сохранить журнал работы в файл"
initial_position = 2
title = "Сохранить журнал работы в файл"
size = Vector2i(900, 900)
borderless = true
ok_button_text = "Да"

View File

@@ -1,18 +1,18 @@
[gd_scene load_steps=10 format=3 uid="uid://b276iygic5itk"]
[ext_resource type="Script" path="res://scenes/работа.gd" id="1_g2xk6"]
[ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip.tscn" id="2_ijbv2"]
[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="3_fppu7"]
[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="3_usoq4"]
[ext_resource type="Script" path="res://scenes/scroll-threats.gd" id="5_tr3hj"]
[ext_resource type="Script" path="res://table/table.gd" id="6_fpdpm"]
[ext_resource type="Script" path="res://scenes/scroll-params.gd" id="6_tict0"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="7_2sxkw"]
[ext_resource type="FontFile" uid="uid://befva8r034a4v" path="res://data/DSEG7Classic-Regular.ttf" id="8_68ssn"]
[ext_resource type="Script" path="res://scenes/работа.gd" id="1_cirhg"]
[ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip.tscn" id="2_5lsre"]
[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="3_rfr42"]
[ext_resource type="Script" path="res://scenes/scroll-threats.gd" id="4_olvla"]
[ext_resource type="Script" path="res://table/table.gd" id="5_04ppt"]
[ext_resource type="Script" path="res://scenes/scroll-params.gd" id="6_l01tb"]
[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="7_ex1qt"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="8_2hm8b"]
[ext_resource type="FontFile" uid="uid://befva8r034a4v" path="res://data/DSEG7Classic-Regular.ttf" id="9_tmklf"]
[node name="Работа" type="Panel"]
script = ExtResource("1_g2xk6")
Bip = ExtResource("2_ijbv2")
script = ExtResource("1_cirhg")
Bip = ExtResource("2_5lsre")
col_grey = Color(0.34902, 0.643137, 0.772549, 0.168627)
col_red = Color(1, 0.568627, 0.431373, 0.239216)
drag_scale_band = 0.05
@@ -35,7 +35,7 @@ offset_bottom = 1169.0
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource("3_usoq4")
texture = ExtResource("3_rfr42")
patch_margin_left = 15
patch_margin_top = 30
patch_margin_right = 15
@@ -59,18 +59,18 @@ offset_left = 4.0
offset_top = 51.0
offset_right = 476.0
offset_bottom = 282.0
script = ExtResource("5_tr3hj")
script = ExtResource("4_olvla")
[node name="table" type="GridContainer" parent="grd_side/frm_threats/scroll"]
layout_mode = 2
columns = 4
script = ExtResource("6_fpdpm")
script = ExtResource("5_04ppt")
[node name="frm_params" type="NinePatchRect" parent="grd_side"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource("3_usoq4")
texture = ExtResource("3_rfr42")
patch_margin_left = 15
patch_margin_top = 30
patch_margin_right = 15
@@ -94,17 +94,17 @@ offset_left = 4.0
offset_top = 54.0
offset_right = 476.0
offset_bottom = 282.0
script = ExtResource("6_tict0")
script = ExtResource("6_l01tb")
[node name="table" type="GridContainer" parent="grd_side/frm_params/scroll"]
layout_mode = 2
script = ExtResource("6_fpdpm")
script = ExtResource("5_04ppt")
[node name="frm_ecm_list" type="NinePatchRect" parent="grd_side"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource("3_usoq4")
texture = ExtResource("3_rfr42")
patch_margin_left = 15
patch_margin_top = 30
patch_margin_right = 15
@@ -131,13 +131,13 @@ offset_bottom = 285.0
[node name="table" type="GridContainer" parent="grd_side/frm_ecm_list/scroll"]
layout_mode = 2
script = ExtResource("6_fpdpm")
script = ExtResource("5_04ppt")
[node name="frm_ecm_params" type="NinePatchRect" parent="grd_side"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource("3_usoq4")
texture = ExtResource("3_rfr42")
patch_margin_left = 15
patch_margin_top = 30
patch_margin_right = 15
@@ -164,12 +164,12 @@ offset_bottom = 282.0
[node name="table" type="GridContainer" parent="grd_side/frm_ecm_params/scroll"]
layout_mode = 2
script = ExtResource("6_fpdpm")
script = ExtResource("5_04ppt")
[node name="canvas" parent="." instance=ExtResource("3_fppu7")]
[node name="canvas" parent="." instance=ExtResource("7_ex1qt")]
metadata/_edit_lock_ = true
[node name="btn_auto_threat" parent="." instance=ExtResource("7_2sxkw")]
[node name="btn_auto_threat" parent="." instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 912.0
offset_top = 67.0
@@ -177,7 +177,7 @@ offset_right = 1102.0
offset_bottom = 117.0
text = "Автоматически"
[node name="btn_strobe" parent="." instance=ExtResource("7_2sxkw")]
[node name="btn_strobe" parent="." instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 912.0
offset_top = 6.0
@@ -185,7 +185,7 @@ offset_right = 1102.0
offset_bottom = 56.0
text = "Строб"
[node name="btn_p5" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p5" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 980.0
@@ -197,7 +197,7 @@ grow_vertical = 2
text = "ОЗП-1"
metadata/rfi_name = "ozp1"
[node name="btn_p6" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p6" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 840.0
offset_top = 1118.0
@@ -206,7 +206,7 @@ offset_bottom = 1168.0
text = "СВ-М2"
metadata/rfi_name = "svm2"
[node name="btn_p7" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p7" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 910.0
offset_top = 1118.0
@@ -215,7 +215,7 @@ offset_bottom = 1168.0
text = "K1"
metadata/rfi_name = "k1"
[node name="btn_p8" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p8" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 770.0
offset_top = 1118.0
@@ -224,7 +224,7 @@ offset_bottom = 1168.0
text = "СВ-И1"
metadata/rfi_name = "svi1"
[node name="btn_p9" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p9" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 700.0
offset_top = 1118.0
@@ -233,7 +233,7 @@ offset_bottom = 1168.0
text = "ПД-ЧМ"
metadata/rfi_name = "pdchm"
[node name="btn_p10" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p10" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 630.0
@@ -245,7 +245,7 @@ grow_vertical = 2
text = "ПД-М4С"
metadata/rfi_name = "pdm4s"
[node name="btn_p11" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p11" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 350.0
offset_top = 1118.0
@@ -254,7 +254,7 @@ offset_bottom = 1168.0
text = "ЛЧМ-1"
metadata/rfi_name = "lchm1"
[node name="btn_p12" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p12" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 420.0
@@ -266,7 +266,7 @@ grow_vertical = 2
text = "МЧМ-1"
metadata/rfi_name = "mchm1"
[node name="btn_p13" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p13" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 490.0
@@ -278,7 +278,7 @@ grow_vertical = 2
text = "ПД-М2"
metadata/rfi_name = "pdm2"
[node name="btn_p14" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p14" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 560.0
@@ -290,7 +290,7 @@ grow_vertical = 2
text = "ПД-М4"
metadata/rfi_name = "pdm4"
[node name="btn_p15" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p15" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 1
anchors_preset = -1
offset_left = 280.0
@@ -302,7 +302,7 @@ grow_vertical = 2
text = "СРН-М2"
metadata/rfi_name = "srnm2"
[node name="btn_p16" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_p16" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 210.0
offset_top = 1118.0
@@ -311,7 +311,7 @@ offset_bottom = 1168.0
text = "СРН-И1"
metadata/rfi_name = "srni1"
[node name="btn_off" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_off" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 140.0
offset_top = 1118.0
@@ -320,7 +320,7 @@ offset_bottom = 1168.0
text = "Откл."
metadata/rfi_name = "<off>"
[node name="btn_auto_rfi" parent="." groups=["группа-режим-помехи"] instance=ExtResource("7_2sxkw")]
[node name="btn_auto_rfi" parent="." groups=["группа-режим-помехи"] instance=ExtResource("8_2hm8b")]
layout_mode = 0
offset_left = 10.0
offset_top = 1118.0
@@ -336,7 +336,7 @@ offset_left = 96.0
offset_top = 109.0
offset_right = 164.0
offset_bottom = 142.0
theme_override_fonts/font = ExtResource("8_68ssn")
theme_override_fonts/font = ExtResource("9_tmklf")
theme_override_font_sizes/font_size = 20
text = "88"
vertical_alignment = 1
@@ -345,7 +345,7 @@ vertical_alignment = 1
layout_mode = 0
offset_right = 68.0
offset_bottom = 33.0
theme_override_fonts/font = ExtResource("8_68ssn")
theme_override_fonts/font = ExtResource("9_tmklf")
theme_override_font_sizes/font_size = 20
text = "00"
vertical_alignment = 1
@@ -357,7 +357,7 @@ offset_left = 96.0
offset_top = 29.0
offset_right = 188.0
offset_bottom = 88.0
theme_override_fonts/font = ExtResource("8_68ssn")
theme_override_fonts/font = ExtResource("9_tmklf")
theme_override_font_sizes/font_size = 56
text = "88"
@@ -365,7 +365,7 @@ text = "88"
layout_mode = 0
offset_right = 92.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("8_68ssn")
theme_override_fonts/font = ExtResource("9_tmklf")
theme_override_font_sizes/font_size = 56
text = "00"

View File

@@ -13,6 +13,7 @@ class Socket extends PacketPeerUDP:
var poll_sockets: Array[Socket]
var units: Dictionary
var sock_unicast: Socket
var sock_capsrpb: Socket
var logger_page: Node
@@ -36,6 +37,7 @@ func _ready() -> void:
poll_sockets.append(create_socket('уарэп-капсрпб-пол'))
sock_unicast = poll_sockets[0]
sock_capsrpb = poll_sockets[2]
for unit_name in REPSettings.UnitProfiles:
var setting = REPSettings.UnitProfiles[unit_name]
@@ -48,6 +50,50 @@ func _ready() -> void:
unit.connect('command_fail', Callable(logger_page, 'on_command_fail').bind(unit_key))
for key in units: Log.info('%s %s:%d' % [units[key].name, key[0], key[1]])
var timer_interfer: = Timer.new()
add_child(timer_interfer)
timer_interfer.connect('timeout', Callable(self, 'on_timer_interfer'))
timer_interfer.start(0.3)
func on_timer_interfer():
var interfer = {}
var random = RandomNumberGenerator.new()
random.randomize()
interfer['ts'] = 6
interfer['ss'] = 0
interfer['ispp'] = random.randi_range(1, 10)
interfer['krp'] = 'pdm2'
interfer['powp'] = random.randi_range(0, 10)
interfer['kni'] = random.randi_range(0, 360)
interfer['params'] = {'freq':random.randi_range(400, 6000), 'width': 20}
interfer['get'] = []
var json = JSON.new().stringify(interfer)
var pac = json.to_utf8_buffer()
sock_capsrpb.set_dest_address(REPSettings.UnitProfiles['уарэп-капсрпб-отп'][1], REPSettings.UnitProfiles['уарэп-капсрпб-отп'][2])
sock_capsrpb.put_packet(pac)
var msg_type8 = {}
var time = Time.get_datetime_dict_from_system()
msg_type8['ts'] = 8
msg_type8['ss'] = 0
msg_type8['roll'] = 0
msg_type8['trim'] = 0
msg_type8['year'] = time['year']
msg_type8['month'] = time['month']
msg_type8['day'] = time['day']
msg_type8['hour'] = time['hour']
msg_type8['minute'] = time['minute']
msg_type8['second'] = time['second']
msg_type8['long'] = 38.4324
msg_type8['lat'] = 43.5353
msg_type8['course'] = 264
msg_type8['speed'] = 10
json = JSON.new().stringify(msg_type8)
pac = json.to_utf8_buffer()
sock_capsrpb.set_dest_address(REPSettings.UnitProfiles['уарэп-капсрпб-отп'][1], REPSettings.UnitProfiles['уарэп-капсрпб-отп'][2])
sock_capsrpb.put_packet(pac)
func poll_receive(sock: Socket, tick: int) -> bool: