windowsize

Wed, 02 Dec 2020 12:54:58 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 02 Dec 2020 12:54:58 -0500
changeset 4
a64766c44642
parent 2
be7cab83b14a
child 5
843e7611b068

windowsize

src/PredictPDPS.jl file | annotate | diff | comparison | revisions
--- a/src/PredictPDPS.jl	Sat Dec 04 09:22:46 2021 +0200
+++ b/src/PredictPDPS.jl	Wed Dec 02 12:54:58 2020 -0500
@@ -235,19 +235,21 @@
             wp("sigma", (e_params.σ₀ == 1 ? "" : "$(e_params.σ₀)") * "\\sigma_{\\max}")
         end
     end
-end                
+end
 
 function run_experiments(;visualise=true,
                           recalculate=true,
                           experiments,
                           save_prefix=default_save_prefix,
                           fullscreen=false,
+                          windowsize=nothing,
                           kwargs...)
 
     # Create visualisation
     if visualise
         rc = Channel(1)
-        visproc = Threads.@spawn bg_visualise_enhanced(rc, fullscreen=fullscreen)
+        visproc = Threads.@spawn bg_visualise_enhanced(rc, fullscreen=fullscreen,
+                                                       windowsize=windowsize)
         bind(rc, visproc)
         vis = rc
     else
@@ -334,7 +336,8 @@
                     visualise=true,
                     recalculate=true,
                     verbose_iter=10,
-                    fullscreen=true,
+                    fullscreen=false,
+                    windowsize=(0.10*4/3, 0.10),
                     kwargs...)
 end
 
@@ -464,10 +467,14 @@
     return st
 end
 
-function bg_visualise_enhanced(rc; fullscreen=false)
+function bg_visualise_enhanced(rc; fullscreen=false, windowsize=nothing)
     process_channel(rc) do d
         imgs, plot_movement, log, vhist = d
-        do_visualise(imgs, refresh=false, fullscreen=fullscreen)
+        try
+            do_visualise(imgs, refresh=false, fullscreen=fullscreen, windowsize=windowsize)
+        catch err
+            print(err)
+        end
         # Overlay movement
         GR.settextcolorind(5)
         GR.setcharheight(0.015)

mercurial