Beispiel #1
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            if (formMain.Crystal == null || formMain.Crystal.A * formMain.Crystal.B * formMain.Crystal.C == 0)
            {
                return;
            }
            List <ZoneAxis> za = new List <ZoneAxis>();

            PhotoInformation photo;

            if (((Button)sender).Name == "buttonSearchPhoto1" && photo1.Paintable)
            {
                photo = photo1;
            }
            else if (((Button)sender).Name == "buttonSearchPhoto2" && photo2.Paintable)
            {
                photo = photo2;
            }
            else if (((Button)sender).Name == "buttonSearchPhoto3" && photo3.Paintable)
            {
                photo = photo3;
            }
            else
            {
                return;
            }

            for (int i = 0; i < formMain.Crystals.Length; i++)
            {
                za.AddRange(FindZoneAxis.GetZoneAxis(formMain.Crystals[i], photo, true));
            }

            if (za.Count > 1000)
            {
                MessageBox.Show("Number of candidates are over 1000. Set more limeted conditions.");
            }
            else if (za.Count > 0)
            {
                if (formTEMIDResults != null)
                {
                    formTEMIDResults.Close();
                }
                formTEMIDResults = new FormTEMIDResults(this);
                formTEMIDResults.Show();
                formTEMIDResults.SetDataSet(photo, za);
            }
            else
            {
                MessageBox.Show("No candidate is found");
            }
        }