private void checkBox1_CheckedChanged_1(object sender, EventArgs e) { CheckBox cb = sender as CheckBox; renderInNewWindow = cb.Checked; if (cb.Checked) { //setup Traffic Light window if (tlForm == null) { tlForm = new TrafficLightForm(); } tlForm.Show(); //trafficLightPanel.Enabled = false; } else { tlForm.Close(); tlForm = null; } }
//Method to initialize graph panels public void resetPanels(Panel p_green, Panel p_yellow, Panel p_red, Panel p_xAxis, Panel p_yAxis, Panel p_zAxis, Chart chart1, Chart chart2, TrafficLightForm tlForm, TextBox txtReceived) { txtReceived.Clear(); p_xAxis.Width = panel_max_width; p_xAxis.BackColor = green; p_yAxis.Width = panel_max_width; p_yAxis.BackColor = green; p_zAxis.Width = panel_max_width; p_zAxis.BackColor = green; p_green.BackColor = Color.FromName("Component"); p_yellow.BackColor = Color.FromName("Component"); p_red.BackColor = Color.FromName("Component"); X_axis_panel_width_factor = 0; Y_axis_panel_width_factor = 0; Z_axis_panel_width_factor = 0; if (tlForm != null) { tlForm.reset(); } //save chart //string exePath = AppDomain.CurrentDomain.BaseDirectory; //this.chart1.SaveImage(exePath+DateTime.Now+"_chart.png", ChartImageFormat.Png); foreach (var series in chart1.Series) { series.Points.Clear(); } foreach (var series in chart2.Series) { series.Points.Clear(); } chart1.Annotations.Clear(); chart2.Annotations.Clear(); }