Hi Steve,

This is a patch which allows users in Sequential analysis boardType
mode, to switch between looking at only Current side-to-move moves or
only Opposite side moves or both sides moves from the MainPV of the
engine on the analysis board.

Thus giving more flexibility wrt what one may want to look at from the
analysis engine's mainpv, also indirectly allowing one to probe more
into the mainpv without cluttering the board.

Inturn to help with the same, a listbox is shown next to the analysis
board in Sequential mode. So that user can switch between these views.

NOTE1:  I have also cleaned up the space-tab usage to be consistent
wrt the block of code in updateAnalysisBoard wrt boardVisualiseMoves,
to only use spaces.

NOTE2: Given that "1st moves from all multiPVs" and "SeqOfMoves in
MainPV" are orthogonal to one another and useful to view parallely at
the same time. I would request you to reconsider your decision to have
them as independent/exclusive modes, which does not allow both to be
viewed at the same time. Do note that both types of arrows use
different colors, so it is visually clearly differentiable without any
confusion. Also one can always disable moves-sequence visualisation by
turning the spinbox down to 0, if needed, while the default of 3 also
doesnt clutter the board.

-- 
Keep ;-)
HanishKVC
Index: tcl/tools/analysis.tcl
===================================================================
--- tcl/tools/analysis.tcl	(revision 3493)
+++ tcl/tools/analysis.tcl	(working copy)
@@ -3670,6 +3670,8 @@
 ###  Toggle whether the small analysis board is shown
 ###  ... not really an init, but updateAnalysisBoard is already taken
 
+set BvmModes "cur opp both"
+
 proc initAnalysisBoard {n} {
   global analysis
   set w .analysisWin$n
@@ -3690,6 +3692,15 @@
       pack forget $w.frame
     "
     pack $w.frame.bd $w.frame.close -side left -anchor n
+
+    if {$analysis(boardType$n) == "Sequential"} {
+      set analysis(bvmMode$n) 2
+      listbox $w.frame.mode -listvariable BvmModes -selectmode single -exportselection false -width 0 -height 0
+      $w.frame.mode selection set $analysis(bvmMode$n)
+      ::utils::tooltip::Set $w.frame.mode "which sides moves to show"
+      pack $w.frame.close $w.frame.mode -side top -anchor n
+    }
+
     bind $w.frame.bd.bd <Button-2> "
       $w.frame.bd.bd delete var bvm
       nextBoardType $n
@@ -3746,11 +3757,24 @@
 proc boardVisualizeMoves {board n moves} {
   global analysis
 
+  if {[winfo exists .analysisWin$n.frame.mode]} {
+    set analysis(bvmMode$n) [.analysisWin$n.frame.mode curselection]
+  } else {
+    set analysis(bvmMode$n) 2
+  }
+
   $board delete bvm
-  set im 0
+  set im -1
+  set mc 0
   foreach cm $moves {
     incr im
-    if {$im > $analysis(boardSeqCount$n)} {
+    if {($analysis(bvmMode$n) <= 1)} {
+      if {[expr $im%2] != $analysis(bvmMode$n)} {
+        continue
+      }
+    }
+    incr mc
+    if {$mc > $analysis(boardSeqCount$n)} {
       break
     }
     if {$cm != ""} {
@@ -3766,8 +3790,8 @@
 
       set xmid [expr ([lindex $coord 0] + [lindex $coord 2]) / 2]
       set ymid [expr ([lindex $coord 1] + [lindex $coord 3]) / 2]
-      # $board create text [expr $xmid+1] [expr $ymid+1] -fill [gradient $analysis(boardSeqNumColor) -.5] -font $analysis(boardSeqFont) -text $im -anchor c -tag bvm
-      $board create text $xmid $ymid -fill $analysis(boardSeqNumColor) -font $analysis(boardSeqFont) -text $im -anchor c -tag bvm
+      # $board create text [expr $xmid+1] [expr $ymid+1] -fill [gradient $analysis(boardSeqNumColor) -.5] -font $analysis(boardSeqFont) -text $mc -anchor c -tag bvm
+      $board create text $xmid $ymid -fill $analysis(boardSeqNumColor) -font $analysis(boardSeqFont) -text $mc -anchor c -tag bvm
     }
   }
 }
@@ -3842,20 +3866,20 @@
     } else {
       # Hanish's feature
       if {[sc_pos moves] == {}} {
-	set analysis(boardSeqLengthSeen$n) 0
-	set analysis(boardSeqDepthSeen$n) 0 
+        set analysis(boardSeqLengthSeen$n) 0
+        set analysis(boardSeqDepthSeen$n) 0 
       } else {
         # Show some amount of the initial part of the Main PV using thin arrows
-	if {$analysis(uci$n) && 
-	    ([llength $moves] > $analysis(boardSeqLengthSeen$n)/2 || 
-	    $analysis(depth$n) > ($analysis(boardSeqDepthSeen$n)+1) ||
-	    $analysis(scoremate$n) != 0)} {
-	  set analysis(boardSeqLengthSeen$n) [llength $moves]
-	  set analysis(boardSeqDepthSeen$n) $analysis(depth$n)
-	  boardVisualizeMoves $bd.bd $n $moves
-	} else {
-	  $bd.bd raise bvm
-	}
+        if {$analysis(uci$n) && 
+            ([llength $moves] > $analysis(boardSeqLengthSeen$n)/2 || 
+            $analysis(depth$n) > ($analysis(boardSeqDepthSeen$n)+1) ||
+            $analysis(scoremate$n) != 0)} {
+          set analysis(boardSeqLengthSeen$n) [llength $moves]
+          set analysis(boardSeqDepthSeen$n) $analysis(depth$n)
+          boardVisualizeMoves $bd.bd $n $moves
+        } else {
+          $bd.bd raise bvm
+        }
       }
     }
   } else {
_______________________________________________
Scidvspc-users mailing list
Scidvspc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scidvspc-users

Reply via email to