Skip to content

Commit 68bcf87

Browse files
committed
Add buttons Autopilot and Parking
1 parent 48e60f0 commit 68bcf87

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/KiteViewers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module KiteViewers
22

33
using GeometryBasics, Rotations, GLMakie, FileIO, LinearAlgebra, Printf, Parameters, Reexport
4-
import GeometryBasics:Point3f
4+
import GeometryBasics:Point3f, GeometryBasics.Point2f
55
using KiteUtils
66

77
export Viewer3D, AbstractKiteViewer, AKV # types

src/viewer3D.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ mutable struct Viewer3D <: AKV
7979
btn_ZOOM_in::Button
8080
btn_ZOOM_out::Button
8181
btn_PLAY::Button
82+
btn_AUTO::Button
83+
btn_PARKING::Button
8284
btn_STOP::Button
8385
step::Int64
8486
energy::Float64
@@ -130,14 +132,16 @@ function Viewer3D(show_kite=true)
130132
btn_ZOOM_in = Button(scene, label = "Zoom +")
131133
btn_ZOOM_out = Button(scene, label = "Zoom -")
132134
btn_PLAY_PAUSE = Button(scene, label = @lift($running ? "PAUSE" : " PLAY "))
135+
btn_AUTO = Button(scene, label = "Autopilot")
136+
btn_PARKING = Button(scene, label = "Parking")
133137
btn_STOP = Button(scene, label = "STOP")
134138
sw = Toggle(scene, active = false)
135139
label = Label(scene, "repeat")
136140

137-
buttongrid[1, 1:7] = [btn_PLAY_PAUSE, btn_ZOOM_in, btn_ZOOM_out, btn_RESET, btn_STOP, sw, label]
141+
buttongrid[1, 1:9] = [btn_PLAY_PAUSE, btn_ZOOM_in, btn_ZOOM_out, btn_RESET, btn_AUTO, btn_PARKING, btn_STOP, sw, label]
138142

139143
gl_screen = display(scene)
140-
s = Viewer3D(scene, layout, scene3D, cam, gl_screen, btn_RESET, btn_ZOOM_in, btn_ZOOM_out, btn_PLAY_PAUSE, btn_STOP, 0, 0, show_kite, false)
144+
s = Viewer3D(scene, layout, scene3D, cam, gl_screen, btn_RESET, btn_ZOOM_in, btn_ZOOM_out, btn_PLAY_PAUSE, btn_AUTO, btn_PARKING, btn_STOP, 0, 0, show_kite, false)
141145

142146
init_system(s.scene3D; show_kite=show_kite)
143147

0 commit comments

Comments
 (0)