コード例 #1
0
        private void HandlerEventCreateMethod(object sender)
        {
            FormCreateMethod form = sender as FormCreateMethod;

            if (form != null && form.Method != null)
            {
                form.Method.Lim = form.LimParams;
                form.Method.NormalizationDirections = form.Norma;

                if (form.NumberUsedComposite != -1)
                {
                    EmptyMethod usedMethods = EventGetUsedMethods?.Invoke(form.NumberUsedComposite);
                    if (usedMethods != null)
                    {
                        form.Method.MethodsUsed = usedMethods;
                    }
                }

                composite.Add(form.Method);
                dataGridView.Rows.Add(new object[] { form.Method.Name,
                                                     form.LimParams?.ToString(),
                                                     form.Norma,
                                                     form.NumberUsedComposite != -1 ? form.NumberUsedComposite.ToString() : "" });
            }
        }
コード例 #2
0
 public void WriteInLogError(Params param, EmptyMethod method, string messageErr)
 {
     richTextBoxLogs.Text += "Метод " + method.Name + "\t";
     richTextBoxLogs.Text += "Параметры " + "y = " + param.Y.Function + "\t" + (param.X0 != null ? "X0 " + param.X0.Vars() + " " : "") + (param.P != null ? "P " + param.P.Vars() + " " : "") + "\t";
     richTextBoxLogs.Text += "Сообщение " + messageErr + "\t";
     richTextBoxLogs.Text += "\n";
 }
コード例 #3
0
        public FormCreateMethod(EmptyMethod method = null)
        {
            InitializeComponent();

            if (method != null)
            {
                this.method           = method;
                labelMethod.Text      = "Метод " + method?.Name;
                limParams             = method?.Lim;
                labelLimParams.Text   = limParams?.ToString();
                checkBoxNorma.Checked = method.NormalizationDirections;
            }
        }
コード例 #4
0
        public void WriteInLog(Result result, Params param, EmptyMethod method)
        {
            bool composite = false;

            if (method as Composite != null)
            {
                composite = true;
            }
            richTextBoxLogs.Text += "Метод " + method.Name + "\t";
            richTextBoxLogs.Text += "Параметры " + "y = " + param.Y.Function + "\t" + (param.X0 != null ? "X0 " + param.X0.Vars(): "") + "\t" + (param.P != null ? "P " + param.P.Vars(): "") + "\t";
            richTextBoxLogs.Text += "Результат " + (!composite ? "K = " + result.K.ToString(): "") + "\t" + (result.XMin != null ? result.XMin.Vars() : "") + "\n";
            if (composite)
            {
                richTextBoxLogs.Text += "\n";
            }
        }
コード例 #5
0
        private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridView    grid = sender as DataGridView;
            DataGridViewRow row  = grid.SelectedRows[0];

            if (row != null)
            {
                EmptyMethod method = composite.GetList()?[row.Index];
                if (method != null)
                {
                    indexUpdateMethod = row.Index;
                    FormCreateMethod form = new FormCreateMethod(method);
                    form.EventCreateMethod += HandlerEventUpdateMethod;
                    form.Show();
                }
            }
        }
コード例 #6
0
        ComboBox CreatedComboBox(EmptyMethod method)
        {
            ComboBox comboBox = new ComboBox();

            Composite composite = method as Composite;

            if (composite != null)
            {
                comboBox.DataSource    = composite.GetList();
                comboBox.DisplayMember = "Name";
            }
            else
            {
                return(null);
            }

            return(comboBox);
        }
コード例 #7
0
        private void comboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            ComboBox comboBox = sender as ComboBox;

            if (comboBox != null)
            {
                EmptyMethod method = comboBox.SelectedItem as EmptyMethod;
                if (method != null)
                {
                    ComboBox newComboBox = CreatedComboBox(method);
                    if (newComboBox != null)
                    {
                        newComboBox.Dock = DockStyle.Top;
                        newComboBox.SelectedValueChanged += comboBox_SelectedValueChanged;
                        RemoveComboBoxes(panelListsMethods.Controls.IndexOf(comboBox) + 1, panelListsMethods.Controls.Count - 1);
                        panelListsMethods.Controls.Add(newComboBox);
                    }
                    else
                    {
                        selectedMethod = method;
                    }
                }
            }
        }
コード例 #8
0
 private void HandlerEventCreateMethod(EmptyMethod method)
 {
     Method = method;
 }
コード例 #9
0
 public override void Add(EmptyMethod m)
 {
     throw new System.NotImplementedException();
 }
コード例 #10
0
 // Adds callback methods to the tool updates
 public void BindMethodToToolUpdate(TransformState s, EmptyMethod method)
 {
     updateMethods[s] += method;
 }