[chronojump] ForceSensor Analyze rectangle yellow rectangle light to see A, B



commit 7d79d2ca8d67fc771d77f0de058087cabb6ca9a1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Oct 9 14:33:08 2019 +0200

    ForceSensor Analyze rectangle yellow rectangle light to see A,B

 src/gui/forceSensor.cs        | 19 +++++++++++++------
 src/gui/forceSensorAnalyze.cs |  7 ++++++-
 src/utilGtk.cs                |  1 +
 3 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index ee7d698f..071a0ada 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -760,7 +760,8 @@ public partial class ChronoJumpWindow
                forcePaintHVLines(ForceSensorGraphs.CAPTURE, fscPoints.RealHeightG, 
ForceSensorCapturePoints.DefaultRealHeightGNeg, 10, false);
                //draw horizontal rectangle of feedback
                if(check_force_sensor_capture_feedback.Active)
-                       forceSensorSignalPlotFeedbackRectangle(fscPoints, force_capture_drawingarea, 
force_capture_pixmap);
+                       forceSensorSignalPlotFeedbackRectangle(fscPoints,
+                                       force_capture_drawingarea, force_capture_pixmap, 
pen_yellow_force_capture);
 
 
                event_execute_ButtonFinish.Clicked -= new EventHandler(on_finish_clicked);
@@ -1191,7 +1192,8 @@ LogB.Information(" fs I ");
                                forcePaintHVLines(ForceSensorGraphs.CAPTURE, fscPoints.RealHeightG, 
forceSensorValues.ForceMin * 2, fscPoints.RealWidthG, false);
                                //draw horizontal rectangle of feedback
                                if(check_force_sensor_capture_feedback.Active)
-                                       forceSensorSignalPlotFeedbackRectangle(fscPoints, 
force_capture_drawingarea, force_capture_pixmap);
+                                       forceSensorSignalPlotFeedbackRectangle(fscPoints,
+                                                       force_capture_drawingarea, force_capture_pixmap, 
pen_yellow_force_capture);
 
                        }
 
@@ -1290,7 +1292,8 @@ LogB.Information(" fs R ");
 
                UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
                if(check_force_sensor_capture_feedback.Active)
-                       forceSensorSignalPlotFeedbackRectangle(fscPoints, force_capture_drawingarea, 
force_capture_pixmap);
+                       forceSensorSignalPlotFeedbackRectangle(fscPoints,
+                                       force_capture_drawingarea, force_capture_pixmap, 
pen_yellow_force_capture);
 
                forcePaintHVLines(ForceSensorGraphs.CAPTURE,
                                getForceSensorMaxForceIncludingRectangle(forceSensorValues.ForceMax),
@@ -1825,7 +1828,8 @@ LogB.Information(" fs R ");
 
                //draw horizontal rectangle of feedback
                if(check_force_sensor_capture_feedback.Active)
-                       forceSensorSignalPlotFeedbackRectangle(fscPoints, force_capture_drawingarea, 
force_capture_pixmap);
+                       forceSensorSignalPlotFeedbackRectangle(fscPoints,
+                                       force_capture_drawingarea, force_capture_pixmap, 
pen_yellow_force_capture);
 
 
                Gdk.Point [] paintPoints = new Gdk.Point[fscPoints.Points.Count];
@@ -1872,7 +1876,9 @@ LogB.Information(" fs R ");
                        return forceSensorTopRectangleAtOperationStart;
        }
 
-       private void forceSensorSignalPlotFeedbackRectangle(ForceSensorCapturePoints points, Gtk.DrawingArea 
drawingarea, Gdk.Pixmap pixmap)
+       //at analyze can show lines AB and rectangle. There the rectangle should be YELLOW_LIGHT
+       private void forceSensorSignalPlotFeedbackRectangle(ForceSensorCapturePoints points,
+                       Gtk.DrawingArea drawingarea, Gdk.Pixmap pixmap, Gdk.GC pen_rectangle)
        {
                //draw horizontal rectangle of feedback
                int fbkNValue = Convert.ToInt32(spin_force_sensor_capture_feedback_at.Value); //feedback 
Newtons value
@@ -1885,7 +1891,8 @@ LogB.Information(" fs R ");
 
                Rectangle rect = new Rectangle(points.GetTimeInPx(0) +1, fbkGraphTop,
                                drawingarea.Allocation.Width -1, fbkGraphRectHeight);
-               pixmap.DrawRectangle(pen_yellow_force_capture, true, rect);
+
+               pixmap.DrawRectangle(pen_rectangle, true, rect);
 
                pixmap.DrawLine(pen_orange_dark_force_capture,
                                points.GetTimeInPx(0), fbkGraphCenter, drawingarea.Allocation.Width, 
fbkGraphCenter);
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index 033f010f..478db47b 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -585,6 +585,7 @@ public partial class ChronoJumpWindow
        Gdk.GC pen_red_force_ai;                //RFD max
        Gdk.GC pen_gray_discont_force_ai;       //vertical lines
        Gdk.GC pen_yellow_force_ai;             //0 force
+       Gdk.GC pen_yellow_light_force_ai;       //feedback rectangle on analyze to differentiate from yellow 
AB lines
        Gdk.GC pen_white_force_ai;              //white box to ensure yellow text is not overlapped
 
        private void forceSensorAIPlot()
@@ -615,6 +616,7 @@ public partial class ChronoJumpWindow
                colormapForceAI.AllocColor (ref UtilGtk.RED_PLOTS,true,true);
                colormapForceAI.AllocColor (ref UtilGtk.GRAY,true,true);
                bool success = colormapForceAI.AllocColor (ref UtilGtk.YELLOW,true,true);
+               colormapForceAI.AllocColor (ref UtilGtk.YELLOW_LIGHT,true,true);
                LogB.Information("Yellow success!: " + success.ToString()); //sempre dona success
 
                colormapForceAI.AllocColor (ref UtilGtk.WHITE,true,true);
@@ -628,6 +630,7 @@ public partial class ChronoJumpWindow
                pen_blue_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
                pen_red_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
                pen_yellow_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
+               pen_yellow_light_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
                pen_white_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
                pen_gray_discont_force_ai = new Gdk.GC(force_sensor_ai_drawingarea.GdkWindow);
 
@@ -635,6 +638,7 @@ public partial class ChronoJumpWindow
                pen_blue_force_ai.Foreground = UtilGtk.BLUE_PLOTS;
                pen_red_force_ai.Foreground = UtilGtk.RED_PLOTS;
                pen_yellow_force_ai.Foreground = UtilGtk.YELLOW;
+               pen_yellow_light_force_ai.Foreground = UtilGtk.YELLOW_LIGHT;
                pen_white_force_ai.Foreground = UtilGtk.WHITE;
                pen_gray_discont_force_ai.Foreground = UtilGtk.GRAY;
 
@@ -646,6 +650,7 @@ public partial class ChronoJumpWindow
                pen_blue_force_ai.SetLineAttributes (1, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, 
Gdk.JoinStyle.Round);
                pen_red_force_ai.SetLineAttributes (1, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, 
Gdk.JoinStyle.Round);
                pen_yellow_force_ai.SetLineAttributes (2, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, 
Gdk.JoinStyle.Round);
+               pen_yellow_light_force_ai.SetLineAttributes (2, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, 
Gdk.JoinStyle.Round);
                pen_white_force_ai.SetLineAttributes (1, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, 
Gdk.JoinStyle.Round);
                pen_gray_discont_force_ai.SetLineAttributes(1, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.Butt, 
Gdk.JoinStyle.Round);
 
@@ -829,7 +834,7 @@ public partial class ChronoJumpWindow
 
                //draw horizontal rectangle of feedback
                if(check_force_sensor_capture_feedback.Active)
-                       forceSensorSignalPlotFeedbackRectangle(fsAI.FscAIPoints, force_sensor_ai_drawingarea, 
force_sensor_ai_pixmap);
+                       forceSensorSignalPlotFeedbackRectangle(fsAI.FscAIPoints, force_sensor_ai_drawingarea, 
force_sensor_ai_pixmap, pen_yellow_light_force_ai);
 
                // 1) create paintPoints
                Gdk.Point [] paintPoints = new Gdk.Point[fsAI.FscAIPoints.Points.Count];
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 3229642b..38b30faf 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -459,6 +459,7 @@ public class UtilGtk
        public static Gdk.Color BLUE = new Gdk.Color(0x6c,0x77,0xab);
        public static Gdk.Color BLUE_CLEAR = new Gdk.Color(0xa0,0xa7,0xca);
        public static Gdk.Color YELLOW = new Gdk.Color(0xff,0xcc,0x01);
+       public static Gdk.Color YELLOW_LIGHT = new Gdk.Color(0xf3,0xde,0x8c);
        public static Gdk.Color YELLOW_DARK = new Gdk.Color(0xcd,0xcd,0x00);
        public static Gdk.Color ORANGE_DARK = new Gdk.Color(0xff,0x7f,0x00);
        


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]