Пример #1
0
        public void AddMotionTestData(DataTable dt, string chartTitle)
        {
            ChartData chartData = new ChartData();
            chartData.chartTitle = chartTitle;
            chartData.datasets = new List<ChartDataSet>();
            
            ChartDataSet tp = new ChartDataSet();
            tp.label = "TP";
            tp.AssignColours(0);

            ChartDataSet fn = new ChartDataSet();
            fn.label = "FN";
            fn.AssignColours(1);

            ChartDataSet fp = new ChartDataSet();
            fp.label = "FP";
            fp.AssignColours(2);

            foreach (DataRow dr in dt.Rows)
            {
                chartData.labels.Add(Math.Round(dr["value"].ToString().StringToDec(), 1).ToString());
                tp.data.Add(dr["TP"].ToString().StringToDec());
                fn.data.Add(dr["FN"].ToString().StringToDec());
                fp.data.Add(dr["FP"].ToString().StringToDec());
            }

            chartData.datasets.Add(tp);
            chartData.datasets.Add(fn);
            chartData.datasets.Add(fp);

            list.Add(chartData);
        }
Пример #2
0
        public void AddLagTestData(DataTable dt, string chartTitle)
        {
            ChartData chartData = new ChartData();

            chartData.chartTitle = chartTitle;
            chartData.datasets   = new List <ChartDataSet>();

            //get the data
            LagTestDataList lagData = new LagTestDataList();

            lagData.Populate();

            //split the labels out
            var labels = lagData.list.GroupBy(x => x.numberMinutes).Select(y => y.First()).ToList();

            labels.ForEach(x => chartData.labels.Add(x.numberMinutes.ToString()));

            //one set of data each for sync/async and memory combinations
            var syncList  = lagData.list.Where(x => !x.asynchronous).ToList();
            var asyncList = lagData.list.Where(x => x.asynchronous).ToList();

            var memoryList = lagData.list.GroupBy(x => x.memoryGb).Select(y => y.First().memoryGb.ToString()).ToList();

            //get the different data types
            int count = 0;

            foreach (String memory in memoryList)
            {
                var sync  = syncList.Where(x => x.memoryGb.ToString().Equals(memory));
                var async = asyncList.Where(x => x.memoryGb.ToString().Equals(memory));

                var syncDataSet = new ChartDataSet();
                syncDataSet.label = "Sync " + memory + "GB";
                syncDataSet.AssignColours(count);
                count++;

                var asyncDataSet = new ChartDataSet();
                asyncDataSet.label = "ASync " + memory + "GB";
                asyncDataSet.AssignColours(count);
                count++;

                foreach (LagTestData data in sync)
                {
                    syncDataSet.data.Add(data.detectionSeconds);
                }

                foreach (LagTestData data in async)
                {
                    asyncDataSet.data.Add(data.detectionSeconds);
                }

                if (memory == "16")
                {
                    chartData.datasets.Add(syncDataSet);
                }
                chartData.datasets.Add(asyncDataSet);
            }

            //add the base line (processing same as minutes to play) for comparision purposes on the graph
            var controlSet = new ChartDataSet();

            controlSet.label = "Realtime";
            controlSet.AssignColours("control");
            chartData.labels.ForEach(x => controlSet.data.Add(x.StringToDec()));
            chartData.datasets.Add(controlSet);

            list.Add(chartData);
        } //AddLagTestData
Пример #3
0
        public void AddLagTestData(DataTable dt, string chartTitle)
        {
            ChartData chartData = new ChartData();
            chartData.chartTitle = chartTitle;
            chartData.datasets = new List<ChartDataSet>();

            //get the data
            LagTestDataList lagData = new LagTestDataList();
            lagData.Populate();

            //split the labels out
            var labels = lagData.list.GroupBy(x => x.numberMinutes).Select(y => y.First()).ToList();
            labels.ForEach(x => chartData.labels.Add(x.numberMinutes.ToString()));

            //one set of data each for sync/async and memory combinations
            var syncList = lagData.list.Where(x => !x.asynchronous).ToList();
            var asyncList = lagData.list.Where(x => x.asynchronous).ToList();

            var memoryList = lagData.list.GroupBy(x => x.memoryGb).Select(y => y.First().memoryGb.ToString()).ToList();

            //get the different data types
            int count = 0;
            foreach(String memory in memoryList)
            {
                var sync = syncList.Where(x => x.memoryGb.ToString().Equals(memory));
                var async = asyncList.Where(x => x.memoryGb.ToString().Equals(memory));

                var syncDataSet = new ChartDataSet();
                syncDataSet.label = "Sync " + memory + "GB";
                syncDataSet.AssignColours(count);
                count++;

                var asyncDataSet = new ChartDataSet();
                asyncDataSet.label = "ASync " + memory + "GB";
                asyncDataSet.AssignColours(count);
                count++;

                foreach (LagTestData data in sync)
                {
                    syncDataSet.data.Add(data.detectionSeconds);
                }

                foreach (LagTestData data in async)
                {
                    asyncDataSet.data.Add(data.detectionSeconds);
                }

                if (memory == "16") { chartData.datasets.Add(syncDataSet); }
                chartData.datasets.Add(asyncDataSet);
            }

            //add the base line (processing same as minutes to play) for comparision purposes on the graph
            var controlSet = new ChartDataSet();
            controlSet.label = "Realtime";
            controlSet.AssignColours("control");
            chartData.labels.ForEach(x => controlSet.data.Add(x.StringToDec()));
            chartData.datasets.Add(controlSet);

            list.Add(chartData);

        }//AddLagTestData