Ejemplo n.º 1
0
        private void savebtn_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < tabControl1.TabPages.Count; i++)
            {
                ResultEntity temp = new ResultEntity();
                for (int j = 0; j < tabControl1.TabPages[i].Controls[0].Controls.Count; j++)
                {
                    if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "readytimevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setreadytime(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "namevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setparamatername(tabControl1.TabPages[i].Controls[0].Controls[j].Text.ToString());
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "shuttertimevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setshuttertimes(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "clinevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setclinevalue(tabControl1.TabPages[i].Controls[0].Controls[j].Text.ToString());
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "setstartvalue")
                    {
                        temp.setresultname("Control line");
                        temp.setresultstartvalue(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "setendvalue")
                    {
                        temp.setresultname("Control line");
                        temp.setresultendvalue(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                }
                Settingentity settingentitytempforresult = (Settingentity)methodtemp.getsettinglist()[i];
                for (int k = 0; k < settingentitytempforresult.getresultentitylist().Count; k++)
                {
                    if (((ResultEntity)settingentitytempforresult.getresultentitylist()[k]).getresultname() == "Control line")
                    {
                        settingentitytempforresult.getresultentitylist().RemoveAt(k);
                    }
                }
                settingentitytempforresult.getresultentitylist().Add(temp);
            }

            Settingdetectsection settemp = new Settingdetectsection(method, formtemp, methodlisttemp, methodtemp, editflag);

            settemp.TopLevel        = false;
            settemp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            settemp.Dock            = System.Windows.Forms.DockStyle.Fill;
            panel1.Controls.Clear();
            panel1.Controls.Add(settemp);
            settemp.Show();
            //formtemp.OnLoad();
            //method.Dispose();
        }
Ejemplo n.º 2
0
 private void MethodSettingEntity_Load(object sender, EventArgs e)
 {
     namevalue.Text  = settingentity.getparamatername();
     clinevalue.Text = settingentity.getlinevalue();
     if (clinevalue.Text.Equals(""))
     {
         clinevalue.SelectedIndex = 0;
     }
     for (int i = 0; i < settingentity.getresultentitylist().Count; i++)
     {
         if (((ResultEntity)settingentity.getresultentitylist()[i]).getresultname() == "Control line")
         {
             setstartvalue.Text = ((ResultEntity)settingentity.getresultentitylist()[i]).getresultstartvalue().ToString();
             setendvalue.Text   = ((ResultEntity)settingentity.getresultentitylist()[i]).getresultendvalue().ToString();
         }
     }
     shuttertimevalue.Text = settingentity.getshuttertimes().ToString();
     readytimevalue.Text   = settingentity.getreadytime().ToString();
 }
Ejemplo n.º 3
0
        private void Addparamaternextbtn_Click(object sender, EventArgs e)
        {
            settingentity.setparamatername(Addparamaternamevalue.Text);
            settingentity.setclinevalue(Addparamaterclinevalue.Text);
            ResultEntity tempresultentity = new ResultEntity();

            tempresultentity.setresultname("Control line");
            tempresultentity.setresultstartvalue(int.Parse(Addparamatersetstartvalue.Text));
            tempresultentity.setresultendvalue(int.Parse(Addparamatersetendvalue.Text));
            settingentity.getresultentitylist().Add(tempresultentity);
            settingentity.setshuttertimes(int.Parse(Addparamatershuttertimevalue.Text));
            settingentity.setreadytime(int.Parse(Addparamaterreadytimevalue.Text));
        }
Ejemplo n.º 4
0
        private void TestlineSetting_Load(object sender, EventArgs e)
        {
            DataGridViewTextBoxColumn From = new DataGridViewTextBoxColumn();

            dataGridView1.AllowUserToAddRows = false;
            From.Name             = "From";
            From.DataPropertyName = "From";
            From.HeaderText       = "From";
            From.ValueType        = typeof(Int32);
            dataGridView1.Columns.Add(From);
            DataGridViewTextBoxColumn To = new DataGridViewTextBoxColumn();

            To.Name             = "To";
            To.DataPropertyName = "To";
            To.HeaderText       = "To";
            To.ValueType        = typeof(Int32);
            dataGridView1.Columns.Add(To);
            DataGridViewTextBoxColumn Result = new DataGridViewTextBoxColumn();

            Result.Name             = "Result";
            Result.DataPropertyName = "Result";
            Result.HeaderText       = "Result";
            Result.ValueType        = typeof(String);
            dataGridView1.Columns.Add(Result);
            if (settingentity.getresultentitylist().Count != 0)
            {
                for (int i = 0; i < settingentity.getresultentitylist().Count; i++)
                {
                    if (((ResultEntity)settingentity.getresultentitylist()[i]).getresultname() == "Test line")
                    {
                        string[] row = { ((ResultEntity)settingentity.getresultentitylist()[i]).getresultstartvalue().ToString(), ((ResultEntity)settingentity.getresultentitylist()[i]).getresultendvalue().ToString(), ((ResultEntity)settingentity.getresultentitylist()[i]).getresultvalue() };
                        dataGridView1.Rows.Add(row);
                    }
                }
            }
        }