Skip to content

Commit

Permalink
add field mod_text
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Apr 5, 2024
1 parent 03e4778 commit 10ae218
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

### [unreleased]
### KiteViewers v0.4.11 - 2024-04-05

#### 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

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

Expand Down
2 changes: 1 addition & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function update_system(kv::AKV, state::SysState; scale=1.0, kite_scale=1.0)
kv.step+=1

# print state values
if mod(kv.step, 2) == 1
if mod(kv.step, kv.mod_text) == 1
msg = "time: $(@sprintf("%7.2f", state.time)) s\n" *
"height: $(@sprintf("%7.2f", height)) m " * "length: $(@sprintf("%7.2f", state.l_tether)) m\n" *
"elevation: $(@sprintf("%7.2f", state.elevation/pi*180.0)) ° " * "heading: $(@sprintf("%7.2f", state.heading/pi*180.0)) °\n" *
Expand Down
4 changes: 3 additions & 1 deletion src/viewer3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ mutable struct Viewer3D <: AKV
btn_OK::Union{Button, Nothing}
sw::Toggle
step::Int64
mod_text::Int64 # 4 means at 40Hz update rate the text is updated only at 10Hz
energy::Float64
show_kite::Bool
stop::Bool
Expand Down Expand Up @@ -225,10 +226,11 @@ function Viewer3D(set::Settings, show_kite=true, autolabel="Autopilot"; precompi
markersizes = Observable([Point3f(1,1,1) for x in 1:set.segments+KITE_SPRINGS]) # includes the segment length
rotations = Observable([Point3f(1,0,0) for x in 1:set.segments+KITE_SPRINGS]) #unit vectors corresponding with
#the orientation of the segments
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,
sw, 0, 0, show_kite, false)
sw, 0, mod_text, 0, show_kite, false)
txt2 = init_system(s, s.scene3D; show_kite=show_kite)

camera = cameracontrols(s.scene3D.scene)
Expand Down

0 comments on commit 10ae218

Please sign in to comment.