new internal void Load() { /* userControlCommentsFont.AcceptComments += delegate(ICollection comm) * { * consumer.Comments = comm; * }; */ PanelFormula.SetResize(panelFormula); fill(); IList <string> a = consumer.AliasNames; numericUpDownOrder.Value = consumer.DerivationOrder; first = false; Diagram.UI.PropertyEditors.AliasTable.AddDicitionary(consumer, tempAliases); try { IAlias alias = consumer; IList <string> al = alias.AliasNames; propertyGridAlias.SetAlias(consumer); string str = consumer.AllVariables; foreach (char c in str) { if (al.Contains(c + "")) { checkedListBoxP.Items.Add("" + c, CheckState.Checked); } else { checkedListBoxP.Items.Add("" + c, CheckState.Unchecked); } } IMeasurements m = consumer; numericUpDownQuantity.Value = m.Count; fillFormulas(); setComboboxes(); userControlFeedBack.Reset(); userControlFeedBack.Set(consumer.Feedback); userControlForward.Measurements = consumer; userControlForward.Items = consumer.ForwardAliases; userControlForward.OnChange += (Dictionary <int, string> d) => { consumer.ForwardAliases = userControlForward.Items; }; IRuntimeUpdate start = consumer; checkBoxRuntimeUpdate.Checked = start.ShouldRuntimeUpdate; checkBoxRuntimeUpdate.CheckStateChanged += (object o, EventArgs e) => { start.ShouldRuntimeUpdate = checkBoxRuntimeUpdate.Checked; }; } catch (Exception ex) { ex.ShowError(10); } }
/// <summary> /// Constructor /// </summary> /// <param name="label">Component label</param> public FormRecursive(IObjectLabel label) : this() { PanelFormula.SetResize(panelFormula); this.label = label; recursive = label.Object as Recursive; propertyGridAl.SetAlias(recursive); ArrayList comments = recursive.Comments; this.SetComments(comments); UpdateFormUI(); fillVariables(); fillFormulas(); fillConstants(); fillMeasurements(); createAndFillAliasComboBox(); }
/// <summary> /// Constructor /// </summary> /// <param name="label"></param> public FormDiffEquation(IObjectLabel label) : this() { PanelFormula.SetResize(panelFormula); this.label = label; solver = label.Object as DifferentialEquationSolver; consumer = solver; // ArrayList comments = solver.Comments; this.SetComments(solver.Comments); numericUpDownDerivationOrder.Value = solver.DerivationOrder; first = false; string var = ""; List <string> vv = new List <string>(); foreach (char c in solver.Keys) { var += c; vv.Add(c + ""); } for (int i = 0; i < Variables.Length; i++) { char v = Variables[i]; if (var.IndexOf(v) > -1) { checkedListBoxV.Items.Add("" + v, CheckState.Checked); } else { checkedListBoxV.Items.Add("" + v, CheckState.Unchecked); } } userControlCharIntDictionary.Minimum = 1; userControlCharIntDictionary.Keys = vv; Dictionary <string, int> dder = new Dictionary <string, int>(); Dictionary <string, int> dor = solver.DerivationOrders; foreach (string key in dor.Keys) { dder[key] = dor[key] + 1; } userControlCharIntDictionary.Dictionary = dder; string str = solver.AllParameters; IList <string> l = solver.AliasNames; foreach (char c in str) { string s = c + ""; if (l.Contains(s)) { checkedListBoxP.Items.Add(s, CheckState.Checked); } else { checkedListBoxP.Items.Add(s, CheckState.Unchecked); } } int top = 0; foreach (char c in solver.Keys) { PanelFormula p = new PanelFormula("" + c, this, panelFormula.Width, 200, Variables, true, null, null); p.Left = 0; p.Top = top; top += p.Height; p.Formula = solver[c]; panelFormula.Controls.Add(p); } UpdateFormUI(); setFormulas(); fillTable(); createAndFillAliasComboBox(); }