コード例 #1
0
ファイル: FormDiffEquation.cs プロジェクト: Erroman/universal
 private void resetCombo()
 {
     foreach (Control c in panelMea.Controls)
     {
         if (!(c is PanelMeasureFormula))
         {
             continue;
         }
         PanelMeasureFormula p = c as PanelMeasureFormula;
         p.ResetCombo();
     }
 }
コード例 #2
0
 /// <summary>
 /// Resets comboboxes
 /// </summary>
 public void ResetCombo()
 {
     foreach (Control c in panelMea.Controls)
     {
         if (!(c is PanelMeasureFormula))
         {
             continue;
         }
         PanelMeasureFormula p = c as PanelMeasureFormula;
         p.ResetCombo();
     }
     comboBoxTime.ClearItems();
 }
コード例 #3
0
        private void acceptConstants()
        {
            try
            {
                string str = "";

                /*
                 * Hashtable t = new Hashtable();
                 * foreach (DataRow row in dataTableP.Rows)
                 * {
                 *  string s = row[0] as string;
                 *  double x = (double)row[1];
                 *  t[s] = x;
                 * }*/
                foreach (string s in checkedListBoxP.CheckedItems)
                {
                    /*  double a = 0;
                     * if (t.ContainsKey(s))
                     * {
                     *    a = (double)t[s];
                     * }
                     * //* dataTableP.Rows.Add(new object[] { s, a });*/
                    str += s;
                }
                Diagram.UI.PropertyEditors.AliasTable.AddDicitionary(consumer, tempAliases);
                consumer.CreateAliases(str);
                Diagram.UI.PropertyEditors.AliasTable.SetDictionary(tempAliases, consumer);
                string var = consumer.InputParameters;
                foreach (Control c in panelMea.Controls)
                {
                    if (!(c is PanelMeasureFormula))
                    {
                        continue;
                    }
                    PanelMeasureFormula p = c as PanelMeasureFormula;
                    p.FillComboboxes(var);
                }
                if (comboBoxTime.SelectedItem != null)
                {
                    comboBoxTime.Tag = comboBoxTime.SelectedItem;
                }

                comboBoxTime.FillCombo(var);
                propertyGridAlias.SetAlias(consumer);
            }
            catch (Exception ex)
            {
                ex.ShowError(10);
            }
        }
コード例 #4
0
ファイル: FormDiffEquation.cs プロジェクト: Erroman/universal
 private void fillComboBoxes(string str)
 {
     foreach (Control c in panelMea.Controls)
     {
         if (!(c is PanelMeasureFormula))
         {
             continue;
         }
         PanelMeasureFormula p = c as PanelMeasureFormula;
         p.FillComboboxes(str);
     }
     comboBoxTime.Items.Clear();
     foreach (char c in str)
     {
         comboBoxTime.Items.Add(c + "");
     }
 }
コード例 #5
0
ファイル: FormDiffEquation.cs プロジェクト: Erroman/universal
        private void setFormulas()
        {
            int    y         = 20;
            string variables = "";

            for (int i = 0; i < solver.Count; i++)
            {
                IMeasurements       arrow = solver[i];
                PanelMeasureFormula panel = new PanelMeasureFormula(arrow, variables, solver);
                panel.Width = 300;
                Panel pan = new Panel();
                pan.Width     = panel.Width;
                pan.BackColor = Color.Black;
                pan.Top       = y;
                pan.Height    = 2;
                panelMea.Controls.Add(pan);
                y += pan.Height;
                panelMea.Controls.Add(panel);
                panel.Left = 0;
                panel.Top  = y;
                y         += panel.Height + 1;
            }
            foreach (string str in solver.Arguments)
            {
                comboBoxTime.Items.Add(str[0] + "");
                variables += str[0];
            }
            foreach (string str in solver.Arguments)
            {
                string s = str;
                int    n = str.Length;
                if (s.Substring(n - 4, 4).Equals("Time"))
                {
                    for (int i = 0; i < variables.Length; i++)
                    {
                        if (variables[i] == str[0])
                        {
                            this.comboBoxTime.SelectedIndex = i;
                            return;
                        }
                    }
                }
            }
        }
コード例 #6
0
        void fill()
        {
            string variables = consumer.InputParameters;
            int    y         = 20;

            for (int i = 0; i < consumer.Count; i++)
            {
                IMeasurements       arrow = consumer[i];
                PanelMeasureFormula panel = new PanelMeasureFormula(arrow, variables, consumer);
                panel.Width = 300;
                Panel pan = new Panel();
                pan.Width     = panel.Width;
                pan.BackColor = Color.Black;
                pan.Top       = y;
                pan.Height    = 2;
                panelMea.Controls.Add(pan);
                y += pan.Height;
                panelMea.Controls.Add(panel);
                panel.Left = 0;
                panel.Top  = y;
                y         += panel.Height + 1;
            }
            comboBoxTime.FillCombo(variables);
            if (consumer.Arguments != null)
            {
                foreach (string str in consumer.Arguments)
                {
                    string s = str + "";
                    int    n = str.Length;
                    if (s.Substring(n - 4, 4).Equals("Time"))
                    {
                        for (int i = 0; i < comboBoxTime.Items.Count; i++)
                        {
                            if (comboBoxTime.Items[i].ToString()[0] == str[0])
                            {
                                comboBoxTime.SelectedIndex = i;
                                return;
                            }
                        }
                    }
                }
            }
        }
コード例 #7
0
        private void fillMeaCombo()
        {
            string    s     = "";
            Hashtable table = recursive.Arguments;

            foreach (char ch in table.Keys)
            {
                s += ch;
            }
            foreach (Control c in panelMea.Controls)
            {
                if (!(c is PanelMeasureFormula))
                {
                    continue;
                }
                PanelMeasureFormula p = c as PanelMeasureFormula;
                p.FillComboboxes(s);
            }
            comboBoxTime.FillCombo(s);
        }
コード例 #8
0
        private void fillMeasurements()
        {
            string    s     = "";
            Hashtable table = recursive.Arguments;

            foreach (char ch in table.Keys)
            {
                s += ch;
            }
            IDataConsumer c = recursive;
            int           y = 0;

            for (int i = 0; i < c.Count; i++)
            {
                IMeasurements       arrow = c[i];
                PanelMeasureFormula panel = new PanelMeasureFormula(arrow, s, recursive);
                panel.Width = 300;
                Panel pan = new Panel();
                pan.Width     = panel.Width;
                pan.BackColor = Color.Black;
                pan.Top       = y;
                pan.Height    = 2;
                panelMea.Controls.Add(pan);
                y += pan.Height;
                panelMea.Controls.Add(panel);
                panel.Left = 0;
                panel.Top  = y;
                y         += panel.Height + 1;
            }
            comboBoxTime.FillCombo(s);
            foreach (char ch in table.Keys)
            {
                if (table[ch].Equals("Time"))
                {
                    int n = s.IndexOf(ch);
                    comboBoxTime.SelectedIndex = n;
                    break;
                }
            }
        }