[chronojump] DoubleContacts cairo graph running on runInterval
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] DoubleContacts cairo graph running on runInterval
- Date: Wed, 3 Nov 2021 18:52:11 +0000 (UTC)
commit 4575d3a5d0b2c7a7893c96a1776d52c133da8169
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Nov 3 15:50:37 2021 -0300
DoubleContacts cairo graph running on runInterval
src/gui/app1/run.cs | 3 +++
src/gui/eventExecute.cs | 34 +++++++++++++++++++++++-----------
2 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/src/gui/app1/run.cs b/src/gui/app1/run.cs
index d2138d7a5..b5aac73cf 100644
--- a/src/gui/app1/run.cs
+++ b/src/gui/app1/run.cs
@@ -267,6 +267,9 @@ public partial class ChronoJumpWindow
cairoPaintBarsPre.StoreEventGraphRunsInterval (eventGraph);
PrepareRunIntervalGraph (cairoPaintBarsPre.eventGraphRunsIntervalStored, false);
+
+ cairoManageRunDoubleContacts = new CairoManageRunDoubleContacts (
+ event_execute_drawingarea_run_simple_double_contacts,
preferences.fontType.ToString() );
}
private void extra_window_runs_interval_initialize(RunType myRunType)
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 25b03c005..a158e4a77 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -541,8 +541,8 @@ public partial class ChronoJumpWindow
public void on_event_execute_drawingarea_run_simple_double_contacts_expose_event (object o,
ExposeEventArgs args)
{
- if(current_mode != Constants.Modes.RUNSSIMPLE)// &&
- //current_mode != Constants.Modes.RUNSINTERVALLIC)
+ if(current_mode != Constants.Modes.RUNSSIMPLE &&
+ current_mode != Constants.Modes.RUNSINTERVALLIC)
return;
//if object not defined or not defined fo this mode, return
@@ -550,9 +550,9 @@ public partial class ChronoJumpWindow
return;
if (current_mode == Constants.Modes.RUNSSIMPLE)
- PrepareRunSimpleDoubleContactsGraph ();
- //else if (current_mode == Constants.Modes.RUNSINTERVALLIC)
- // PrepareRunIntervalDoubleContactsGraph
(cairoManageRunDoubleContacts.eventGraphRunsIntervalStored, false);
+ PrepareRunDoubleContactsGraph (true);
+ else if (current_mode == Constants.Modes.RUNSINTERVALLIC)
+ PrepareRunDoubleContactsGraph (false);
}
// simple and DJ jump
@@ -733,7 +733,7 @@ public partial class ChronoJumpWindow
cairoPaintBarsPre.RunsShowTime = check_run_show_time.Active;
cairoPaintBarsPre.Paint();
}
- public void PrepareRunSimpleDoubleContactsGraph()
+ public void PrepareRunDoubleContactsGraph(bool simple)
{
LogB.Information("cairoManageRunDoubleContacts == null: ", (cairoManageRunDoubleContacts ==
null).ToString());
@@ -745,11 +745,25 @@ public partial class ChronoJumpWindow
if(runPTL == null || ! runPTL.UseDoubleContacts())
return;
- if(currentEventExecute == null || currentEventExecute.PrepareEventGraphRunSimpleObject ==
null)
+ if(currentEventExecute == null)
return;
+ double timeTotal = 0;
+ if(simple)
+ {
+ if (currentEventExecute.PrepareEventGraphRunSimpleObject == null)
+ return;
+
+ timeTotal = currentEventExecute.PrepareEventGraphRunSimpleObject.time; //TODO: check
problems on deleting last test, or changing mode
+ } else {
+ if (currentEventExecute.PrepareEventGraphRunIntervalRealtimeCaptureObject == null)
+ return;
+
+ timeTotal =
Util.GetTotalTime(currentEventExecute.PrepareEventGraphRunIntervalRealtimeCaptureObject.timesString);
+ }
+
// Paint cairo graph
- cairoManageRunDoubleContacts.Paint(currentEventExecute, runPTL);
+ cairoManageRunDoubleContacts.Paint(currentEventExecute, runPTL, timeTotal);
}
public void PrepareRunIntervalGraph(PrepareEventGraphRunInterval eventGraph, bool animate)
@@ -3219,14 +3233,12 @@ public class CairoManageRunDoubleContacts
this.fontStr = fontStr;
}
- public void Paint (EventExecute currentEventExecute, RunPhaseTimeList runPTL)
+ public void Paint (EventExecute currentEventExecute, RunPhaseTimeList runPTL, double timeTotal)
{
if(darea == null || darea.GdkWindow == null) //at start program, this can fail
return;
// 1) get data
- double timeTotal = currentEventExecute.PrepareEventGraphRunSimpleObject.time; //TODO: check
problems on deleting last test, or changing mode
-
List<RunPhaseTimeListObject> runPTLInListForPainting = runPTL.InListForPainting();
double negativePTLTime = getRunSRunINegativePTLTime(runPTLInListForPainting);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]