@@ -384,7 +384,7 @@ void plot_point(int x, int y)
384384 mvprintw (y /Y_SCALE , x * X_SCALE , "O (%d,%d)" , x - Y_PRINT_OFFSET , y - X_PRINT_OFFSET );
385385}
386386
387- int eye_plot_graph (int * data , bool plot_6p_points )
387+ int eye_plot_graph (int * data , bool plot_6p_points , unsigned int w2h_score )
388388{
389389 initscr ();
390390 noecho ();
@@ -406,6 +406,12 @@ int eye_plot_graph(int *data, bool plot_6p_points)
406406 mvprintw (y /Y_SCALE , 0 , "%2d" , y );
407407 }
408408
409+ char legend [32 ];
410+ snprintf (legend , sizeof (legend ), "W2H SCORE = %u" , w2h_score );
411+
412+ if (plot_6p_points == true)
413+ mvprintw (0 , COLS - strlen (legend ) - 1 , "%s" , legend );
414+
409415 //Adjusting the eye points to plot from 0 to 42 for x-axis and 0 t0 100 for Y-axis
410416 //as ncurses library did not support negative ploting
411417 data [0 ] = data [0 ] + X_LAYOUT_SHIFT ;
@@ -435,8 +441,14 @@ int eye_plot_graph(int *data, bool plot_6p_points)
435441 plot_point (X_LAYOUT_SHIFT + Y_PRINT_OFFSET , data [3 ] + X_PRINT_OFFSET );
436442 }
437443
444+ mvprintw (LINES - 1 , 0 , "Press 'q' to quit." );
438445 refresh ();
439- getch ();
446+
447+ int ch ;
448+ while ((ch = getch ()) != 'q' ) {
449+ // Standby, do nothing
450+ }
451+
440452 endwin ();
441453 return 0 ;
442454}
0 commit comments