public void init_display_mw(Xaxis_mode X_axis_mode_para,List<string> graph_captions) { NumGraphs = graph_captions.Count; used_Xaxis_mode = X_axis_mode_para; display.DataSources.Clear(); display.SetDisplayRangeX(0, 10);//i.e. 10seconds for (int j = 0; j < NumGraphs; j++) { display.DataSources.Add(new DataSource()); display.DataSources[j].Name = "Graph " + (j + 1); display.DataSources[j].OnRenderXAxisLabel += RenderXLabel; display.DataSources[j].OnRenderYAxisLabel += RenderYLabel; // "STACKED": //if (this.InvokeRequired) //{ // this.Invoke(new MethodInvoker(delegate // { // this.Text = "Stacked Graph"; // })); //} //this.Text = "Stacked Graph"; display.PanelLayout = PlotterGraphPaneEx.LayoutMode.STACKED; display.DataSources[j].Length = NumPointBuff; //Total number of points this display could handle display.DataSources[j].AutoScaleY = true; //display.DataSources[j].SetDisplayRangeY(-20, 20); //display.DataSources[j].SetGridDistanceY(5); } //Update Color Scheme to "WHITE" Color[] cols = { Color.DarkRed, Color.DarkSlateGray, Color.DarkCyan, Color.DarkGreen, Color.DarkBlue , Color.DarkMagenta, Color.DeepPink }; for (int j = 0; j < NumGraphs; j++) { display.DataSources[j].GraphColor = cols[j % 7]; } display.BackgroundColorTop = Color.White; display.BackgroundColorBot = Color.White; display.SolidGridColor = Color.LightGray; display.DashedGridColor = Color.LightGray; for (int j=0;j < NumGraphs; j++){ display_var.Add(new List<float>()); } string newVar; for (int j = 0; j < NumGraphs; j++) { if (j != NumGraphs - 1) { newVar = string.Format("{0},", graph_captions[j]); } else { newVar = string.Format("{0}", graph_captions[j]);//To avoid adding the last comma } newVar = string.Format("{0}", Environment.NewLine); csv.Append(newVar); display_var.Add(new List<float>()); } }
public void init_display_rx(Xaxis_mode X_axis_mode_para, List<string> graph_captions) { string[] seriesArray = { "Throttle", "Roll", "Pitch", "Yaw" }; int[] pointsArray = { 1500, 1500, 1500, 1500 }; rx_chart.Series.Clear(); rx_chart.Titles.Add("RX Values"); rx_chart.ChartAreas[0].AxisY.Minimum = 0; rx_chart.ChartAreas[0].AxisY.Maximum = 1000; for (int i = 0; i < seriesArray.Length; i++) { Series series = rx_chart.Series.Add(seriesArray[i]); series.Points.Add(pointsArray[i]); } rx_status.Text = string.Format("{0} channel is available by the RX receiver", graph_captions.Count); }
public void init_display(Action<MainPanel.Xaxis_mode, List<string>> init_func, Xaxis_mode X_axis_mode_para, List<string> graph_captions) { init_func(X_axis_mode_para, graph_captions); }