示例#1
0
文件: cWell.cs 项目: cyrenaique/HCS
        public void DisplayInfoWindow()
        {
            FormForWellInformation NewWindow = new FormForWellInformation();

            NewWindow.textBoxName.Text = Name;
            NewWindow.textBoxInfo.Text = Info;

            if (Concentration >= 0)
                NewWindow.textBoxConcentration.Text = Concentration.ToString("e4");

            if (LocusID != -1)
                NewWindow.textBoxLocusID.Text = ((int)(LocusID)).ToString();

            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            CurrentSeries.ShadowOffset = 2;

            for (int IdxValue = 0; IdxValue < ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber(); IdxValue++)
                CurrentSeries.Points.Add(ListDescriptors[CurrentDescriptorToDisplay].Getvalue(IdxValue));

            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);
            CurrentChartArea.BorderColor = Color.Black;

            NewWindow.chartForFormWell.ChartAreas.Add(CurrentChartArea);
            NewWindow.chartForFormWell.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
            CurrentChartArea.BackColor = Color.FromArgb(64, 64, 64);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].Title = ListDescriptors[CurrentDescriptorToDisplay].GetName();
            CurrentSeries.ChartType = SeriesChartType.Line;
            CurrentSeries.Color = Color.White;
            CurrentSeries.BorderWidth = 3;
            CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY;

            CurrentSeries.Name = "Series" + PosX + "x" + PosY;
            NewWindow.chartForFormWell.Series.Add(CurrentSeries);

            Title CurrentTitle = new Title(PosX + "x" + PosY);
            NewWindow.chartForFormWell.Titles.Add(CurrentTitle);

            NewWindow.Text = PosX + "x" + PosY + " / " + StateForClassif;

            if (NewWindow.ShowDialog() == DialogResult.OK)
                this.Info = NewWindow.textBoxInfo.Text;

            NewWindow.chartForFormWell.Update();
            NewWindow.chartForFormWell.Show();
            return;
        }
示例#2
0
        public void DrawPic(FormForWellInformation NewWindow, List<double> lMin, List<double> lMax)
        {
            if (images == null) return;

            Graphics ThisGraph = NewWindow.panelForImage.CreateGraphics();
            //   ThisGraph.Clear(Color.White);
            //NewWindow.pictureBoxForImage.Image = (Image)images[(int)NewWindow.numericUpDownIdxImage.Value];
            //Graphics bmG = Graphics.FromImage((Image)images[(int)NewWindow.numericUpDownIdxImage.Value]);
            ThisGraph.DrawImage((Image)images[(int)NewWindow.numericUpDownIdxImage.Value], new Point(0, 0));
            ThisGraph.DrawString("Image " + (int)NewWindow.numericUpDownIdxImage.Value, new Font(FontFamily.GenericSansSerif, 10), System.Drawing.Brushes.LightYellow, 5, 5);
            //  ThisGraph.DrawImage((Image)images[(int)NewWindow.numericUpDownIdxImage.Value], new Point(0, 0));

            //  NewWindow.pictureBoxForImage.Invalidate();
        }
示例#3
0
文件: cWell.cs 项目: cyrenaique/HCSA
        public void DisplayInfoWindow(int IdxDescriptor)
        {
            FormForWellInformation NewWindow = new FormForWellInformation(this);
            NewWindow.Text = this.GetShortInfo();

            cExtendedTable EL = this.GetAverageValuesList(true);

            cViewerTable VT = new cViewerTable();
            VT.SetInputData(EL);
            VT.Run();
            cExtendedControl EXT = VT.GetOutPut();
            EXT.Width = NewWindow.panelForDescValues.Width;
            EXT.Height = NewWindow.panelForDescValues.Height;

            NewWindow.panelForDescValues.Controls.Add(VT.GetOutPut());

            NewWindow.textBoxName.Text = GetCpdName();
            NewWindow.textBoxInfo.Text = Info;

            object ConcentrationValue = this.ListProperties.FindValueByName("Concentration");
            if (ConcentrationValue != null) NewWindow.textBoxConcentration.Text = ((double)ConcentrationValue).ToString("e4");
            else
                NewWindow.textBoxConcentration.Text = "n.a.";

            object ValObj = this.ListProperties.FindValueByName("Locus ID");
            if (ValObj != null)
            {
                int LocusID = (int)ValObj;
                NewWindow.textBoxLocusID.Text = ((int)(LocusID)).ToString();
            }
            else
                NewWindow.textBoxLocusID.Text = "n.a.";

            if (cGlobalInfo.ViewMode != eViewMode.PIE)
            {
                if (/*(cGlobalInfo.ViewMode == eViewMode.DISTRIBUTION) &&*/ (cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor().IsConnectedToDatabase))
                {
                    this.AssociatedPlate.DBConnection = new cDBConnection(this.AssociatedPlate, this.SQLTableName);

                    List<cDescriptorType> LCDT = new List<cDescriptorType>();
                    LCDT.Add(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor());
                    cExtendedTable ET = new cExtendedTable();

                    foreach (var item in cGlobalInfo.ListCellularPhenotypes)
                    {
                        List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>();
                        ListCellularPhenotypesToBeSelected.Add(item);

                        cExtendedTable TmpET = this.AssociatedPlate.DBConnection.GetWellValues(this,
                                                 LCDT,
                                                 ListCellularPhenotypesToBeSelected);
                        if (TmpET.Count == 0) continue;
                        TmpET[0].Name = item.Name;
                        TmpET[0].Tag = item;

                        ET.Add(TmpET[0]);
                    }

                    ET.Name = this.GetShortInfo();
                    cViewerStackedHistogram VSH = new cViewerStackedHistogram();
                    VSH.SetInputData(ET);
                    // VSH.Chart.BinNumber = LCDT[0].GetBinNumber();
                    VSH.ListProperties.FindByName("Bin Number").SetNewValue((int)LCDT[0].GetBinNumber());

                    //VS.Chart.IsSelectable = true;
                    //VSH.Chart.BackgroundColor = Color.LightGray;
                    VSH.Chart.IsShadow = true;
                    VSH.Chart.IsXGrid = true;
                    VSH.Chart.IsYGrid = true;
                    VSH.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();

                    VSH.Run();
                    VSH.Chart.Width = 0;
                    VSH.Chart.Height = 0;

                    cExtendedControl EC = VSH.GetOutPut();
                    EC.Width = NewWindow.chartForFormWell.Width;
                    EC.Height = NewWindow.chartForFormWell.Height;

                    NewWindow.chartForFormWell.Controls.Add(EC);

                    this.AssociatedPlate.DBConnection.CloseConnection();
                }
                else
                {
                    NewWindow.tabControlMain.TabPages.RemoveByKey("tabPageHisto");

                }

            }
            else
            {
                NewWindow.tabControlMain.TabPages["tabPageHisto"].Text = "Pie";
                Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
                ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);
                CurrentSeries.ChartType = SeriesChartType.Pie;
                for (int IdxValue = 0; IdxValue < ListSignatures.Count; IdxValue++)
                {
                    if (ListSignatures[IdxValue].GetAssociatedType().IsActive())
                    {
                        double Value = ListSignatures[IdxValue].GetValue();
                        CurrentSeries.Points.Add(Value);
                        if (Value > 0)
                        {
                            CurrentSeries.Points[CurrentSeries.Points.Count - 1].Label = ListSignatures[IdxValue].GetAssociatedType().GetName();
                            CurrentSeries.Points[CurrentSeries.Points.Count - 1].ToolTip = Value.ToString();
                        }
                    }
                }
                CurrentChartArea.BorderColor = Color.Black;

                NewWindow.chartForFormWell.ChartAreas.Add(CurrentChartArea);
                NewWindow.chartForFormWell.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
                CurrentChartArea.BackColor = Color.FromArgb(64, 64, 64);
                CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY;

                CurrentSeries.Name = "Series" + PosX + "x" + PosY;
                NewWindow.chartForFormWell.Series.Add(CurrentSeries);
            }

            #region Text Info
            NewWindow.richTextBoxDescription.AcceptsTab = true;
            NewWindow.richTextBoxDescription.AppendText("Plate: " + this.AssociatedPlate.GetName() + "\nWell: [" + this.GetPosX() + "x" + this.GetPosY() + "] - " + this.GetNumBiologicalObjects() + " Object(s).");

            NewWindow.richTextBoxDescription.AppendText("\n\nProperty List:\n");
            foreach (var item in this.ListProperties)
            {
                if (item.GetValue() != null)
                {
                    NewWindow.richTextBoxDescription.AppendText("\nName:\t" + item.PropertyType.Name + "\n\tType: " + item.PropertyType.Type.ToString() + "\n\tValue: " + item.GetValue().ToString() + "\n\tLocked: " + item.PropertyType.IsLocked.ToString() + "\n");
                    if ((item.PropertyType.Type == eDataType.DOUBLE) || (item.PropertyType.Type == eDataType.INTEGER))
                    {
                        NewWindow.richTextBoxDescription.AppendText("\tMin:\t" + item.PropertyType.Min + "\n\tMax: " + item.PropertyType.Max + "\n");
                    }

                }
                else
                    NewWindow.richTextBoxDescription.AppendText("\nName:\t" + item.PropertyType.Name + "\n\tType: " + item.PropertyType.Type.ToString() + "\n\tValue: NULL\n\tLocked: " + item.PropertyType.IsLocked.ToString() + "\n");
            }
            #endregion

            NewWindow.chartForFormWell.Update();
            NewWindow.Show();
            return;
        }
示例#4
0
        /// <summary>
        /// Display the information window related to the selected well
        /// </summary>
        public void DisplayInfoWindow()
        {
            FormForWellInformation NewWindow = new FormForWellInformation(this);

            NewWindow.textBoxName.Text = Name;
            NewWindow.textBoxInfo.Text = Info;

            if (Concentration >= 0)
                NewWindow.textBoxConcentration.Text = Concentration.ToString("e4");

            if (LocusID != -1)
                NewWindow.textBoxLocusID.Text = ((int)(LocusID)).ToString();

            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);
            if (Parent.GlobalInfo.ViewMode != eViewMode.PIE)
            {

                CurrentSeries.ShadowOffset = 2;

                for (int IdxValue = 0; IdxValue < ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber(); IdxValue++)
                {
                    double Value = ListDescriptors[CurrentDescriptorToDisplay].GetHistovalue(IdxValue);
                    //CurrentSeries.Points.Add(Value);

                    CurrentSeries.Points.AddXY(ListDescriptors[CurrentDescriptorToDisplay].GetHistoXvalue(IdxValue), Value);

                    CurrentSeries.Points[IdxValue].ToolTip = Value.ToString();
                }

                CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[0].Title = ListDescriptors[CurrentDescriptorToDisplay].GetName();
                //  if (CurrentSeries.Points.Count == 1)
                CurrentSeries.ChartType = SeriesChartType.Column;
                //  else
                //    CurrentSeries.ChartType = SeriesChartType.Line;
                CurrentSeries.Color = Color.White;
                CurrentSeries.BorderWidth = 3;
            }
            else
            {
                CurrentSeries.ChartType = SeriesChartType.Pie;
                for (int IdxValue = 0; IdxValue < ListDescriptors.Count; IdxValue++)
                {
                    if (ListDescriptors[IdxValue].GetAssociatedType().IsActive())
                    {
                        double Value = ListDescriptors[IdxValue].GetValue();
                        CurrentSeries.Points.Add(Value);
                        if (Value > 0)
                        {
                            CurrentSeries.Points[CurrentSeries.Points.Count - 1].Label = ListDescriptors[IdxValue].GetAssociatedType().GetName();

                            CurrentSeries.Points[CurrentSeries.Points.Count - 1].ToolTip = Value.ToString();
                        }
                    }
                }

            }
            CurrentChartArea.BorderColor = Color.Black;

            NewWindow.chartForFormWell.ChartAreas.Add(CurrentChartArea);
            NewWindow.chartForFormWell.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
            CurrentChartArea.BackColor = Color.FromArgb(64, 64, 64);
            CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY;

            CurrentSeries.Name = "Series" + PosX + "x" + PosY;
            NewWindow.chartForFormWell.Series.Add(CurrentSeries);

            //     GlobalInfo.SwitchDistributionMode();
            //}

            //private void displayReferenceToolStripMenuItem_Click(object sender, EventArgs e)
            //{
            //    CDisplayGraph DispGraph = new CDisplayGraph(CompleteScreening.Reference[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].ToArray(), CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName() + " - Reference distribution.");
            //}

            NewWindow.richTextBoxDescription.AppendText("Plate: " + this.AssociatedPlate.Name + "\nWell: [" + this.GetPosX() + "x" + this.GetPosY() + "]");
            NewWindow.richTextBoxDescription.AppendText("\nCell Number: " + this.CellNumber);

            if (Parent.GlobalInfo.ViewMode != eViewMode.PIE)
            {
                NewWindow.richTextBoxDescription.AppendText("\nHistogram: BINS: " + ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber() + ", STEP: "  + ListDescriptors[CurrentDescriptorToDisplay].Histogram.Step);
            }

            if (Parent.GlobalInfo.IsDistributionMode() && (Parent.Reference != null))
            {
                Series CurrentSeriesReference = new Series("Reference");

                CurrentSeriesReference.ChartType = SeriesChartType.Line;
                CurrentSeriesReference.BorderWidth = 2;
                CurrentSeriesReference.Color = Color.Red;
                //  CurrentSeriesReference.ShadowOffset = 2;

                double[] ReferenceCurve = Parent.Reference[Parent.ListDescriptors.CurrentSelectedDescriptor].ToArray();

                for (int IdxValue = 0; IdxValue < ReferenceCurve.Length; IdxValue++)
                {
                    double Value = ReferenceCurve[IdxValue];
                    CurrentSeriesReference.Points.Add(Value);
                    CurrentSeriesReference.Points[IdxValue].ToolTip = "[Reference] " + Value.ToString();
                }
                NewWindow.chartForFormWell.Series.Add(CurrentSeriesReference);

                if (Parent.GlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked)
                {
                    StripLine AverageLine = new StripLine();
                    AverageLine.BackColor = Color.Red;
                    AverageLine.IntervalOffset = Parent.Reference[Parent.ListDescriptors.CurrentSelectedDescriptor].GetWeightedMean();
                    AverageLine.StripWidth = double.Epsilon;
                    CurrentChartArea.AxisX.StripLines.Add(AverageLine);
                    AverageLine.Text = String.Format("{0:0.###}", AverageLine.IntervalOffset);
                    AverageLine.ForeColor = Color.White;
                    AverageLine.StripWidth = 0.0001;
                }

            }

            if (Parent.GlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked)
            {

                StripLine AverageLineHisto = new StripLine();
                AverageLineHisto.BackColor = Color.Red;
                AverageLineHisto.IntervalOffset = ListDescriptors[CurrentDescriptorToDisplay].Histogram.GetAverageValue();
                //   AverageLineHisto.IntervalOffset = ListDescriptors[CurrentDescriptorToDisplay].Getvalues().GetWeightedMean();
                AverageLineHisto.StripWidth = double.Epsilon;
                CurrentChartArea.AxisX.StripLines.Add(AverageLineHisto);
                AverageLineHisto.Text = String.Format("{0:0.###}", AverageLineHisto.IntervalOffset);
                AverageLineHisto.ForeColor = Color.White;
                AverageLineHisto.StripWidth = 0.0001;
            }

            Title CurrentTitle = new Title(PosX + "x" + PosY);
            NewWindow.chartForFormWell.Titles.Add(CurrentTitle);

            NewWindow.Text = PosX + "x" + PosY + " / " + StateForClassif;

            string connec = string.Concat(new string[] { "server=", "192.168.10.10", ";uid=", "***", ";pwd=", "***", ";database=", "OPERA_DB" });

            string[] ListOpera = new string[3];
            ListOpera[0] = "OPERA-COMMON";
            ListOpera[1] = "OPERA-P3";
            ListOpera[2] = "OPERA-SUWON";
            List<string> strf = new List<string>();

            string[] SplittedString = Parent.ListPlatesActive[Parent.CurrentDisplayPlateIdx].Name.Split('(');
            if (SplittedString.Length == 1) goto THEEND;
            string PlateName = "(" + SplittedString[1];
            SqlConnection sqc = new SqlConnection(connec);
            for (int OperaIdx = 0; OperaIdx < ListOpera.Length; OperaIdx++)
            {
                string queryString = "SELECT A.PATH, A.TREE_NAME,B.MEA_NAME,B.MEA_YEAR, B.MEA_TYPE,B.BARCODE, C.MEA, C.[CIA-1],C.[CIA-2],C.[CIA-3], C.[CIA-4],C.[CIA-5],C.[CIA-6],";
                queryString += " A.END_FLAG FROM TB_OPERA_DB_TREE A LEFT OUTER JOIN TB_OPERA_MEA B ON A.ITEM_SEQ = B.MEA_PATH AND B.MEA_TYPE = '" + ListOpera[OperaIdx] + "' LEFT OUTER JOIN TB_OPERA_PATH C ON B.MEA_YEAR = C.EQ_YEAR";
                queryString += " AND B.MEA_TYPE = C.EQ_TYPE AND C.EQ_TYPE = '" + ListOpera[OperaIdx] + "' WHERE A.EQ_TYPE = '" + ListOpera[OperaIdx] + "' ORDER BY A.PATH ASC, A.LVL ASC, A.P_SEQ ASC";

                //  string queryString = "SELECT B.MEA_NAME, B.BARCODE, C.[CIA-1],C.[CIA-2],C.[CIA-3], C.[CIA-4],C.[CIA-5],C.[CIA-6]";
                //  queryString += " FROM TB_OPERA_DB_TREE A LEFT OUTER JOIN TB_OPERA_MEA B ON A.ITEM_SEQ = B.MEA_PATH AND B.MEA_TYPE = '" + ListOpera[OperaIdx] + "' LEFT OUTER JOIN TB_OPERA_PATH C ON B.MEA_YEAR = C.EQ_YEAR";
                //  queryString += " AND B.MEA_TYPE = C.EQ_TYPE AND C.EQ_TYPE = '" + ListOpera[OperaIdx] + "' WHERE A.EQ_TYPE = '" + ListOpera[OperaIdx] + "' ORDER BY A.PATH ASC, A.LVL ASC, A.P_SEQ ASC";

                SqlCommand command = new SqlCommand(queryString, sqc);
                sqc.Open();
                SqlDataReader reader = command.ExecuteReader();

                int cpt = 0;

                while (reader.Read())
                {

                    if (reader.GetSqlString(2).ToString().Contains(PlateName))
                    {
                        for (int i = 0; i < reader.FieldCount; i++)
                        {
                            strf.Add(reader.GetSqlString(i).ToString());
                        }
                        goto THELOOPEND;
                    }

                    cpt++;
                }
                sqc.Close();

            }

            THELOOPEND: sqc.Close();

            if (strf.Count > 1)
            {

                string MeaFileLocation = strf[6] + strf[0] + "\\" + strf[2];

                StreamReader st = new StreamReader(MeaFileLocation);
                string FileRead = "";
                while (!st.EndOfStream)
                {
                    FileRead = st.ReadToEnd();
                }
                string[] Splter = new string[1];
                Splter[0] = "Wavelength";
                int NumWaveLength = FileRead.Split(Splter, StringSplitOptions.None).Length;

                string specifier = "000";

                string PX = this.GetPosX().ToString(specifier);
                string PY = this.GetPosY().ToString(specifier);

                for (int IdxCIA = 0; IdxCIA < 6; IdxCIA++)
                {

                    if (strf[IdxCIA + 2] == "Null") break;
                    string FinalName = strf[0].Remove(strf[0].Length - 4);

                    string NewTemp1 = strf[IdxCIA + 2] + "\\" + strf[1] + "\\" + FinalName + "\\" + PY + PX + "000.flex";
                    if (File.Exists(NewTemp1))
                    {
                        //  Bitmap NewBMP = new Bitmap(NewTemp1);

                        images = new ArrayList();

                        FreeImageAPI.FIMULTIBITMAP LoadedMultiPageImage = FreeImage.OpenMultiBitmap(FREE_IMAGE_FORMAT.FIF_TIFF, NewTemp1, false, true, true, FREE_IMAGE_LOAD_FLAGS.DEFAULT);

                        //int count = NewBMP.GetFrameCount(System.Drawing.Imaging.FrameDimension.Page);
                        for (int idx = 0; idx < FreeImage.GetPageCount(LoadedMultiPageImage); idx++)
                        {
                            // save each frame to a bytestream
                            //NewBMP.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, idx);
                            //MemoryStream byteStream = new MemoryStream();
                            //NewBMP.Save(byteStream, System.Drawing.Imaging.ImageFormat.Bmp);

                            FreeImageAPI.FIBITMAP LoadedPage = FreeImage.LockPage(LoadedMultiPageImage, idx);

                            FreeImageAPI.BITMAPINFO ImageInfo = FreeImage.GetInfoEx(LoadedPage);
                            int NumBands = (int)ImageInfo.bmiHeader.biPlanes;

                            FreeImageAPI.FIBITMAP LoadedImage = FreeImage.ConvertToStandardType(LoadedPage, true);
                            FreeImage.FlipVertical(LoadedImage);

                            images.Add((Image)FreeImage.GetBitmap(LoadedImage));

                            // and then create a new Image from it
                            //images.Add(Image.FromStream(byteStream));
                        }

                        NewWindow.numericUpDownIdxImage.Maximum = images.Count - 1;

                        DrawPic(NewWindow, null, null);
                        break;
                    }
                }

            }

            //    // display Image

            //    string toSearch = AssociatedPlate.Name;
            //    string[] ToSplit = toSearch.Split('/');

            //    if (Parent.GlobalInfo.OptionsWindow.textBoxMainServer.Text == "") goto THEEND;
            //    string[] ResultsPath = Directory.GetDirectories(Parent.GlobalInfo.OptionsWindow.textBoxMainServer.Text, ToSplit[0], SearchOption.AllDirectories);
            //    string RealDir = "";
            //    if (ResultsPath.Length == 0) goto THEEND;
            //    foreach (string CurrPath in ResultsPath)
            //    {
            //        string[] Results = Directory.GetFiles(CurrPath, ToSplit[1] + ".mea", SearchOption.AllDirectories);
            //        if (Results.Length == 1)
            //        {
            //            RealDir = Results[0];
            //            break;
            //        }
            //    }

            //    if (RealDir == "") goto THEEND;
            //    //XmlReader XMLRead = XmlReader.Create(RealDir);
            //    List<string> ListHosts = new List<string>();

            //    XmlReader xmlReader = new XmlTextReader(RealDir);
            //    xmlReader.MoveToContent();
            //    while (!xmlReader.EOF)
            //    {
            //        string localName = xmlReader.LocalName;
            //        switch (localName)
            //        {
            //            case "Host":
            //                {
            //                    string HostName = xmlReader["name"];
            //                    if (HostName != null) ListHosts.Add(HostName);
            //                    break;
            //                }
            //            default: break;
            //        }
            //        xmlReader.Read();
            //    }

            //    StreamReader st = new StreamReader(RealDir);
            //    string FileRead = "";
            //    while (!st.EndOfStream)
            //    {
            //        FileRead = st.ReadToEnd();
            //    }

            //    int Idx = FileRead.IndexOf("path");
            //    string Stemp = FileRead.Remove(0, Idx + 6);
            //    int Idx1 = Stemp.IndexOf("table_");

            //    string NewTmp = Stemp.Remove(Idx1 - 11);

            //    //string PX = "0"+this.GetPosX().ToString("N3");
            //    string specifier = "000";

            //    string PX = this.GetPosX().ToString(specifier);
            //    string PY = this.GetPosY().ToString(specifier);

            //    string NewHost = "";
            //    foreach (string Host in ListHosts)
            //    {
            //        if (Host == "CIA-1") NewHost = "CIA-01";
            //        if (Host == "CIA-2") NewHost = "CIA-02";
            //        if (Host == "CIA-3") NewHost = "CIA-03";
            //        if (Host == "CIA-4") NewHost = "CIA-04";

            //        string NewTemp1 = "\\\\ip-korea.org\\REQ\\opr_p2_2012\\" + NewHost + "\\screening\\" + NewTmp + PY + PX + "000.flex";
            //        if (File.Exists(NewTemp1))
            //        {

            //            //  Graphics g = Graphics.FromImage(NewBMP);
            //            Bitmap NewBMP = new Bitmap(NewTemp1);

            //            //XmpParser parser = new XmpParser();
            //            //System.Xml.XmlDocument xml = (System.Xml.XmlDocument)parser.ParseFromImage(stream, frameIndex);

            //            images = new ArrayList();

            //            int count = NewBMP.GetFrameCount(System.Drawing.Imaging.FrameDimension.Page);
            //            for (int idx = 0; idx < count; idx++)
            //            {
            //                // save each frame to a bytestream
            //                NewBMP.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, idx);
            //                MemoryStream byteStream = new MemoryStream();
            //                NewBMP.Save(byteStream, System.Drawing.Imaging.ImageFormat.Bmp);

            //                // and then create a new Image from it
            //                images.Add(Image.FromStream(byteStream));
            //            }

            //            NewWindow.numericUpDownIdxImage.Maximum = images.Count - 1;

            //            DrawPic(NewWindow, null, null);
            //        }
            //    }
            ////Graphics g = NewWindow.pictureBoxForImage.CreateGraphics();
            ////g.DrawImage((Image)NewBMP, 1, 1);
            ////NewBMP.PixelFormat = System.Drawing.Imaging.PixelFormat.Format16bppRgb555;
            //// NewWindow.pictureBoxForImage.Image = (Image)NewBMP;
            ////NewWindow.pictureBoxForImage.Image = System.Drawing.Image.FromFile("005001000.tiff", true);
            ////  NewWindow.pictureBoxForImage.Image = System.Drawing.Image.FromFile("hilbert.tif");
            ////NewWindow.pictureBoxForImage.
            //THEEND: ;

            THEEND: ;

            NewWindow.chartForFormWell.Update();
            //NewWindow.chartForFormWell.Show();

            NewWindow.Show();
            return;
        }