Commit 29dcdab7 authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

serving, tank graphic fixes

parent 36689447
using InteractNext, Mux, Plots, LabProcesses, LabGUI
using InteractNext, Plots, LabProcesses, LabGUI
include("tankgraphic.jl")
include("DoubleTank.jl")
include("tanklabgui.jl")
......@@ -14,6 +14,13 @@ catch
port = 8000
end
if webservice
using Mux
else
using Mux #change later
using Blink
end
if simulated
R = DoubleTankSimulator(σ = 0.001)
else
......@@ -67,7 +74,8 @@ g1, r1, tp = makegui(R)
if webservice
webio_serve(page("/", r1), port)
else
using Blink
webio_serve(page("/", r1), port)
w = Window()
body!(w, r1)
size(w, 1900, 900)
loadurl(w, "http:0.0.0.0:$port")
end
using InteractNext, Mux, Plots, LabGUI
const lightblue = (150, 150, 255)
const wall_thickness = 5
......@@ -7,6 +6,10 @@ const animationspeed = 1500
inspectdr(show=false)
const tankattr = Dict("y" => 0,
"x" => 0,
"height" => 800,
"width" => 300)
function stream(width, height, x, y)
bigstyle = Dict(:fill => "rgb$s_blue")
......@@ -63,8 +66,6 @@ function tank_construct(upper, lower, pump_speed = 1, tnum = 0, r = -1)
arrowwidth = 0
arrowheight= 20
arrowtext = ""
#level_upper = height*upper
#level_lower = height*lower
upper_x = 75
upper_y = 100
lower_x = 75
......@@ -105,11 +106,9 @@ function tank_construct(upper, lower, pump_speed = 1, tnum = 0, r = -1)
stream(w2, height+50, upper_x+(width-w2)/2, height+100)...,
stream(w3, 100, upper_x+(width-w3)/2, 2*height+150)...,
container1, container2, redarrow,
#water_container(width, height, upper, upper_x, upper_y),
#water_container(width, height, lower, lower_x, lower_y),
svg_rect(tank_width, tank_height, tank_x, tank_y),
pipe,
funnel,
id = "tank",
attributes = stdattr)
attributes = tankattr)
end
......@@ -96,7 +96,7 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
layout = make_grid(1, 2)
left_element = make_grid(2,1)
settings_element = make_grid(5,1)
settings_element = make_grid(4,1)
corner_element = make_grid(1,4)
......@@ -112,11 +112,10 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
d_element = setindex_(d_element, dom"div"(gui.widgets[:dOn]), 1, 1)
d_element = setindex_(d_element, dom"div"(gui.widgets[:Td]), 2, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:run]), 1, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:tankno]), 2, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:mode]), 3, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:rbox]), 4, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:u]), 5, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:tankno]), 1, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:mode]), 2, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:rbox]), 3, 1)
settings_element = setindex_(settings_element, dom"div"(gui.widgets[:u]), 4, 1)
io_element = Node(:div, attributes=Dict("display"=>"inlineBlock"),
gui.widgets[:run],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment