Rename Regulator fields

This commit is contained in:
Aaron Fenyes 2025-02-12 11:55:45 -08:00
parent 24139ad5e9
commit b3e4e902f3
3 changed files with 15 additions and 15 deletions

View file

@ -25,8 +25,8 @@ fn RegulatorInput(regulator: Regulator) -> View {
view! {
input(
r#type="text",
placeholder=regulator.measured.with(|result| result.to_string()),
bind:value=regulator.desired_text,
placeholder=regulator.measurement.with(|result| result.to_string()),
bind:value=regulator.set_point_text,
on:change=move |event: Event| {
let target: HtmlInputElement = event.target().unwrap().unchecked_into();
let value = target.value();
@ -34,8 +34,8 @@ fn RegulatorInput(regulator: Regulator) -> View {
regulator.role.set(Measurement);
} else {
match target.value().parse::<f64>() {
Ok(desired) => batch(|| {
regulator.desired.set(desired);
Ok(set_pt) => batch(|| {
regulator.set_point.set(set_pt);
regulator.role.set(Constraint(true));
}),
Err(_) => regulator.role.set(Constraint(false))