Skip to content

Commit

Permalink
Add menu time_lapse
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Apr 5, 2024
1 parent f1b481a commit 03e4778
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

### [unreleased]

#### Added
- add menu time_lapse for changing the simulation/ replay speed

### KiteViewers v0.4.10 - 2024-03-30

#### Fixed
- fixed bug that caused problems with displaying tethers with more than 6 segments

#### Added
- the function Viewer3D() has now the optional parameter `menus=true`, if passed it shows the menus, otherwise not



2 changes: 1 addition & 1 deletion data/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
system:
log_file: "data/log_8700W_8ms" # filename without extension [replay only]
# use / as path delimiter, even on Windows
time_lapse: 1.0 # relative replay speed
time_lapse: 4 # relative replay speed (1..8, should be integer)
sim_time: 100.0 # simulation time [sim only]
segments: 6 # number of tether segments
sample_freq: 20 # sample frequency in Hz
Expand Down
2 changes: 1 addition & 1 deletion mwes/mwe_05.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using KiteViewers, KiteUtils
se().segments=12
viewer=Viewer3D(se(), true; precompile=true, menus=true)
viewer=Viewer3D(se(), true; precompile=false, menus=true)
segments=se().segments
state=demo_state_4p(segments+1)
update_system(viewer, state, kite_scale=0.25)
Expand Down
14 changes: 13 additions & 1 deletion src/viewer3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ mutable struct Viewer3D <: AKV
btn_STOP::Button
menu::Union{Menu, Nothing}
menu_rel_tol::Union{Menu, Nothing}
menu_time_lapse::Union{Menu, Nothing}
btn_OK::Union{Button, Nothing}
sw::Toggle
step::Int64
Expand Down Expand Up @@ -146,13 +147,24 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
label2.halign[]=:left
label2.valign[]=:top
label2.alignmode=Outside(160, 0, 0, 70)
menu3 = Menu(fig, bbox = fig.scene.viewport,
options = ["1x", "2x", "3x", "4x", "6x", "8x"], default = "4x")
menu3.width[] =120
menu3.halign[]=:left
menu3.valign[]=:top
menu3.alignmode[]=Outside(30, 0, 0, 90)
label3 = Label(fig, "time_lapse", bbox=fig.scene.viewport)
label3.halign[]=:left
label3.valign[]=:top
label3.alignmode=Outside(160, 0, 0, 100)
btn_OK = Button(fig, bbox=fig.scene.viewport, label = "OK")
btn_OK.halign[]=:left
btn_OK.valign[]=:top
btn_OK.alignmode[]=Outside(160, 0, 0, 30)
else
menu1=nothing
menu2=nothing
menu3=nothing
btn_OK=nothing
end

Expand Down Expand Up @@ -215,7 +227,7 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
#the orientation of the segments
s = Viewer3D(fig, scene3D, cam, gl_screen, points, pos, part_pos, markersizes,
rotations, set, btn_RESET, btn_ZOOM_in, btn_ZOOM_out,
btn_PLAY_PAUSE, btn_AUTO, btn_PARKING, btn_STOP, menu1, menu2, btn_OK,
btn_PLAY_PAUSE, btn_AUTO, btn_PARKING, btn_STOP, menu1, menu2, menu3, btn_OK,
sw, 0, 0, show_kite, false)
txt2 = init_system(s, s.scene3D; show_kite=show_kite)

Expand Down

0 comments on commit 03e4778

Please sign in to comment.