|
28 | 28 | renders(h, reset = false) = Int(ccall(GmtvtkTest._test_fn(:gmtvtk_render_count_test), Cint, |
29 | 29 | (Ptr{Cvoid}, Cint), h, Cint(reset))) |
30 | 30 |
|
| 31 | + # The slider's value at every paint of the 3-D view since the last start: what reached the screen. |
| 32 | + paintlog(h, start) = start ? (ccall(GmtvtkTest._test_fn(:gmtvtk_paint_log_test), Cint, |
| 33 | + (Ptr{Cvoid}, Cint, Ptr{Cint}, Cint), h, 1, C_NULL, 0); Int[]) : |
| 34 | + (buf = zeros(Cint, 100_000); |
| 35 | + n = ccall(GmtvtkTest._test_fn(:gmtvtk_paint_log_test), Cint, |
| 36 | + (Ptr{Cvoid}, Cint, Ptr{Cint}, Cint), h, 0, buf, Cint(length(buf))); |
| 37 | + Int.(buf[1:max(n, 0)])) |
| 38 | + |
31 | 39 | # Hold for `secs` by SLEEPING (the Timer pump runs), then release and let it settle `settle` s. |
32 | 40 | function hold(h, st, dir, secs; settle = 3.0) |
33 | 41 | renders(h, true) |
| 42 | + paintlog(h, true) |
34 | 43 | v0 = aqf_realpress(h, dir, true) |
35 | 44 | @assert v0 >= 0 "arrow press hook failed: $v0" |
36 | 45 | drawn = Int[]; gap = 0.0; tl = time(); t0 = tl |
|
45 | 54 | sleep(0.01); t = time(); gap = max(gap, t - tl); tl = t |
46 | 55 | push!(marks, slider(h)) |
47 | 56 | end |
48 | | - (; v0, vrel, ndrawn = length(unique(drawn)), nr, gap, |
| 57 | + pl = paintlog(h, false) |
| 58 | + painted = [pl[i] for i in eachindex(pl) if i == 1 || pl[i] != pl[i-1]] # each layer once, in order |
| 59 | + (; v0, vrel, ndrawn = length(unique(drawn)), nr, gap, painted, |
49 | 60 | vmid = marks[max(1, length(marks) ÷ 2)], vend = slider(h), cur = st.cur + 1) |
50 | 61 | end |
51 | 62 |
|
52 | 63 | aqf_on_screen() do # the real mouse needs the window on the screen |
53 | 64 | mktempdir() do dir |
| 65 | + # The small tank, one of a real model's size (765x476), and a big one whose slice takes longer than |
| 66 | + # the arrow's repeat interval -- where the repeats used to run the slider ahead of the drawing. |
| 67 | + for (nx, ny) in ((128, 96), (765, 476), (2000, 1500)) |
54 | 68 | # 40 steps: enough that a working hold cannot run out of slices inside the hold window. |
55 | | - nc = aqf_make_tsunami_nc(joinpath(dir, "tsu_transport.nc"); nt = 40) |
| 69 | + nc = aqf_make_tsunami_nc(joinpath(dir, "tsu_transport_$nx.nc"); nx, ny, nt = 40) |
56 | 70 | f = iview() |
57 | 71 | try |
58 | 72 | IG._on_drop(f.h, nc); aqf_pump(80) |
59 | 73 | st = IG._AQUA[f.h] |
60 | 74 | for dir in (+1, -1) |
61 | 75 | r = hold(f.h, st, dir, 2.0) |
62 | | - @info "hold dir=$dir" r |
63 | | - isdefined(Main, :_log) && Main._log(" hold dir=", dir, ": ", r) |
| 76 | + @info "hold $(nx)x$ny dir=$dir" r |
| 77 | + isdefined(Main, :_log) && Main._log(" hold ", nx, "x", ny, " dir=", dir, ": ", r) |
| 78 | + # SMOOTH: every layer the slider passed was PAINTED, one after the other, in order. A |
| 79 | + # hold that freezes on one layer and then jumps ten skips the ones in between. |
| 80 | + @test filter(!=(r.v0), r.painted) == collect(r.v0 + dir:dir:r.vrel) |
64 | 81 | # Moves in the asked direction, several DRAWN slices (a healthy 2 s hold draws 10+). |
65 | 82 | @test dir * (r.vrel - r.v0) > 3 |
66 | 83 | @test r.ndrawn > 3 |
|
79 | 96 | end |
80 | 97 | end |
81 | 98 | end |
| 99 | + end |
82 | 100 | end |
83 | 101 |
|
84 | 102 | # THE SAME HOLD WITH "Sat img" ON, ON A REAL-SIZE TANK. With the satellite drape on, every slice also |
|
0 commit comments