WIP: PFD instrument
This commit is contained in:
parent
4be36eb39e
commit
740a72bcb6
23 changed files with 432 additions and 32 deletions
|
|
@ -1,32 +1,12 @@
|
|||
extends Node
|
||||
|
||||
const PFD_PATH: String = "pfd#adi,vsi,alt,ias,rht,rpm,hsi"
|
||||
|
||||
@export var lidia_hostname: String = "localhost"
|
||||
@export var lidia_port: int = 5555
|
||||
|
||||
@onready var controls: Node = $SubViewport2/Controls
|
||||
|
||||
func _ready():
|
||||
if !$CEF.initialize({"incognito":true, "locale":"en-US"}):
|
||||
push_error($CEF.get_error())
|
||||
get_tree().quit()
|
||||
return
|
||||
print("CEF version: " + $CEF.get_full_version())
|
||||
|
||||
# Wait one frame for the texture rect to get its size
|
||||
await get_tree().process_frame
|
||||
|
||||
var browser_pfd = $CEF.create_browser(
|
||||
"http://{}:{}/{}".format([lidia_hostname, lidia_port, PFD_PATH], "{}"),
|
||||
$SubViewport/TextureRect,
|
||||
{ "frame_rate": 90, "javascript": true },
|
||||
)
|
||||
browser_pfd.name = "pfd"
|
||||
browser_pfd.enable_ad_block(false) # Required for lidia static assets
|
||||
@onready var pfd: Node = $SubViewport/PFD
|
||||
|
||||
# Propagate the calls to child
|
||||
func set_controls(current: Vector4):
|
||||
controls.set("controls", current)
|
||||
func set_trim(trim: Vector4):
|
||||
controls.set("trim", trim)
|
||||
func update_pfd(aircraft: Transform3D, velocity: Vector3):
|
||||
pfd.call("update", aircraft, velocity)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue