[chronojump] Removed paintRunInterval (no cairo)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Removed paintRunInterval (no cairo)
- Date: Mon, 27 Sep 2021 12:14:43 +0000 (UTC)
commit 2fd2f8792346111d98ec7d10aa2419de5a5b8cf3
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Sep 27 14:14:05 2021 +0200
Removed paintRunInterval (no cairo)
src/gui/eventExecute.cs | 226 ------------------------------------------------
1 file changed, 226 deletions(-)
---
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 575ac96fa..08919bcf8 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -1563,232 +1563,6 @@ public partial class ChronoJumpWindow
}
}
- private void paintRunInterval (Gtk.DrawingArea drawingarea, double distance, double distanceTotal,
string distancesString,
- double lastTime, string timesString, double avgTime,
- double maxValue, double minValue, int tracks, int topMargin, int bottomMargin,
- int hightValuePosition, int lowValuePosition, bool startIn, bool finished,
- bool volumeOn, Preferences.GstreamerTypes gstreamer,
- RepetitiveConditionsWindow repetitiveConditionsWin, RunPhaseTimeList runPTL)
- {
- //int topMargin = 10;
- int ancho=drawingarea.Allocation.Width;
- int alto=drawingarea.Allocation.Height;
-
- UtilGtk.ErasePaint(event_execute_drawingarea, event_execute_pixmap);
-
- writeMarginBottom(minValue, alto, " m/s", bottomMargin, ancho);
-
- int lWidth = 1;
- int lHeight = 1;
-
- double timeTotal = Util.GetTotalTime(timesString);
-
- //check now here that we will have not division by zero problems
- if(maxValue - minValue > 0)
- {
- /*
- * removed avg line and value.
- * value will be on the table at bottom
- * also check distance/avgTime is the right value
- *
- if(tracks > 1) {
- //blue speed average discountinuos line
- drawGuideOrAVG(pen_azul_discont, distance/avgTime, alto, ancho, topMargin,
bottomMargin, maxValue, minValue);
- }
- */
-
- //paint reference guide black and green if needed
- drawGuideOrAVG(pen_black_discont, eventGraphConfigureWin.BlackGuide,
- alto, ancho, topMargin, bottomMargin, maxValue, minValue,
guideWidthEnum.FULL);
- drawGuideOrAVG(pen_green_discont, eventGraphConfigureWin.GreenGuide,
- alto, ancho, topMargin, bottomMargin, maxValue, minValue,
guideWidthEnum.FULL);
-
- string [] myTimesStringFull = timesString.Split(new char[] {'='});
- int count = 0;
-
- double oldValue = 0;
- double myTimeDouble = 0;
- double myTimeDoubleAccumulated = 0;
-
- Gdk.GC myPen = pen_rojo; //default value
- double myValue = 0;
-
- // start of contact chunks
- double negativePTLTime = 0;
- double timeTotalWithExtraPTL = timeTotal;
- List<RunPhaseTimeListObject> runPTLInListForPainting = new
List<RunPhaseTimeListObject>();
- if(runPTL != null && runPTL.UseDoubleContacts())
- {
- runPTLInListForPainting = runPTL.InListForPainting();
- negativePTLTime = getRunSRunINegativePTLTime(runPTLInListForPainting);
- timeTotalWithExtraPTL = getRunSRunITimeTotalWithExtraPTLTime (timeTotal,
runPTLInListForPainting, negativePTLTime);
-
- LogB.Information(string.Format("timeTotal: {0}, negativePTLTime: {1},
timeTotalWithExtraPTL: {2}",
- timeTotal, negativePTLTime, timeTotalWithExtraPTL));
-
- //paint contact chunks later
- }
- // end of creation of contact chunks (chunks are painted later)
-
- foreach (string myTime in myTimesStringFull)
- {
- LogB.Information(myTime.ToString());
- myTimeDouble = Convert.ToDouble(myTime);
- if(myTimeDouble < 0)
- myTimeDouble = 0;
-
- myTimeDoubleAccumulated += myTimeDouble;
-
- //blue speed evolution
- myPen = pen_azul;
-
-
- double myDistance = distance;
- if(distancesString != "") //if distances are variable
- myDistance = Util.GetRunIVariableDistancesStringRow(distancesString,
count);
-
- myValue = myDistance / myTimeDouble;
-
- int xStart = event_execute_rightMargin;
- if(myTimeDoubleAccumulated - myTimeDouble > 0 || negativePTLTime > 0)
- xStart = event_execute_rightMargin + Convert.ToInt32((ancho -
2*event_execute_rightMargin) *
- (myTimeDoubleAccumulated + negativePTLTime -
myTimeDouble) / timeTotalWithExtraPTL);
-
- int xEnd = event_execute_rightMargin;
- if(myTimeDoubleAccumulated > 0)
- xEnd = event_execute_rightMargin + Convert.ToInt32((ancho -
2*event_execute_rightMargin) *
- (myTimeDoubleAccumulated + negativePTLTime) /
timeTotalWithExtraPTL);
-
- /*
- LogB.Information(string.Format("ancho: {0}, (ancho -
2*event_execute_rightMargin): {1}, timeTotal: {2}, timeTotalWithExtraPTL: {3}",
- ancho, (ancho - 2*event_execute_rightMargin),
timeTotal, timeTotalWithExtraPTL ));
-
- LogB.Information(string.Format("xStart: {0}, b: {1}, c: {2}, num: {3},
numDenom: {4}, numDenom*anchoright: {5}, xStartCalc: {6}, xStart: {7}",
- myTimeDoubleAccumulated, negativePTLTime,
myTimeDouble,
- (myTimeDoubleAccumulated + negativePTLTime -
myTimeDouble),
- (myTimeDoubleAccumulated + negativePTLTime -
myTimeDouble) / timeTotalWithExtraPTL,
- Convert.ToInt32((ancho - 2*event_execute_rightMargin)
* (myTimeDoubleAccumulated + negativePTLTime) / timeTotalWithExtraPTL),
- event_execute_rightMargin + Convert.ToInt32((ancho -
2*event_execute_rightMargin) *
- (myTimeDoubleAccumulated + negativePTLTime -
myTimeDouble) / timeTotalWithExtraPTL),
- xStart
- ));
- LogB.Information(string.Format("xEnd: {0}, b: {1}, num: {2}, numDenom: {3},
xEnd: {4}",
- myTimeDoubleAccumulated, negativePTLTime,
- (myTimeDoubleAccumulated + negativePTLTime),
- (myTimeDoubleAccumulated + negativePTLTime) /
timeTotalWithExtraPTL,
- xEnd
- ));
- */
-
- //LogB.Information("xStart: " + xStart.ToString() + "; xEnd: " + xEnd);
-
-
- if(myDistance != 0) //on RSA don't plot speed on the rest phase
- {
- int myHeight = calculatePaintHeight(myValue, alto, maxValue,
minValue, topMargin, bottomMargin);
- Rectangle rect = new Rectangle(
- xStart,
- myHeight,
- xEnd - xStart,
- alto-bottomMargin - myHeight
- );
- //LogB.Information(string.Format("drawBar rect y: {0}, height: {1}",
y, alto-bottomMargin-y-1));
-
- event_execute_pixmap.DrawRectangle(pen_background, true, rect);
- event_execute_pixmap.DrawRectangle(pen_background_shifted, false,
rect);
- }
-
- if(myDistance > 0) { //on RSA don't plot speed on the rest phase
- layoutSmall.SetMarkup((Math.Round(myValue,2)).ToString() + " m/s");
- layoutSmall.GetPixelSize(out lWidth, out lHeight);
- int myHeight = calculatePaintHeight(myValue, alto, maxValue,
minValue, topMargin, bottomMargin);
- event_execute_pixmap.DrawLayout (pen_black,
- ((xStart + xEnd)/2) -lWidth/2,
- myHeight - lHeight,
- layoutSmall);
- }
-
- layoutSmall.SetMarkup((Math.Round(myDistance,1)).ToString() + " m");
- layoutSmall.GetPixelSize(out lWidth, out lHeight);
- event_execute_pixmap.DrawLayout (pen_black, ((xStart + xEnd)/2) -lWidth/2,
alto -10, layoutSmall);
-
- layoutSmall.SetMarkup((Math.Round(myTimeDouble,2)).ToString() + " s");
- layoutSmall.GetPixelSize(out lWidth, out lHeight);
- event_execute_pixmap.DrawLayout (pen_black, xEnd -lWidth/2, alto -18,
layoutSmall);
-
-
- /*
- //paint Y lines
- if(eventGraphConfigureWin.VerticalGrid) {
- if(count == 0)
- event_execute_pixmap.DrawLine(pen_beige_discont,
- xStart,
- topMargin,
- xStart,
- alto-topMargin);
-
- event_execute_pixmap.DrawLine(pen_beige_discont,
- xEnd,
- topMargin,
- xEnd,
- alto-topMargin);
- }
- */
-
- oldValue = myValue;
- count ++;
- }
-
- //paint contact chunks
- if(runPTL != null && runPTL.UseDoubleContacts())
- paintRunSRunIContactChunks(event_execute_pixmap, alto, ancho, bottomMargin,
- runPTLInListForPainting, timeTotal, timeTotalWithExtraPTL,
negativePTLTime, true, finished);
-
- //writeValue(myPen, myValue, (--count) + added0Value, tracks, ancho, alto, maxValue,
minValue, topMargin, bottomMargin);
-
-
- //bells & images
- event_execute_image_run_interval_time_good.Hide();
- event_execute_image_run_interval_time_bad.Hide();
- bool showTimeGood = false;
- bool showTimeBad = false;
-
- //sounds of best & worst
- if(count > 0) {
- if(repetitiveConditionsWin.RunTimeBest && lowValuePosition == count)
- showTimeGood = true;
- else if(repetitiveConditionsWin.RunTimeWorst && hightValuePosition == count)
- showTimeBad = true;
- }
-
- if(repetitiveConditionsWin.RunTimeLower && lastTime <
repetitiveConditionsWin.RunTimeLowerValue)
- showTimeGood = true;
- if(repetitiveConditionsWin.RunTimeGreater && lastTime >
repetitiveConditionsWin.RunTimeGreaterValue)
- showTimeBad = true;
-
- if(showTimeGood) {
- Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn, preferences.gstreamer);
- event_execute_image_run_interval_time_good.Show();
- }
- if(showTimeBad) {
- Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, preferences.gstreamer);
- event_execute_image_run_interval_time_bad.Show();
- }
-
- plotSimulatedMessageIfNeededAtCenter(ancho, alto);
- }
-
- event_execute_label_run_interval_time_now.Text = "<b>" +
Util.TrimDecimals(lastTime.ToString(), preferences.digitsNumber) + "</b>";
- event_execute_label_run_interval_time_now.UseMarkup = true;
- event_execute_label_run_interval_time_avg.Text = Util.TrimDecimals(avgTime.ToString(),
preferences.digitsNumber);
- event_execute_label_run_interval_time_total.Text = "<b>" +
Util.TrimDecimals(timeTotal.ToString(), preferences.digitsNumber) + "</b>";
- event_execute_label_run_interval_time_total.UseMarkup = true;
-
- event_execute_label_run_interval_speed_now.Text = "<b>" + Util.TrimDecimals((distance /
lastTime).ToString(), preferences.digitsNumber) + "</b>";
- event_execute_label_run_interval_speed_now.UseMarkup = true;
- event_execute_label_run_interval_speed_avg.Text = Util.TrimDecimals((distanceTotal /
Util.GetTotalTime(timesString)).ToString(), preferences.digitsNumber);
- }
-
private void paintPulse (Gtk.DrawingArea drawingarea, double lastTime, string timesString, double
avgTime, int pulses,
double maxValue, double minValue, int topMargin, int bottomMargin)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]