/// <summary>
        /// определить аргумент
        /// </summary>
        private void InsertChannel(int index)
        {
            if (radioButton1.Checked)
            {
                SignalsForm signs = new SignalsForm(app);
                if (signs.ShowDialog(this) == DialogResult.OK)
                {
                    Parameter par = signs.SelectedParameter;
                    if (par != null)
                    {
                        if (index == 0)
                        {
                            first = new Argument();

                            first.Index = par.Position;
                            first.Source = DataSource.Signals;
                        }
                        else
                        {
                            second = new Argument();

                            second.Index = par.Position;
                            second.Source = DataSource.Signals;
                        }

                        listView1.Items[index].SubItems[0].Text = par.Position.ToString();

                        listView1.Items[index].SubItems[1].Text = "Канал устройства";
                        listView1.Items[index].SubItems[2].Text = par.Description;
                    }
                }
            }
            else
                if (radioButton2.Checked)
                {
                    ResultsForm res = new ResultsForm(app);
                    if (res.ShowDialog(this) == DialogResult.OK)
                    {
                        Formula form = res.SelectedParameter;
                        if (form != null)
                        {
                            if (index == 0)
                            {
                                first = new Argument();

                                first.Index = form.Position;
                                first.Source = DataSource.Results;
                            }
                            else
                            {
                                second = new Argument();

                                second.Index = form.Position;
                                second.Source = DataSource.Results;
                            }

                            listView1.Items[index].SubItems[0].Text = form.Position.ToString();

                            listView1.Items[index].SubItems[1].Text = "Значение конвейера";
                            listView1.Items[index].SubItems[2].Text = form.Macros.Description;
                        }
                    }
                }
        }
Exemple #2
0
        /// <summary>
        /// определить аргумент
        /// </summary>
        private void InsertChannel(int index)
        {
            if (radioButton1.Checked)
            {
                SignalsForm signs = new SignalsForm(app);
                if (signs.ShowDialog(this) == DialogResult.OK)
                {
                    Parameter par = signs.SelectedParameter;
                    if (par != null)
                    {
                        if (index == 0)
                        {
                            first = new Argument();

                            first.Index  = par.Position;
                            first.Source = DataSource.Signals;
                        }
                        else
                        {
                            second = new Argument();

                            second.Index  = par.Position;
                            second.Source = DataSource.Signals;
                        }

                        listView1.Items[index].SubItems[0].Text = par.Position.ToString();

                        listView1.Items[index].SubItems[1].Text = "Канал устройства";
                        listView1.Items[index].SubItems[2].Text = par.Description;
                    }
                }
            }
            else
            if (radioButton2.Checked)
            {
                ResultsForm res = new ResultsForm(app);
                if (res.ShowDialog(this) == DialogResult.OK)
                {
                    Formula form = res.SelectedParameter;
                    if (form != null)
                    {
                        if (index == 0)
                        {
                            first = new Argument();

                            first.Index  = form.Position;
                            first.Source = DataSource.Results;

                            listView1.Items[index].SubItems[0].Text = first.Index.ToString();
                        }
                        else
                        {
                            second = new Argument();

                            second.Index  = form.Position;
                            second.Source = DataSource.Results;

                            listView1.Items[index].SubItems[0].Text = second.Index.ToString();
                        }

                        listView1.Items[index].SubItems[1].Text = "Значение конвертера";
                        listView1.Items[index].SubItems[2].Text = form.Macros.Description;
                    }
                }
            }
        }