Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DoubleTankLab.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
processes
DoubleTankLab.jl
Commits
29dcdab7
Commit
29dcdab7
authored
7 years ago
by
Jacob Wikmark
Browse files
Options
Downloads
Patches
Plain Diff
serving, tank graphic fixes
parent
36689447
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/tankdemo.jl
+11
-3
11 additions, 3 deletions
src/tankdemo.jl
src/tankgraphic.jl
+5
-6
5 additions, 6 deletions
src/tankgraphic.jl
src/tanklabgui.jl
+5
-6
5 additions, 6 deletions
src/tanklabgui.jl
with
21 additions
and
15 deletions
src/tankdemo.jl
+
11
−
3
View file @
29dcdab7
using
InteractNext
,
Mux
,
Plots
,
LabProcesses
,
LabGUI
using
InteractNext
,
Plots
,
LabProcesses
,
LabGUI
include
(
"tankgraphic.jl"
)
include
(
"tankgraphic.jl"
)
include
(
"DoubleTank.jl"
)
include
(
"DoubleTank.jl"
)
include
(
"tanklabgui.jl"
)
include
(
"tanklabgui.jl"
)
...
@@ -14,6 +14,13 @@ catch
...
@@ -14,6 +14,13 @@ catch
port
=
8000
port
=
8000
end
end
if
webservice
using
Mux
else
using
Mux
#change later
using
Blink
end
if
simulated
if
simulated
R
=
DoubleTankSimulator
(
σ
=
0.001
)
R
=
DoubleTankSimulator
(
σ
=
0.001
)
else
else
...
@@ -67,7 +74,8 @@ g1, r1, tp = makegui(R)
...
@@ -67,7 +74,8 @@ g1, r1, tp = makegui(R)
if
webservice
if
webservice
webio_serve
(
page
(
"/"
,
r1
),
port
)
webio_serve
(
page
(
"/"
,
r1
),
port
)
else
else
using
Blink
webio_serve
(
page
(
"/"
,
r1
),
port
)
w
=
Window
()
w
=
Window
()
body!
(
w
,
r1
)
size
(
w
,
1900
,
900
)
loadurl
(
w
,
"http:0.0.0.0:
$
port"
)
end
end
This diff is collapsed.
Click to expand it.
src/tankgraphic.jl
+
5
−
6
View file @
29dcdab7
using
InteractNext
,
Mux
,
Plots
,
LabGUI
const
lightblue
=
(
150
,
150
,
255
)
const
lightblue
=
(
150
,
150
,
255
)
const
wall_thickness
=
5
const
wall_thickness
=
5
...
@@ -7,6 +6,10 @@ const animationspeed = 1500
...
@@ -7,6 +6,10 @@ const animationspeed = 1500
inspectdr
(
show
=
false
)
inspectdr
(
show
=
false
)
const
tankattr
=
Dict
(
"y"
=>
0
,
"x"
=>
0
,
"height"
=>
800
,
"width"
=>
300
)
function
stream
(
width
,
height
,
x
,
y
)
function
stream
(
width
,
height
,
x
,
y
)
bigstyle
=
Dict
(
:
fill
=>
"rgb
$
s_blue"
)
bigstyle
=
Dict
(
:
fill
=>
"rgb
$
s_blue"
)
...
@@ -63,8 +66,6 @@ function tank_construct(upper, lower, pump_speed = 1, tnum = 0, r = -1)
...
@@ -63,8 +66,6 @@ function tank_construct(upper, lower, pump_speed = 1, tnum = 0, r = -1)
arrowwidth
=
0
arrowwidth
=
0
arrowheight
=
20
arrowheight
=
20
arrowtext
=
""
arrowtext
=
""
#level_upper = height*upper
#level_lower = height*lower
upper_x
=
75
upper_x
=
75
upper_y
=
100
upper_y
=
100
lower_x
=
75
lower_x
=
75
...
@@ -105,11 +106,9 @@ function tank_construct(upper, lower, pump_speed = 1, tnum = 0, r = -1)
...
@@ -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
(
w2
,
height
+
50
,
upper_x
+
(
width
-
w2
)
/
2
,
height
+
100
)
...
,
stream
(
w3
,
100
,
upper_x
+
(
width
-
w3
)
/
2
,
2
*
height
+
150
)
...
,
stream
(
w3
,
100
,
upper_x
+
(
width
-
w3
)
/
2
,
2
*
height
+
150
)
...
,
container1
,
container2
,
redarrow
,
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
),
svg_rect
(
tank_width
,
tank_height
,
tank_x
,
tank_y
),
pipe
,
pipe
,
funnel
,
funnel
,
id
=
"tank"
,
id
=
"tank"
,
attributes
=
std
attr
)
attributes
=
tank
attr
)
end
end
This diff is collapsed.
Click to expand it.
src/tanklabgui.jl
+
5
−
6
View file @
29dcdab7
...
@@ -96,7 +96,7 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
...
@@ -96,7 +96,7 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
layout
=
make_grid
(
1
,
2
)
layout
=
make_grid
(
1
,
2
)
left_element
=
make_grid
(
2
,
1
)
left_element
=
make_grid
(
2
,
1
)
settings_element
=
make_grid
(
5
,
1
)
settings_element
=
make_grid
(
4
,
1
)
corner_element
=
make_grid
(
1
,
4
)
corner_element
=
make_grid
(
1
,
4
)
...
@@ -112,11 +112,10 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
...
@@ -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
[
:
dOn
]),
1
,
1
)
d_element
=
setindex_
(
d_element
,
dom
"div"
(
gui
.
widgets
[
:
Td
]),
2
,
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
]),
1
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
tankno
]),
2
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
mode
]),
2
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
mode
]),
3
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
rbox
]),
3
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
rbox
]),
4
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
u
]),
4
,
1
)
settings_element
=
setindex_
(
settings_element
,
dom
"div"
(
gui
.
widgets
[
:
u
]),
5
,
1
)
io_element
=
Node
(
:
div
,
attributes
=
Dict
(
"display"
=>
"inlineBlock"
),
io_element
=
Node
(
:
div
,
attributes
=
Dict
(
"display"
=>
"inlineBlock"
),
gui
.
widgets
[
:
run
],
gui
.
widgets
[
:
run
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment