Пример #1
0
        private void BuildModel()
        {
            int    n     = 0;
            double coeff = 0;

            try
            {
                n     = (int)numericUpDownN.Value;
                coeff = (double)numericUpDownK.Value;
            }
            catch
            {
                MessageBox.Show("Неверный формат входных параметров!");
                return;
            }
            int countOfResolution = 9;

            CriticalParamsService.TextBoxLog = textBoxState;
            //List<ParamsPolygon> polygons = await CriticalParamsService.GetPolygonsOfCriticalArea(n, coeff, countOfResolution, 1);
            //var paramsModel3D = CriticalParamsService.GetCriticalArea(n, coeff, countOfResolution, 1);
            var paramsModel3D = CriticalParamsService.GetCriticalAreaSpecialEditionOfTheBestPractises(n, coeff, countOfResolution, 1);

            //GraphForm graphForm = new GraphForm(polygons, this);
            if (graphForm == null || !graphForm.Visible)
            {
                graphForm = new GraphForm(paramsModel3D, this);
                graphForm.Show();
            }
            else if (graphForm.Visible)
            {
                graphForm.Focus();
            }
        }
Пример #2
0
        private List <ParamsContainer> TestingModel(int n, double coeff, double accuracy, double initialStep)
        {
            List <ParamsContainer> list = new List <ParamsContainer>();

            list.Add(CriticalParamsService.TestingDelta(n, coeff, DACEmulator.Delta.Coeff, initialStep, accuracy));
            list.Add(CriticalParamsService.TestingDelta(n, coeff, DACEmulator.Delta.Index, initialStep, accuracy));
            list.Add(CriticalParamsService.TestingDelta(n, coeff, DACEmulator.Delta.SM, initialStep, accuracy));
            return(list);
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            long now  = DateTime.Now.Ticks;
            var  area = CriticalParamsService.GetCriticalArea(4, 1000, 10f, 1);

            using (Graphics g = CreateGraphics())
            {
                Point[] points = area.Select(p => { return(new Point((int)p.X + 1300, (int)p.Y + 300)); }).ToArray();
                g.DrawLines(Pens.Black, points);
                //foreach(Point3D point in area){
                //    g.DrawEllipse(Pens.Black, point.X+1300, point.Y+300, 1, 1);
                //}
            }
            GraphForm graphForm = new GraphForm {
                Area = area
            };

            graphForm.Show();
            double time = ((double)(DateTime.Now.Ticks - now)) / 10000000;
        }