Commit 0c96577f authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

proper time axis

parent 1e6e497f
......@@ -52,20 +52,23 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
Node(:div, tankg, id="tanks", attributes=tankattr)
end
glnv = (0:maxplotlength)*P.h
w2, graphic2 = @construct for
plotdummy in checkbox(false, label="This button does nothing")
if length(gui.data[1])>maxplotlength
start = length(gui.data[1])-maxplotlength
dataln = length(gui.data[1])
if dataln>maxplotlength
start = dataln-maxplotlength
else
start=1
end
p = plot(layout=(2,1), size=(700, 600))
plot!(p[1], gui.data[1][start:end], label="y", ylim = boundsupper)
plot!(p[1], gui.data[2][start:end], label="r")
plot!(p[2], gui.data[3][start:end], label="P", ylim = boundslower)
plot!(p[2], gui.data[4][start:end], label="I")
plot!(p[2], gui.data[5][start:end], label="D")
plot!(p[2], gui.data[6][start:end], label="Tot", color=:black)
lnv = glnv[1:min(dataln, maxplotlength+1)]
p = plot(layout=(2,1), size=(700, 600), xlabel = "seconds")
plot!(p[1], lnv, gui.data[1][start:end], label="y", ylim = boundsupper)
plot!(p[1], lnv, gui.data[2][start:end], label="r")
plot!(p[2], lnv, gui.data[3][start:end], label="P", ylim = boundslower)
plot!(p[2], lnv, gui.data[4][start:end], label="I")
plot!(p[2], lnv, gui.data[5][start:end], label="D")
plot!(p[2], lnv, gui.data[6][start:end], label="Tot", color=:black)
end
#-----------------------------------------------#
......
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