コード例 #1
0
        /// <summary>
        /// Load system performance graph
        /// </summary>
        public void DisplayDarkEchoSystem()
        {
            var    tempData       = new List <double>();
            string FactionName    = String.Empty;
            var    tmpFactionData = new List <SystemInfByFactionOxy>();

            PlotModel.Series.Clear();
            PlotModel.Axes.Clear();
            PlotColours.Clear();

            foreach (var histRec in _displayDESystems[_displayDESystems.FindIndex(x => x.StarSystem == SystemOverview.SystemName)].FactionHistory)
            {
                histRec.Factions.RemoveAll(x => x.Name.Contains("Federation Local Branch"));
                foreach (var f in histRec.Factions)
                {
                    var sysInfByFaction = new SystemInfByFactionOxy();
                    sysInfByFaction.DateNAndInf = new List <FactionDateInf>();

                    if (tmpFactionData.FirstOrDefault(x => x.FactionName == f.Name) == null)
                    {
                        var dai = new FactionDateInf();
                        sysInfByFaction.FactionName = f.Name;
                        dai.FactionInf     = (f.Influence * 100);
                        dai.FactionInfDate = histRec.timestamp;
                        sysInfByFaction.DateNAndInf.Add(dai);
                        tmpFactionData.Add(sysInfByFaction);
                    }
                    else
                    {
                        var dai = new FactionDateInf();
                        dai.FactionInf     = (f.Influence * 100);
                        dai.FactionInfDate = histRec.timestamp;
                        tmpFactionData[tmpFactionData.FindIndex(x => x.FactionName == f.Name)].DateNAndInf.Add(dai);
                    }
                }
            }

            var MaxHistoryDays = 0;
            var index          = 0;

            foreach (var sf in tmpFactionData)
            {
                LineSeries ls = new LineSeries()
                {
                    Color = OxyColor.Parse(hexColours[index])
                };
                PlotColours.Add(new PlotColour()
                {
                    FactionName = sf.FactionName, HexColour = hexColours[index]
                });

                ls.Title = sf.FactionName;

                if (MaxHistoryDays < sf.DateNAndInf.Count)
                {
                    MaxHistoryDays = sf.DateNAndInf.Count;
                }

                foreach (var dai in sf.DateNAndInf)
                {
                    ls.Points.Add(new DataPoint(DateTimeAxis.ToDouble(dai.FactionInfDate), dai.FactionInf));
                }

                PlotModel.Series.Add(ls);
                index++;
            }

            AddAxis();
            PlotModel.InvalidatePlot(true);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        public void DisplayDarkEchoSystem()
        {
            var    tempData       = new List <double>();
            string FactionName    = String.Empty;
            var    tmpFactionData = new List <SystemInfByFactionOxy>();

            TrafficButtonContent = "Show Traffic";

            PlotModel.Series.Clear();
            PlotModel.Axes.Clear();

            foreach (var histRec in _deSystems[_deSystems.FindIndex(x => x.StarSystem == SelectedSystem)].FactionHistory)
            {
                histRec.Factions.RemoveAll(x => x.Name.Contains("Federation Local Branch"));
                foreach (var f in histRec.Factions)
                {
                    var sysInfByFaction = new SystemInfByFactionOxy();
                    sysInfByFaction.DateNAndInf = new List <FactionDateInf>();

                    if (tmpFactionData.FirstOrDefault(x => x.FactionName == f.Name) == null)
                    {
                        var dai = new FactionDateInf();
                        sysInfByFaction.FactionName = f.Name;
                        dai.FactionInf     = (f.Influence * 100);
                        dai.FactionInfDate = histRec.timestamp;
                        sysInfByFaction.DateNAndInf.Add(dai);
                        tmpFactionData.Add(sysInfByFaction);
                    }
                    else
                    {
                        var dai = new FactionDateInf();
                        dai.FactionInf     = (f.Influence * 100);
                        dai.FactionInfDate = histRec.timestamp;
                        tmpFactionData[tmpFactionData.FindIndex(x => x.FactionName == f.Name)].DateNAndInf.Add(dai);
                    }
                }
            }

            var MaxHistoryDays = 0;

            foreach (var sf in tmpFactionData)
            {
                LineSeries ls = new LineSeries();

                ls.Title = sf.FactionName;

                if (MaxHistoryDays < sf.DateNAndInf.Count)
                {
                    MaxHistoryDays = sf.DateNAndInf.Count;
                }

                foreach (var dai in sf.DateNAndInf)
                {
                    ls.Points.Add(new DataPoint(DateTimeAxis.ToDouble(dai.FactionInfDate), dai.FactionInf));
                }
                PlotModel.Series.Add(ls);
            }
            AddAxis("Inf");
            PlotModel.Title = string.Format("System: {0} - Faction performance over the past {1} days", SelectedSystem, MaxHistoryDays);
            PlotModel.InvalidatePlot(true);
        }