fix jaguar pattern seeding. now parameter changes are displayed in textboxes

feat/diff_Jaguar
Nikola Sebastian Munder 2025-06-13 11:59:43 +02:00
parent 5b1a6f92b0
commit 4ea3d4a3ea
1 changed files with 6 additions and 14 deletions

View File

@ -90,11 +90,15 @@ function param_box!(grid, row, labeltxt, observable::Observable)
on(box.stored_string) do s on(box.stored_string) do s
try try
observable[] = parse(Float64, s) observable[] = parse(Float64, s)
println("changed $labeltxt to $s") box.displayed_string[] = s
catch catch
@warn "Invalid input for $labeltxt: $s" @warn "Invalid input for $labeltxt: $s"
end end
end end
on(observable) do val
box.displayed_string[] = string(val)
end
return box
end end
function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs) function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
@ -129,7 +133,6 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
param_box!(textboxgrid, 3, "Feed", F) param_box!(textboxgrid, 3, "Feed", F)
param_box!(textboxgrid, 4, "kill", k) param_box!(textboxgrid, 4, "kill", k)
println("aufruf")
running = Observable(false) running = Observable(false)
on(running) do r on(running) do r
@ -157,22 +160,12 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
end end
on(btn_Jaguar.clicks) do _ on(btn_Jaguar.clicks) do _
Du[] = 0.142 Du[] = 0.142
Dv[] = 0.078 Dv[] = 0.078
F[] = 0.0617 F[] = 0.0617
k[] = 0.062 k[] = 0.062
if !running[] reset!(U, V, heat_obs)
running[] = true
U .= 1.0
V .= 0.0
@async while running[]
multi_step!((U, V), stepsize[], heat_obs, params_obs)
sleep(0.0015)
end
end
starting_points!(U, V) starting_points!(U, V)
heat_obs[] = copy(U) heat_obs[] = copy(U)
end end
@ -187,7 +180,6 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
return return
end end
x, y = pt x, y = pt
println("params_obs[].N, ", params_obs[].N)
i, j = coord_to_index(x, y, params_obs[].N) i, j = coord_to_index(x, y, params_obs[].N)
# get corners of square that will get filled with concentration # get corners of square that will get filled with concentration