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() : "" }); } }
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"; }
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; } }
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"; } }
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(); } } }
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); }
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; } } } }
private void HandlerEventCreateMethod(EmptyMethod method) { Method = method; }
public override void Add(EmptyMethod m) { throw new System.NotImplementedException(); }
// Adds callback methods to the tool updates public void BindMethodToToolUpdate(TransformState s, EmptyMethod method) { updateMethods[s] += method; }