Exemple #1
0
        public Setcontrolzone(ArrayList list, MethodEntity methodtemp, int framewightvalue, int frameheightvalue)
        {
            InitializeComponent();
            framewidth  = framewightvalue;
            frameheight = frameheightvalue;

            for (int i = 0; i < list.Count; i++)
            {
                if (((Settingimageentity)list[i]).getparamatertype() != "Color")
                {
                    Bitmap  tempbitmap = ((Settingimageentity)list[0]).getimage();//default value
                    TabPage tab        = new TabPage();
                    tab.Name = ((Settingentity)methodtemp.getsettinglist()[i]).getparamatername();
                    tab.Text = tab.Name;
                    for (int k = 0; k < list.Count; k++)
                    {
                        if (((Settingentity)methodtemp.getsettinglist()[i]).getparamatername() == ((Settingimageentity)list[i]).getparamatername())
                        {
                            tempbitmap = ((Settingimageentity)list[i]).getimage();
                        }
                    }
                    Controlzoneentity form = new Controlzoneentity(tempbitmap, (Settingentity)methodtemp.getsettinglist()[i], framewidth, frameheight);
                    form.TopLevel = false;
                    tab.Controls.Add(form.panel1);
                    tabControl1.TabPages.Add(tab);
                    form.Show();
                    tabControl1.Show();
                }
            }
        }
Exemple #2
0
 public MethodNext(ArrayList valuelist, MethodEntity value)
 {
     InitializeComponent();
     if (Form1.language != "")
     {
         refreshlanguage(Form1.language);
     }
     methodtemp     = value;
     methodlisttemp = valuelist;
 }
Exemple #3
0
 public Method(Form1 formvalue, ArrayList value, MethodEntity tempmethodentity, int flag)
 {
     InitializeComponent();
     if (Form1.language != "")
     {
         refreshlanguage(Form1.language);
     }
     methodlist = value;
     formtemp   = formvalue;
     methodtemp = tempmethodentity;
     editflag   = flag;
 }
Exemple #4
0
 public MethodNext(Method method, Form1 formtemp, ArrayList methodlist, MethodEntity methodtemp, int flag)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     if (Form1.language != "")
     {
         refreshlanguage(Form1.language);
     }
     this.method         = method;
     this.formtemp       = formtemp;
     this.methodlisttemp = methodlist;
     this.methodtemp     = methodtemp;
     this.editflag       = flag;
 }
Exemple #5
0
 public Settingdetectsection(Method form, Form1 formtemp, ArrayList methodlist, MethodEntity methodentity, int flag)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     if (Form1.language != "")
     {
         refreshlanguage(Form1.language);
     }
     this.form      = form;
     this.formtemp  = formtemp;
     methodtemp     = methodentity;
     methodlisttemp = methodlist;
     editflag       = flag;
 }
Exemple #6
0
 public MethodSettingEntity(Method formvalue, Form1 mainformvalue, MethodNext methodnexttempvalue, ArrayList valuelist, MethodEntity methodvalue, int value)
 {
     InitializeComponent();
     if (Form1.language != "")
     {
         refreshlanguage(Form1.language);
     }
     methodtemp               = methodvalue;
     methodnexttemp           = methodnexttempvalue;
     settingentity            = (Settingentity)methodvalue.getsettinglist()[value];
     methodlisttemp           = valuelist;
     form                     = formvalue;
     formtemp                 = mainformvalue;
     clinevalue.SelectedIndex = 0;
     namevalue.Text           = settingentity.getparamatername();
 }
Exemple #7
0
 public MethodEdit(MethodEntity tempmethodentity)
 {
     InitializeComponent();
     methodentity = tempmethodentity;
 }
Exemple #8
0
        public Settingsensitive(ArrayList list, MethodEntity methodtempvalue)
        {
            System.Collections.ArrayList namelist = new ArrayList();
            imagelist  = list;
            methodtemp = methodtempvalue;
            // TODO: Complete member initialization
            Pointentity temp = new Pointentity();

            InitializeComponent();
            if (Form1.language != "")
            {
                refreshlanguage(Form1.language);
            }
            Sensitivevalue.Text = "5";
            scanpicture(list);
            //this.colorlist = colorlist;
            for (int i = 0; i < methodtemp.getsettinglist().Count; i++)
            {
                namelist.Add(((Settingentity)methodtemp.getsettinglist()[i]).getparamatername());
            }
            for (int i = 0; i < namelist.Count; i++)
            {
                if (((Settingentity)methodtemp.getsettinglist()[i]).getlinevalue() != "Color")
                {
                    DateTime  currenttime      = DateTime.Now;
                    int       colorvaluetop    = 255;
                    int       colorvaluebottom = 255;
                    ArrayList templist         = new ArrayList();
                    int       averagevalue     = 0;
                    if (i < chartlist.Count)
                    {
                        TabPage tabPage = new TabPage();
                        tabPage.Text       = "page" + i.ToString();
                        tabPage.ClientSize = new Size(749, 368);
                        tabPage.BackColor  = Color.White;
                        Chart chart2 = new Chart();
                        chart2.Series.Clear();
                        chart2.ChartAreas.Add("ChartArea2");
                        chart2.Location   = new Point(24, 17);
                        chart2.ClientSize = new Size(672, 300);
                        chart2.Margin     = new Padding(3, 3, 3, 3);
                        chart2.ChartAreas["ChartArea2"].AxisX.Interval = 1;
                        chart2.ChartAreas["ChartArea2"].AxisY.Maximum  = 300;
                        Series series = new Series("Spline");
                        chart2.Legends.Add(new Legend("Spline1"));

                        series.LegendText = namelist[i].ToString();
                        //series.Tag = "asda";
                        series.ChartType   = SeriesChartType.Spline;
                        series.BorderWidth = 3;
                        colorlist          = (System.Collections.ArrayList)chartlist[i];
                        for (int k = 0; k < colorlist.Count; k++)
                        {
                            temp = (Pointentity)colorlist[k];
                            series.Points.AddY(temp.getcolor());
                            if (temp.getcolor() < colorvaluetop && k < colorlist.Count / 2)
                            {
                                colorvaluetop = temp.getcolor();
                            }
                            else if (temp.getcolor() < colorvaluebottom && k > colorlist.Count / 2)
                            {
                                colorvaluebottom = temp.getcolor();
                            }
                        }
                        chart2.Series.Add(series);
                        tabPage.Controls.Add(chart2);
                        chart2.Show();
                        tabPage.Name = namelist[i].ToString();
                        tabPage.Text = namelist[i].ToString();
                        tabgroup.TabPages.Add(tabPage);
                        temp             = (Pointentity)colorlist[0];
                        averagevalue     = temp.getcolor();
                        colorvaluetop    = averagevalue - colorvaluetop;
                        colorvaluebottom = averagevalue - colorvaluebottom;
                        TextAnnotation text = new TextAnnotation();
                        text.Text = "C:";
                        text.X    = 85;
                        text.Y    = 20;
                        chart2.Annotations.Add(text);
                        text      = new TextAnnotation();
                        text.Text = colorvaluetop.ToString();
                        text.X    = 90;
                        text.Y    = 20;
                        chart2.Annotations.Add(text);
                        text      = new TextAnnotation();
                        text.Text = "T:";
                        text.X    = 85;
                        text.Y    = 27;
                        chart2.Annotations.Add(text);
                        text      = new TextAnnotation();
                        text.Text = colorvaluebottom.ToString();
                        text.X    = 90;
                        text.Y    = 27;
                        chart2.Annotations.Add(text);
                        text      = new TextAnnotation();
                        text.Text = "Loading:";
                        text.X    = 85;
                        text.Y    = 34;
                        chart2.Annotations.Add(text);
                        text = new TextAnnotation();
                        System.DateTime timetemp = new DateTime();
                        TimeSpan        ts       = currenttime - timetemp;
                        text.Text = "0." + ts.Milliseconds.ToString() + "/s";
                        text.X    = 92;
                        text.Y    = 34;
                        chart2.Annotations.Add(text);
                    }
                }
            }
        }
Exemple #9
0
        private void save_Click(object sender, EventArgs e)
        {
            if (editflag == 1)
            {
                MySqlDataReader tempsqlreader = databaseoperator.select("methodtable", "Methodname", methodtemp.getmethodname());
                ArrayList       deletelist    = new ArrayList();
                while (tempsqlreader.Read())
                {
                    deletelist.Add((String)tempsqlreader.GetValue(3));
                }
                databaseoperator.connectdatabase();
                databaseoperator.opendatabase();
                databaseoperator.deletedata("methodtable", "Methodname", methodtemp.getmethodname());
                for (int i = 0; i < deletelist.Count; i++)
                {
                    databaseoperator.deletedata("settingentitytable", "Paramaterindex", (String)deletelist[i]);
                    databaseoperator.deletedata("resulttable", "Resultvalueindex", (String)deletelist[i]);
                    databaseoperator.deletedata("rectangletable", "Rectangleindex", (String)deletelist[i]);
                    databaseoperator.deletedata("setzonetable", "Setzoneindex", (String)deletelist[i]);
                }
                databaseoperator.closedatabase();
            }
            bool flagtemp = true;

            methodtemp.getcameraandsourcesetting().setcameraname(devicename);
            methodtemp.getcameraandsourcesetting().setresolution(resolution);
            methodtemp.getcameraandsourcesetting().setbrightnes(brightness);
            methodtemp.getcameraandsourcesetting().setcontrast(contrast);
            methodtemp.getcameraandsourcesetting().setsaturation(saturation);
            for (int k = 0; k < methodlisttemp.Count; k++)
            {
                MethodEntity temp = (MethodEntity)methodlisttemp[k];
                if (temp.getmethodname() == methodtemp.getmethodname())
                {
                    flagtemp = false;
                    break;
                }
            }
            if (flagtemp == true)
            {
                methodlisttemp.Add(methodtemp);
            }


            for (int databasei = 0; databasei < methodtemp.getsettinglist().Count; databasei++)
            {
                string paramaterindex = methodtemp.getmethodname().ToString() + ((Settingentity)methodtemp.getsettinglist()[databasei]).getparamatername().ToString();
                databaseoperator.insertdata("Methodtable", "Methodname,Paramaters,Paramaterindex,Brightness,Contrast,Saturation,Cameraname,Resolution, Sensitivevalue,Adjustvalue", "'" + methodtemp.getmethodname().ToString() + "'" + "," + "'" + ((Settingentity)methodtemp.getsettinglist()[databasei]).getparamatername().ToString() + "'" + "," + "'" + paramaterindex + "'" + "," + ((Cameraandsourcesetting)methodtemp.getcameraandsourcesetting()).getbrightness() + "," + ((Cameraandsourcesetting)methodtemp.getcameraandsourcesetting()).getcontrast() + "," + ((Cameraandsourcesetting)methodtemp.getcameraandsourcesetting()).getsaturation() + "," + "'" + ((Cameraandsourcesetting)methodtemp.getcameraandsourcesetting()).getcameraname() + "'" + "," + methodtemp.getcameraandsourcesetting().getresolution() + "," + methodtemp.getsensitive() + "," + methodtemp.getadjustvalue());
                string settingtablevalue = "'" + ((Settingentity)methodtemp.getsettinglist()[databasei]).getparamatername().ToString() + "'" + "," + "'" + ((Settingentity)methodtemp.getsettinglist()[databasei]).getlinevalue().ToString() + "'" + "," + ((Settingentity)methodtemp.getsettinglist()[databasei]).getshuttertimes().ToString() +
                                           "," + ((Settingentity)methodtemp.getsettinglist()[databasei]).getreadytime().ToString() + "," + "'" + methodtemp.getmethodname().ToString() + "'" + "," + "'" + paramaterindex.ToString() + "'" + "," + "'" + paramaterindex.ToString() + "'" + "," + "'" + paramaterindex.ToString() + "'";
                databaseoperator.insertdata("Settingentitytable", "Paramatername,Cline,Shuttertime,Readytime,Methodname,Resultvalueindex,Rectangleindex,Paramaterindex",
                                            settingtablevalue);
                string rectangletablevalue = "'" + paramaterindex + "'" + "," + ((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getx().ToString() + "," + ((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).gety().ToString() + "," + ((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getimagewidth().ToString() + "," + ((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getimageheight().ToString();
                databaseoperator.insertdata("Rectangletable", "Rectangleindex,X,Y,Width,Height", rectangletablevalue);
                for (int resulti = 0; resulti < ((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist().Count; resulti++)
                {
                    //string resultvalueindex = paramaterindex + ((ResultEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist()[resulti]).getresultname().ToString();
                    string resultvalueindex = paramaterindex;
                    string resulttablevalue = "'" + resultvalueindex + "'" + "," + "'" + ((ResultEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist()[resulti]).getresultname().ToString() + "'" + "," + "'" + ((ResultEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist()[resulti]).getresultstartvalue().ToString() + "'" + "," + "'" + ((ResultEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist()[resulti]).getresultendvalue().ToString() + "'" + "," + "'" + ((ResultEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getresultentitylist()[resulti]).getresultvalue() + "'";
                    databaseoperator.insertdata("Resulttable", "Resultvalueindex,Resultname,Resultstartvalue,Resultendvalue,Resultvalue", resulttablevalue);
                }
                for (int setzonei = 0; setzonei < ((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist().Count; setzonei++)
                {
                    string setzonetablevalue = "'" + ((Settingentity)methodtemp.getsettinglist()[databasei]).getparamatername() + "'" + "," + "'" + paramaterindex + "'" + "," + ((Setzoneentity)((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist()[setzonei]).getzonepositionx().ToString() + "," + ((Setzoneentity)((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist()[setzonei]).getzonepositiony().ToString() + "," + ((Setzoneentity)((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist()[setzonei]).getzonepositionwidth().ToString() + "," + ((Setzoneentity)((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist()[setzonei]).getzonepositionheight().ToString() + "," + "'" + ((Setzoneentity)((ImageSampleEntity)((Settingentity)methodtemp.getsettinglist()[databasei]).getImageSample()).getcontrolzonelist()[setzonei]).getzonecategory() + "'";
                    databaseoperator.insertdata("SetZonetable", "Paramater,Setzoneindex,ZonepositionX,ZonepositionY,ZonepositionWidth, ZonepositionHeight, Zonecategory", setzonetablevalue);
                }
            }
            formtemp.OnLoad();
            form.getclosingmethod();
            form.Dispose();
        }