[chronojump] ForceSensor feedback rectangle with better margins
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor feedback rectangle with better margins
- Date: Fri, 28 Feb 2020 11:44:10 +0000 (UTC)
commit 38d750998bc373d48ae597891a912f267de69dd2
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Feb 28 12:37:57 2020 +0100
ForceSensor feedback rectangle with better margins
src/gui/app1/forceSensor.cs | 14 +++++++-------
src/gui/app1/forceSensorAnalyze.cs | 8 +++++---
2 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 6d810dd4..fe064821 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -762,7 +762,7 @@ public partial class ChronoJumpWindow
forcePaintHVLines(ForceSensorGraphs.CAPTURE, fscPoints.RealHeightG,
ForceSensorCapturePoints.DefaultRealHeightGNeg, 10, false);
//draw horizontal rectangle of feedback
if(preferences.forceSensorCaptureFeedbackActive)
- forceSensorSignalPlotFeedbackRectangle(fscPoints,
+ forceSensorSignalPlotFeedbackRectangle(fscPoints,
force_capture_drawingarea.Allocation.Width,
force_capture_drawingarea, force_capture_pixmap,
pen_blue_light_force_capture);
@@ -1202,7 +1202,7 @@ LogB.Information(" fs I ");
forcePaintHVLines(ForceSensorGraphs.CAPTURE, fscPoints.RealHeightG,
forceSensorValues.Min * 2, fscPoints.RealWidthG, false);
//draw horizontal rectangle of feedback
if(preferences.forceSensorCaptureFeedbackActive)
- forceSensorSignalPlotFeedbackRectangle(fscPoints,
+ forceSensorSignalPlotFeedbackRectangle(fscPoints,
force_capture_drawingarea.Allocation.Width,
force_capture_drawingarea, force_capture_pixmap,
pen_blue_light_force_capture);
}
@@ -1302,7 +1302,7 @@ LogB.Information(" fs R ");
UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
if(preferences.forceSensorCaptureFeedbackActive)
- forceSensorSignalPlotFeedbackRectangle(fscPoints,
+ forceSensorSignalPlotFeedbackRectangle(fscPoints,
force_capture_drawingarea.Allocation.Width,
force_capture_drawingarea, force_capture_pixmap,
pen_blue_light_force_capture);
forcePaintHVLines(ForceSensorGraphs.CAPTURE,
@@ -1923,7 +1923,7 @@ LogB.Information(" fs R ");
//draw horizontal rectangle of feedback
if(preferences.forceSensorCaptureFeedbackActive)
- forceSensorSignalPlotFeedbackRectangle(fscPoints,
+ forceSensorSignalPlotFeedbackRectangle(fscPoints,
force_capture_drawingarea.Allocation.Width,
force_capture_drawingarea, force_capture_pixmap,
pen_blue_light_force_capture);
@@ -1969,7 +1969,7 @@ LogB.Information(" fs R ");
}
//at analyze can show lines AB and rectangle. There the rectangle should be YELLOW_LIGHT
- private void forceSensorSignalPlotFeedbackRectangle(ForceSensorCapturePoints points,
+ private void forceSensorSignalPlotFeedbackRectangle(ForceSensorCapturePoints points, int maxX,
Gtk.DrawingArea drawingarea, Gdk.Pixmap pixmap, Gdk.GC pen_rectangle)
{
//draw horizontal rectangle of feedback
@@ -1982,12 +1982,12 @@ LogB.Information(" fs R ");
int fbkGraphTop = points.GetForceInPx(fbkNValue) - fbkGraphRectHalfHeight;
Rectangle rect = new Rectangle(points.GetTimeInPx(0) +1, fbkGraphTop,
- drawingarea.Allocation.Width -1, fbkGraphRectHeight);
+ maxX - points.GetTimeInPx(0) -1, fbkGraphRectHeight);
pixmap.DrawRectangle(pen_rectangle, true, rect);
pixmap.DrawLine(pen_blue_dark_force_capture,
- points.GetTimeInPx(0), fbkGraphCenter, drawingarea.Allocation.Width,
fbkGraphCenter);
+ points.GetTimeInPx(0) +1, fbkGraphCenter, maxX -1, fbkGraphCenter);
}
private enum ForceSensorGraphs { CAPTURE, ANALYSIS_GENERAL }
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 57ed55fa..8f2892de 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -1041,9 +1041,13 @@ public partial class ChronoJumpWindow
button_force_sensor_image_save_rfd_manual.Sensitive = true;
+ int xPxStart = fsAI.FscAIPoints.GetTimeInPx(0);
+ int xPxEnd = fsAI.FscAIPoints.GetTimeInPx(forceSensorValues.TimeLast);
+
//draw horizontal rectangle of feedback
if(preferences.forceSensorCaptureFeedbackActive)
- forceSensorSignalPlotFeedbackRectangle(fsAI.FscAIPoints, force_sensor_ai_drawingarea,
force_sensor_ai_pixmap, pen_blue_light_force_ai);
+ forceSensorSignalPlotFeedbackRectangle(fsAI.FscAIPoints, xPxEnd,
+ force_sensor_ai_drawingarea, force_sensor_ai_pixmap,
pen_blue_light_force_ai);
// 1) create paintPoints
//LogB.Information(string.Format("forceSensorAnalyzeManualGraphDo():
fsAI.FscAIPoints.Points.Count: {0}", fsAI.FscAIPoints.Points.Count));
@@ -1062,8 +1066,6 @@ public partial class ChronoJumpWindow
// 2b) draw horizontal 0 line on elastic, and Y right axis
if(fsAI.CalculedElasticPSAP)
{
- int xPxStart = fsAI.FscAIPointsDispl.GetTimeInPx(0);
- int xPxEnd = fsAI.FscAIPointsDispl.GetTimeInPx(forceSensorValues.TimeLast);
int yPx = fsAI.FscAIPoints.GetForceInPx(0);
layout_force_ai_text.SetMarkup("Dist (m)");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]