Skip to content

Commit

Permalink
Add t_sim
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Apr 5, 2024
1 parent a9c52fd commit e603c82
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Added
- add menu time_lapse for changing the simulation/ replay speed
- add field `mod_text` to Viewer3D; it defines the quotient of the update rate and the text update rate
- add textbox `t_sim` to enter the simulation time

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

Expand Down
2 changes: 1 addition & 1 deletion mwes/mwe_05.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ segments=se().segments
state=demo_state_4p(segments+1)
update_system(viewer, state, kite_scale=0.25)
sleep(5)
close(viewer.screen)
#close(viewer.screen)
15 changes: 14 additions & 1 deletion src/viewer3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ mutable struct Viewer3D <: AKV
menu::Union{Menu, Nothing}
menu_rel_tol::Union{Menu, Nothing}
menu_time_lapse::Union{Menu, Nothing}
t_sim::Union{Textbox, Nothing}
btn_OK::Union{Button, Nothing}
sw::Toggle
step::Int64
Expand Down Expand Up @@ -158,6 +159,17 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
label3.halign[]=:left
label3.valign[]=:top
label3.alignmode=Outside(160, 0, 0, 100)
tb = Textbox(fig, bbox = fig.scene.viewport, placeholder = "Simulation time",
validator = UInt16, stored_string="460")
tb.width[] =120
tb.halign[]=:left
tb.valign[]=:top
tb.alignmode[]=Outside(30, 0, 0, 130)
# tb.stored_string[]="460"
label3 = Label(fig, "t_sim [s]", bbox=fig.scene.viewport)
label3.halign[]=:left
label3.valign[]=:top
label3.alignmode=Outside(160, 0, 0, 137)
btn_OK = Button(fig, bbox=fig.scene.viewport, label = "OK")
btn_OK.halign[]=:left
btn_OK.valign[]=:top
Expand All @@ -166,6 +178,7 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
menu1=nothing
menu2=nothing
menu3=nothing
tb = nothing
btn_OK=nothing
end

Expand Down Expand Up @@ -229,7 +242,7 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
mod_text = 4
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, menu3, btn_OK,
btn_PLAY_PAUSE, btn_AUTO, btn_PARKING, btn_STOP, menu1, menu2, menu3, tb, btn_OK,
sw, 0, mod_text, 0, show_kite, false)
txt2 = init_system(s, s.scene3D; show_kite=show_kite)

Expand Down

0 comments on commit e603c82

Please sign in to comment.