Exemple #1
0
        static public Protocol  CreateFromCSVFile(string csvFile)
        {
            int      commaCnt = 5;
            FileInfo fileInfo = new FileInfo(csvFile);
            string   name     = fileInfo.Name;

            string[] strLines = File.ReadAllLines(csvFile, Encoding.Default);
            strLines = strLines.Where(x => x != "").ToArray();
            List <StepDefinition> stepDefinitions = new List <StepDefinition>();


            for (int i = 1; i < strLines.Length; i++)
            {
                string sLine      = strLines[i];
                int    currentCnt = sLine.Count(x => x == comma);
                if (currentCnt != commaCnt)
                {
                    throw new Exception(string.Format("CSV文件格式非法,期望列数为{0},实际列数为{1}!", commaCnt, currentCnt));
                }
                string[]       lineContents   = sLine.Split(',');
                StepDefinition stepDefinition = new StepDefinition(lineContents, i);
                stepDefinitions.Add(stepDefinition);
            }
            Dictionary <int, int> sample_Seconds = ReadTimeInfo(csvFile.Replace(".csv", ".txt"));

            return(new Protocol(name, stepDefinitions, sample_Seconds));
        }
Exemple #2
0
 public StepDefinitionWithProgressInfo(StepDefinition stepDef)
 {
     Description   = stepDef.Description;
     SourceLabware = stepDef.SourceLabware;
     Volume        = stepDef.Volume;
     //DeadVolume = stepDef.DeadVolume;
     DestLabware = stepDef.DestLabware;
     //RepeatTimes = stepDef.RepeatTimes;
     //ReuseTimes = stepDef.ReuseTimes;
     //TipType = stepDef.TipType;
     LineNumber = stepDef.LineNumber;
 }