Added a basic vehicle status UI showing mode and a few key datapoints.
This commit is contained in:
1 parent
f05a6148fb
commit
ea6ba54666
15 files changed
+623
No files matched your search
@@ -0,0 +1,27 @@
|
||||
extends VBoxContainer
|
||||
|
||||
@onready var panel = $VehicleStatusPanel
|
||||
var elapsed := 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
$Controls/State.item_selected.connect(_select_state)
|
||||
$Controls/Contrast.toggled.connect(func(high: bool) -> void:
|
||||
theme = load("res://themes/theme_highcontrast.tres" if high else "res://themes/theme.tres")
|
||||
)
|
||||
$Controls/Pulse.toggled.connect(func(enabled: bool) -> void: panel.pulse_alerts = enabled)
|
||||
_select_state(0)
|
||||
|
||||
func _select_state(index: int) -> void:
|
||||
match index:
|
||||
0: panel.set_status("STATIONKEEP", 0, "", "Position hold active", "Thrusters enabled")
|
||||
1: panel.set_status("Supply voltage low", 1, "PWR-012", "46.5 V · below 48 V nominal", "Check topside supply and tether load")
|
||||
2: panel.set_status("Enclosure overtemperature", 2, "TMP-003", "68 °C · trip 65 °C · thrusters inhibited", "Inspect cooling before reset")
|
||||
3: panel.set_status("Enclosure overtemperature", 2, "TMP-003", "68 °C · trip 65 °C · thrusters inhibited", "Inspect cooling before reset")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
elapsed += delta
|
||||
match $Controls/State.selected:
|
||||
0: panel.set_telemetry(48.0, 18.2 + sin(elapsed) * 0.6, 874 + sin(elapsed) * 29, 34)
|
||||
1: panel.set_telemetry(46.5, 25.5, 1186, 42)
|
||||
2: panel.set_telemetry(48.0, 2.1, 101, 68)
|
||||
3: pass
|
||||
Reference in new issue
Block a user