Beispiel #1
0
        public cWell(cSignature Desc, int Col, int Row, cScreening screenParent, cPlate CurrentPlate)
        {
            //Parent = screenParent;
            this.AssociatedPlate = CurrentPlate;

            this.ListSignatures = new cListSignature();

            this.ListSignatures.Add(Desc);

            this.PosX = Col;
            this.PosY = Row;

            //   this.CurrentColor = this.cGlobalInfo.ListClasses[ClassForClassif].ColourForDisplay;
            Desc.AssociatedWell = this;

            // this.ListClass.Add(this.InitialClass);
            this.ListProperties = new cListWellProperty(this);
            this.ListProperties.UpdateValueByName("Well Class", 2);
        }
Beispiel #2
0
        public cWell(string FileName, cScreening screenParent, cPlate CurrentPlate)
        {
            // Parent = screenParent;
            this.AssociatedPlate = CurrentPlate;

            StreamReader sr = new StreamReader(FileName);
            int Idx;
            string NewLine;
            string TmpLine;
            string line;

            // we have to build the descriptor list
            if (cGlobalInfo.CurrentScreening.ListDescriptors.Count == 0)
            {
                Idx = FileName.LastIndexOf("\\");
                NewLine = FileName.Remove(0, Idx + 1);
                TmpLine = NewLine;

                Idx = TmpLine.IndexOf("x");
                NewLine = TmpLine.Remove(Idx);

                if (!int.TryParse(NewLine, out this.PosX))
                {
                    MessageBox.Show("Error in load the current file.\n", "Loading error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    sr.Close();
                    return;
                }

                NewLine = TmpLine.Remove(0, Idx + 1);
                Idx = NewLine.IndexOf(".");
                TmpLine = NewLine.Remove(Idx);

                this.PosY = Convert.ToInt16(TmpLine);

                line = sr.ReadLine();
                while (line != null)
                {
                    if (line != null)
                    {
                        Idx = line.IndexOf("\t");
                        string DescName = line.Remove(Idx);

                        List<double> readData = new List<double>();

                        NewLine = line.Remove(0, Idx + 1);
                        line = NewLine;

                        Idx = line.IndexOf("\t");
                        int NumValue = 0;
                        while (Idx > 0)
                        {
                            string DescValue = line.Remove(Idx);
                            double CurrentValue = Convert.ToDouble(DescValue);

                            readData.Add(CurrentValue);
                            NewLine = line.Remove(0, Idx + 1);
                            line = NewLine;
                            Idx = line.IndexOf("\t");
                            NumValue++;
                        }
                        if (line.Length > 0)
                        {
                            double Value = Convert.ToDouble(line);
                            readData.Add(Value);
                        }
                        // first check if the descriptor exist
                        cGlobalInfo.CurrentScreening.ListDescriptors.AddNew(new cDescriptorType(DescName, true, NumValue));

                    }
                    line = sr.ReadLine();
                }
                sr.Close();
            }

            this.ListSignatures = new cListSignature();
            sr = new StreamReader(FileName);

            Idx = FileName.LastIndexOf("\\");
            NewLine = FileName.Remove(0, Idx + 1);
            TmpLine = NewLine;

            Idx = TmpLine.IndexOf("x");
            NewLine = TmpLine.Remove(Idx);
            this.PosX = Convert.ToInt16(NewLine);

            NewLine = TmpLine.Remove(0, Idx + 1);
            Idx = NewLine.IndexOf(".");
            TmpLine = NewLine.Remove(Idx);

            this.PosY = Convert.ToInt16(TmpLine);

            line = sr.ReadLine();
            int IDxLine = 0;
            while (line != null)
            {
                if (line != null)
                {
                    Idx = line.IndexOf("\t");
                    string DescName = line.Remove(Idx);
                    cExtendedList readData = new cExtendedList();

                    NewLine = line.Remove(0, Idx + 1);
                    line = NewLine;

                    Idx = line.IndexOf("\t");

                    while (Idx > 0)
                    {
                        string DescValue = line.Remove(Idx);
                        double CurrentValue = Convert.ToDouble(DescValue);

                        readData.Add(CurrentValue);
                        NewLine = line.Remove(0, Idx + 1);
                        line = NewLine;
                        Idx = line.IndexOf("\t");
                    }
                    if (line.Length > 0)
                    {
                        double Value = Convert.ToDouble(line);
                        readData.Add(Value);
                    }
                    cSignature CurrentDesc = new cSignature(readData, cGlobalInfo.CurrentScreening.ListDescriptors[IDxLine].GetBinNumber() - 1, cGlobalInfo.CurrentScreening.ListDescriptors[IDxLine], cGlobalInfo.CurrentScreening);
                    this.ListSignatures.Add(CurrentDesc);
                }
                line = sr.ReadLine();
                IDxLine++;
            }
            sr.Close();

            // this.ListClass.Add(this.InitialClass);

            this.ListProperties = new cListWellProperty(this);
            this.ListProperties.UpdateValueByName("Well Class", 2);
            //    this.CurrentColor = this.cGlobalInfo.ListClasses[ClassForClassif].ColourForDisplay;
            return;
        }