forked from StudioInfinity/dyna3
Rename Regulator fields
This commit is contained in:
parent
24139ad5e9
commit
b3e4e902f3
3 changed files with 15 additions and 15 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue