public void DrawSourceNext() { SourceY s = sourceY; for (int i = 0; i < 3; i++) { s++; if (s > SourceY.Heart) { s = SourceY.Alt; } if (parent.mPage.mBAr[(int)MenuPage.BFkt.graph_alt + (int)s].enabled) { break; } } SetSource(s, SourceX.Old); }
public void SetSource(SourceY srcY, SourceX srcX) { if (srcY != SourceY.Old && srcY != sourceY) { sourceY = srcY; scaleCmd = ScaleCmd.DoAutoscaleNoUndo; } if (sourceY == SourceY.Speed) { y = parent.PlotS; y2 = null; title1 = "Speed [/"; if ((parent.comboUnits.SelectedIndex == 0) || (parent.comboUnits.SelectedIndex == 3)) { yScaleP = 32; yScaleQ = 515; title2 = "mph]"; } else { yScaleP = 1; yScaleQ = 10; title2 = "km/h]"; } } else if (sourceY == SourceY.Heart) { y = parent.PlotH; y2 = null; yScaleP = 1; yScaleQ = 1; title1 = "Heart Rate [/"; title2 = "bpm]"; } else //if (sourceY == SourceY.Alt) { y = parent.PlotZ; y2 = parent.Plot2ndZ; title1 = "Altitude [/"; if ((parent.comboUnits.SelectedIndex == 3) || (parent.comboUnits.SelectedIndex == 5) || (parent.comboUnits.SelectedIndex == 6)) { yScaleP = 1250; yScaleQ = 381; // altitude in feet title2 = "feet]"; } else { yScaleP = 1; yScaleQ = 1; title2 = "m]"; } } //int indexMin = -1; //int indexMax = -1; if (srcX != SourceX.Old && srcX != sourceX) { sourceX = srcX; //if (autostate != Autostate.DoAutoscale) //todo keep x section //{ // for (int i = 0; i < parent.PlotCount; i++) // { // if (indexMin == -1 && x[i] >= xMin) indexMin = i; // if (x[i] <= xMax) indexMax = i; // } //} scaleCmd = ScaleCmd.DoAutoscaleNoUndo; } if (sourceX == SourceX.Distance) { x = parent.PlotD; x2 = parent.Plot2ndD; xLabel1 = "Distance [/"; //xLabel2 = "m]"; if ((parent.comboUnits.SelectedIndex == 0) || (parent.comboUnits.SelectedIndex == 3)) { xScaleP = 64; xScaleQ = 103; xLabel2 = "miles]"; } else { xScaleP = 1; xScaleQ = 1; //additional settings in UpdateScaling() } } else //if (sourceX == SourceX.Time) { x = parent.PlotT; x2 = parent.Plot2ndT; xScaleP = 1; xScaleQ = 1; //xUnit = 1; xLabel1 = "Time [/"; //xLabel2 = "sec]"; } UpdateScaling(false); //also ensures that whole graph is drawn (Index2draw=-1) }
public void SetSource(SourceY srcY, SourceX srcX) { if (srcY != SourceY.Old && srcY != sourceY) { sourceY = srcY; scaleCmd = ScaleCmd.DoAutoscaleNoUndo; } if (sourceY == SourceY.Speed) { y = parent.PlotS; y2 = null; title1 = "Speed [/"; if ((parent.comboUnits.SelectedIndex == 0) || (parent.comboUnits.SelectedIndex == 3)) { yScaleP = 32; yScaleQ = 515; title2 = "mph]"; } else { yScaleP = 1; yScaleQ = 10; title2 = "km/h]"; } } else if (sourceY == SourceY.Heart) { y = parent.PlotH; y2 = null; yScaleP = 1; yScaleQ = 1; title1 = "Heart Rate [/"; title2 = "bpm]"; } else //if (sourceY == SourceY.Alt) { y = parent.PlotZ; y2 = parent.Plot2ndZ; title1 = "Altitude [/"; if ((parent.comboUnits.SelectedIndex == 3) || (parent.comboUnits.SelectedIndex == 5) || (parent.comboUnits.SelectedIndex == 6)) { yScaleP = 1250; yScaleQ = 381; // altitude in feet title2 = "feet]"; } else { yScaleP = 1; yScaleQ = 1; title2 = "m]"; } } //int indexMin = -1; //int indexMax = -1; if (srcX != SourceX.Old && srcX != sourceX) { sourceX = srcX; //if (autostate != Autostate.DoAutoscale) //todo keep x section //{ // for (int i = 0; i < parent.PlotCount; i++) // { // if (indexMin == -1 && x[i] >= xMin) indexMin = i; // if (x[i] <= xMax) indexMax = i; // } //} scaleCmd = ScaleCmd.DoAutoscaleNoUndo; } if (sourceX == SourceX.Distance) { x = parent.PlotD; x2 = parent.Plot2ndD; xLabel1 = "Distance [/"; //xLabel2 = "m]"; if ((parent.comboUnits.SelectedIndex == 0) || (parent.comboUnits.SelectedIndex == 3)) { xScaleP = 64; xScaleQ = 103; xLabel2 = "miles]"; } else { xScaleP = 1; xScaleQ = 1; //additional settings in UpdateScaling() } } else //if (sourceX == SourceX.Time) { x = parent.PlotT; x2 = parent.Plot2ndT; xScaleP = 1; xScaleQ = 1; //xUnit = 1; xLabel1 = "Time [/"; //xLabel2 = "sec]"; } UpdateScaling(false); //also ensures that whole graph is drawn (Index2draw=-1) }