Example #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();
        }
Example #2
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));
        }
Example #3
0
        private void addparamaterbtn_Click(object sender, EventArgs e)
        {
            Settingentity newsettingentity = new Settingentity();

            newsettingentity.setparamatername(newparamatername);
            methodtemp.getsettinglist().Add(newsettingentity);
            TabPage tab = new TabPage();

            tab.Name = newparamatername;
            tab.Text = newparamatername;
            MethodSettingEntity newmethodsettingentity = new MethodSettingEntity(form, formtemp, methodnexttemp, methodlisttemp, methodtemp, methodtemp.getsettinglist().Count - 1);

            newmethodsettingentity.TopLevel = false;
            tab.Controls.Add(newmethodsettingentity.panel1);
            methodnexttemp.tabControl1.TabPages.Add(tab);
        }
Example #4
0
        private void nextbtn_Click(object sender, EventArgs e)
        {
            MySqlDataReader mysqlreader = database.select("Methodtable", "Methodname");

            while (mysqlreader.Read())
            {
                if (mysqlreader[0].ToString().Equals(methodnamevalue.Text) && editflag == 0)
                {
                    MessageBox.Show("method has been created");
                    return;
                }
            }
            ArrayList namelisttemp = new ArrayList();

            methodtemp.setmethodname(methodnamevalue.Text);
            methodtemp.setsensitive(5);
            string line = namevalue.Text;

            //Regex reg = new Regex("[A-Za-z0-9]+");
            string[] match = Regex.Split(line, ",| ,|, ");
            //MatchCollection match = reg.Matches(line);
            if (Paramaternumbertextbox.Text != "" && match.Length == int.Parse(Paramaternumbertextbox.Text))
            {
                for (int i = 0; i < match.Length; i++)
                {
                    Settingentity settingentity = new Settingentity();
                    string        value         = match[i].ToString();
                    namelisttemp.Add(value);
                    settingentity.setparamatername(value);
                    if (methodtemp.getsettinglist().Count > 0)
                    {
                        for (int j = 0; j < methodtemp.getsettinglist().Count; j++)
                        {
                            if (((Settingentity)methodtemp.getsettinglist()[j]).getparamatername() == value)
                            {
                                break;
                            }
                            else if (j == methodtemp.getsettinglist().Count - 1)
                            {
                                methodtemp.getsettinglist().Add(settingentity);
                            }
                        }
                    }
                    else
                    {
                        methodtemp.getsettinglist().Add(settingentity);
                    }
                }
                //namelist = namelisttemp;
                MethodNext temp = new MethodNext(this, formtemp, methodlist, methodtemp, editflag);
                //MethodNext temp = new MethodNext();
                temp.TopLevel        = false;
                temp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                temp.Dock            = System.Windows.Forms.DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(temp);
                for (int i = 0; i < namelisttemp.Count; i++)
                {
                    TabPage tab = new TabPage();
                    tab.Name = (string)namelisttemp[i];
                    tab.Text = (string)namelisttemp[i];

                    MethodSettingEntity form = new MethodSettingEntity(this, formtemp, temp, methodlist, methodtemp, i);
                    form.TopLevel = false;
                    tab.Controls.Add(form.panel1);
                    temp.tabControl1.TabPages.Add(tab);
                    form.Show();
                }
                temp.Show();
            }
            else
            {
                MessageBox.Show("Please input correct number");
            }
        }