Merge remote-tracking branch 'origin/master' into dev_danil
# Conflicts: # scripts/PRD.gd
This commit is contained in:
@@ -232,22 +232,6 @@ theme_override_font_sizes/font_size = 14
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
|
||||
text = "Загрузить"
|
||||
|
||||
[node name="Litera_3_5_7" type="ColorRect" parent="Background"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_top = 48.0
|
||||
offset_right = 1941.0
|
||||
offset_bottom = 352.0
|
||||
color = Color(0.669446, 0.567301, 0.66881, 1)
|
||||
|
||||
[node name="Litera_1" type="ColorRect" parent="Background"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_top = 359.0
|
||||
offset_right = 2182.0
|
||||
offset_bottom = 638.0
|
||||
color = Color(0.669446, 0.567301, 0.66881, 1)
|
||||
|
||||
[node name="ISA" type="Label" parent="."]
|
||||
offset_left = 225.0
|
||||
offset_top = 11.0
|
||||
@@ -280,12 +264,11 @@ theme_override_styles/tab_selected = SubResource("StyleBoxTexture_k08q3")
|
||||
theme_override_styles/tab_hovered = SubResource("StyleBoxTexture_dklg6")
|
||||
theme_override_styles/tab_unselected = SubResource("StyleBoxTexture_17le6")
|
||||
tab_alignment = 2
|
||||
current_tab = 1
|
||||
current_tab = 0
|
||||
tab_focus_mode = 0
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="PRD" type="Panel" parent="TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_7u7p7")
|
||||
metadata/_tab_index = 0
|
||||
@@ -429,6 +412,7 @@ script = ExtResource("2_vmbyo")
|
||||
node_gap = Vector2(100, 50)
|
||||
|
||||
[node name="ControlPanel" type="Panel" parent="TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_tn8m6")
|
||||
script = ExtResource("9_akagi")
|
||||
|
||||
@@ -119,8 +119,6 @@ class FGOS:
|
||||
var peer = peerstream_fs.get_stream_peer()
|
||||
if peer:
|
||||
peer.put_data(data_to_sand)
|
||||
else:
|
||||
print_debug('client_fs.get_status != 2 !!!')
|
||||
|
||||
|
||||
#func _parse(rx_data: PackedByteArray):
|
||||
|
||||
@@ -132,13 +132,15 @@ func _ready() -> void:
|
||||
node_select_yau_07b.get_node2(1, 4).add_item(key)
|
||||
node_select_yau_07b_2.get_node2(1, 4).add_item(key)
|
||||
|
||||
#draw_control_panel_prd(Constants.ADDRESSES[0][3])
|
||||
draw_control_panel_prd(Constants.ADDRESSES[0][3])
|
||||
|
||||
Network.connect('yau_status_line', Callable(self, '_on_yau_status'))
|
||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||
Network.connect('yau_read_isa', Callable(self, '_on_read_isa'))
|
||||
Network.connect('port_fs_opened_1', _on_port_changed_fs_1.bind(Color.GREEN))
|
||||
Network.connect('port_fs_opened_2', _on_port_changed_fs_2.bind(Color.GREEN))
|
||||
Network.connect('port_fs_opened_1', _on_port_changed_fs_1.bind(Color.AQUAMARINE))
|
||||
Network.connect('port_fs_closed_1', _on_port_changed_fs_1.bind(Color.CRIMSON))
|
||||
Network.connect('port_fs_opened_2', _on_port_changed_fs_2.bind(Color.AQUAMARINE))
|
||||
Network.connect('port_fs_closed_2', _on_port_changed_fs_2.bind(Color.CRIMSON))
|
||||
Network.connect('data_from_fs_1', _on_data_fs_1)
|
||||
Network.connect('data_from_fs_2', _on_data_fs_2)
|
||||
|
||||
@@ -316,6 +318,7 @@ func _on_data_fs_1(fs_1_data):
|
||||
Constants.CMD.BASE_GET_CURRENT_TEMP:
|
||||
if GRP == Constants.GROUP.BASE:
|
||||
node_select_fs_1.set_node_text(1, 5, '%.2f' % fs_1_data.decode_float(0xC) + ' °C')
|
||||
#$read.text = str(fs_1_data.hex_encode())
|
||||
|
||||
|
||||
func _on_data_fs_2(fs_2_data):
|
||||
@@ -609,8 +612,9 @@ func set_bits(v, a, m):
|
||||
|
||||
|
||||
## 1 ФС
|
||||
func _on_port_changed_fs_1(port_name: String, _color: Color) -> void:
|
||||
func _on_port_changed_fs_1(port_name: String, color: Color) -> void:
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.set_node_text(1, 1, port_name)
|
||||
$TabContainer/PRD/body_grid/litera_2_4_6/fs_control.get_node2(1,1).modulate = color
|
||||
|
||||
|
||||
func _on_start_fs_1():
|
||||
@@ -631,8 +635,10 @@ func _on_set_att_1(att: String):
|
||||
|
||||
|
||||
## 2 ФС
|
||||
func _on_port_changed_fs_2(port_name: String, _color: Color) -> void:
|
||||
func _on_port_changed_fs_2(port_name: String, color: Color) -> void:
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.set_node_text(1, 1, port_name)
|
||||
$TabContainer/PRD/body_grid/litera_3_5_7/fs_control.get_node2(1, 1).modulate = color
|
||||
|
||||
|
||||
func _on_start_fs_2():
|
||||
Network.start_work_fs_2()
|
||||
|
||||
@@ -7,11 +7,6 @@ func _ready() -> void:
|
||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||
Network.connect('yau_status_line', Callable(self, '_control_pribor'))
|
||||
|
||||
var timer = Timer.new()
|
||||
self.add_child(timer)
|
||||
timer.connect('timeout', Callable(self, 'on_timer'))
|
||||
timer.start(1)
|
||||
|
||||
'''sockets_ind = [
|
||||
$soc_y5/ems_g/light_ind,
|
||||
$soc_y5/ug/light_ind,
|
||||
@@ -32,11 +27,11 @@ func on_timer(unit):
|
||||
print(unit)
|
||||
|
||||
func _on_data_received(data_from_yau_07):
|
||||
var status_board = data_from_yau_07.decode_u8(Constants.DataIndices.STATUS_BOARD)
|
||||
var dry_contact: int = data_from_yau_07.decode_u16(Constants.DataIndices.DRY_CONTACT) # Контроль сухих контактов (УГ)
|
||||
var _status_board = data_from_yau_07.decode_u8(Constants.DataIndices.STATUS_BOARD)
|
||||
var _dry_contact: int = data_from_yau_07.decode_u16(Constants.DataIndices.DRY_CONTACT) # Контроль сухих контактов (УГ)
|
||||
|
||||
|
||||
## From Network status about yau-07
|
||||
func _control_pribor(yau_status:bool) -> void:
|
||||
func _control_pribor(_yau_status:bool) -> void:
|
||||
#$device.text = str(Constants.CURRENT_MODE)
|
||||
$soc_y5/ay07.state = Constants.STATE_VAL.GOOD
|
||||
|
||||
@@ -97,8 +97,8 @@ func _on_data_received(data_from_yau_07):
|
||||
var out_imp: int = data_from_yau_07.decode_u16(Constants.DataIndices.OUT_IMPULS_PRD)
|
||||
var parent_node2 = get_parent().get_parent()
|
||||
|
||||
#process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2)
|
||||
#process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2)
|
||||
process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2)
|
||||
process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2)
|
||||
|
||||
|
||||
func process_sockets_horizon(blank: int, imp: int, count: int, col: int, parent_node2: Node):
|
||||
@@ -113,20 +113,18 @@ func process_sockets_horizon(blank: int, imp: int, count: int, col: int, parent_
|
||||
|
||||
set_frame(socket_status, frame_type)
|
||||
|
||||
if i == 1:
|
||||
set_frame(get_specific_node(parent_node2, 5), frame_type)
|
||||
if i == 1: # СИ_2_в_УФ
|
||||
var CI_2_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(2).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_2_UF, frame_type)
|
||||
if i == 2:
|
||||
set_frame(get_specific_node(parent_node2, 6), frame_type)
|
||||
if i == 2: # СИ_3_в_УФ
|
||||
var CI_3_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(1).get_child(2).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_3_UF, frame_type)
|
||||
if i == 4:
|
||||
set_frame(get_specific_node(parent_node2, 7), frame_type)
|
||||
if i == 5:
|
||||
set_frame(get_specific_node(parent_node2, 8), frame_type)
|
||||
if i == 9:
|
||||
set_frame(get_specific_node(parent_node2, 9), frame_type)
|
||||
if i == 4: # Модуляция_УМ_2
|
||||
pass
|
||||
if i == 5: # Модуляция_УМ_3
|
||||
pass
|
||||
if i == 9: # ФГОЗ_3
|
||||
pass
|
||||
|
||||
|
||||
func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_node2: Node):
|
||||
@@ -141,24 +139,18 @@ func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_nod
|
||||
|
||||
set_frame(socket_status, frame_type)
|
||||
|
||||
if i == 1:
|
||||
set_frame(get_specific_node(parent_node2, 1), frame_type)
|
||||
if i == 2:
|
||||
set_frame(get_specific_node(parent_node2, 2), frame_type)
|
||||
if i == 9:
|
||||
set_frame(get_specific_node(parent_node2, 3), frame_type)
|
||||
if i == 1: # СЗИ_2_от_УФ
|
||||
pass
|
||||
if i == 2: # СЗИ_3_от_УФ
|
||||
pass
|
||||
if i == 9: # СИ_2_от_ФС
|
||||
var CI_2_FS = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(0).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_2_FS, frame_type)
|
||||
if i == 10:
|
||||
set_frame(get_specific_node(parent_node2, 4), frame_type)
|
||||
if i == 10: # СИ_3_от_ФС
|
||||
var CI_3_FS = parent_node2.get_child(3).get_child(0).get_child(0).get_child(1).get_child(0).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_3_FS, frame_type)
|
||||
|
||||
|
||||
func get_specific_node(parent_node2: Node, child_index: int)-> Node:
|
||||
return parent_node2.get_child(3, false).get_child(1).get_child(4).get_child(child_index).get_child(3)
|
||||
|
||||
|
||||
func set_frame(node: Node, val: int): node.set_frame(val)
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,8 @@ signal data_from_fs_1(data:PackedByteArray)
|
||||
signal data_from_fs_2(data:PackedByteArray)
|
||||
signal port_fs_opened_1(port_name: String)
|
||||
signal port_fs_opened_2(port_name: String)
|
||||
signal port_closed(port_name: String)
|
||||
signal port_fs_closed_1(port_name: String)
|
||||
signal port_fs_closed_2(port_name: String)
|
||||
signal port_error(error_str: String)
|
||||
|
||||
|
||||
@@ -78,7 +79,10 @@ func poll_receive_fs(client: StreamPeerTCP, peerstream: PacketPeer, ip_fs: Strin
|
||||
return
|
||||
# Проверяем состояние подключения
|
||||
if client.get_status() != StreamPeerTCP.STATUS_CONNECTED:
|
||||
emit_signal("port_closed", ip_fs)
|
||||
if client == client_fs_1:
|
||||
emit_signal("port_fs_closed_1", ip_fs)
|
||||
elif client == client_fs_2:
|
||||
emit_signal("port_fs_closed_2", ip_fs)
|
||||
return
|
||||
|
||||
if peer.get_available_bytes() > 0:
|
||||
|
||||
Reference in New Issue
Block a user