Skip to content

Commit

Permalink
Improve consistancy
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Mar 23, 2024
1 parent 847848a commit 00ceb8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion mwes/mwe_03.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using KiteViewers
Viewer3D()
viewer::Viewer3D = Viewer3D()
clear_viewer(viewer)

# KiteViewers.running[]=true
nothing
10 changes: 5 additions & 5 deletions src/viewer3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ end

function set_status(kv::AKV, status_text)
global last_status
if status_tex == "Paused"
if status_text != "Paused"
last_status = status[]
end
status[] = status_text
Expand Down Expand Up @@ -138,7 +138,6 @@ function Viewer3D(show_kite=true, autolabel="Autopilot"; precompile=false)

text!(scene2D, status, position = Point2f( 20, 0), fontsize = TEXT_SIZE, align = (:left, :bottom), show_axis = false, space=:pixel)
textnode2[]="depower\nsteering:"
status[]="Stopped"

fig[2, 1] = buttongrid = GridLayout(tellwidth=false)
l_sublayout = GridLayout()
Expand Down Expand Up @@ -173,6 +172,7 @@ function Viewer3D(show_kite=true, autolabel="Autopilot"; precompile=false)

camera = cameracontrols(s.scene3D.scene)
reset_view(camera, s.scene3D)
set_status(s, "Stopped")

on(s.btn_RESET.clicks) do c
reset_view(camera, s.scene3D)
Expand All @@ -193,9 +193,9 @@ function Viewer3D(show_kite=true, autolabel="Autopilot"; precompile=false)
end
on(s.btn_PLAY.clicks) do c
running[] = ! running[]
viewer.stop = ! KiteViewers.running[]
if ! running[]
set_status(s, "Paused")
s.stop = ! KiteViewers.running[]
if running[]
pause(s)
else
set_status(s, last_status)
end
Expand Down

0 comments on commit 00ceb8e

Please sign in to comment.