public void ReportProgress(RunPanelData data) { if (this.InvokeRequired) { // Execute the same method, but this time on the GUI thread this.Invoke( new Action(() => { ReportProgressSync(data); } )); } else { ReportProgressSync(data); } }
/// <summary> /// Deserilization of run condition /// </summary> /// <param name="p"></param> public void ActivatePanel(RunPanelData data) { m_cbIterationType.SelectedIndex = data.TerminationType; m_eb_iterations.Text = data.TerminationValue.ToString(); eb_currentIteration.Text = data.CurrentIteration.ToString(); eb_currentFitness.Text = data.BestFitness.ToString(); eb_bestSolutionFound.Text = data.ChangedAtGeneration.ToString(); //clear previous data if exist this.zedFitness.GraphPane.CurveList.Clear(); this.zedModel.GraphPane.CurveList.Clear(); this.zedFitness.GraphPane.CurveList.Add(data.maxFitness); this.zedFitness.GraphPane.CurveList.Add(data.avgFitness); this.zedFitness.GraphPane.AxisChange(this.CreateGraphics()); this.zedModel.GraphPane.CurveList.Add(data.gpCalculateOutput); this.zedModel.GraphPane.CurveList.Add(data.experimentalData); this.zedModel.GraphPane.AxisChange(this.CreateGraphics()); // this.zedFitness.RestoreScale(zedFitness.GraphPane); if (data.OutputType != BasicTypes.ColumnType.Numeric) { for (int i = 0; i < data.experimentalData.Points.Count; i++) { if (data.experimentalData.Points[i].Y > max) { max = data.experimentalData.Points[i].Y; } } Classes = data.Classes; zedModel.GraphPane.YAxis.ScaleFormatEvent += YAxis_ScaleFormatEvent; //zedModel.GraphPane.XAxis.Scale.Min = 0; zedModel.GraphPane.YAxis.Scale.Min = -0.1; zedModel.GraphPane.YAxis.Scale.Max = max + 0.2; zedModel.GraphPane.YAxis.MajorGrid.DashOff = 0; zedModel.GraphPane.YAxis.MajorGrid.IsVisible = true; zedModel.GraphPane.XAxis.MajorGrid.DashOff = 0; zedModel.GraphPane.XAxis.MajorGrid.IsVisible = false; zedModel.GraphPane.YAxis.Scale.MajorStep = 1; zedModel.GraphPane.YAxis.Scale.MinorStep = 1; zedModel.GraphPane.XAxis.Scale.MajorStep = 1; zedModel.GraphPane.XAxis.Scale.MinorStep = 1; } else { zedModel.GraphPane.YAxis.Scale.MaxAuto = true; zedModel.GraphPane.YAxis.Scale.MinAuto = true; zedModel.GraphPane.YAxis.MajorGrid.IsVisible = false; zedModel.GraphPane.XAxis.MajorGrid.IsVisible = false; zedModel.GraphPane.YAxis.Scale.MajorStepAuto = true; zedModel.GraphPane.YAxis.Scale.MinorStepAuto = true; zedModel.GraphPane.XAxis.Scale.MajorStep = 1; zedModel.GraphPane.XAxis.Scale.MinorStep = 0; } zedModel.GraphPane.YAxis.Title.Text = data.Label; this.zedModel.RestoreScale(zedModel.GraphPane); }
public void ReportProgressSync(RunPanelData data) { eb_currentIteration.Text = data.CurrentIteration.ToString(CultureInfo.InvariantCulture); eb_currentFitness.Text = data.BestFitness.ToString(CultureInfo.InvariantCulture); eb_bestSolutionFound.Text = data.ChangedAtGeneration.ToString(CultureInfo.InvariantCulture); }