private void DrawAircraft(plotType pType, string ac)
        {
            if (MilCheck.Checked)
            {
                DrawAircraftData(ac, pType, false);
            }

            if (WepCheck.Checked)
            {
                DrawAircraftData(ac, pType, true);
            }
        }
        private void DrawAircraftData(string ac, plotType pType, bool wep)
        {
            PerformanceBL bl = new PerformanceBL(ac);

            ArrayList heights = new ArrayList();
            ArrayList rates   = new ArrayList();

            if (pType == plotType.Speed)
            {
                bl.GetSpeedData(heights, rates, wep);
            }
            if (pType == plotType.Climb)
            {
                bl.GetClimbData(heights, rates, wep);
            }

            if ((heights.Count == 0) || (rates.Count == 0))
            {
                return;
            }

            _numPlots++;

            LinePlot lp = new LinePlot();

            lp.OrdinateData = heights;
            lp.AbscissaData = rates;

            lp.Color        = Registry.Instance.AircraftColours.GetAircraftColour(ac);
            lp.Pen.Width    = 2.0f;
            lp.ShowInLegend = true;

            if (wep)
            {
                lp.Label         = string.Concat(ac, " - ", "WEP");
                lp.Pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
            }
            else
            {
                lp.Label         = string.Concat(ac, " - ", "MIL");
                lp.Pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
            }

            if (pType == plotType.Speed)
            {
                SpeedPlot.Add(lp);
            }
            if (pType == plotType.Climb)
            {
                ClimbPlot.Add(lp);
            }
        }
        private void RefreshPlot(plotType pType, bool legend, string title, string XLabel, int margin)
        {
            NPlot.Windows.PlotSurface2D surf = null;

            if (pType == plotType.Speed)
            {
                surf = SpeedPlot;
            }
            if (pType == plotType.Climb)
            {
                surf = ClimbPlot;
            }

            _numPlots = 0;
            foreach (int i in AircraftList.CheckedIndices)
            {
                DrawAircraft(pType, AircraftList.Items[i].ToString());
            }

            if (_numPlots == 0)
            {
                return;
            }

            if (legend)
            {
                AttachLegend(surf);
            }

            surf.Title        = title;
            surf.XAxis1.Label = XLabel;
            surf.YAxis1.Label = "feet";

            surf.YAxis1.WorldMin  = 0;
            surf.XAxis1.WorldMin -= margin;
            surf.XAxis1.WorldMax += margin;

            Grid grid = new Grid();

            grid.VerticalGridType   = Grid.GridType.Fine;
            grid.HorizontalGridType = Grid.GridType.Fine;
            grid.MajorGridPen       = new Pen(Color.LightGray, 0.5f);

            surf.Add(grid);
            surf.Refresh();
        }
        private void RefreshPlot(plotType pType, bool legend, string title, string XLabel, int margin)
        {
            NPlot.Windows.PlotSurface2D surf = null;

            if (pType == plotType.Speed)
                surf = SpeedPlot;
            if (pType == plotType.Climb)
                surf = ClimbPlot;

            _numPlots = 0;
            foreach (int i in AircraftList.CheckedIndices)
            {
                DrawAircraft(pType, AircraftList.Items[i].ToString());
            }

            if (_numPlots == 0)
                return;

            if (legend)
                AttachLegend(surf);

            surf.Title = title;
            surf.XAxis1.Label = XLabel;
            surf.YAxis1.Label = "feet";

            surf.YAxis1.WorldMin = 0;
            surf.XAxis1.WorldMin -= margin;
            surf.XAxis1.WorldMax += margin;

            Grid grid = new Grid();
            grid.VerticalGridType = Grid.GridType.Fine;
            grid.HorizontalGridType = Grid.GridType.Fine;
            grid.MajorGridPen = new Pen(Color.LightGray, 0.5f);

            surf.Add(grid);
            surf.Refresh();
        }
        private void DrawAircraftData(string ac, plotType pType, bool wep)
        {
            PerformanceBL bl = new PerformanceBL(ac);

            ArrayList heights = new ArrayList();
            ArrayList rates = new ArrayList();

            if (pType == plotType.Speed)
                bl.GetSpeedData(heights, rates, wep);
            if (pType == plotType.Climb)
                bl.GetClimbData(heights, rates, wep);

            if ((heights.Count == 0) || (rates.Count == 0))
                return;

            _numPlots++;

            LinePlot lp = new LinePlot();
            lp.OrdinateData = heights;
            lp.AbscissaData = rates;

            lp.Color = Registry.Instance.AircraftColours.GetAircraftColour(ac);
            lp.Pen.Width = 2.0f;
            lp.ShowInLegend = true;

            if (wep)
            {
                lp.Label = string.Concat(ac, " - ", "WEP");
                lp.Pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
            }
            else
            {
                lp.Label = string.Concat(ac, " - ", "MIL");
                lp.Pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
            }

            if (pType == plotType.Speed)
                SpeedPlot.Add(lp);
            if (pType == plotType.Climb)
                ClimbPlot.Add(lp);
        }
        private void DrawAircraft(plotType pType, string ac)
        {
            if (MilCheck.Checked)
            {
                DrawAircraftData(ac, pType, false);
            }

            if (WepCheck.Checked)
            {
                DrawAircraftData(ac, pType, true);
            }
        }