Improve Eval Graph with -evalZoom and -evalThreshold
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 9 Jul 2011 11:28:08 +0000 (13:28 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 10 Jul 2011 19:29:25 +0000 (21:29 +0200)
The score range between -1 and +1 can now be blown up by a factor
specified through -evalZoom. The threshold below which histogram bars
are no longer printed (wich used to e hard-coded 25 centi-Pawn) can now
be set through the -evalThreshold option.

args.h
common.h
evalgraph.c
xoptions.c

diff --git a/args.h b/args.h
index fbf2651..61da040 100644 (file)
--- a/args.h
+++ b/args.h
@@ -623,6 +623,8 @@ ArgDescriptor argDescriptors[] = {
   { "sn", ArgString, (void *) &appData.pgnName[1], FALSE, INVALID },
   { "absoluteAnalysisScores", ArgBoolean, (void *) &appData.whitePOV, TRUE, FALSE },
   { "scoreWhite", ArgBoolean, (void *) &appData.scoreWhite, TRUE, FALSE },
+  { "evalZoom", ArgInt, (void *) &appData.zoom, TRUE, (ArgIniType) 1 },
+  { "evalThreshold", ArgInt, (void *) &appData.evalThreshold, TRUE, (ArgIniType) 25 },
   { "fSAN", ArgTrue, (void *) &appData.pvSAN[0], FALSE, FALSE },
   { "sSAN", ArgTrue, (void *) &appData.pvSAN[1], FALSE, FALSE },
   { "pairingEngine", ArgFilename, (void *) &appData.pairingEngine, TRUE, "" },
index 17feddb..2b5b684 100644 (file)
--- a/common.h
+++ b/common.h
@@ -645,6 +645,8 @@ typedef struct {
     Boolean useInternalWrap; /* use internal wrapping -- noJoin usurps this if set */
     Boolean pasteSelection; /* paste X selection instead of clipboard */
     int nrVariations;   /* [HGM] multivar  */
+    int zoom;           /* [HGM] evalGraph */
+    int evalThreshold;  /* [HGM] evalGraph */
     Boolean dropMenu;   /* [HGM] pv        */
     Boolean markers;    /* [HGM] markers   */
     Boolean pieceMenu;
index 1380276..a24ba02 100644 (file)
@@ -109,8 +109,10 @@ static int GetValueY( int value )
 {
     if( value < -range*700 ) value = -range*700;
     if( value > +range*700 ) value = +range*700;
-
-    return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / (1400.*range));
+    if(value > 100*range)  value += appData.zoom * 100 - 100*range; else
+    if(value < -100*range) value -= appData.zoom * 100 - 100*range; else
+       value *= appData.zoom;
+    return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / ((1200. + 200.*appData.zoom)*range));
 }
 
 // the brush selection is made part of the DrawLine, by passing a style argument
@@ -159,7 +161,7 @@ static void DrawHistogram( int x, int y, int width, int value, int side )
 {
     int left, top, right, bottom;
 
-    if( value > -25 && value < +25 ) return;
+    if( value > -appData.evalThreshold*range && value < +appData.evalThreshold*range ) return;
 
     left = x;
     right = left + width + 1;
index cd761d4..7e7eed8 100644 (file)
@@ -390,6 +390,7 @@ Option generalOptions[] = {
 { 0, 0, 10, NULL, (void*) &appData.flashCount, "", NULL, Spin, N_("Flash Moves (0 = no flashing):") },
 { 0, 1, 10, NULL, (void*) &appData.flashRate, "", NULL, Spin, N_("Flash Rate (high = fast):") },
 { 0, 5, 100,NULL, (void*) &appData.animSpeed, "", NULL, Spin, N_("Animation Speed (high = slow):") },
+{ 0,  1, 5, NULL, (void*) &appData.zoom, "", NULL, Spin, N_("Zoom factor in Evaluation Graph:") },
 { 0,  0, 0, NULL, (void*) &GeneralOptionsOK, "", NULL, EndMark , "" }
 };