feat: added input update to ui

This commit is contained in:
2025-12-23 11:43:07 +01:00
parent 45ccd0bedb
commit 38102f57ef
2 changed files with 21 additions and 3 deletions

View File

@@ -34,9 +34,16 @@ func _ready() -> void:
target_node = get_node("Target")
p_input = get_node("PID Menue/PanelContainer/VBoxContainer/Proportinal Term (P)/Input")
p_input.value_changed.connect(_update_p_value)
i_input = get_node("PID Menue/PanelContainer/VBoxContainer/Integral (I)/Input")
i_input.value_changed.connect(_update_i_value)
d_input = get_node("PID Menue/PanelContainer/VBoxContainer/Derivative (D)/Input")
d_input.value_changed.connect(_update_d_value)
force_input = get_node("PID Menue/PanelContainer/VBoxContainer/Force/Input")
force_input.value_changed.connect(_update_force_value)
target_input =get_node("PID Menue/PanelContainer/VBoxContainer/Target Rotation/Input")
target_input.value_changed.connect(_update_target_rot)
@@ -56,6 +63,17 @@ func _ready() -> void:
func _update_target_rot(value:float) -> void:
target_node.rotation.x = deg_to_rad(value)
func _update_p_value(value:float) -> void:
p = value
func _update_i_value(value:float) -> void:
i = value
func _update_d_value(value:float) -> void:
d = value
func _update_force_value(value:float) -> void:
force = value
func _process(delta: float) -> void:
# PID Stuff

View File

@@ -77,7 +77,7 @@ layout_mode = 2
[node name="Input" type="SpinBox" parent="PID Menue/PanelContainer/VBoxContainer/Proportinal Term (P)"]
layout_mode = 2
max_value = 10.0
max_value = 1.0
step = 0.01
value = 0.5
@@ -91,7 +91,7 @@ text = "Integral (I)"
[node name="Input" type="SpinBox" parent="PID Menue/PanelContainer/VBoxContainer/Integral (I)"]
layout_mode = 2
max_value = 10.0
max_value = 1.0
step = 0.01
[node name="Derivative (D)" type="HBoxContainer" parent="PID Menue/PanelContainer/VBoxContainer"]
@@ -104,7 +104,7 @@ text = "Derivative (D)"
[node name="Input" type="SpinBox" parent="PID Menue/PanelContainer/VBoxContainer/Derivative (D)"]
layout_mode = 2
max_value = 10.0
max_value = 1.0
step = 0.01
[node name="Force" type="HBoxContainer" parent="PID Menue/PanelContainer/VBoxContainer"]