Merge remote-tracking branch 'sasha/master'
# Conflicts: # scenes/эмс/эмс.gd
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dd60btbqnpiqw"
|
||||
uid="uid://nm7cpjw6rs51"
|
||||
path="res://.godot/imported/document-new-0.png-4076926ba4469926b76b7d685aad96aa.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://b8xqbrj2ontxe"
|
||||
uid="uid://dvf4iwl08c1lt"
|
||||
path="res://.godot/imported/ofont.ru_Franklin Gothic Book.ttf-52f1dac05bf20c0c7af86c6e9cfad8fc.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b6p0ndxcng02k"
|
||||
uid="uid://cl8h2vaibabyi"
|
||||
path="res://.godot/imported/кнопка-квадрат-1.png-3e8f354c4e789ff37e9c072bb90aa353.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bq67yytxgoopq"
|
||||
uid="uid://b4oau2xgcka77"
|
||||
path="res://.godot/imported/мп550-работа-эскиз.png-7af57230feae7557e482f8923843a550.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://83m8t7nj4a60"
|
||||
uid="uid://gkbvsypul1qg"
|
||||
path="res://.godot/imported/отметка-самолёт.png-bb46afb23fe946fe2230cd3d30c66dca.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqu18m05sdl5w"
|
||||
uid="uid://bq6biyc0nxjv4"
|
||||
path="res://.godot/imported/прицел-табличка.png-45ba36412555fb1cbc42d6445071f6cd.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
||||
@@ -26,7 +26,7 @@ func _on_button_pressed():
|
||||
$margin/vbox.alignment = v
|
||||
|
||||
|
||||
func _enter_tree() -> void: _on_resized()
|
||||
func _enter_tree() -> void: call_deferred('_on_resized')
|
||||
|
||||
func _on_resized() -> void:
|
||||
$rect.size = size
|
||||
|
||||
@@ -43,7 +43,7 @@ func init_boards():
|
||||
g_boards['КЭМС-Б'] = yemsboards.EmsBoard.new(0, 0x130, yemsconsts.INPUT_KEMS, yemsconsts.OUTPUT_KEMS)
|
||||
g_boards['ЭМС-Б1'] = yemsboards.EmsBoard.new(1, 0x110, yemsconsts.INPUT_EMS1, yemsconsts.OUTPUT_EMS1)
|
||||
g_boards['ЭМС-Б2'] = yemsboards.EmsBoard.new(2, 0x120, yemsconsts.INPUT_EMS2, yemsconsts.OUTPUT_EMS2)
|
||||
|
||||
|
||||
init_tbl_in()
|
||||
$scrollin/tbl_in.pin_header($scrollin, self)
|
||||
init_tbl_out()
|
||||
@@ -52,7 +52,7 @@ func init_boards():
|
||||
$scrl_out_set/tbl_out_set.pin_header($scrl_out_set, self)
|
||||
init_tbl_files()
|
||||
$scrl_files/tbl_files.pin_header($scrl_files, self)
|
||||
|
||||
|
||||
var unit_key = repsettings.get_unit_key('уарэп-эмс')
|
||||
var unit = repnetwork.units[unit_key]
|
||||
unit.connect('data_received', Callable(self, 'on_data_ems_received'))
|
||||
@@ -60,7 +60,7 @@ func init_boards():
|
||||
$btn_disconnect.connect('pressed', Callable(self, 'on_btn_disconnect'))
|
||||
$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))
|
||||
|
||||
|
||||
|
||||
|
||||
## Обработчик нажатия кнопки disconnect.
|
||||
|
||||
@@ -9,7 +9,7 @@ const SERIAL_PROTO: = {'uart': spt25.SPT25 }
|
||||
|
||||
class Serial extends SerialPort:
|
||||
func send_to(data: PackedByteArray):
|
||||
write_raw(data)
|
||||
return write_raw(data)
|
||||
func try_open(parsing_proc: Callable):
|
||||
if not is_open():
|
||||
open(port)
|
||||
@@ -205,6 +205,8 @@ func get_tcp_data(sock: SocketTCP, peer, len_rx):
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
var tick = Time.get_ticks_msec()
|
||||
for addr in units_udp:
|
||||
var unit = units[addr]
|
||||
|
||||
@@ -4,7 +4,7 @@ class_name spt25_unit extends Node
|
||||
class SPT25 extends unit.Unit:
|
||||
|
||||
var tx_tick: int = 0
|
||||
var req_period = 3000
|
||||
var req_period = 3.0
|
||||
func _to_string() -> String: return String('СПТ-25: %s %s' % [self.name, ['отключен', 'на связи'][int(online)]])
|
||||
|
||||
func _init(nm) -> void:
|
||||
@@ -28,5 +28,6 @@ class SPT25 extends unit.Unit:
|
||||
func process(delta: float):
|
||||
tick += delta
|
||||
if (tick - tx_tick) > req_period:
|
||||
tx_tick = tick
|
||||
return Error.OK
|
||||
return Error.ERR_BUSY
|
||||
|
||||
@@ -74,7 +74,6 @@ func get_string_slice(s_in: String, s_out: Array, i0: int, i1: int):
|
||||
func pos_calc(freq: float, aoa: float, pos0: Vector2, r0: float, r1: float, f0: float, f1: float):
|
||||
var r = remap(freq, f0, f1, r0, r1)
|
||||
var aoa_rad = radians(aoa) - PI / 2.0
|
||||
|
||||
return Vector2(cos(aoa_rad), sin(aoa_rad)) * r + pos0
|
||||
|
||||
|
||||
@@ -112,11 +111,6 @@ func map_dec_to_rad(pos0: Vector2, pos: Vector2) -> Vector2:
|
||||
return Vector2(ang + 360.0 * float(ang < 0.0), hypot(x1, y1))
|
||||
|
||||
|
||||
## Переводит значение val из диапазона a0...a1 в диапазон b0...b1.
|
||||
func map_range(val: float, a0: float, a1: float, b0: float, b1: float) -> float:
|
||||
return (((val - a0) * (b1 - b0)) / (a1 - a0)) + b0
|
||||
|
||||
|
||||
## Возвращает [b]true[/b], если точка внутри заданного полигона.[br]
|
||||
## [param pos] - Проверяемая точка.[br]
|
||||
## [param p] - Координаты вершин полигона.[br]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class_name base_unit extends Node
|
||||
|
||||
## Базовый класс для управления подключаемыми устройствами
|
||||
|
||||
class Unit:
|
||||
signal line_changed(unit) ## Вызывается при изменение состояния связи
|
||||
signal command_done(unit) ## Вызывается после выполнения команды.
|
||||
|
||||
Reference in New Issue
Block a user