private TimeSeriesGraph CreateSineGraph()
        {
            TimeSeriesGraph graph = new TimeSeriesGraph();

            string     sineString = SineData.ToString();
            DataParser parser     = new DataParser(sineString);

            List <float> x1 = parser.GetListFromColumn(0);
            List <float> y1 = parser.GetListFromColumn(1);
            List <float> z1 = parser.GetListFromColumn(2);
            List <float> x2 = parser.GetListFromColumn(3);
            List <float> y2 = parser.GetListFromColumn(4);
            List <float> z2 = parser.GetListFromColumn(5);
            List <float> x3 = parser.GetListFromColumn(6);
            List <float> y3 = parser.GetListFromColumn(7);
            List <float> z3 = parser.GetListFromColumn(8);

            PlotPoint new_point = new PlotPoint(x1, y1, z1);

            graph.AddPlotPoint(new_point);

            new_point = new PlotPoint(x2, y2, z2);
            graph.AddPlotPoint(new_point);

            new_point = new PlotPoint(x3, y3, z3);
            graph.AddPlotPoint(new_point);

            return(graph);
        }
示例#2
0
        /*
         * Temporary method to use CSV parsing when creating graph
         */
        private void CreateTimeSeriesGraphUsingCSV()
        {
            var        csvString = DataFile1.ToString(); // Convert CSV to String for easier use
            DataParser parser    = new DataParser(csvString);

            // Create PlotPoint object using data from CSV
            List <float> x_values  = parser.GetListFromColumn(0); // Grab values from first column
            List <float> y_values  = parser.GetListFromColumn(1);
            List <float> z_values  = parser.GetListFromColumn(2);
            PlotPoint    new_point = new PlotPoint(x_values, y_values, z_values);

            // Create empty Graph object and give it plot points
            Graph = new TimeSeriesGraph();
            Graph.AddPlotPoint(new_point);

            csvString = DataFile2.ToString();
            parser    = new DataParser(csvString);

            x_values  = parser.GetListFromColumn(0);
            y_values  = parser.GetListFromColumn(1);
            z_values  = parser.GetListFromColumn(2);
            new_point = new PlotPoint(x_values, y_values, z_values);

            // Create empty Graph object and give it plot points
            Graph.AddPlotPoint(new_point);
        }
        private TimeSeriesGraph CreateDroneGraph()
        {
            TimeSeriesGraph graph = new TimeSeriesGraph();

            string     droneString = DroneData.ToString();
            DataParser parser      = new DataParser(droneString);

            List <float>  x_values    = parser.GetListFromColumn(4); // lat
            List <float>  y_values    = parser.GetListFromColumn(2); // alt
            List <float>  z_values    = parser.GetListFromColumn(3); // long
            List <string> time_values = parser.GetTimePoints(1);     // time

            PlotPoint new_point = new PlotPoint(x_values, y_values, z_values);

            graph.AddPlotPoint(new_point);
            graph.AddTimePoints(time_values);

            return(graph);
        }