@@ -96,13 +96,13 @@ set_maybe!(obs::Observable, ::NotSpecified) = nothing
9696Set the solution of the current appstate to `sol`.
9797"""
9898function set_sol! (sol)
99- wait_for ()
99+ sync ()
100100 if isnothing (APPSTATE[])
101101 APPSTATE[] = AppState (sol)
102102 else
103103 APPSTATE[]. sol[] = sol
104104 end
105- wait_for ()
105+ sync ()
106106 nothing
107107end
108108
@@ -117,12 +117,12 @@ function set_state!(; sol = NotSpecified(),
117117 t = NotSpecified (),
118118 tmin = NotSpecified (),
119119 tmax = NotSpecified ())
120- wait_for ()
120+ sync ()
121121 sol != NotSpecified () && set_sol! (sol)
122122 set_maybe! (appstate (). t, t)
123123 set_maybe! (appstate (). tmin, tmin)
124124 set_maybe! (appstate (). tmax, tmax)
125- wait_for ()
125+ sync ()
126126 nothing
127127end
128128
@@ -139,15 +139,15 @@ function set_graphplot!(; nstate = NotSpecified(),
139139 estate_rel = NotSpecified (),
140140 ncolorrange = NotSpecified (),
141141 ecolorrange = NotSpecified ())
142- wait_for ()
142+ sync ()
143143 gp = appstate (). graphplot
144144 set_maybe! (gp. nstate, nstate)
145145 set_maybe! (gp. estate, estate)
146146 set_maybe! (gp. nstate_rel, nstate_rel)
147147 set_maybe! (gp. estate_rel, estate_rel)
148148 set_maybe! (gp. ncolorrange, ncolorrange)
149149 set_maybe! (gp. ecolorrange, ecolorrange)
150- wait_for ()
150+ sync ()
151151 nothing
152152end
153153
@@ -161,15 +161,15 @@ To automaticially create commands see [`dump_app_state()`](@ref).
161161function set_timeseries! (key; selcomp = NotSpecified (),
162162 states = NotSpecified (),
163163 rel = NotSpecified ())
164- wait_for ()
164+ sync ()
165165 if ! haskey (appstate (). tsplots[], key)
166166 appstate (). tsplots[][key] = TimeseriesPlot ()
167167 end
168168 tsplot = appstate (). tsplots[][key]
169169 set_maybe! (tsplot. selcomp, selcomp)
170170 set_maybe! (tsplot. states, states)
171171 set_maybe! (tsplot. rel, rel)
172- wait_for ()
172+ sync ()
173173 nothing
174174end
175175
@@ -182,7 +182,7 @@ Defines timeseries, where `tsarray` is an array of timeseries keyword arguments
182182To automaticially create commands see [`dump_app_state()`](@ref).
183183"""
184184function define_timeseries! (tsarray)
185- wait_for ()
185+ sync ()
186186 if length (tsarray) != length (appstate (). tsplots[])
187187 empty! (appstate (). tsplots[])
188188 tskeys = [gendomid (" ts" ) for _ in tsarray]
@@ -193,7 +193,7 @@ function define_timeseries!(tsarray)
193193 set_timeseries! (key; tsargs... )
194194 end
195195 notify (appstate (). tsplots)
196- wait_for ()
196+ sync ()
197197 nothing
198198end
199199
@@ -205,7 +205,7 @@ commands to recreate the current appstate.
205205The intended usecase is to quickly recreate "starting points" for interactive exploration.
206206"""
207207function dump_app_state (io= stdout )
208- wait_for ()
208+ sync ()
209209 println (io, " # To recreate the current state, run the following commands:\n " )
210210 println (io, styled " set_sol!({red:sol}) # optional if after inspect(sol)" )
211211 println (io, " set_state!(; t=$(appstate (). t[]) , tmin=$(appstate (). tmin[]) , tmax=$(appstate (). tmax[]) )" )
0 commit comments