コード例 #1
0
        public void ReadConfigureFile(string sConfigPath)
        {
            if (!File.Exists(sConfigPath))
            {
                log.Error("Configure file does not exist!");
                return;
            }

            bool bFirstRow = true;

            using (StreamReader sr = new StreamReader(sConfigPath, System.Text.Encoding.Default))
            {
                string sContent = "";
                while (true)
                {
                    sContent = sr.ReadLine();
                    if (sContent == null)
                    {
                        break;
                    }

                    if (bFirstRow)
                    {
                        bFirstRow = false;
                    }
                    else
                    {
                        DestRack destRackInfo = ExtractRackInfo(sContent.Split('\t').ToList());
                        rackInfos.Add(destRackInfo);
                    }
                }
            }
        }
コード例 #2
0
        private DestRack ExtractRackInfo(List <string> list)
        {
            if (list.Count < 4)
            {
                throw new Exception("配置文件格式错误,配置项不全");
            }
            DestRack rack = new DestRack();

            rack.Name      = list[0];
            rack.Alignment = (PipettingApproach)Enum.Parse(typeof(PipettingApproach), list[1]);
            rack.Width     = int.Parse(list[2]);
            rack.Height    = int.Parse(list[3]);
            return(rack);
        }
コード例 #3
0
 private DestRack ExtractRackInfo(List<string> list)
 {
     if (list.Count < 4)
     {
         throw new Exception("配置文件格式错误,配置项不全");
     }
     DestRack rack = new DestRack();
     rack.Name = list[0];
     rack.Alignment =   (PipettingApproach) Enum.Parse(typeof(PipettingApproach), list[1]);
     rack.Width = int.Parse(list[2]);
     rack.Height = int.Parse(list[3]);
     return rack;
 }