Пример #1
0
        public ViewConsole(PSOModel model)
        {
            this.model = model;
            this.model.Register(this);

            AddController(MakeConrtoller());
        }
Пример #2
0
        public View2D(PSOModel model)
        {
            InitializeComponent();
            this.model = model;
            this.model.Register(this);

            AddController(MakeConrtoller());

            chart.ChartAreas[0].AxisX.Interval            = 1;
            chart.ChartAreas[0].AxisY.Interval            = 1;
            chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
            chart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;

            chart.ChartAreas[0].AxisX.Minimum = (int)numericUpDownOXmin.Value;
            chart.ChartAreas[0].AxisY.Minimum = (int)numericUpDownOYmin.Value;
            chart.ChartAreas[0].AxisX.Maximum = (int)numericUpDownOXmax.Value;
            chart.ChartAreas[0].AxisY.Maximum = (int)numericUpDownOYmax.Value;

            chart.Series.Add("function");
            chart.Series[0].ChartType = SeriesChartType.Spline;

            chart.Series.Add("points");
            chart.Series[1].Color     = Color.Black;
            chart.Series[1].ChartType = SeriesChartType.Point;

            f = new Function("f(x) = " + functionBox.Text);

            DrawFunction();
        }
        static void Main()
        {
            PSOModel model = new PSOModel();

            ViewConsole console = new ViewConsole(model);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new View2D(model));
        }
 public ControllerConsole(ViewConsole view, PSOModel model)
 {
     this.model = model;
     this.view  = view;
 }
Пример #5
0
 public Controller2D(View2D view, PSOModel model)
 {
     this.model = model;
     this.view  = view;
 }