Доработка. Контроль Прибор У-ЭП
This commit is contained in:
@@ -23,4 +23,4 @@ func get_radius_inner_0() -> float: return material.get('shader_parameter/radiu
|
||||
func get_radius_inner_1() -> float: return material.get('shader_parameter/radius_inner_1')
|
||||
|
||||
func set_view_mode(val: int): material.set('shader_parameter/mode', val);
|
||||
func set_band_colors(val: Array): material.set('shader_parameter/ant_band_c', val)
|
||||
func set_band_colors(val: Array): material.set('shader_parameter/ant_band_c', val)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://4bjn35xdurgx"]
|
||||
|
||||
[node name="pribor_UF" type="Node2D"]
|
||||
|
||||
[node name="test_label" type="Label" parent="."]
|
||||
text = "Здесь будет схема прибора СПТ Левый"
|
||||
@@ -1,6 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://bv0dyyaodxcvc"]
|
||||
|
||||
[node name="pribor_UF" type="Node2D"]
|
||||
|
||||
[node name="test_label" type="Label" parent="."]
|
||||
text = "Здесь будет схема прибора СПТ Правый"
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bs7h65e7bodp3"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_7xobt"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/element_v.tscn" id="2_bp8jp"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_6olof"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/element_v.tscn" id="2_cf6tc"]
|
||||
|
||||
[node name="pribor_UF" type="Node2D"]
|
||||
|
||||
@@ -10,13 +10,13 @@ offset_left = 98.0
|
||||
offset_top = 184.0
|
||||
offset_right = 756.0
|
||||
offset_bottom = 1122.0
|
||||
texture = ExtResource("1_7xobt")
|
||||
texture = ExtResource("1_6olof")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
|
||||
[node name="ref_A1" parent="." instance=ExtResource("2_bp8jp")]
|
||||
[node name="ref_A1" parent="." instance=ExtResource("2_cf6tc")]
|
||||
offset_left = 175.0
|
||||
offset_top = 529.0
|
||||
offset_right = 332.0
|
||||
@@ -26,7 +26,7 @@ fname = "МАА150-1С27"
|
||||
rname = "A1"
|
||||
state = 1
|
||||
|
||||
[node name="ref_A2" parent="." instance=ExtResource("2_bp8jp")]
|
||||
[node name="ref_A2" parent="." instance=ExtResource("2_cf6tc")]
|
||||
offset_left = 496.0
|
||||
offset_top = 531.0
|
||||
offset_right = 631.0
|
||||
@@ -36,7 +36,7 @@ fname = "МАА150-1С27"
|
||||
rname = "A2"
|
||||
state = 1
|
||||
|
||||
[node name="ref_A3" parent="." instance=ExtResource("2_bp8jp")]
|
||||
[node name="ref_A3" parent="." instance=ExtResource("2_cf6tc")]
|
||||
offset_left = 377.0
|
||||
offset_top = 531.0
|
||||
offset_right = 468.0
|
||||
@@ -5,9 +5,7 @@ const PRIBORS_RES = \
|
||||
'pribor_rtr': 'res://scenes/pribor-rtr/pribor-rtr.tscn',
|
||||
'pribor_afsp_l': 'res://scenes/pribor-afsp-l/pribor-afsp-l.tscn',
|
||||
'pribor_afsp_r': 'res://scenes/pribor-afsp-r/pribor-afsp-r.tscn',
|
||||
'pribor_sch3': 'res://scenes/pribor-sch3/pribor-sch3.tscn',
|
||||
'pribor_spt_l': 'res://scenes/pribor-spt-l/pribor-spt-l.tscn',
|
||||
'pribor_spt_r': 'res://scenes/pribor-spt-r/pribor-spt-r.tscn',
|
||||
'pribor_uyep': 'res://scenes/pribor-uyep/pribor-uyep.tscn',
|
||||
'pribor_prd_v_1': 'res://scenes/pribor-prd-v-1/pribor-prd-v-1.tscn',
|
||||
'pribor_prd_n_1': 'res://scenes/pribor-prd-n-1/pribor-prd-n-1.tscn',
|
||||
'pribor_prd_k_1': 'res://scenes/pribor-prd-k-1/pribor-prd-k-1.tscn',
|
||||
@@ -29,17 +27,17 @@ func _ready():
|
||||
pribor_node.connect('button_up', Callable(self, 'on_pribor_press').bind(pribor_sch_path))
|
||||
|
||||
|
||||
func on_pribor_press(pribor_sch_path):
|
||||
clear_obj($pribor_sch)
|
||||
var pribor_sch_obj = load(pribor_sch_path)
|
||||
assert(pribor_sch_obj)
|
||||
var pribor_sch = pribor_sch_obj.instantiate()
|
||||
assert(pribor_sch)
|
||||
$pribor_sch.add_child(pribor_sch)
|
||||
func on_pribor_press(pribor_path):
|
||||
clear_obj($mnemo_container)
|
||||
var pribor_obj = load(pribor_path)
|
||||
assert(pribor_obj)
|
||||
var pribor = pribor_obj.instantiate()
|
||||
assert(pribor)
|
||||
$mnemo_container.add_child(pribor)
|
||||
|
||||
|
||||
func clear_obj(obj: Object):
|
||||
var items = obj.get_children()
|
||||
for item in items:
|
||||
obj.remove_child(item)
|
||||
item.free()
|
||||
item.queue_free()
|
||||
|
||||
@@ -65,7 +65,7 @@ size_flags_vertical = 15
|
||||
texture_normal = ExtResource("4_l0nc7")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="pribor_sch3" type="TextureButton" parent="."]
|
||||
[node name="pribor_uyep" type="TextureButton" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1220.0
|
||||
offset_top = 739.0
|
||||
@@ -76,28 +76,6 @@ size_flags_vertical = 15
|
||||
texture_normal = ExtResource("5_kvnex")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="pribor_spt_l" type="TextureButton" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1080.0
|
||||
offset_top = 755.0
|
||||
offset_right = 1173.0
|
||||
offset_bottom = 911.0
|
||||
size_flags_horizontal = 15
|
||||
size_flags_vertical = 15
|
||||
texture_normal = ExtResource("3_hhadv")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="pribor_spt_r" type="TextureButton" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1360.0
|
||||
offset_top = 756.0
|
||||
offset_right = 1453.0
|
||||
offset_bottom = 912.0
|
||||
size_flags_horizontal = 15
|
||||
size_flags_vertical = 15
|
||||
texture_normal = ExtResource("3_hhadv")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="pribor_prd_v_2" type="TextureButton" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 960.0
|
||||
@@ -236,7 +214,7 @@ size_flags_vertical = 15
|
||||
texture_normal = ExtResource("6_i1yfn")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="pribor_sch" type="Panel" parent="."]
|
||||
[node name="mnemo_container" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
|
||||
[node name="txr_legend0" type="TextureRect" parent="."]
|
||||
|
||||
@@ -23,7 +23,7 @@ extends Panel
|
||||
|
||||
var drag_button: MouseButton ## Кнопка мыши нажатая при перетаскивании
|
||||
var drag_fsm: DragFSM = DragFSM.IDLE ## Текущее состояние перетаскивания
|
||||
var btn_select: BtnSel = BtnSel.THREAT ## Текущее состояние кнопки выбора цели
|
||||
var btn_select: BtnSel = BtnSel.THREAT ## Текущее состояние кнопки выбора цели
|
||||
var drag_pos_begin: Vector2 ## Точка начала перетаскивания
|
||||
var max_zoom: int ## Максимальный уровень детализации
|
||||
var min_zoom: int ## Минимальный уровень детализации
|
||||
@@ -77,7 +77,7 @@ var fs_band = fs_band_rto # Текущий режим блоков ФС
|
||||
var fs_default_colors: Array # Цвета по умолчанию для блоков ФС
|
||||
var fs_selected: Dictionary # Словарь выбранных секторов
|
||||
var fs_active: Dictionary # Словарь секторов назначенных на подавление
|
||||
|
||||
|
||||
## Состояние перетаскивания
|
||||
enum DragFSM {
|
||||
DRAG, ## В процессе
|
||||
@@ -101,7 +101,7 @@ func on_threat_selected(th, ecm_btns): on_rto_threat_sel(th.id, ecm_btns)
|
||||
|
||||
|
||||
## Обработчик нажатия на кнопку вид
|
||||
func on_button_view_toggled(toggled: bool):
|
||||
func on_button_view_toggled(toggled: bool):
|
||||
signaller.emit_signal('map_mode_changed', int(toggled))
|
||||
if toggled:
|
||||
fs_band = fs_band_rls
|
||||
@@ -219,7 +219,7 @@ func on_threat_lost(th) -> void:
|
||||
bip.free()
|
||||
|
||||
|
||||
## обработчик нажатия на цель на экране
|
||||
## обработчик нажатия на цель на экране
|
||||
func on_bip_pressed(th_id, _ecm_btns):
|
||||
if btn_select == BtnSel.THREAT:
|
||||
signaller.emit_signal('rto_threat_sel', th_id)
|
||||
@@ -351,7 +351,7 @@ func _input(event) -> void:
|
||||
sel_fs_sector(event)
|
||||
drag_fsm = DragFSM.IDLE
|
||||
emit_signal('drag_end', event)
|
||||
|
||||
|
||||
elif event is InputEventKey:
|
||||
if event.physical_keycode == KEY_SHIFT:
|
||||
shift_pressed = event.pressed
|
||||
@@ -394,8 +394,8 @@ func sel_fs_sector(event):
|
||||
if angle < 0:
|
||||
angle +=360
|
||||
var distance: float = event.position.distance_to(center + center_offset)
|
||||
var sector: int
|
||||
var band: int
|
||||
var sector: int
|
||||
var band: int
|
||||
var has_band: bool = false
|
||||
for sec in fs_sectors.values():
|
||||
if angle >= sec[0] and angle <= sec[1]:
|
||||
@@ -468,16 +468,16 @@ func on_fs_selected(ecm):
|
||||
|
||||
|
||||
func get_fs_index(ecm):
|
||||
var sector: int
|
||||
var band: int
|
||||
var sector: int
|
||||
var band: int
|
||||
var angle: float = ecm.kni + 45.0
|
||||
if angle > 360.0:
|
||||
angle -= 360.0
|
||||
angle -= 360.0
|
||||
for sec in fs_sectors.values():
|
||||
if float(angle) >= sec[0] and float(angle) <= sec[1]:
|
||||
sector = fs_sectors.find_key(sec)
|
||||
for diap in fs_freq.values():
|
||||
if ecm.params.has('freq'):
|
||||
if ecm.params.has('freq'):
|
||||
if ecm.params['freq'] >= diap[0] and ecm.params['freq'] <= diap[1]:
|
||||
band = fs_freq.find_key(diap)
|
||||
var fs_index = band * 4 + sector
|
||||
|
||||
Reference in New Issue
Block a user