Exemplo n.º 1
0
        /// <summary>
        /// определить аргумент
        /// </summary>
        private void InsertChannel(int index)
        {
            ResultsForm res = new ResultsForm(app);

            if (index == 0)
            {
                if (first != null)
                {
                    res.Position = first.Index;
                }
            }
            else
            {
                if (second != null)
                {
                    res.Position = second.Index;
                }
            }

            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 = form.Macros.Description;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Выбрать калибруемый параметр
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void selectParameter_Click(object sender, EventArgs e)
        {
            ResultsForm r_frm = new ResultsForm(app);
            if (_parameter != null)
            {
                r_frm.Position = _parameter.Identifier;
            }

            if (r_frm.ShowDialog(this) == DialogResult.OK)
            {
                textBoxSelectedParameter.Tag = r_frm.SelectedParameter;
                textBoxSelectedParameter.Text = r_frm.SelectedParameter.Name;

                _parameter = r_frm.SelectedParameter;
                checkBoxDoScale.Checked = false;

                transformation.Clear();
                foreach (Transformation.TCondition val in _parameter.Transformation.Table)
                {
                    Transformation.TCondition _v = new DeviceManager.Transformation.TCondition();

                    _v.Multy = val.Multy;
                    _v.Result = val.Result;

                    _v.Shift = val.Shift;
                    _v.Signal = val.Signal;

                    transformation.Insert(_v);
                }
                //transformation.Arg[0].Index = first.Index;
            }
        }
Exemplo n.º 3
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;
                            }
                            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;
                        }
                    }
                }
        }
Exemplo n.º 4
0
 /// <summary>
 /// добавить сигнал конвертора
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void first_btn_Click(object sender, EventArgs e)
 {
     ResultsForm frm = new ResultsForm(_app);
     if (frm.ShowDialog(this) == DialogResult.OK)
     {
         f = frm.SelectedParameter;
         textBox1.Text = f.Macros.Description;
     }
 }
Exemplo n.º 5
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;
                    }
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// определить аргумент
        /// </summary>
        private void InsertChannel(int index)
        {
            ResultsForm res = new ResultsForm(app);
            if (index == 0)
            {
                if (first != null)
                {
                    res.Position = first.Index;
                }
            }
            else
            {
                if (second != null)
                {
                    res.Position = second.Index;
                }
            }

            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 = form.Macros.Description;
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Выбрать калибруемый параметр
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void selectParameter_Click(object sender, EventArgs e)
        {
            ResultsForm r_frm = new ResultsForm(app);
            if (first != null)
            {
                r_frm.Position = first.Index;
            }

            if (r_frm.ShowDialog(this) == DialogResult.OK)
            {
                textBoxSelectedParameter.Tag = r_frm.SelectedParameter;
                textBoxSelectedParameter.Text = r_frm.SelectedParameter.Macros.Description;

                first.Index = r_frm.SelectedParameter.Position;
                transformation.Args[0].Index = first.Index;
            }
        }