diff --git a/src/DoubleTankLab.jl b/src/DoubleTankLab.jl index f3051c5f3d9158d923a66d6516a2865eaf62dd29..5d03cf4b2adcf96ded46a53ecf9b861d37be4588 100644 --- a/src/DoubleTankLab.jl +++ b/src/DoubleTankLab.jl @@ -1,5 +1,5 @@ module DoubleTankLab -using Interact, WebIO, InspectDR, Plots, LabGUI, Mux +using Interact, WebIO, InspectDR, Plots, LabGUI, Mux, Parameters include("tankgraphic.jl") include("doubletank.jl") include("tanklabgui.jl") diff --git a/src/doubletank.jl b/src/doubletank.jl index 49009ff2c38277b938fca5843afcbd513d5e0942..9637d60692c147199ca46cd4abaf6501858ff03f 100644 --- a/src/doubletank.jl +++ b/src/doubletank.jl @@ -1,13 +1,9 @@ -#export DoubleTankSimulator, DoubleTank - const uppertankempty = 0.0 const lowertankempty = 0.0 const uppertankfull = 10.07 const lowertankfull = 9.39 const venturimin = 0.0 const venturimax = 14.0 -using Parameters - @with_kw mutable struct PID b::Float64 = 1.0 @@ -22,11 +18,11 @@ using Parameters D::Float64 = 0 Tot::Float64 = 0 end + function PID(b, K, h, Ti, Td, y_old, N) PID(b, K, h, Ti, Td, y_old, N, 0.0, 0.0, 0.0, 0.0) end - function (p::PID)(r, y, onv=(1,1,1)) #The PID should operate entirely on normalized values @unpack b, K, h, Ti, Td, N, y_old, P, I, D, Tot = p diff --git a/src/tankdemo.jl b/src/tankdemo.jl index 406645725f6d3da2987ddb75eceb10b9f70a1ede..113ec301209f0035f0fab0138996adba3f634e4d 100644 --- a/src/tankdemo.jl +++ b/src/tankdemo.jl @@ -50,11 +50,11 @@ function runsimulation(;simulated=true, webservice=true, port=8000, σ = 0.001, end start_time = end_time end - println("The lab time is over, go home! 😊\n") #Easter egg, unlikely to be shown end - - g1, r1, tp = makegui(R, run_process, 10, 10) + plot_fps = 2 + gui_fps = 5 + g1, r1, tp = makegui(R, run_process, plot_fps, gui_fps) webio_serve(page("/", r1), port) end