From 9a0eb3d46678674b6a556104c84b70ef5de2265a Mon Sep 17 00:00:00 2001 From: Albin Heimerson <albin.heimerson@control.lth.se> Date: Wed, 25 Mar 2020 11:11:19 +0100 Subject: [PATCH] slow down animation to allow for smaller instances --- src/DoubleTankLab.jl | 2 +- src/doubletank.jl | 6 +----- src/tankdemo.jl | 6 +++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/DoubleTankLab.jl b/src/DoubleTankLab.jl index f3051c5..5d03cf4 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 49009ff..9637d60 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 4066457..113ec30 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 -- GitLab