Skip to content
Snippets Groups Projects
Commit 8a678388 authored by Albin Heimerson's avatar Albin Heimerson
Browse files

remove periodically and print hack

parent ce63d7d9
No related branches found
No related tags found
1 merge request!1WIP: Julia1
......@@ -31,8 +31,7 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du
n = 1
LabProcesses.initialize(P)
start_time = time()
for t in 0:P.h:duration
@periodically P.h begin
for t in 0:P.h:20
y = measure(P)[n]
r = gui[:r]
if gui[:tankno]=="Upper"
......@@ -52,7 +51,7 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du
pidcontroller.I = gui[:u]-(pidcontroller.Tot-pidcontroller.I)
end
end
@show t # Not working without some print in the loop, not sure why...
# @show t # Not working without some print in the loop, not sure why...
push!(gui, y, 1)
push!(gui, r, 2)
push!(gui, pidcontroller.P, 3)
......@@ -60,14 +59,20 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du
push!(gui, pidcontroller.D, 5)
push!(gui, pidcontroller.Tot, 6)
push!(gui, t, 7)
end_time = time()
sleep_time = P.h + start_time - end_time
if sleep_time 0.001
sleep(sleep_time)
end
start_time = end_time
end
println("The lab time is over, go home! 😊\n") #Easter egg, unlikely to be shown
LabProcesses.finalize(P)
end
g1, r1, tp = makegui(R, run_process, 1, 1)
g1, r1, tp = makegui(R, run_process, 10, 10)
if webservice
webio_serve(page("/", r1), port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment